Get coin metadata

Get coin metadata

Retrieves the metadata of a specific coin on the Aptos blockchain.

This function is useful when you need to display user-friendly information about a coin, such as its name, symbol, and decimals.

getCoinMetadata(coinType: MoveStructId): Promise<IFungibleAssetMetadata>

IFungibleAssetMetadata:

Name
Type
Description

name

string

The full name of the coin (e.g., “Aptos”).

symbol

string

The coin’s symbol (e.g., “APT”).

decimals

number

The number of decimal places the coin uses.

Get metadata of APT

const APTOS_COIN = "0x1::aptos_coin::AptosCoin";
const aptMetadata = await wallet.getCoinMetadata(APTOS_COIN);
// {
//    name: 'Aptos Coin',
//    symbol: 'APT',
//    decimals: 8,
// };

Last updated