balance field directly.
Ledger endpoints
GET /api/wallets/:walletId/ledgers
Returns paginated ledger entries for a single wallet. Use this endpoint when you want to show a wallet’s balance history in your UI or reconcile its activity.
Query parameters
GET /api/ledger
Returns the global ledger — entries across all wallets. Useful for platform-wide reconciliation or building an admin view of all balance changes.
This endpoint accepts the same page and pageSize query parameters as the per-wallet endpoint.
LedgerEntry fields
Why balanceAfter matters
balanceAfter lets you reconstruct the wallet’s full balance timeline from the ledger alone. Each entry is a snapshot: take any entry and you instantly know the balance at that moment in history. This is useful for:
- Auditing what a wallet’s balance was at a specific time
- Building a balance chart over time without a separate time-series store
- Verifying that the current
balanceon the wallet object matches the latest ledger entry’sbalanceAfter
Example response
TypeScript example: fetching ledger entries with pagination
Fetching the global ledger
To query across all wallets, swap the endpoint for/api/ledger. The response shape is identical: