Skip to content

Commit

Permalink
🐛 fix: remove temp DOD token (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
rustin01 authored Oct 21, 2024
1 parent 499cfb8 commit f53f2df
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions apps/wallet/src/apis/react-query/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
})
Expand Down

0 comments on commit f53f2df

Please sign in to comment.