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 🙏

© 2025 – Pkg Stats / Ryan Hefner

console-wallet-dapp-templ

v0.0.20

Published

> A lightweight SDK for connecting your Web3 applications to the **Console Wallet Extension** — enabling account access, connection status, message signing, and sending **Canton Coin** with ease.

Readme

🧩 Console DApp SDK

A lightweight SDK for connecting your Web3 applications to the Console Wallet Extension — enabling account access, connection status, message signing, and sending Canton Coin with ease.


🚀 Overview

Console DApp SDK is a developer-friendly library that allows any decentralized application (DApp) to seamlessly integrate with the Console Wallet browser extension.

It provides simple APIs to:

  • 🔗 Connect your DApp to a user’s Console Wallet
  • 👤 Access the active account and connection state
  • ✍️ Request message signing to the wallet
  • 💰 Send Canton Coin transactions securely and reliably

With just a few lines of code, you can authenticate users, sign data, or trigger Canton blockchain transactions — all through a unified SDK built for simplicity and safety.


⚙️ Key Features

| Feature | Description | | -------------------------- | -------------------------------------------------------------- | | 🔌 Easy Integration | One SDK import connects your app to Console Wallet instantly | | 👛 Account Access | Retrieve connected account address and chain info | | 🧾 Message Signing | Sign arbitrary messages or typed data directly from the wallet | | 💸 Transaction Support | Send Canton Coin with a simple API call | | 🔒 Secure by Design | Uses wallet’s native permissions and confirmation flows | | 🧠 Framework Agnostic | Works with React, Vue, or vanilla JS apps |


🧠 Why Use Console DApp SDK?

Instead of manually handling RPC connections or building custom wallet logic, console-wallet-dapp-templ provides a clean, unified interface for interacting with the Canton ecosystem.

It’s ideal for:

  • Light start with Canton blockchain
  • Web3 DApps that need wallet connection and signing
  • Any app that interacts with Canton

🧠 Core Functionality

The Console DApp SDK provides a communication layer between your Web3 application and the Console Wallet Extension using the browser’s native window.postMessage API.

It handles all low-level messaging logic automatically, so you can focus on building your DApp — not managing communication details.

🔄 How It Works

  1. When your DApp sends a request (e.g., connect(), signMessage(), or sendTransaction()),
    the SDK transmits a structured message to the Console Wallet Extension via window.postMessage.

  2. Each outgoing request is assigned a unique request ID, which is included in both the request and the extension’s response.

  3. The SDK listens for incoming responses from the extension, matches them to their original request using the ID,
    and automatically resolves the corresponding Promise in your application.

This approach ensures reliable, asynchronous communication between the DApp and the extension — preventing race conditions, mismatched responses, or orphaned message handlers.

🧩 Benefits

  • ✅ Fully type-safe and asynchronous API
  • 🧭 No manual message listeners required
  • 🛡️ Prevents response mismatch errors with per-request unique IDs
  • ⚡ Lightweight and dependency-free
  • 🧠 Extensible for future Console Wallet capabilities (multi-chain support, session management, etc.)

In short: the SDK abstracts all the complex message passing between your DApp and the wallet, providing a stable and predictable communication layer out of the box.

📡 Supported Requests

The SDK exposes several high-level request methods that communicate with the Console Wallet Extension through secure message passing.
Each request is automatically tagged with a unique request ID to ensure reliable response matching.

| Method | Description | Request Payload | Response | | ---------------------- | -------------------------------------------------------------- | --------------------------------- | ----------------------- | | getAccounts() | Retrieves the currently connected wallet account(s). | — | GetAccountsResponse | | signMessage(message) | Requests the user to sign a message in hex or base 64 format. | { message: SignMessageRequest } | SignedMessageResponse | | signSend(data) | Signs and broadcasts a transaction to send Canton Coin. | SignSendRequest | SignSendResponse | | connect(data) | Prompts the users to connect their Console Wallet to the DApp. | ConnectRequest | boolean | | getIsConnected() | Checks if the DApp is already connected to the wallet. | — | boolean |


🪄 Example

const handleSignSend = async () => {
  if (!amount || !receiver || !expireDate) {
    alert('Please fill all fields');
    return;
  }

  try {
    const activeAccount = await consoleWalletPixelplex.getAccounts();
    const signResult = await consoleWalletPixelplex.signSend({
      to: receiver,
      from: activeAccount?.[0].party || '',
      amount,
      expireDate,
    });

    setResult(signResult.status ? 'Transaction signed successfully' : 'Transaction error');
  } catch (error) {
    console.error('Error signing transaction:', error);
    setResult('Error signing transaction');
  }
};

📦 Installation

npm install console-wallet-dapp-templ
# or
yarn add console-wallet-dapp-templ

Before your DApp can interact with the Console Wallet Extension, it needs to initialize a connection session.
This step establishes secure communication between your web application and the user’s wallet.

🔌 Connecting Your DApp

The SDK provides a simple connect() method that requests permission from the user’s Console Wallet.

import { consoleWalletPixelplex } from 'console-wallet-dapp-templ';

const handleConnect = async () => {
  try {
    await consoleWalletPixelplex.connect({ name, icon });
  } catch (error) {
    console.error('Error checking connection:', error);
  }
};

const handleCheckConnection = async () => {
  try {
    const isConnected = await consoleWalletPixelplex.getIsConnected();
    setConnectionStatus(isConnected ? 'Connected' : 'Not connected');
  } catch (error) {
    console.error('Error checking connection:', error);
  }
};