suix_getCoinMetadata - Sui

Example code for the suix_getCoinMetadata JSON-RPC method. Complete guide on how to use suix_getCoinMetadata JSON-RPC in GetBlock Web3 documentation.

This method returns metadata for a specified coin type on the SUI network, including its symbol, decimals, name, description, and icon URL. This information is essential for displaying tokens correctly in wallet interfaces, DEXs, and portfolio trackers. The metadata is stored on-chain and reflects the token's official configuration.

Parameters

Parameter
Type
Required
Description

coin_type

string

Yes

The fully qualified type name for the coin (e.g., 0x2::sui::SUI)

Returns

Field
Type
Description

decimals

uint8

Number of decimal places for display formatting

name

string

Human-readable name of the coin

symbol

string

Trading symbol (e.g., SUI, USDC)

description

string

Description of the coin and its purpose

iconUrl

string

URL to the coin's icon image (may be null)

id

ObjectID

The CoinMetadata object ID on-chain

Request Example

curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "suix_getCoinMetadata",
  "params": [
    "0x2::sui::SUI"
  ]
}'

Response Example

Response Parameters

Parameter
Type
Description

decimals

integer

Number of decimal places (SUI uses 9, meaning 1 SUI = 10^9 MIST)

name

string

Full name of the token

symbol

string

Short trading symbol

description

string

Token description

iconUrl

string

URL to token icon (null if not set)

id

string

On-chain CoinMetadata object ID

Use Cases

  • Display correct token symbols and names in wallets

  • Format balances with proper decimal places

  • Show token icons in user interfaces

  • Validate token information for listings

  • Build token registries and databases

Error Handling

Error Code
Description

-32602

Invalid params - malformed coin type

-32603

Internal error - node processing issues

null result

Coin type does not have registered metadata

SDK Integration

Last updated

Was this helpful?