Skip to content

Commit 47e6f77

Browse files
committed
upgrade chain-registry to 2.0
1 parent 59b6207 commit 47e6f77

File tree

16 files changed

+55
-72
lines changed

16 files changed

+55
-72
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
"url": "https://github.com/hyperweb-io/create-hyperweb-app"
4343
},
4444
"packageManager": "[email protected]"
45-
}
45+
}

templates/chain-admin/components/contract/common/AttachFundsRadio.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useMemo, useState } from 'react';
22
import { Box } from '@interchain-ui/react';
3-
import { Asset } from '@chain-registry/v2-types';
3+
import { Asset } from '@chain-registry/types';
44
import BigNumber from 'bignumber.js';
55
import { TbCurrencyDollarOff } from 'react-icons/tb';
66
import { LuListPlus } from 'react-icons/lu';

templates/chain-admin/components/contract/common/SelectAssetContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Dispatch, SetStateAction, useMemo } from 'react';
2-
import { assetLists } from '@chain-registry/v2';
2+
import { assetLists } from 'chain-registry';
33
import { LuPlus } from 'react-icons/lu';
44

55
import {

templates/chain-admin/components/contract/common/SelectAssetItem.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Dispatch, SetStateAction, useState } from 'react';
22
import { HiOutlineTrash } from 'react-icons/hi';
3-
import { Asset } from '@chain-registry/v2-types';
3+
import { Asset } from '@chain-registry/types';
44
import {
55
Avatar,
66
Box,
@@ -95,7 +95,7 @@ export const SelectAssetItem = ({
9595
>
9696
<PopoverTrigger>
9797
<SelectButton
98-
onClick={() => {}}
98+
onClick={() => { }}
9999
placeholder={selectedAssetWithAmount?.asset?.symbol ?? 'Select'}
100100
_css={{ width: isMobile ? '100px' : '140px' }}
101101
/>
@@ -108,9 +108,8 @@ export const SelectAssetItem = ({
108108
py="10px"
109109
bg="$background"
110110
borderRadius="4px"
111-
boxShadow={`0px 4px 20px 0px rgba(${
112-
theme === 'light' ? '0,0,0' : '128,128,128'
113-
}, 0.1)`}
111+
boxShadow={`0px 4px 20px 0px rgba(${theme === 'light' ? '0,0,0' : '128,128,128'
112+
}, 0.1)`}
114113
maxHeight="220px"
115114
overflowY="auto"
116115
>

templates/chain-admin/hooks/common/useStarshipChains.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AssetList, Chain } from '@chain-registry/types';
33
import {
44
Chain as ChainV2,
55
AssetList as AssetListV2,
6-
} from '@chain-registry/v2-types';
6+
} from '@chain-registry/types';
77

88
import { StarshipConfig } from '@/starship';
99
import { convertKeysToCamelCase } from '@/utils';
@@ -33,7 +33,7 @@ export const useStarshipChains = () => {
3333

3434
const assets = (await Promise.all(
3535
chains.map((chain) =>
36-
fetcher<AssetList>(`${baseUrl}/chains/${chain.chain_id}/assets`)
36+
fetcher<AssetList>(`${baseUrl}/chains/${chain.chain_id}/assets`) // if use chainId, got error: Cannot read properties of undefined (reading 'chainName') at const { connect, disconnect, address, wallet } = useChain(selectedChain)
3737
)
3838
).then((assetLists) => assetLists.filter(Boolean))) as AssetList[];
3939

templates/chain-admin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@tanstack/react-query": "4.32.0",
3232
"ace-builds": "1.35.0",
3333
"bignumber.js": "9.1.2",
34-
"chain-registry": "1.62.3",
34+
"chain-registry": "2.0.9",
3535
"dayjs": "1.11.11",
3636
"hyperwebjs": "^0.0.5",
3737
"interchain-kit": "^0.2.1",
@@ -46,7 +46,7 @@
4646
"zustand": "4.5.2"
4747
},
4848
"devDependencies": {
49-
"@chain-registry/types": "0.44.3",
49+
"@chain-registry/types": "2.0.9",
5050
"@starship-ci/cli": "^2.10.2",
5151
"@tanstack/react-query-devtools": "4.32.0",
5252
"@types/node": "18.11.9",

templates/chain-admin/pages/_app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import '@interchain-ui/react/styles';
33

44
import type { AppProps } from 'next/app';
55
import { ChainProvider } from '@interchain-kit/react';
6-
import { chains, assetLists } from '@chain-registry/v2';
6+
import { chains, assetLists } from 'chain-registry';
77
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
88
import { Box, Toaster, useTheme } from '@interchain-ui/react';
99
// import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

templates/chain-admin/utils/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Wallet } from '@interchain-kit/core';
2-
import { Asset, AssetList, Chain } from '@chain-registry/v2-types';
2+
import { Asset, AssetList, Chain } from '@chain-registry/types';
33
import BigNumber from 'bignumber.js';
44

55
export const getNativeAsset = (assets: AssetList) => {

templates/chain-admin/utils/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AssetList, Chain } from '@chain-registry/v2-types';
1+
import { AssetList, Chain } from '@chain-registry/types';
22
import { toBech32, fromBech32 } from '@interchainjs/encoding';
33
import { Log, findAttribute } from '@interchainjs/utils';
44
import { parseCoins } from '@interchainjs/amino';

templates/chain-admin/utils/staking/staking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@interchainjs/react/cosmos/staking/v1beta1/query';
1212
import BigNumber from 'bignumber.js';
1313
import { QueryAnnualProvisionsResponse } from '@interchainjs/react/cosmos/mint/v1beta1/query';
14-
import type { Asset } from '@chain-registry/v2-types';
14+
import type { Asset } from '@chain-registry/types';
1515
import type { Coin } from '@interchainjs/react/types';
1616

1717
const DAY_TO_SECONDS = 24 * 60 * 60;

0 commit comments

Comments
 (0)