Get SPL Token Balance
Check a wallet's SPL token balance on Solana. Returns the raw token amount, human-readable balance, and token decimals. Supports any SPL token (USDC, BONK, etc.) on mainnet and devnet.
Catalog action Solana Onchain
Check a wallet's SPL token balance on Solana. Returns the raw token amount, human-readable balance, and token decimals. Supports any SPL token (USDC, BONK, etc.) on mainnet and devnet.
At a Glance
| Field | Value |
|---|---|
| Action ID | get-spl-token-balance |
| Category | Solana Onchain |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | solana, spl, token, balance, query, read |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
walletAddress | string | Yes | Solana wallet address to check the balance for. |
tokenMintAddress | string | Yes | The token's contract address on Solana. You can find this on the token's page on Solscan or Jupiter. |
chainId | number | Yes | Solana network (Mainnet or Devnet) |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
balance | string | Yes | Raw token balance in smallest unit (e.g. '1500000' for 1.5 USDC) |
formattedBalance | string | Yes | Human-readable balance (e.g. '1.5') |
decimals | number | Yes | Token decimal places |
walletAddress | string | No | Wallet address that was checked. |
tokenMintAddress | string | No | The token's contract address. |
tokenAccountAddress | string | null | No | Associated token account address holding the tokens, or null if no account exists |
chainId | number | No | Solana chain ID |
Examples
json{ "type": "get-spl-token-balance", "payload": { "walletAddress": "0x0000000000000000000000000000000000000000", "tokenMintAddress": "0x0000000000000000000000000000000000000000", "chainId": 7565164 }, "children": []}
bashcurl -X POST "https://api.b3os.org/v1/actions/get-spl-token-balance/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "walletAddress": "0x0000000000000000000000000000000000000000", "tokenMintAddress": "0x0000000000000000000000000000000000000000", "chainId": 7565164 }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
