Skip to content

Ledger APIs

These six APIs read ledger-level data — the current ledger's sequence and base fee, the last-closed ledger's time and hash, a general-purpose nonce, and keylet range enumeration. They were originally documented together with the slot family on a single "Ledger and Slot APIs" page; that page has been split in two, and this page covers the ledger-info half.

All signatures are copied verbatim from hook/extern.h. Return codes reference the shared error table in ../../glossary.md; values come from include/xrpl/hook/Enum.h and hook/error.h. Implementations live in src/xrpld/app/hook/detail/HookAPI.cpp (core logic) and src/xrpld/app/hook/detail/applyHook.cpp (WASM-facing wrappers).


Index

FunctionPurpose
fee_baseBase fee (drops) of the current ledger.
ledger_seqCurrent ledger sequence number.
ledger_last_timeClose time of the last closed ledger.
ledger_last_hashHash of the last closed ledger.
ledger_nonceA unique per-call nonce.
ledger_keyletEnumerate the next keylet in a lo..hi range.