npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cantonjs-splice-token-standard

v0.4.0

Published

Participant-first CIP-0056 helpers for cantonjs applications

Readme

cantonjs-splice-token-standard

Ledger-centric CIP-0056 helpers for cantonjs, built on stable Splice interface package IDs from cantonjs-splice-interfaces.

This package is for app-side ledger integration:

  • query active token-standard contracts through the Ledger API
  • execute factory and non-factory interface choices through the Ledger API
  • parse ledger transactions into stable token-standard history items
  • prepare and execute participant interactive submissions for external-party flows

It intentionally does not depend on private validator endpoints, wallet-internal endpoints, or validator-private template names.

Status

  • Stability: GA
  • Supported Canton line: 3.4.x
  • Supported Splice line: 0.5.x
  • Recommended for: new transfer and allocation flows built on the stable Token Standard path

Install

npm install cantonjs cantonjs-splice-interfaces cantonjs-splice-token-standard

When To Use This Package

Use cantonjs-splice-token-standard when your app already talks to a Canton participant or validator Ledger API and you want stable, versioned helpers around the official Token Standard interfaces.

Use the official wallet SDK instead when you need wallet-provider stacks, browser wallet UX, richer wallet workflows, end-user session/auth orchestration, or other wallet-managed flows that sit above raw ledger integration.

For new transfer flows, prefer this package over legacy wallet-external transfer-offer APIs.

Package Policy

  • Reads and writes go through cantonjs Ledger API helpers or injected Transports only.
  • Stable helper names are versioned around Token Standard V1 interface package IDs such as TransferFactoryV1 and HoldingV1.
  • External-party flows use participant interactive submission (/v2/interactive-submission/*), not validator-private endpoints.
  • The package does not invent registry or validator HTTP endpoints beyond the official ledger APIs.

Quick Start

import { createLedgerClient, jsonApi } from 'cantonjs'
import {
  EMPTY_EXTRA_ARGS,
  acceptTransferInstructionV1,
  executePreparedTokenSubmission,
  prepareTransferViaFactoryV1,
  queryHoldingsV1,
} from 'cantonjs-splice-token-standard'

const transport = jsonApi({
  url: 'https://participant.example.com',
  token: process.env.CANTON_JWT!,
})

const client = createLedgerClient({
  transport,
  actAs: 'Alice::validator',
})

const holdings = await queryHoldingsV1(client)

const prepared = await prepareTransferViaFactoryV1(
  { transport, actAs: 'Alice::validator' },
  {
    factoryContractId: 'factory-cid',
    choiceArgument: {
      expectedAdmin: 'Validator::admin',
      transfer: {
        sender: 'Alice::validator',
        receiver: 'Bob::validator',
        amount: '10.0000000000',
        instrumentId: { admin: 'Issuer::issuer', id: 'USD' },
        requestedAt: '2026-04-02T12:00:00Z',
        executeBefore: '2026-04-02T12:05:00Z',
        inputHoldingCids: holdings.map((holding) => holding.createdEvent.contractId),
        meta: { values: {} },
      },
      extraArgs: EMPTY_EXTRA_ARGS,
    },
  },
)

const tx = await executePreparedTokenSubmission(
  { transport },
  prepared.preparedTransaction,
  [
    {
      party: 'Alice::validator',
      signatures: [{ format: 'RAW', signature: 'base64-signature', signedBy: 'key-1' }],
    },
  ],
)

await acceptTransferInstructionV1(client, {
  instructionContractId: 'transfer-instruction-cid',
  choiceArgument: { extraArgs: EMPTY_EXTRA_ARGS },
})

Export Surface

  • Query helpers: queryHoldingsV1, queryMetadataContractsV1, queryTransferInstructionsV1, queryTransferFactoriesV1, queryAllocationsV1, queryAllocationRequestsV1, queryAllocationInstructionsV1, queryAllocationFactoriesV1
  • History helpers: parseTokenStandardHistoryFromTransactionV1, parseTokenStandardHistoryFromUpdatesV1
  • Command helpers: transferViaFactoryV1, prepareTransferViaFactoryV1, acceptTransferInstructionV1, allocateViaFactoryV1, prepareAllocationViaFactoryV1, executeAllocationV1, and the generic submitTokenStandardChoice / prepareTokenStandardChoice

License

Apache-2.0