Account Operations

Get the account nonce

// Get account nonce
let nonce = client.get_account_nonce(address).await?;

Get the Account Balance

// Get token account balance
let token_account = client.get_token_account(owner, mint_address).await?;
println!("Balance: {}", token_account.amount);

List all token accounts for an address

// List all token accounts for an address
let (accounts, total) = client.list_token_accounts(owner, Some(10), Some(0)).await?;

Derive the token account address

// Derive token account address
let token_account_addr = client.derive_token_account_address(wallet, mint);

Last updated