Actions23
- General Actions
- Bots Actions
- Deals Actions
- User Actions
Overview
This node interacts with the Gainium API to retrieve user-related data, specifically focusing on fetching user balances in this context. It supports paginated requests and filtering options, allowing users to obtain detailed balance information across different exchanges and assets. This is useful for traders or portfolio managers who want to monitor their asset holdings programmatically.
Practical examples include:
- Retrieving all balances across all exchanges for a user.
- Filtering balances by specific assets like BTC or USDT.
- Choosing between real trading balances or paper trading (simulated) balances.
- Paginating through large sets of balance data when there are many assets.
Properties
| Name | Meaning |
|---|---|
| Return All Items | Whether to return all items by automatically paginating through results (true/false). |
| Page Number | The page number to fetch when not returning all items; each page contains up to 500 assets. |
| Additional Options | Collection of optional filters: |
| - Exchange ID | Optional ID of the exchange to filter balances; if omitted, balances from all exchanges are used. |
| - Assets | Comma-separated list of asset symbols to filter results (e.g., "BTC,USDT"). |
| - Paper | Boolean flag indicating whether to use paper trading balances (true) or real trading (false). |
Note: There is also a notice property advising users to refer to the official Gainium API documentation for request formats.
Output
The output JSON structure contains:
data: An array of balance objects representing the user's asset balances.pagination: An object containing pagination details such as current page, total pages, and total results.
Example structure:
{
"data": [
{
"asset": "BTC",
"balance": 0.5,
"exchangeId": "123",
...
},
...
],
"pagination": {
"page": 1,
"totalPages": 3,
"totalResults": 1500
}
}
If the "Return All Items" option is enabled, the node automatically paginates through all pages and returns the combined results.
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the Gainium API.
- The node uses HMAC SHA-256 signing for request authentication.
- Requires network access to the Gainium API base URL configured in the credentials.
- No additional external dependencies beyond standard n8n HTTP request helpers.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Incorrect pagination parameters may result in incomplete data or errors.
- Providing malformed JSON or invalid filter strings in additional options can cause request errors.
- Network connectivity issues to the Gainium API endpoint.
Error messages:
"Error: <reason>"— Indicates an error response from the Gainium API; check the reason message for details."HMAC generation failed: Web Crypto API not available"— Occurs if the environment does not support required cryptographic functions; ensure running in a supported environment."Operation ... is not supported"— Happens if an unsupported operation is selected; verify the operation name."Invalid JSON in filterModel: ..."— When JSON parsing fails for filter inputs; validate JSON syntax.
Resolutions:
- Verify API credentials and permissions.
- Use valid page numbers and enable "Return All Items" for complete data retrieval.
- Validate JSON inputs before using them in the node.
- Ensure stable internet connection and API availability.
Links and References
- Gainium Official API Documentation (Please refer to this for detailed request formats and API capabilities)
- n8n HTTP Request Node Documentation (for understanding HTTP request handling in n8n)