@@ -19,14 +19,15 @@ import {
19
19
} from '@masknet/web3-hooks-base'
20
20
import {
21
21
CurrencyType ,
22
+ TokenType ,
22
23
ZERO ,
23
24
currySameAddress ,
24
25
isSameAddress ,
25
26
leftShift ,
26
27
toZero ,
27
28
type FungibleToken ,
28
29
} from '@masknet/web3-shared-base'
29
- import { AddressType } from '@masknet/web3-shared-evm'
30
+ import { AddressType , ChainId as EvmChainId , SchemaType } from '@masknet/web3-shared-evm'
30
31
import { uniqBy } from 'lodash-es'
31
32
import { useCallback , useEffect , useMemo , useState , useTransition } from 'react'
32
33
import { getFungibleTokenItem } from './FungibleTokenItem.js'
@@ -105,13 +106,24 @@ export function FungibleTokenList<T extends NetworkPluginID>(props: FungibleToke
105
106
const nativeToken = useMemo ( ( ) => Utils . chainResolver . nativeCurrency ( chainId ) , [ chainId ] )
106
107
107
108
const filteredFungibleTokens = useMemo ( ( ) => {
108
- const allFungibleTokens =
109
- extendTokens ?
110
- uniqBy (
111
- [ ...( nativeToken ? [ nativeToken ] : [ ] ) , ...tokens , ...fungibleTokens , ...trustedFungibleTokens ] ,
112
- ( x ) => x . address . toLowerCase ( ) ,
113
- )
114
- : tokens
109
+ const merged = [ ...( nativeToken ? [ nativeToken ] : [ ] ) , ...tokens , ...fungibleTokens , ...trustedFungibleTokens ]
110
+ if ( chainId === EvmChainId . Base ) {
111
+ if ( ! merged . some ( ( x ) => x . symbol === 'VIRTUAL' ) ) {
112
+ merged . push ( {
113
+ id : '0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b' ,
114
+ type : TokenType . Fungible ,
115
+ schema : SchemaType . ERC20 ,
116
+ chainId : 8453 ,
117
+ address : '0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b' ,
118
+ name : 'Virtual Protocol' ,
119
+ symbol : 'VIRTUAL' ,
120
+ decimals : 18 ,
121
+ logoURL :
122
+ 'https://www.okx.com/cdn/web3/currency/token/8453-0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b-97.png/type=default_350_0?v=1732307157464' ,
123
+ } )
124
+ }
125
+ }
126
+ const allFungibleTokens = extendTokens ? uniqBy ( merged , ( x ) => x . address . toLowerCase ( ) ) : tokens
115
127
116
128
const blockedTokenAddresses = new Map ( blockedFungibleTokens . map ( ( x ) => [ x . address . toLowerCase ( ) , true ] ) )
117
129
const includeMap = includeTokens ? new Map ( includeTokens . map ( ( x ) => [ x . toLowerCase ( ) , true ] ) ) : null
0 commit comments