diff --git a/.changeset/tasty-pugs-develop.md b/.changeset/tasty-pugs-develop.md deleted file mode 100644 index df563328b9..0000000000 --- a/.changeset/tasty-pugs-develop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'minifront': patch ---- - -Update revision number parsing logic diff --git a/apps/minifront/CHANGELOG.md b/apps/minifront/CHANGELOG.md index 46468a1229..01fe99ae60 100644 --- a/apps/minifront/CHANGELOG.md +++ b/apps/minifront/CHANGELOG.md @@ -1,5 +1,31 @@ # minifront +## 6.4.0 + +### Minor Changes + +- bump registry + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/types@11.0.0 + - @repo/ui@6.2.0 + - @penumbra-zone/crypto-web@7.0.0 + - @penumbra-zone/perspective@8.0.0 + +## 6.3.0 + +### Minor Changes + +- Bump registry + +### Patch Changes + +- bce49fe: Update revision number parsing logic +- Updated dependencies + - @repo/ui@6.1.0 + ## 6.2.1 ### Patch Changes diff --git a/apps/minifront/package.json b/apps/minifront/package.json index b541825036..1759a2bd3f 100644 --- a/apps/minifront/package.json +++ b/apps/minifront/package.json @@ -1,6 +1,6 @@ { "name": "minifront", - "version": "6.2.1", + "version": "6.4.0", "private": true, "license": "(MIT OR Apache-2.0)", "type": "module", @@ -19,7 +19,7 @@ "@cosmos-kit/core": "^2.12.0", "@cosmos-kit/react": "^2.15.0", "@interchain-ui/react": "^1.23.16", - "@penumbra-labs/registry": "8.0.1", + "@penumbra-labs/registry": "9.1.0", "@penumbra-zone/bech32m": "workspace:*", "@penumbra-zone/client": "workspace:*", "@penumbra-zone/crypto-web": "workspace:*", diff --git a/apps/minifront/src/fetchers/registry.ts b/apps/minifront/src/fetchers/registry.ts index 9677062982..ae5d82cda6 100644 --- a/apps/minifront/src/fetchers/registry.ts +++ b/apps/minifront/src/fetchers/registry.ts @@ -23,7 +23,7 @@ export const getStakingTokenMetadata = async () => { throw new Error('Could not fetch chain id'); } - const { stakingAssetId } = chainRegistryClient.get(chainId); + const stakingAssetId = chainRegistryClient.globals().stakingAssetId; const stakingAssetsMetadata = await getAssetMetadataById(stakingAssetId); if (!stakingAssetsMetadata) { diff --git a/apps/node-status/CHANGELOG.md b/apps/node-status/CHANGELOG.md index 05c3d9f9c4..6bf56268f7 100644 --- a/apps/node-status/CHANGELOG.md +++ b/apps/node-status/CHANGELOG.md @@ -1,5 +1,23 @@ # node-status +## 4.1.0 + +### Minor Changes + +- bump registry + +### Patch Changes + +- Updated dependencies + - @repo/ui@6.2.0 + +## 4.0.3 + +### Patch Changes + +- Updated dependencies + - @repo/ui@6.1.0 + ## 4.0.2 ### Patch Changes diff --git a/apps/node-status/package.json b/apps/node-status/package.json index 55587139b0..2f160a93d4 100644 --- a/apps/node-status/package.json +++ b/apps/node-status/package.json @@ -1,6 +1,6 @@ { "name": "node-status", - "version": "4.0.2", + "version": "4.1.0", "private": true, "license": "(MIT OR Apache-2.0)", "type": "module", diff --git a/packages/crypto/CHANGELOG.md b/packages/crypto/CHANGELOG.md index 57cd0ac798..826182be44 100644 --- a/packages/crypto/CHANGELOG.md +++ b/packages/crypto/CHANGELOG.md @@ -1,5 +1,12 @@ # @penumbra-zone/crypto-web +## 7.0.0 + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/types@11.0.0 + ## 6.0.0 ### Patch Changes diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 5f345e71fa..6dd1061a05 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-zone/crypto-web", - "version": "6.0.0", + "version": "7.0.0", "license": "(MIT OR Apache-2.0)", "type": "module", "engine": { diff --git a/packages/perspective/CHANGELOG.md b/packages/perspective/CHANGELOG.md index 7f097b336e..a913fda190 100644 --- a/packages/perspective/CHANGELOG.md +++ b/packages/perspective/CHANGELOG.md @@ -1,5 +1,11 @@ # @penumbra-zone/perspective +## 8.0.0 + +### Patch Changes + +- @penumbra-zone/wasm@11.0.0 + ## 7.0.0 ### Minor Changes diff --git a/packages/perspective/package.json b/packages/perspective/package.json index 387342b00f..5aad8f9a69 100644 --- a/packages/perspective/package.json +++ b/packages/perspective/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-zone/perspective", - "version": "7.0.0", + "version": "8.0.0", "license": "(MIT OR Apache-2.0)", "description": "Tools for assuming different perspectives of Penumbra transactions", "type": "module", diff --git a/packages/query/CHANGELOG.md b/packages/query/CHANGELOG.md index acca430e24..4fda583cf0 100644 --- a/packages/query/CHANGELOG.md +++ b/packages/query/CHANGELOG.md @@ -1,5 +1,14 @@ # @penumbra-zone/query +## 8.0.0 + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/types@11.0.0 + - @penumbra-zone/crypto-web@7.0.0 + - @penumbra-zone/wasm@11.0.0 + ## 7.0.0 ### Minor Changes diff --git a/packages/query/package.json b/packages/query/package.json index 5ec88eb029..b24098b831 100644 --- a/packages/query/package.json +++ b/packages/query/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-zone/query", - "version": "7.0.0", + "version": "8.0.0", "license": "(MIT OR Apache-2.0)", "type": "module", "engine": { diff --git a/packages/services/CHANGELOG.md b/packages/services/CHANGELOG.md index 18949f37a0..54c1be872c 100644 --- a/packages/services/CHANGELOG.md +++ b/packages/services/CHANGELOG.md @@ -1,5 +1,28 @@ # @penumbra-zone/router +## 9.0.0 + +### Minor Changes + +- bump registry + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/storage@8.0.0 + - @penumbra-zone/types@11.0.0 + - @penumbra-zone/crypto-web@7.0.0 + - @penumbra-zone/query@8.0.0 + - @penumbra-zone/wasm@11.0.0 + - @penumbra-zone/perspective@8.0.0 + +## 8.0.0 + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/storage@7.1.0 + ## 7.0.0 ### Minor Changes diff --git a/packages/services/package.json b/packages/services/package.json index 61cbc58283..4c1a9cc2b7 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-zone/services", - "version": "7.0.0", + "version": "9.0.0", "license": "(MIT OR Apache-2.0)", "type": "module", "engine": { diff --git a/packages/services/src/test-utils.ts b/packages/services/src/test-utils.ts index 1ba0821084..6e4670f506 100644 --- a/packages/services/src/test-utils.ts +++ b/packages/services/src/test-utils.ts @@ -33,7 +33,7 @@ export interface IndexedDbMock { getAuction?: Mock; getAuctionOutstandingReserves?: Mock; hasStakingAssetBalance?: Mock; - fetchStakingTokenId?: Mock; + stakingTokenAssetId?: Mock; } export interface AuctionMock { diff --git a/packages/services/src/view-service/transaction-planner/index.test.ts b/packages/services/src/view-service/transaction-planner/index.test.ts index f13d2646d2..3ff6d53ca6 100644 --- a/packages/services/src/view-service/transaction-planner/index.test.ts +++ b/packages/services/src/view-service/transaction-planner/index.test.ts @@ -30,7 +30,7 @@ describe('TransactionPlanner request handler', () => { getAppParams: vi.fn(), getGasPrices: vi.fn(), constants: vi.fn(), - fetchStakingTokenId: vi.fn(), + stakingTokenAssetId: vi.fn(), hasStakingAssetBalance: vi.fn(), }; @@ -80,7 +80,7 @@ describe('TransactionPlanner request handler', () => { }), ); - mockIndexedDb.fetchStakingTokenId?.mockResolvedValueOnce(true); + mockIndexedDb.stakingTokenAssetId?.mockResolvedValueOnce(true); mockIndexedDb.hasStakingAssetBalance?.mockResolvedValueOnce(true); await transactionPlanner(req, mockCtx); diff --git a/packages/services/src/view-service/transaction-planner/index.ts b/packages/services/src/view-service/transaction-planner/index.ts index 6aa781761e..1c4fd426ec 100644 --- a/packages/services/src/view-service/transaction-planner/index.ts +++ b/packages/services/src/view-service/transaction-planner/index.ts @@ -6,23 +6,17 @@ import { assertSwapAssetsAreNotTheSame } from './assert-swap-assets-are-not-the- import { TransactionPlannerRequest } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; import { fvkCtx } from '../../ctx/full-viewing-key'; import { extractAltFee } from '../fees'; -import { AssetId } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { TransactionPlan } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb'; export const transactionPlanner: Impl['transactionPlanner'] = async (req, ctx) => { const services = await ctx.values.get(servicesCtx)(); const { indexedDb } = await services.getWalletServices(); - // Retrieve the staking token from asset registry - const stakingTokenId = indexedDb.fetchStakingTokenId(); - // Query IndexedDB directly to check for the existence of staking token - const nativeToken = await indexedDb.hasStakingAssetBalance(stakingTokenId); + const nativeToken = await indexedDb.hasStakingAssetBalance(); // Initialize the gas fee token using an native staking token's asset ID - let gasFeeToken = new AssetId({ - inner: stakingTokenId.inner, - }); + let gasFeeToken = indexedDb.stakingTokenAssetId; // If there is no native token balance, extract and use an alternate gas fee token if (!nativeToken) { diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 5a68233116..abc238e1b9 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,23 @@ # @penumbra-zone/storage +## 8.0.0 + +### Major Changes + +- bump registry + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/types@11.0.0 + - @penumbra-zone/wasm@11.0.0 + +## 7.1.0 + +### Minor Changes + +- Bump registry + ## 7.0.0 ### Major Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 8cdc832023..a82fbe7e7b 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-zone/storage", - "version": "7.0.0", + "version": "8.0.0", "license": "(MIT OR Apache-2.0)", "type": "module", "engine": { @@ -28,7 +28,7 @@ } }, "dependencies": { - "@penumbra-labs/registry": "8.0.1", + "@penumbra-labs/registry": "9.1.0", "idb": "^8.0.0" }, "peerDependencies": { diff --git a/packages/storage/src/indexed-db/index.ts b/packages/storage/src/indexed-db/index.ts index 24b0a33b5d..7cf7cd5db9 100644 --- a/packages/storage/src/indexed-db/index.ts +++ b/packages/storage/src/indexed-db/index.ts @@ -80,7 +80,7 @@ export class IndexedDb implements IndexedDbInterface { private readonly u: IbdUpdater, private readonly c: IdbConstants, private readonly chainId: string, - private readonly stakingTokenAssetId: AssetId, + readonly stakingTokenAssetId: AssetId, ) {} static async initialize({ @@ -142,7 +142,7 @@ export class IndexedDb implements IndexedDbInterface { new IbdUpdater(db), constants, chainId, - registryClient.get(chainId).stakingAssetId, + registryClient.globals().stakingAssetId, ); await instance.saveRegistryAssets(registryClient, chainId); // Pre-load asset metadata from registry @@ -276,10 +276,14 @@ export class IndexedDb implements IndexedDbInterface { // Registry version already saved if (lastPosition === commit) return; - const assets = registryClient.get(chainId).getAllAssets(); - const saveLocalMetadata = assets.map(m => this.saveAssetsMetadata(m)); - await Promise.all(saveLocalMetadata); - await this.u.update({ table: 'REGISTRY_VERSION', key: 'commit', value: commit }); + try { + const assets = registryClient.get(chainId).getAllAssets(); + const saveLocalMetadata = assets.map(m => this.saveAssetsMetadata(m)); + await Promise.all(saveLocalMetadata); + await this.u.update({ table: 'REGISTRY_VERSION', key: 'commit', value: commit }); + } catch (error) { + console.error('Failed pre-population of assets from the registry', error); + } } async *iterateSpendableNotes() { @@ -811,19 +815,11 @@ export class IndexedDb implements IndexedDbInterface { }; } - fetchStakingTokenId(): AssetId { - const registryClient = new ChainRegistryClient(); - const registry = registryClient.get(this.chainId); - const stakingToken = registry.stakingAssetId; - - return stakingToken; - } - - async hasStakingAssetBalance(assetId: AssetId): Promise { + async hasStakingAssetBalance(): Promise { const spendableUMNotes = await this.db.getAllFromIndex( 'SPENDABLE_NOTES', 'assetId', - uint8ArrayToBase64(assetId.inner), + uint8ArrayToBase64(this.stakingTokenAssetId.inner), ); return spendableUMNotes.some(note => { diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index f61f6f65b9..0b0bf9a832 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,11 @@ # @penumbra-zone/types +## 11.0.0 + +### Major Changes + +- bump registry + ## 10.0.0 ### Minor Changes diff --git a/packages/types/package.json b/packages/types/package.json index 8d7253ef77..ce108d2d0e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-zone/types", - "version": "10.0.0", + "version": "11.0.0", "license": "(MIT OR Apache-2.0)", "type": "module", "engine": { diff --git a/packages/types/src/indexed-db.ts b/packages/types/src/indexed-db.ts index d8126b921e..a6d4af249f 100644 --- a/packages/types/src/indexed-db.ts +++ b/packages/types/src/indexed-db.ts @@ -58,6 +58,8 @@ export interface IdbUpdate>( table: StoreName, ): AsyncGenerator, void>; @@ -144,9 +146,7 @@ export interface IndexedDbInterface { auctionId: AuctionId, ): Promise<{ input: Value; output: Value } | undefined>; - hasStakingAssetBalance(assetId: AssetId): Promise; - - fetchStakingTokenId(): AssetId; + hasStakingAssetBalance(): Promise; } export interface PenumbraDb extends DBSchema { diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 62cfa192b2..1cf45a8232 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,22 @@ # @penumbra-zone/ui +## 6.2.0 + +### Minor Changes + +- bump registry + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/types@11.0.0 + +## 6.1.0 + +### Minor Changes + +- Bump registry + ## 6.0.0 ### Major Changes diff --git a/packages/ui/components/ui/tx/index.tsx b/packages/ui/components/ui/tx/index.tsx index 977975a73c..d3f3d50396 100644 --- a/packages/ui/components/ui/tx/index.tsx +++ b/packages/ui/components/ui/tx/index.tsx @@ -2,7 +2,7 @@ import { TransactionView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbr import { MemoViewComponent } from './memo-view'; import { ActionViewComponent } from './action-view'; import { ViewBox, ViewSection } from './viewbox'; -import { getStakingTokenMetaData } from './registry'; +import { getFeeAssetMetadataOrDefault } from './registry'; import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { ValueViewComponent } from '../value'; @@ -13,13 +13,23 @@ export const TransactionViewComponent = ({ txv }: { txv: TransactionView }) => { // Request the fee 'Metadata' and construct a 'ValueView' object const chainId = txv.bodyView.transactionParameters.chainId; const assetId = txv.bodyView.transactionParameters.fee.assetId; - const feeAssetMetadata = getStakingTokenMetaData(chainId, assetId); - const feeValueView = new ValueView({ - valueView: { - case: 'knownAssetId', - value: { amount: txv.bodyView.transactionParameters.fee.amount, metadata: feeAssetMetadata }, - }, - }); + const feeAssetMetadata = getFeeAssetMetadataOrDefault(chainId, assetId); + const feeValueView = feeAssetMetadata + ? new ValueView({ + valueView: { + case: 'knownAssetId', + value: { + amount: txv.bodyView.transactionParameters.fee.amount, + metadata: feeAssetMetadata, + }, + }, + }) + : new ValueView({ + valueView: { + case: 'unknownAssetId', + value: { amount: txv.bodyView.transactionParameters.fee.amount }, + }, + }); return (
diff --git a/packages/ui/components/ui/tx/registry.tsx b/packages/ui/components/ui/tx/registry.tsx index a3e743cde0..bdf6a3a847 100644 --- a/packages/ui/components/ui/tx/registry.tsx +++ b/packages/ui/components/ui/tx/registry.tsx @@ -4,17 +4,13 @@ import { Metadata, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -export function getStakingTokenMetaData( +export function getFeeAssetMetadataOrDefault( chainId: string, - assetId: AssetId | undefined, + assetId?: AssetId, ): Metadata | undefined { const registryClient = new ChainRegistryClient(); const registry = registryClient.get(chainId); - if (assetId === undefined) { - assetId = registry.stakingAssetId; - } - const StakingTokenMetadata = registry.getMetadata(assetId); - - return StakingTokenMetadata; + const feeAssetId = assetId ?? registryClient.globals().stakingAssetId; + return registry.getMetadata(feeAssetId); } diff --git a/packages/ui/package.json b/packages/ui/package.json index e32bfc0a01..86f1950fc0 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@repo/ui", - "version": "6.0.0", + "version": "6.2.0", "private": true, "license": "(MIT OR Apache-2.0)", "type": "module", @@ -59,7 +59,7 @@ "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", "@mui/material": "^5.15.18", - "@penumbra-labs/registry": "8.0.1", + "@penumbra-labs/registry": "9.1.0", "@penumbra-zone/bech32m": "workspace:*", "@penumbra-zone/types": "workspace:*", "@radix-ui/react-avatar": "^1.0.4", diff --git a/packages/wasm/CHANGELOG.md b/packages/wasm/CHANGELOG.md index 087436afd0..4ddd31a9c9 100644 --- a/packages/wasm/CHANGELOG.md +++ b/packages/wasm/CHANGELOG.md @@ -1,5 +1,12 @@ # @penumbra-zone/wasm +## 11.0.0 + +### Patch Changes + +- Updated dependencies + - @penumbra-zone/types@11.0.0 + ## 10.0.0 ### Minor Changes diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 675283f385..2acc2a7fca 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-zone/wasm", - "version": "10.0.0", + "version": "11.0.0", "license": "(MIT OR Apache-2.0)", "type": "module", "engine": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 54752513b2..ab421abe43 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -139,8 +139,8 @@ importers: specifier: ^1.23.16 version: 1.23.23(@types/react@18.3.3)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@penumbra-labs/registry': - specifier: 8.0.1 - version: 8.0.1 + specifier: 9.1.0 + version: 9.1.0 '@penumbra-zone/bech32m': specifier: workspace:* version: link:../../packages/bech32m @@ -540,8 +540,8 @@ importers: specifier: ^1.10.0 version: 1.10.0 '@penumbra-labs/registry': - specifier: 8.0.1 - version: 8.0.1 + specifier: 9.1.0 + version: 9.1.0 '@penumbra-zone/bech32m': specifier: workspace:* version: link:../bech32m @@ -639,8 +639,8 @@ importers: specifier: ^5.15.18 version: 5.15.20(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@penumbra-labs/registry': - specifier: 8.0.1 - version: 8.0.1 + specifier: 9.1.0 + version: 9.1.0 '@penumbra-zone/bech32m': specifier: workspace:* version: link:../bech32m @@ -3008,8 +3008,8 @@ packages: resolution: {integrity: sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==} engines: {node: '>= 10.0.0'} - '@penumbra-labs/registry@8.0.1': - resolution: {integrity: sha512-wbnIhOL7zWUKRF0TGxSUwJpdnoT0jE/xuK8ce/OnUFxgcn8sgdL+Z+TgAx4JNicLuJftUmOm9ACtF86Lpv3zMw==} + '@penumbra-labs/registry@9.1.0': + resolution: {integrity: sha512-t6AQk0rWJMbyGpNxMWI8dQwSy0jl0mfrFMzwZBVn32tvaQcNbFsKiTn7C1q9l+mksrSdYwP2Q62iodJY0mWgBw==} '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} @@ -14279,7 +14279,7 @@ snapshots: '@parcel/watcher-win32-ia32': 2.4.1 '@parcel/watcher-win32-x64': 2.4.1 - '@penumbra-labs/registry@8.0.1': {} + '@penumbra-labs/registry@9.1.0': {} '@pkgjs/parseargs@0.11.0': optional: true