import { CurrencyType , TokenType , Web3Plugin } from '@masknet/plugin-infra' ; import { leftShift , multipliedBy } from '@masknet/web3-shared-base' ; import type { ChainId } from '@masknet/web3-shared-flow' ; export function createFungibleToken ( chainId , address , name , symbol , decimals ) { return { id : address , chainId , type : TokenType . Fungible , address , name , symbol , decimals , } ; } export function createFungibleAsset ( token , balance , logoURI ? , price ? ) { return { id : token . address , chainId : token . chainId , balance : leftShift ( balance , 8 ) . toFixed ( ) , token , logoURI , value : { [ CurrencyType . USD ] : multipliedBy ( price ?. usd ?? 0 , leftShift ( balance , 8 ) ) . toFixed ( ) , } , price , } ; }