Skip to content

Commit

Permalink
fix: hard code fix for virtual on base
Browse files Browse the repository at this point in the history
  • Loading branch information
swkatmask committed Jan 26, 2025
1 parent 6a5bad3 commit 0d9d28f
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions packages/web3-providers/src/Web3/EVM/state/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { NetworkPluginID, type StorageObject } from '@masknet/shared-base'
import { queryClient } from '@masknet/shared-base-ui'
import { isSameAddress, type FungibleToken, type NonFungibleToken } from '@masknet/web3-shared-base'
import {
ChainId,
formatEthereumAddress,
isValidAddress,
isValidChainId,
type ChainId,
type SchemaType,
} from '@masknet/web3-shared-evm'
import type { Subscription } from 'use-subscription'
Expand Down Expand Up @@ -34,7 +34,25 @@ export class EVMToken extends TokenState<ChainId, SchemaType> {
private async getStoredFungibleTokens(chainId: ChainId) {
const storedTokensMap = this.storage.credibleFungibleTokenList.value
const storedTokens = storedTokensMap[chainId]
if (storedTokens) return storedTokens
if (storedTokens) {
if (chainId === ChainId.Base) {
return storedTokens.some((x) => x.symbol === 'VIRTUAL') ? storedTokens : (
[
...storedTokens,
{
chainId: 8453,
address: '0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b',
name: 'Virtual Protocol',
symbol: 'VIRTUAL',
decimals: 18,
logoURI:
'https://www.okx.com/cdn/web3/currency/token/8453-0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b-97.png/type=default_350_0?v=1732307157464',
},
]
)
}
return storedTokens
}
return queryClient.fetchQuery({
// eslint-disable-next-line @tanstack/query/exhaustive-deps
queryKey: ['evm', 'get-fungible-token-list', chainId],
Expand Down

0 comments on commit 0d9d28f

Please sign in to comment.