Solana RPC

Token Methods

Methods for querying SPL token data.

getTokenAccountBalance

POST - JSON-RPC

Returns the token balance of an SPL Token account.

params[0]stringrequired

Token account Pubkey as a base-58 encoded string.

params[1]object

Configuration object with optional commitment.

curl https://rpc.nln.clr3.org \  -H "Content-Type: application/json" \  -H "x-api-key: YOUR_API_KEY" \  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountBalance","params":["7fUAJdStEuGbc3sM84cKRL6yYaaSstyLSU4ve5oovLS7"]}'

getTokenAccountsByOwner

POST - JSON-RPC

Returns all SPL Token accounts by token owner.

params[0]stringrequired

Owner Pubkey as a base-58 encoded string.

params[1]objectrequired

Filter object - must contain one of:

  • mint (string) - token mint address
  • programId (string) - SPL Token program ID
params[2]object

Configuration object with encoding, commitment, dataSlice, minContextSlot.

curl https://rpc.nln.clr3.org \  -H "Content-Type: application/json" \  -H "x-api-key: YOUR_API_KEY" \  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwner","params":["4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F",{"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"encoding":"jsonParsed"}]}'

getTokenAccountsByDelegate

POST - JSON-RPC

Returns all SPL Token accounts approved by a given delegate.

params[0]stringrequired

Delegate Pubkey as a base-58 encoded string.

params[1]objectrequired

Filter object with mint or programId.

params[2]object

Configuration object with encoding, commitment, dataSlice, minContextSlot.

curl https://rpc.nln.clr3.org \  -H "Content-Type: application/json" \  -H "x-api-key: YOUR_API_KEY" \  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByDelegate","params":["4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",{"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"encoding":"jsonParsed"}]}'

getTokenLargestAccounts

POST - JSON-RPC

Returns the 20 largest accounts of a particular SPL Token type.

params[0]stringrequired

Token Mint Pubkey as a base-58 encoded string.

params[1]object

Configuration object with optional commitment.

curl https://rpc.nln.clr3.org \  -H "Content-Type: application/json" \  -H "x-api-key: YOUR_API_KEY" \  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenLargestAccounts","params":["3wyAj7Rt1TWVPZVteFJPR1GhW8djSzmXbpAqk7uP8dWu"]}'

getTokenSupply

POST - JSON-RPC

Returns the total supply of an SPL Token type.

params[0]stringrequired

Token Mint Pubkey as a base-58 encoded string.

params[1]object

Configuration object with optional commitment.

curl https://rpc.nln.clr3.org \  -H "Content-Type: application/json" \  -H "x-api-key: YOUR_API_KEY" \  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenSupply","params":["3wyAj7Rt1TWVPZVteFJPR1GhW8djSzmXbpAqk7uP8dWu"]}'