{ balance: string // formatted token amount, available in the given account name: string // Name of the token price: object /* price of token in fiat, supports only usd for now if usd price is not found returns {} */ symbol: string // The symbol of the token decimals: number // The number of decimals the token uses token_id: string // ID of this particular token i.e a near address icon: string // icon URL of the token, can be a base64 string as well isWhitelisted: boolean // if the token is a verifed token or not}[] // array of this object
const balance = await sdk.fetchTokenBalance(tokenId, accountId)
// Try token.pembrock.near as tokenId, combatant.near as accountId
accountId is the near wallet address.
tokenId is the nep-141 token address.
Response Body
{
balance: number // formatted token amount, available in the given account
token_metadata: {
name: string // Name of the token
symbol: string // The symbol of the token
decimals: number // The number of decimals the token uses
token_id: string // ID of this particular token i.e a near address
icon: string // icon URL of the token, can be a base64 string as well
isWhitelisted: boolean // if the token is a verifed token or not
}
_raw: {
balance: string // unformatted token amount, available in the given account
}
}