10 Compute Units.
Reference: Here
Parameters
startLedger(number) - Ledger sequence number to start fetching responses from (inclusive).- This method will return an error if
startLedgeris less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. - If a
cursoris included in the request,startLedgermust be omitted.
- This method will return an error if
pagination- Pagination in stellar-rpc is similar to pagination in Horizon. See Pagination.-
cursor(string) An opaque string which acts as a paging token. To obtain the next page of results occurring after a given response set this value to thecursorfield of the response. -
limit(number) The maximum number of ledgers returned. On Pubnet and Testnet the limit can range from 1 to 200. On Pubnet RPC v2 (Beta) it can range from 1 to 20, and a higher value returns an error. - If this argument isn’t designated, it defaults to 50 on Pubnet and Testnet, and 5 on Pubnet RPC v2 (Beta).
-
xdrFormat(string) - Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.- Specifies whether XDR should be encoded as Base64 (default or ‘base64’) or JSON (‘json’).
Returns
ledgersarray[object]hashstring - The hash of the ledger header which was included in the chainsequencenumber - The sequence number of the ledger (sometimes called the ‘block height’).ledgerCloseTimestring - The timestamp at which the ledger was closed.headerXdrstring - The LedgerHeader structure for this ledger (base64-encoded string).metadataXdrstring - The LedgerCloseMeta union for this ledger (base64-encoded string).
latestLedgernumber - The sequence number of the latest ledger known to Stellar RPC at the time it handled the request.latestLedgerCloseTimenumber - The unix timestamp of the close time of the latest ledger known to Stellar RPC at the time it handled the request.oldestLedgernumber - The sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request.oldestLedgerCloseTimenumber - The unix timestamp of the close time of the oldest ledger ingested by Stellar RPC at the time it handled the request.cursorstring - A token which can be included in a subsequent request to obtain the next page of results.