mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
* Add support for all rippled APIs, including subscriptions. * Add support for arbitrary stream message types. * Note that rippled APIs take amounts in drops. * request() will be available in ripple-lib version 1.0.0+
30 lines
937 B
Plaintext
30 lines
937 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://ripple.com/build/rippled-apis/#markers-and-pagination).
|
|
|
|
### 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 will reject 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);
|
|
```
|