Skip to content

Reference

ledger.completions

Poll command completions over HTTP POST /v2/commands/completions with cursor batching.

completions wraps POST /v2/commands/completions. It returns the next batch of completions strictly after beginExclusive, optionally constrained by limit / streamIdleTimeoutMs query parameters.

For tracking a specific submission, prefer subscribeToCompletions or waitForCompletion—the HTTP variant is best for periodic polling loops.

Receiver: await canton.ledger.completions

Setup

import { Canton } from '@fairmint/canton-node-sdk';

const canton = new Canton({
  network: 'devnet',
  provider: '5n',
  partyId: 'OWN_PARTY_ID',
});

Minimal example

const page = await canton.ledger.completions({
  userId: canton.getUserId()!,
  parties: [canton.getPartyId()],
  beginExclusive: lastSeenOffset,
  limit: 64,
});

Parameters — CompletionsParams

  • userId (required, string) — Ledger user whose completions stream you consume.
  • parties (required, string[]) — Parties whose completions should appear (typically includes submitting parties).
  • beginExclusive (required, number) — Exclusive lower bound offset (must advance as you page).
  • limit (optional, number) — Query limit on the URL controlling batch size.
  • streamIdleTimeoutMs (optional, number) — Mapped to stream_idle_timeout_ms query string.

The JSON body mirrors CompletionsRequest (userId, parties, beginExclusive).

Returns — CompletionsResponse

OpenAPI-generated completion batch payload—inspect completions, offsets, and checkpoints returned by your participant version.

Errors and pitfalls

Advance beginExclusive using offsets/checkpoints from prior responses; stale cursors may replay or skip depending on participant semantics.

Auth and party

OAuth token; userId must align with the authenticated ledger user.

See also

Source

operations/v2/commands/completions.ts