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

@partylayer/sdk

v0.4.1

Published

Main SDK for PartyLayer - Unified wallet integration for Canton Network

Readme

@partylayer/sdk

The unified SDK for connecting dApps to Canton Network wallets

npm version TypeScript License: MIT


Overview

@partylayer/sdk provides a unified interface for connecting your decentralized application (dApp) to multiple Canton Network wallets. It abstracts wallet-specific implementations behind a simple, type-safe API — one integration for every Canton wallet.

Features

  • Multi-Wallet Support: Console, 5N Loop, Cantor8, and Bron wallets
  • Zero Configuration: Works out of the box with sensible defaults
  • Type-Safe: Full TypeScript support with strict mode
  • Secure: Encrypted session storage with origin binding
  • Event-Driven: Subscribe to connection, transaction, and error events

Installation

npm install @partylayer/sdk

For React applications, also install the React integration:

npm install @partylayer/sdk @partylayer/react

Quick Start

1. Create a Client

import { createPartyLayer } from '@partylayer/sdk';

const client = createPartyLayer({
  network: 'devnet',
  app: { name: 'My dApp' },
});

2. Connect to a Wallet

// List available wallets
const wallets = await client.listWallets();
console.log('Available wallets:', wallets.map(w => w.name));

// Connect to a specific wallet
const session = await client.connect({ walletId: 'console' });
console.log('Connected! Party ID:', session.partyId);

3. Sign Messages & Transactions

// Sign a message
const { signature } = await client.signMessage({
  message: 'Authorize login to My dApp',
});

// Sign a transaction
const { signedTx, transactionHash } = await client.signTransaction({
  tx: myTransaction,
});

// Submit a transaction
const receipt = await client.submitTransaction({
  signedTx,
});

4. Listen to Events

// Connection events
client.on('session:connected', (event) => {
  console.log('Connected:', event.session.partyId);
});

client.on('session:disconnected', () => {
  console.log('Disconnected');
});

// Transaction events
client.on('tx:status', (event) => {
  console.log('Transaction status:', event.status);
});

// Error events
client.on('error', (event) => {
  console.error('Error:', event.error.message);
});

5. Disconnect

await client.disconnect();

Supported Wallets

| Wallet | ID | Type | Auto-Registered | |--------|-----|------|-----------------| | Console Wallet | console | Browser Extension | ✅ Yes | | 5N Loop | loop | Mobile / Web | ✅ Yes | | Cantor8 | cantor8 | Browser Extension | ✅ Yes | | Bron | bron | Enterprise (OAuth) | ⚙️ Requires config |


Configuration

const client = createPartyLayer({
  // Required
  network: 'devnet', // 'devnet' | 'testnet' | 'mainnet'
  app: {
    name: 'My dApp',
    origin: 'https://mydapp.com', // Optional, defaults to window.location.origin
  },

  // Optional
  registryUrl: 'https://registry.partylayer.xyz/v1/wallets.json', // Default
  channel: 'stable', // 'stable' | 'beta'
  
  // Advanced: Custom adapters
  adapters: [
    ...getBuiltinAdapters(),
    new BronAdapter({ auth: {...}, api: {...} }),
  ],
});

API Reference

createPartyLayer(config)

Creates a new PartyLayer client instance.

Client Methods

| Method | Description | Returns | |--------|-------------|---------| | listWallets(filter?) | List available wallets | Promise<WalletInfo[]> | | connect(options?) | Connect to a wallet | Promise<Session> | | disconnect() | Disconnect current session | Promise<void> | | getActiveSession() | Get active session | Promise<Session \| null> | | signMessage(params) | Sign an arbitrary message | Promise<SignedMessage> | | signTransaction(params) | Sign a transaction | Promise<SignedTransaction> | | submitTransaction(params) | Submit signed transaction | Promise<TxReceipt> | | on(event, handler) | Subscribe to events | () => void (unsubscribe) | | off(event, handler) | Unsubscribe from events | void | | destroy() | Cleanup client resources | void |

Events

| Event | Description | |-------|-------------| | session:connected | Wallet connected successfully | | session:disconnected | Wallet disconnected | | session:expired | Session has expired | | tx:status | Transaction status update | | registry:status | Registry status change | | error | Error occurred |


Error Handling

import {
  WalletNotFoundError,
  WalletNotInstalledError,
  UserRejectedError,
  SessionExpiredError,
  TimeoutError,
} from '@partylayer/sdk';

try {
  await client.connect({ walletId: 'console' });
} catch (error) {
  if (error instanceof WalletNotInstalledError) {
    console.log('Please install the wallet extension');
  } else if (error instanceof UserRejectedError) {
    console.log('User rejected the connection request');
  } else if (error instanceof TimeoutError) {
    console.log('Connection timed out');
  }
}

Using Bron (Enterprise Wallet)

Bron requires OAuth2 configuration:

import { createPartyLayer, BronAdapter, getBuiltinAdapters } from '@partylayer/sdk';

const client = createPartyLayer({
  network: 'devnet',
  app: { name: 'My dApp' },
  adapters: [
    ...getBuiltinAdapters(),
    new BronAdapter({
      auth: {
        clientId: 'your-client-id',
        redirectUri: 'https://your-app.com/auth/callback',
        authorizationUrl: 'https://auth.bron.example/authorize',
        tokenUrl: 'https://auth.bron.example/token',
      },
      api: {
        baseUrl: 'https://api.bron.example',
        getAccessToken: async () => getStoredAccessToken(),
      },
    }),
  ],
});

TypeScript

This package is written in TypeScript and includes type definitions. All types are exported:

import type {
  Session,
  WalletInfo,
  SignedMessage,
  SignedTransaction,
  TxReceipt,
  PartyLayerConfig,
  ConnectOptions,
} from '@partylayer/sdk';

Related Packages

| Package | Description | |---------|-------------| | @partylayer/react | React hooks and components | | @partylayer/core | Core types and abstractions |


Links


License

MIT