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

@cantor8/wallet-connect-sdk

v0.3.0

Published

C8 Wallet Connect SDK for dApp developers: postMessage API to interact with C8 Wallet.

Readme

C8 Wallet Connect SDK

Lightweight SDK for dApp developers to integrate the C8 Wallet via a popup window and postMessage communication.

Quick Start

Installation

npm i @cantor8/wallet-connect-sdk

Import the provider into your dApp:

import { C8WalletProvider } from "./provider";

Configuration

Create a new provider instance:

const c8 = new C8WalletProvider({
  dappUrl: window.location.href,
  dappName: "Cantor8 Wallet Connect SDK Demo",
  network: "devnet",
});

Events

You can subscribe to wallet events using c8.on():

c8.on("connected", (e) => console.log("Connected", e));
c8.on("disconnected", (e) => console.log("Disconnected", e));
c8.on("accountChanged", (e) => console.log("Account's balance changed", e));
c8.on("txInitiated", (e) => console.log("TX initiated", e));
c8.on("txChanged", (e) => console.log("TX changed", e));

Basic Usage

const c8 = new C8WalletProvider({
  dappUrl: window.location.href,
  dappName: "Cantor8 Wallet Connect SDK Demo",
  network: "devnet",
});

await c8.connect();

// Instruments list type: InstrumentListPayload
const instruments = await c8.getInstruments();
console.log("Instruments", instruments);

const firstInstrumentId = instruments.instruments[0]?.instrumentId;

// Accounts list type: AccountListPayload
const accounts = await c8.getAccounts(firstInstrumentId);
console.log("Accounts", accounts);

const senderPartyId = accounts.accounts[0]?.partyId;

const senderHoldingInstrumentId =
  accounts.accounts[0]?.holdings[0]?.instrumentId || firstInstrumentId;

// Submit a transfer
// SubmitTransferResultPayload
const res = await c8.send({
  senderPartyId,
  instrumentId: senderHoldingInstrumentId,
  amount: 1.23,
  receiverPartyId: "Party::Receiver",
});

console.log("Send result", res); // { txId }

API Reference

Public API: C8WalletProvider

| Method | Parameters | Return Type | | --------------------- | ------------------------------------------ | --------------------------------------------------------- | | connect() | None | Promise<void> | | disconnect() | None | Promise<void> | | status() | None | Promise<{ connected: boolean; walletVersion?: string }> | | getInstruments() | None | Promise<InstrumentListPayload> | | getAccounts() | instrumentId?: string | Promise<AccountListPayload> | | send() | input: SendInput | Promise<SubmitTransferResultPayload> | | signAndExecute() | input: SignAndExecuteInput | Promise<void> | | checkTxStatusById() | input: { txId: string } | Promise<TransferStatusResponsePayload> | | on() | event: T, cb: Listener<C8EventByType<T>> | () => boolean |

send() Input

{
  senderPartyId: string;
  instrumentId: string;
  amount: number;
  receiverPartyId: string;
  memo?: string;
  metadata?: Record<string, string>;
}

signAndExecute() Input

{
  note: string;
  partyId: string;
  commandId: string;
  commandsJson: string;
  disclosedContracts: string;
}

Events Reference

Use c8.on(eventType, callback) to listen for changes emitted by the wallet.

| Event Type | Payload Properties | Description | | ------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | connected | meta?: Json | Fired when the wallet successfully connects. | | disconnected | reason?: string, meta?: Json | Fired when the session disconnects. | | txInitiated | txId?: string, meta?: Json | Fired when a transaction request is initiated. | | txChanged | txId: string, status: "pending" \| "confirmed" \| "failed" \| string, meta?: Json | Fired when a transaction's completion status updates. | | accountChanged | accounts: AccountInfoPayload[], meta?: Json | Fired when internal account asset holdings scale or modify. | | themeChanged | theme: "dark" \| "light", meta?: Json | Fired when the wallet interface changes its UI display theme. | | operationCanceled | reason: string, meta?: Json | Fired when an action or modal interface is explicitly rejected by the user. |

Unsubscribing from Events

The on() method returns an unsubscribe function:

const unsubscribe = c8.on("connected", (event) => {
  console.log("Connected", event);
});

unsubscribe();

License

MIT