token.getMetadata
Gets the metadata for a TIP-20 token, including name, symbol, decimals, currency, and total supply.
Usage
ts
import { } from 'wagmi/tempo'
import { } from './config'
const = await ..(, {
: '0x20c0000000000000000000000000000000000000',
})
.('Currency:', .)
.('Decimals:', .)Currency: USD.('Name:', .)Decimals: 18.('Symbol:', .)Name: United States Dollar.('Total Supply:', .)Symbol: USDTotal Supply: 1000000000000000000000nts
import { createConfig, http } from 'wagmi'
import { tempoTestnet } from 'wagmi/chains'
import { KeyManager, webAuthn } from 'wagmi/tempo'
export const config = createConfig({
connectors: [
webAuthn({
keyManager: KeyManager.localStorage(),
}),
],
chains: [tempoTestnet],
multiInjectedProviderDiscovery: false,
transports: {
[tempoTestnet.id]: http(),
},
})Return Type
ts
type ReturnType = {
currency: string
decimals: number
name: string
paused?: boolean
quoteToken?: Address
supplyCap?: bigint
symbol: string
totalSupply: bigint
transferPolicyId?: bigint
}Parameters
token
- Type:
Address | bigint
Address or ID of the TIP-20 token.