Skip to main content
The ledger namespace is used for preparing, signing, and executing transactions and other Ledger API operations.

Availability

The ledger namespace is always available as part of the basic SDK interface. It’s initialized automatically when you create an SDK instance and doesn’t require additional configuration via extend().

Key changes from v0 to v1

v0 used the userLedger or adminLedger controller with implicit party context set via sdk.setPartyId(). v1 uses the ledger namespace where you:
  • Pass partyId explicitly to each operation
  • Have an explicit lifecycle with prepare/sign/execute chain instead of a single method
  • Access operations through logical groupings (external, internal, dar, and acs)
Prepare, signing, and executing transactions Previously, a single method would handle everything.

Each step in lifecycle is clearer, workflowIds are generated automatically and there is better typesafety at each step. The below example demonstrates how offline signing works.
Full example: online and offline signing
Active Contract Set (ACS) queries

No need to manually enter get the ledger end for the offset and there is direct extraction of the activeContracts. However, we still have an acs.readRaw method for unfiltered results. DAR management

Migration reference

See also