@chainlink/canton-contracts
v2.3.0
Published
TypeScript bindings for the Chainlink Canton contracts, generated by `dpm codegen-js`
Maintainers
Keywords
Readme
@chainlink/canton-contracts
Official TypeScript bindings for the Chainlink Canton contracts, generated with dpm codegen-js from the released DARs in contracts/dars/released.
The package is published to npm automatically on contracts/vX.Y.Z releases (see Publishing).
Publishing
Publishing runs on every contracts/vX.Y.Z tag in the release-publish workflow. It uses npm trusted publishing (OIDC) via the publish GitHub environment — no long-lived npm token is stored.
The package can also be published manually by dispatching the workflow from the default branch — e.g. for an initial publish whose release tag predates this workflow:
gh workflow run release-publish.yamlManual dispatch publishes the committed version of the selected ref; on a contracts/vX.Y.Z ref the version is re-stamped from the tag as a safeguard.
Installation
npm install @chainlink/canton-contractsUsage
The package contains one directory per Daml package, named <package>-<package version>. Import the bindings for a Daml package as a deep import:
import { CCIP } from '@chainlink/canton-contracts/ccip-api-v2-2.0.0';or in CommonJS:
const { CCIP } = require('@chainlink/canton-contracts/ccip-api-v2-2.0.0');A convenience barrel re-exporting every package is available at the package root:
const bindings = require('@chainlink/canton-contracts');
bindings['ccip-api-v2-2.0.0'].packageId;Cross-package references inside the generated bindings (e.g. the ccip-api-v2 bindings referring to splice-api-token-metadata-v1) resolve to deep imports of this package, so no additional packages need to be installed.
Peer dependencies
The generated bindings require @daml/types as a peer dependency, pinned to the major/minor of the Daml SDK the bindings were generated from. Install a matching version alongside the bindings.
Versioning
The package version tracks the contracts/vX.X.X releases of the chainlink-canton repository: bindings vX.Y.Z are generated from the DARs of contracts release vX.Y.Z. See the repository's contracts CHANGELOG for what changed.
The release-please release PR for contracts automatically bumps version in this package's package.json (via the
extra-files JSON updater in release-please-config.json), so the committed
version always matches the release the bindings were regenerated from.
Multiple deployed versions of the same Daml package lineage (e.g. ccip-burn-mint-token-pool-v2-2.0.0 and ccip-burn-mint-token-pool-v2-2.1.2) are included side by side; import the one matching the deployed contract.
Regeneration
The bindings are generated by contracts/cmd/genbindingsjs and committed so changes are reviewable. To regenerate after releasing new DARs:
make generate-bindings-jsRequires dpm and Go. CI fails if the committed bindings drift from the released DARs.
