Skip to main content

Module ledger

Module ledger 

Source
Expand description

Persistent append-only wallet ledger — tracks ILP micropayment dispatches and locally-signed transaction hashes so that WalletStatus can report real values instead of hardcoded mocks.

Storage format: NDJSON in <storage_path>/wallet_ledger.ndjson. Each line is a LedgerEntry serialized as JSON.

Structs§

LedgerEntry
A single entry in the wallet ledger.

Enums§

LedgerEntryKind

Functions§

append_entry
Append a ledger entry to the NDJSON file. Creates the file if it doesn’t exist.
epoch_days_to_date_pub
Public accessor for epoch-to-date conversion (used by api.rs timestamp formatting).
ledger_path
Returns the path to the wallet ledger file.
new_entry
Create a new LedgerEntry with the current timestamp.
read_entries
Read all ledger entries. Returns an empty vec if the file doesn’t exist.
total_ilp_sent_micro_cents
Sum total ILP micro-cents dispatched with status “sent”.