@fairmint/wrapped-assets-daml-js
v0.0.26
Published
WrappedAssets-v01 DAML contracts with generated JavaScript/TypeScript bindings (Canton Token Standard holdings, mint/burn, compliance enforcement, BurnOffer redeem).
Readme
canton-assets
Apache-2.0 repository for the WrappedAssets-v01 DAML package — reserve-backed holdings
implementing Canton Token Standard V1 (holding, burn-mint, transfer, and allocation interfaces),
with transfer-agent compliance enforcement (holding freeze / instrument pause) and recovery.
Holdings require distinct operator and transfer-agent signatures (two-party authorization).
Published npm bindings: @fairmint/wrapped-assets-daml-js (generated JS/TS only — not an
application SDK). First real release is 0.0.1 (npm placeholder was 0.0.0).
For contract structure, redeem, and instrument pause, see docs/.
Install JS bindings
npm install @fairmint/wrapped-assets-daml-jsPeer dependencies: @daml/[email protected] and @daml/[email protected] (also listed as runtime
dependencies for convenience).
import { WRAPPED_ASSETS_TEMPLATES, WrappedAssets, Splice } from '@fairmint/wrapped-assets-daml-js';
console.log(WRAPPED_ASSETS_TEMPLATES.burnMintFactory);Minimal mint → enforce/release or BurnOffer.Accept sample:
examples/mint-burn/.
Registry SDK
The generated bindings above are a mechanical translation of the DAR with no opinions in them.
@fairmint/wrapped-assets-sdk is the opinionated wrapper: it answers the
Canton Network Token Standard's registry questions — the instruments, the transfer and allocation
factories, and the six choice contexts — from three ledger reads behind a RegistryLedger port, so
the template matching, decimal-exact supply and pause rules live in one place rather than in each
server that serves them. It ships as a second package from this repository, versioned separately.
The SDK takes its template identifiers, choice names and choice-argument shapes from the published
@fairmint/[email protected] bindings instead of restating them, so it tracks exactly
the DAR this repository publishes — registry factories, instrument pause and compliance enforcement
included. Callers inject a RegistryLedger or a duck-typed JSON API reader (getActiveContracts +
getEventsByContractId). To read CIP-56 results, use @fairmint/canton-node-sdk (or another
client) with this package's CHOICES / TEMPLATE_IDS.
Layout
docs/contract-overview.md— structural template/choice map and workflow diagramsdocs/redeem.md— owner-initiated redemption viaBurnOfferdocs/instrument-pause.md— pause gate and recovery pathsdocs/cns-register.md— CNS/ANSregistryUrlsdry-run and dispatchdocs/csol.md— public cSOL instrument page outline (draft for review)docs/csol-hosting.md— GitHub Pages /csol.canton.fairmint.comsetupdocs/— docs indexsite/csol/— static Vite + React public page for cSOLWrappedAssets-v01/— Token Standard V1 contractsTest/— in-memory Daml Script teststest/localnet/— live-ledger integration testsexamples/mint-burn/— JS bindings samplepackages/sdk/—@fairmint/wrapped-assets-sdk, the registry SDKdars/— backed-up DARs (dars.lockfor integrity)generated/— build / codegen output (not hand-edited)multi-package.yaml— active package graph
Build and test
npm install
npx canton-dev-tools install-dpm-sdks
export PATH="$HOME/.dpm/bin:$PATH"
npm run lint
npm run build
npm test
npm run codegen
npm run verify-package
npm run typecheck:samplenpm test is both suites: test:daml (Daml Script, needs dpm) then test:sdk (node:test over
packages/sdk, needs neither Java nor the Daml SDK). CI runs them as separate jobs.
npm run build fetches pinned Splice interface DARs via the packaged default in
@fairmint/canton-dev-tools before compiling with dpm. LocalNet runtime Splice/quickstart pins
live in that package as well. Optional repo-root splice-dars.json overrides the shared pin when
needed.
Generic DAML→JS codegen (codegen-js, bundle-dependencies, create-root-index, package stamping,
collapse-manifest, prepare-release) lives in @fairmint/canton-dev-tools. Bundle presets and the
merged published lib/ (including WRAPPED_ASSETS_TEMPLATES) are configured in repo-root
daml-js-bundle.json. This repo keeps product-specific verify lists and samples.
Publish on main uses GitHub Actions OIDC trusted publishing (publish.yml); do not put
NPM_TOKEN on the publish step.
LocalNet integration
Live-ledger tests upload the built DAR and smoke WrappedAssetsBurnMintFactory on Canton LocalNet
(Docker required; first start ~10–15 min):
npm run build
npm run localnet:verifyLocalNet lifecycle and DAML package tooling come from
@fairmint/canton-dev-tools. What this repo's suite
asserts is in test/localnet/README.md.
License
Apache-2.0. See LICENSE.
