ledgers

Get ledger detail by sequence — header + prev/next navigation + embedded paginated transactions.

Two DB-only reads, issued concurrently — both key off the path :sequence, so neither waits on the other (task 0446):

  • Header. Resolve :sequence against ledgers + prev/next computed via sequence comparisons on the ledgers PK (index-only scan, no heap fetch). Decides the 404.
  • Transactions. Keyset-paginated read of transactions, pruned to the one partition holding that sequence (intDiv(ledger_sequence, 500000)).

The detail endpoint reuses the standard ?limit= / ?cursor= query parameters to drive embedded transactions pagination. Detail itself is a single resource, so no naming collision arises — the params page the embedded list directly.

get/v1/ledgers/{sequence}

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header x-api-key
    • HTTP bearer

Path parameters

sequenceinteger required

Ledger sequence number

Query parameters

limitinteger

Embedded transactions page size (1–100, default 20).

cursorstring

Embedded transactions opaque pagination cursor.

Response

Ledger detail with embedded transactions

base_feeinteger required
closed_atstring date-time required
hashstring required

Ledger hash (64-char lowercase hex).

next_sequenceinteger nullable

Sequence number of the ledger that closed immediately after this one. null at the chain head (this is the most recent ledger we have indexed).

prev_sequenceinteger nullable

Sequence number of the ledger that closed immediately before this one. null at the chain tail (no earlier ledger persisted).

protocol_versioninteger required
sequenceinteger required
successful_transaction_countinteger nullable

Successful transactions in this ledger — same semantics (and same null case) as [LedgerListItem::successful_transaction_count].

transaction_countinteger required

Changes

No recorded changes to this operation across all 50 revisions of this API.