Skip to main content

Pagination

Pagination in stellar-rpc is similar to pagination in Horizon.

For methods which support it, the pagination arguments are passed as a final object argument with two values:

  • cursor: string - (optional) A string ID that points to a specific location in a collection of responses and is pulled from the pagingtoken value of a record. When a cursor is provided Stellar-RPC will _not include the element whose id matches the cursor in the response. Only elements which appear after the cursor are included.
  • limit: number - (optional) The maximum number of records returned. The limit for getEvents can range from 1 to 10000 - an upper limit that is hardcoded in Stellar-RPC for performance reasons. If this argument isn't designated, it defaults to 100.

For example, calling a method with pagination parameter set:

{
"jsonrpc": "2.0",
"id": "1",
"method": "exampleMethod",
"params": {
"some": "argument",
"pagination": {
"cursor": "1234-1",
"limit": 100
}
}
}