OneBalance API uses cursor-based pagination for endpoints that return large collections of items. This approach provides efficient navigation through result sets.
The /status/get-tx-history
endpoint supports pagination through the following parameters:
Parameter | Type | Required | Description |
---|
limit | string | Yes | Maximum number of transactions to return in a single request (e.g., 10 ) |
continuation | string | No | A cursor value received from a previous response used to fetch the next page |
Paginated responses include:
{
"transactions": [
// Array of transaction objects
],
"continuation": "txn_00123456789abcdef" // Token to fetch the next page
}
The continuation
property will be present when more results are available beyond the current page. If it’s absent or null, you’ve reached the end of the results.
Initial Request
GET /api/status/get-tx-history?user=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&limit=10
Response
{
"transactions": [
// 10 transaction objects
],
"continuation": "txn_00123456789abcdef"
}
Subsequent Request
To fetch the next page, include the continuation
token from the previous response:
GET /api/status/get-tx-history?user=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&limit=10&continuation=txn_00123456789abcdef
- Always specify a limit - This controls how many items you receive per page.
- Store the continuation token - Save the token from each response to allow users to navigate to the next page.
- Check for continuation - If a response doesn’t include a continuation token, it means you’ve reached the end of the results.
- Handle pagination in your UI - Implement “Next” and “Previous” buttons that appear or disappear based on the availability of continuation tokens.
Limits and Constraints
- The
limit
parameter must be a positive number.
- For optimal performance, we recommend using reasonable limit values (10-50).
- The maximum number of results you can request per page may be capped by the server.
- Continuation tokens are temporary and may expire after a certain period of time.
Responses are generated using AI and may contain mistakes.