Skip to main content
The CoinReadApi provides methods for querying coin-related data on the Sui network. All methods are in the suix namespace.

Methods

getCoins

Returns all Coin<coin_type> objects owned by an address.
owner
SuiAddress
required
The owner’s Sui address
coin_type
string
Optional type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC). Defaults to 0x2::sui::SUI if not specified
cursor
string
Optional paging cursor
limit
usize
Maximum number of items per page
result
CoinPage
Paginated coin results
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getCoins",
    "params": [
      "0x...",
      "0x2::sui::SUI",
      null,
      10
    ]
  }'

getAllCoins

Returns all Coin objects owned by an address (all coin types).
owner
SuiAddress
required
The owner’s Sui address
cursor
string
Optional paging cursor
limit
usize
Maximum number of items per page
result
CoinPage
Paginated results with all coins of all types
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getAllCoins",
    "params": [
      "0x...",
      null,
      50
    ]
  }'

getBalance

Returns the total coin balance for one coin type, owned by the address.
owner
SuiAddress
required
The owner’s Sui address
coin_type
string
Optional type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC). Defaults to 0x2::sui::SUI if not specified
result
Balance
Balance information
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getBalance",
    "params": [
      "0x...",
      "0x2::sui::SUI"
    ]
  }'

getAllBalances

Returns the total coin balance for all coin types owned by the address.
owner
SuiAddress
required
The owner’s Sui address
result
Balance[]
Array of balance information for each coin type
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getAllBalances",
    "params": [
      "0x..."
    ]
  }'

getCoinMetadata

Returns metadata (symbol, decimals, etc.) for a coin type.
If the coin’s metadata was wrapped in the transaction that published its marker type, or the latest version is wrapped or deleted, it will not be found.
coin_type
string
required
Type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC)
result
SuiCoinMetadata
Coin metadata if found
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getCoinMetadata",
    "params": [
      "0x2::sui::SUI"
    ]
  }'

getTotalSupply

Returns the total supply for a coin type.
coin_type
string
required
Type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC)
result
Supply
Supply information
curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getTotalSupply",
    "params": [
      "0x2::sui::SUI"
    ]
  }'

Usage Example with Rust SDK

use sui_sdk::SuiClientBuilder;
use sui_types::base_types::SuiAddress;
use std::str::FromStr;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let sui = SuiClientBuilder::default()
        .build("https://fullnode.mainnet.sui.io:443")
        .await?;
    
    let address = SuiAddress::from_str("0x...")?;
    
    // Get SUI balance
    let balance = sui.coin_read_api()
        .get_balance(address, None)
        .await?;
    
    println!("SUI Balance: {}", balance.total_balance);
    
    // Get all balances
    let all_balances = sui.coin_read_api()
        .get_all_balances(address)
        .await?;
    
    for balance in all_balances {
        println!("{}: {}", balance.coin_type, balance.total_balance);
    }
    
    // Get coin metadata
    let metadata = sui.coin_read_api()
        .get_coin_metadata("0x2::sui::SUI".to_string())
        .await?;
    
    if let Some(meta) = metadata {
        println!("Symbol: {}, Decimals: {}", meta.symbol, meta.decimals);
    }
    
    Ok(())
}

Build docs developers (and LLMs) love