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

@ccbridge-sdk/dapp-sdk

v0.0.13

Published

TypeScript SDK with constants and request helpers used by CC Bridge DApps.

Readme

@ccbridge-sdk/dapp-sdk

TypeScript SDK with constants and request helpers used by CC Bridge DApps.

Installation

yarn add @ccbridge-sdk/dapp-sdk
# or
npm i @ccbridge-sdk/dapp-sdk

Usage

import { BRIDGE_CONTRACT_ADDRESS, getAgreement, getEvmHistory } from '@ccbridge-sdk/dapp-sdk';

const agreement = await getAgreement({ party: 'Alice::fingerprint' });

const history = await getEvmHistory({
  sender: '0x0000000000000000000000000000000000000000',
  rowsPerPage: 10,
  pageParam: 0,
});

console.log(BRIDGE_CONTRACT_ADDRESS, agreement, history);

Developer notes

Agreement (required)

Before transferring to or from a party, the party must have an active agreement. If the agreement is not created, the bridge flow will fail.

  • Check if an agreement exists: getAgreement({ party })
  • Create an agreement:
    • The party owner signs the agreement payload using their Ed25519 private key
    • Use prepareAgreementCreate to get a payload to sign
    • Use submitAgreementCreate to submit the signed payload

Transfer from Canton

To transfer assets from Canton, you typically:

  • Prepare the transfer details (server-side prepare step)
  • Have the party owner sign the prepared payload (Ed25519)
  • Submit the signed payload (server-side submit step)

This SDK exposes the prepareCantonWithDraw / submitCantonWithDraw helpers for the Console Wallet API part of that flow.

Transfer from EVM

To transfer from EVM, a DApp usually needs an off-chain component (backend/relayer) that:

  • Watches EVM events / transaction status
  • Builds and submits the corresponding Canton-side communication

To simplify EVM-side integration, this package exports:

  • BRIDGE_ABI (bridge contract ABI)
  • ERC20_ABI (ERC-20 ABI)
  • BRIDGE_CONTRACT_ADDRESS (default bridge address)
const tx = await activeWallet?.wallet.writeContract({
  address: BRIDGE_CONTRACT_ADDRESS,
  abi: BRIDGE_ABI,
  account: activeWallet.wallet.account,
  chain: activeWallet.wallet.chain,
  functionName: 'sendCanonicalTokenToCanton',
  args: [tokenAddress, amount, textToHex(partyId)],
  value: tokenAddress === zeroAddress ? amount : undefined,
});

Stealth transfers

Stealth transfers require a Canton Wallet that supports encryption.

  • Once stealth data is created/registered, you can transfer to EVM and later decrypt the EVM private key using your Canton Wallet (for the same party).
  • If stealth data is re-created (re-registered), you will lose the ability to decrypt EVM keys created before the re-creation.

Requests

All request helpers are exported from @ccbridge/dapp-sdk. Each request supports an optional requestUrlOverride field (when present) to override the base URL used for the call.

| Function | Purpose | Request type | Response type | | ------------------------ | ------------------------------------------------------------------ | ------------------------------- | -------------------------------- | | getAgreement | Fetches Canton bridge agreement status by party. | GetAgreementRequest | GetAgreementResponse | | prepareAgreementCreate | Prepares agreement creation (server-side preparation step). | PrepareAgreementCreateRequest | PrepareAgreementCreateResponse | | submitAgreementCreate | Submits agreement creation (server-side submit step). | SubmitAgreementCreateRequest | SubmitAgreementCreateResponse | | prepareCantonWithDraw | Prepares a Canton withdraw via Console Wallet API. | PrepareCantonWithDrawRequest | PrepareCantonWithDrawResponse | | submitCantonWithDraw | Submits a Canton withdraw via Console Wallet API. | SubmitCantonWithDrawRequest | SubmitCantonWithDrawResponse | | getStealthAddress | Fetches the registered stealth identity for an address/public key. | GetStealthAddressRequest | GetStealthAddressResponse | | registerStealthAddress | Registers a stealth identity. | RegisterStealthAddressRequest | RegisterStealthAddressResponse | | getCantonHistory | Lists Canton transfer statuses. | GetCantonHistoryRequest | GetCantonHistoryResponse | | getEvmHistory | Returns merged EVM history (send + receive) sorted by createdAt. | GetEvmHistoryRequest | GetEvmHistoryResponse | | getStealthHistory | Lists EVM bridge jobs (stealth-related history). | GetStealthHistoryRequest | GetStealthHistoryResponse |

Constants

All constants are exported from @ccbridge/dapp-sdk:

| Name | Value | Description | | ------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | CANTON_NETWORK | CANTON_NETWORK | Key/name used by consumers to refer to the Canton network. | | EVM_CHAIN_ID | 1 | EVM chain id (Ethereum Mainnet). | | EVM_EXPLORER | https://etherscan.io/ | Default EVM explorer base URL. | | CC_VIEW | https://ccview.io/ | CC View base URL. | | BRIDGE_CONTRACT_ADDRESS | 0x287d38Ca1d89Cd3c435A8279Ac9A3528dDeB9131 | EVM Bridge contract address. | | AGREEMENT_API | https://ccbridge.xyz/ | Default base URL for Canton agreement-related API. | | EVM_HISTORY_API | https://ccbridge.xyz/ | Default base URL for EVM history API. | | CANTON_WALLET_API | https://consolewallet.io/ | Default base URL for Console Wallet API. | | ERC20_ABI | (exported) | ERC-20 ABI definition. | | BRIDGE_ABI | (exported) | Bridge contract ABI definition. | | zeroAddress | 0x0000000000000000000000000000000000000000 | EVM zero address constant. | | EVM_CHAIN_METADATA | (exported) | Token metadata map per EVM network (contract address → name/symbol/decimals/icon). | | TokenMetadata | (exported) | Type for token metadata entries used in EVM_CHAIN_METADATA. | | PairId | (exported) | Enum of supported token pair identifiers (e.g. usdc, eth, wbtc). | | PairInfo | (exported) | Type describing a single token pair (cc + evm token data). | | PAIRS | (exported) | Helper that returns the supported pair map for given EVM + Canton network variants. NOTE: balances must be fetched by dapp consumer |