diff --git a/apps/wallet/src/apis/react-query/token.ts b/apps/wallet/src/apis/react-query/token.ts index 22a1d2f..2b17bda 100644 --- a/apps/wallet/src/apis/react-query/token.ts +++ b/apps/wallet/src/apis/react-query/token.ts @@ -16,13 +16,14 @@ export const useAllAssetListQuery = () => { if (!res.isSuccess || !res.value) { throw new Error('Get all asset list failed') } - return [ - ...res.value, - { + const result = [...res.value] + if (!res.value.find((asset) => asset.assetSymbol === 'ICP')) { + console.debug('ICP not found, add temp ICP') + result.unshift({ assetId: new AssetId(new BigNumber(90000)), // ICP temp id chain: Chain.Dfinity, chainNetwork: ChainNetwork.DfinityMainNet, - chainAssetType: ChainAssetType.Native, + chainAssetType: ChainAssetType.ICP, contractAddress: '', decimalPlaces: DecimalPlaces.fromNumber(8), isBaseToken: true, @@ -31,22 +32,27 @@ export const useAllAssetListQuery = () => { displayName: 'ICP', assetSymbol: 'ICP', subAssets: [], - }, - { - assetId: new AssetId(new BigNumber(90001)), // DOD temp id - chain: Chain.Dfinity, - chainNetwork: ChainNetwork.DfinityMainNet, - chainAssetType: ChainAssetType.ICRC3, - contractAddress: 'cp4zx-yiaaa-aaaah-aqzea-cai', - decimalPlaces: null, // decimal needs to be queried at runtime - isBaseToken: true, - orderNo: 999, - icon: '', - displayName: 'Doge On Doge', - assetSymbol: 'DOD', - subAssets: [], - }, - ] as RootAssetInfo[] + }) + } + return result as RootAssetInfo[] + + // return [ + // ...res.value, + // { + // assetId: new AssetId(new BigNumber(90001)), // DOD temp id + // chain: Chain.Dfinity, + // chainNetwork: ChainNetwork.DfinityMainNet, + // chainAssetType: ChainAssetType.ICRC3, + // contractAddress: 'cp4zx-yiaaa-aaaah-aqzea-cai', + // decimalPlaces: null, // decimal needs to be queried at runtime + // isBaseToken: true, + // orderNo: 999, + // icon: '', + // displayName: 'Doge On Doge', + // assetSymbol: 'DOD', + // subAssets: [], + // }, + // ] as RootAssetInfo[] }, staleTime: 60 * 60 * 1000, // 1 hour })