mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-04 17:26:46 +00:00
Use example.com instead of ripple.com Co-authored-by: Elliot Lee <github.public@intelliot.com>
30 lines
916 B
Plaintext
30 lines
916 B
Plaintext
## requestNextPage
|
|
|
|
`requestNextPage(command: string, params: object = {}, currentResponse: object): Promise<object>`
|
|
|
|
Requests the next page of data.
|
|
|
|
You can use this convenience method, or include `currentResponse.marker` in `params` yourself, when using `request`.
|
|
|
|
See [Markers and Pagination](https://xrpl.org/markers-and-pagination.html).
|
|
|
|
### Return Value
|
|
|
|
This method returns a promise that resolves with the next page of data from rippled.
|
|
|
|
If the response does not have a next page, the promise rejects with `new errors.NotFoundError('response does not have a next page')`.
|
|
|
|
### Example
|
|
|
|
```javascript
|
|
const command = 'ledger_data'
|
|
const params = {
|
|
ledger_index: 'validated'
|
|
}
|
|
return api.request(command, params).then(response => {
|
|
return api.requestNextPage(command, params, response)
|
|
}).then(response_page_2 => {
|
|
/* Do something useful with second page of response */
|
|
}).catch(console.error);
|
|
```
|