Overview
This node retrieves the token balance for a specified account on the WAX blockchain. It queries the blockchain API to get the balance of a particular token symbol from a given token contract for the provided account name. This is useful in scenarios where you want to monitor or use token balances within an automation workflow, such as checking user balances before processing transactions or triggering actions based on token holdings.
Practical examples:
- Checking a user's WAX token balance before allowing access to a service.
- Monitoring balances of custom tokens issued on the WAX blockchain.
- Integrating token balance checks into larger workflows involving blockchain data.
Properties
| Name | Meaning |
|---|---|
| Account Name | The blockchain account name whose token balance you want to retrieve (required). |
| Token Contract | The smart contract account that manages the token (default: eosio.token, required). |
| Symbol | The token symbol to check the balance for (default: WAX). |
| API Endpoint | The URL of the WAX blockchain API endpoint to query (default: https://wax.greymass.com, required). |
Output
The node outputs an array with one item per input. Each output item contains a JSON object with the following structure:
{
"account": "string", // The queried account name
"contract": "string", // The token contract used
"symbol": "string", // The token symbol checked
"balance": number // The numeric balance of the token for the account
}
No binary data is produced by this node.
Dependencies
- Requires access to a WAX blockchain API endpoint supporting the
/v1/chain/get_currency_balancePOST method. - Uses HTTP requests via the Axios library to communicate with the blockchain API.
- No special credentials are embedded; however, the API endpoint must be accessible and may require network connectivity.
Troubleshooting
- Empty or zero balance returned: Ensure the account name, token contract, and symbol are correct. If the account holds no tokens of the specified symbol, the balance will be zero.
- Network errors or timeouts: Verify the API endpoint URL is correct and reachable from your environment.
- Invalid response or parsing errors: Confirm the API endpoint supports the expected method and returns data in the expected format.
- Missing required parameters: The node requires
Account Name,Token Contract, andAPI Endpointto be set; missing these will cause errors.
Links and References
- WAX Blockchain API Documentation
- EOSIO get_currency_balance API Reference (WAX uses EOSIO-based APIs)
- Axios HTTP Client