Overview
This node retrieves the token balance for a specified account on the WAX blockchain. It queries a WAX API endpoint to get the balance of a particular token symbol from a given token contract associated with the account. This is useful in scenarios where you want to monitor or display token balances, automate workflows based on token holdings, or integrate WAX blockchain data into other systems.
Practical examples include:
- Checking a user's WAX token balance before allowing access to a service.
- 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 an array of JSON objects, each containing:
account: The queried WAX account name.contract: The token contract used.symbol: The token symbol requested.balance: The numeric balance of the specified token for the account.
Example output JSON:
{
"account": "exampleaccount",
"contract": "eosio.token",
"symbol": "WAX",
"balance": 123.45
}
No binary data is produced by this node.
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 Axios HTTP client library internally to make requests.
Troubleshooting
Common issues:
- Incorrect account name or token contract may result in zero balance or no data.
- 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: Check the API endpoint URL and network connection.
- Invalid response or unexpected data format: Verify the API endpoint supports the required method and returns expected data.
- Missing required parameters: Ensure all required properties (Account Name, Token Contract, API Endpoint) are provided.