-
Notifications
You must be signed in to change notification settings - Fork 0
Ledger JSON API
This client provides a type-safe interface for interacting with the Ledger JSON API.
Per-method documentation migrated from the former docs site: see Reference and the pages under reference/ledger (overview: reference/ledger).
The Ledger JSON API v2 endpoints do not all share the same request-body shape.
In particular, /v2/commands/submit-and-wait-for-transaction expects:
{
"commands": {
"commands": [],
"commandId": "...",
"actAs": ["..."]
},
"transactionFormat": {}
}The SDK method accepts the convenient flat command parameters, then serializes
the JsCommands fields under the top-level commands property. Keep
transactionFormat beside that property. Do not infer this endpoint's wire
shape from the deprecated transaction-tree endpoint, which uses a different
OpenAPI schema.
Errors reporting missing commands.commands, commands.commandId, or
commands.actAs indicate a malformed HTTP envelope. The participant rejects
that request before sequencing, so it does not produce a Canton transaction.
When adding or changing a generated operation:
- Check the exact OpenAPI request schema for that endpoint.
- Keep public convenience parameters separate from the serialized wire body.
- Assert the complete request payload in a regression test, including default
commandIdandactAsvalues. - Confirm a rejected-envelope test has no matching update ID before treating it as a ledger failure.