diff --git a/apps/minifront/src/fetchers/registry.ts b/apps/minifront/src/fetchers/registry.ts index 4a4fd69d77..b55bd16cf1 100644 --- a/apps/minifront/src/fetchers/registry.ts +++ b/apps/minifront/src/fetchers/registry.ts @@ -18,17 +18,25 @@ export const useRegistry = () => { }; export const getStakingTokenMetadata = async () => { - const chainId = await getChainId(); - if (!chainId) { - throw new Error('Could not fetch chain id'); - } + const chainId = await getChainId(); + if (!chainId) { + throw new Error('Could not fetch chain id'); + } - const { stakingAssetId } = await chainRegistryClient.get(chainId); - const stakingAssetsMetadata = await getAssetMetadataById(stakingAssetId); + const { stakingAssetId } = await chainRegistryClient.get(chainId); + const stakingAssetsMetadata = await getAssetMetadataById(stakingAssetId); - if (!stakingAssetsMetadata) { - throw new Error('Could not fetch staking asset metadata'); - } - return stakingAssetsMetadata; + if (!stakingAssetsMetadata) { + throw new Error('Could not fetch staking asset metadata'); + } + return stakingAssetsMetadata; }; +export const getIbcConnections = async () => { + const chainId = await getChainId(); + if (!chainId) throw new Error('Could not fetch chain id'); + + const registryClient = new ChainRegistryClient(); + const { ibcConnections } = await registryClient.get(chainId); + return ibcConnections; +}; diff --git a/apps/minifront/src/state/ibc.ts b/apps/minifront/src/state/ibc.ts index 7a3f4ffaff..c1f6b16957 100644 --- a/apps/minifront/src/state/ibc.ts +++ b/apps/minifront/src/state/ibc.ts @@ -16,11 +16,7 @@ import { toBaseUnit } from '@penumbra-zone/types/src/lo-hi'; import { planBuildBroadcast } from './helpers'; import { amountMoreThanBalance } from './send'; import { getAssetId } from '@penumbra-zone/getters/src/metadata'; -import { - assetPatterns, - localAssets, - STAKING_TOKEN_METADATA, -} from '@penumbra-zone/constants/src/assets'; +import { assetPatterns } from '@penumbra-zone/constants/src/assets'; import { bech32, bech32m } from 'bech32'; import { errorToast } from '@penumbra-zone/ui/lib/toast/presets'; import { Chain } from '@penumbra-labs/registry'; diff --git a/packages/storage/package.json b/packages/storage/package.json index 9eded7d695..d13563aaad 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -19,8 +19,8 @@ "./indexed-db/*": "./src/indexed-db/*.ts" }, "dependencies": { - "@penumbra-zone/bech32m": "workspace:*", "@penumbra-labs/registry": "^5.1.0", + "@penumbra-zone/bech32m": "workspace:*", "@penumbra-zone/constants": "workspace:*", "@penumbra-zone/crypto-web": "workspace:*", "@penumbra-zone/getters": "workspace:*", diff --git a/packages/storage/src/indexed-db/indexed-db.test.ts b/packages/storage/src/indexed-db/indexed-db.test.ts index 1c8ed4b6a6..72eb431cb7 100644 --- a/packages/storage/src/indexed-db/indexed-db.test.ts +++ b/packages/storage/src/indexed-db/indexed-db.test.ts @@ -281,7 +281,7 @@ describe('IndexedDb', () => { chainId: 'test', dbVersion: 2, walletId: new WalletId({ - inner: Uint8Array.from({ length: 8 }, () => Math.floor(Math.random() * 256)), + inner: Uint8Array.from({ length: 32 }, () => Math.floor(Math.random() * 256)), }), registryAssets: [metadataA, metadataB], }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49dc7091f8..026306d359 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -756,8 +756,8 @@ importers: packages/services-context: dependencies: '@penumbra-labs/registry': - specifier: ^4.0.0 - version: 4.0.0 + specifier: ^5.1.0 + version: 5.1.0 '@penumbra-zone/constants': specifier: workspace:* version: link:../constants @@ -789,6 +789,9 @@ importers: packages/storage: dependencies: + '@penumbra-labs/registry': + specifier: ^5.1.0 + version: 5.1.0 '@penumbra-zone/bech32m': specifier: workspace:* version: link:../bech32m @@ -6429,6 +6432,7 @@ packages: dependencies: is-glob: 4.0.3 micromatch: 4.0.5 + napi-wasm: 1.1.0 dev: false bundledDependencies: - napi-wasm @@ -17960,6 +17964,10 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + /napi-wasm@1.1.0: + resolution: {integrity: sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==} + dev: false + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true