Skip to content

Reference

Reference

Hand-written TypeScript reference for `@fairmint/canton-node-sdk` — Canton entry point, ledger / validator / scan clients, and utilities.

The reference covers the runtime, all three API clients, and every utility helper that ships from @fairmint/canton-node-sdk. Pick a starting point below or use the sidebar to drill in.

The shape stays consistent across pages: a short prose intro, a minimal TypeScript example, parameters and return notes, errors and pitfalls, an auth/party note, and a link to the source on GitHub. No autogenerated card grids and no API browser — every page is hand-curated.

Core

The shared runtime, configuration loader, and small types used everywhere else.

  • Canton — unified entry point that exposes ledger, validator, and scan from one constructor.
  • CantonConfig — every constructor field in prose.
  • EnvLoader — derive ClientConfig from CANTON_* environment variables.
  • AuthenticationManager — OAuth2, static bearer, and tokenGenerator flows.
  • CantonRuntime — HTTP, auth, token plumbing, and fork.
  • BaseClient — shared client base class behind LedgerJsonApiClient, ValidatorApiClient, ScanApiClient.
  • ErrorsApiError, NetworkError, ConfigurationError, ValidationError, AuthenticationError.
  • Branded typesPartyId, ContractId, Offset, and friends.
  • Logging — log redaction and setLogger.
  • waitForCondition — generic polling helper used by transfer settlement.

Ledger JSON API client — canton.ledger

Every method on LedgerJsonApiClient, plus the waitForCompletion helpers exported alongside it.

Ledger overview → covers commands, parties, packages, ACS reads, updates and transactions, completion helpers, interactive submission, users and rights, identity providers, and version/auth introspection. Common starting points:

Validator API client — canton.validator

OAuth-backed validator surface: user onboarding, ANS, scan-proxy reads, token-standard registry, wallet, traffic, and transfer offers.

Validator overview → groups every method by area. Common starting points:

Scan API client — canton.scan

Public read-mostly surface with multi-endpoint rotation across SV-hosted Scan bases. No OAuth required.

Scan overview → explains rotation behavior plus every operation. Common starting points:

Utilities

Higher-level helpers built on the raw clients. Use these when you would otherwise stitch together several primitive calls by hand.

How to read each page

Every method page follows the same structure so they read predictably:

  1. One-paragraph intro that names the call and what it actually does.
  2. Setup snippet for new Canton({ … }) if needed.
  3. Minimal TypeScript example — copy-pasteable.
  4. Parameters, field by field. Required fields are marked.
  5. Returns — the practical shape, not the exhaustive type dump.
  6. Errors and pitfalls — failure modes the SDK actually surfaces.
  7. Auth and party — what acting identity is required.
  8. Source — direct link to the operation file in Fairmint/canton-node-sdk on GitHub.

For long-form walkthroughs, see Guides and Examples. For environment setup and a first end-to-end run, start with the Quickstart.