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 display token balances, automate workflows based on token holdings, or integrate WAX token data into other systems.
Practical examples include:
- Checking a user's WAX token balance before allowing access to certain features.
- Automating notifications when an account's token balance changes.
- Integrating token balance data into dashboards or reports.
Properties
| Name | Meaning |
|---|---|
| Account Name | The WAX blockchain account name whose token balance you want to retrieve. |
| Token Contract | The smart contract that manages the token (default is "eosio.token"). |
| Symbol | The symbol of the token to check the balance for (default is "WAX"). |
| API Endpoint | The URL of the WAX blockchain API endpoint to query (default is "https://wax.greymass.com"). |
Output
The node outputs a JSON object with the following structure for each input item:
{
"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
}
There is no binary output; all data is returned as JSON.
Dependencies
- Requires access to a WAX blockchain API endpoint that supports the
/v1/chain/get_currency_balancePOST method. - No special credentials are embedded; however, the API endpoint must be accessible and responsive.
- Uses the
axiosHTTP client library internally to make API requests.
Troubleshooting
Common issues:
- Incorrect account name or token contract may result in zero balance or empty responses.
- Network connectivity problems or incorrect API endpoint URLs will cause request failures.
- If the token symbol does not exist for the account, the balance defaults to zero.
Error messages:
- Network errors or timeouts indicate issues reaching the API endpoint; verify the URL and network access.
- API response errors may occur if the endpoint is down or the request payload is malformed; ensure parameters are correct.
Resolution tips:
- Double-check the account name, token contract, and symbol for typos.
- Confirm the API endpoint URL is valid and reachable.
- Test the API manually using tools like Postman to verify expected responses.
Links and References
- WAX Blockchain API Documentation
- EOSIO get_currency_balance API Reference (WAX uses EOSIO-based APIs)
- Axios HTTP Client