Appearance
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
| Function | Purpose |
|---|---|
fee_base | Base fee (drops) of the current ledger. |
ledger_seq | Current ledger sequence number. |
ledger_last_time | Close time of the last closed ledger. |
ledger_last_hash | Hash of the last closed ledger. |
ledger_nonce | A unique per-call nonce. |
ledger_keylet | Enumerate the next keylet in a lo..hi range. |
Related documents
- ../../README.md — documentation index.
- ../../overview.md — hook execution model and lifecycle.
- ../../glossary.md — full error-code and term reference.
- ../../macros.md —
SBUF,GUARD, and buffer helpers. - ../../best-practices.md — slot budgets and iterating ledger objects.
- Slot APIs —
slot_set,slot_subfield,meta_slot,xpop_slot, and the rest of the slot family. - control.md —
hook_againand the strong/weak execution model. - transaction.md —
otxn_slot,otxn_field, and originating-txn access. - emit-and-etxn.md —
etxn_fee_base,etxn_nonce, and emission. - utility.md —
util_keyletfor building the keyletsslot_set/ledger_keyletconsume.