@sigilry/splice-dars
@sigilry/splice-dars provides vendored Splice DAR files with typed path exports. Use it with @sigilry/cli to generate TypeScript types from the official Splice contracts without manually downloading release artifacts.
What are DARs?
Section titled “What are DARs?”DAR (DAML Archive) files are compiled packages of DAML smart contracts. The Splice network publishes DARs for its token standard, amulet contracts, and wallet APIs. You need these DARs to generate typed TypeScript bindings for interacting with Splice contracts on Canton Network.
Install
Section titled “Install”yarn add @sigilry/splice-darsGet DAR paths for codegen
Section titled “Get DAR paths for codegen”The primary use case is feeding DAR paths to @sigilry/cli for TypeScript code generation:
import { defineConfig } from "@sigilry/cli/config";import { spliceDars } from "@sigilry/splice-dars";
export default defineConfig({ dars: [spliceDars.amulet, spliceDars.apiTokenHolding, spliceDars.apiTokenTransferInstruction], output: "./src/generated",});Then generate types:
sigilry codegenUse all DARs
Section titled “Use all DARs”import { allSpliceDars } from "@sigilry/splice-dars";
// Pass every Splice DAR to codegenexport default defineConfig({ dars: [...allSpliceDars], output: "./src/generated",});Check the Splice version
Section titled “Check the Splice version”import { SPLICE_VERSION } from "@sigilry/splice-dars";
console.log(SPLICE_VERSION); // "0.5.14"Available DARs
Section titled “Available DARs”| Export Key | Contract Package |
|---|---|
amulet | Core Amulet contracts (AmuletRules, TransferPreapproval) |
util | Shared utility modules |
apiFeaturedApp | Featured app API |
apiTokenAllocation | Token allocation |
apiTokenAllocationInstruction | Token allocation instructions |
apiTokenAllocationRequest | Token allocation requests |
apiTokenBurnMint | Token burn and mint |
apiTokenHolding | Token holdings |
apiTokenMetadata | Token metadata |
apiTokenTransferInstruction | Token transfer instructions |
utilBatchedMarkers | Batched marker utilities |
utilTokenStandardWallet | Token standard wallet utilities |
Exports
Section titled “Exports”| Export | Type | Description |
|---|---|---|
spliceDars | Record<string, string> (readonly) | Named DAR file paths |
allSpliceDars | readonly string[] | All DAR paths as an array |
SPLICE_VERSION | string literal | Upstream Splice release version |
Versioning
Section titled “Versioning”This package follows standard semver via changesets. The SPLICE_VERSION export tells you which Splice release the bundled DARs came from — the npm version and Splice version are independent.
| Package Version | Splice Version |
|---|---|
| 0.3.x | 0.5.4 |
| 0.4.0 | 0.5.14 |
Typical workflow
Section titled “Typical workflow”- Install
@sigilry/splice-darsand@sigilry/cli - Reference the DAR paths you need in
sigilry.config.ts - Run
sigilry codegento generate TypeScript types - Import generated types in your dApp code
- Use
@sigilry/dappor@sigilry/reactto interact with the Canton ledger
Source and licensing
Section titled “Source and licensing”DAR artifacts are extracted from the public Splice release with SHA256 verification. Bundled DARs are redistributed under Apache License 2.0; package wrapper code is MIT.