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

@d9-network/dapp-connector

v0.1.0

Published

Production SDK for connecting D9 Wallet from dapps via PAPI extension and WalletConnect.

Downloads

27

Readme

@d9-network/dapp-connector

Production SDK for connecting D9 Wallet from web dapps.

Supports:

  • PAPI extension (window.injectedWeb3["d9-wallet"]) inside the D9 Wallet in-app browser
  • WalletConnect v2 (d9net namespace) for external browsers / mobile deep links

Install

npm install @d9-network/dapp-connector
# or
pnpm add @d9-network/dapp-connector

Quick start

import {
  createD9DAppConnector,
  D9_DEFAULT_CHAIN_ID,
  D9_DEFAULT_WALLET_CONNECT_PROJECT_ID,
  D9_DEFAULT_WALLET_CONNECT_RELAY_URL,
  buildD9WalletConnectAppLink,
} from "@d9-network/dapp-connector";

const connector = createD9DAppConnector({
  dappName: "My DApp",
  chainId: D9_DEFAULT_CHAIN_ID, // d9net:<genesis-ref>
  walletConnect: {
    projectId: D9_DEFAULT_WALLET_CONNECT_PROJECT_ID,
    relayUrl: D9_DEFAULT_WALLET_CONNECT_RELAY_URL,
    metadata: {
      name: "My DApp",
      description: "Example",
      url: window.location.origin,
      icons: [`${window.location.origin}/icon.png`],
    },
  },
});

// Prefer injected PAPI when available; otherwise WalletConnect.
const start = await connector.connect({ transport: "auto" });

if (start.transport === "papi") {
  // Connected immediately after user approval in the wallet.
  console.log(connector.getAccounts());
} else {
  // Show QR / open deep link with start.uri
  if (start.uri) {
    // Mobile deep link into D9 Wallet
    // window.location.href = buildD9WalletConnectAppLink(start.uri)
  }
  await start.approval();
}

const account = connector.getAccounts()[0];
if (!account) throw new Error("No account");

const signed = await connector.signMessage({
  address: account.address,
  message: "Hello from My DApp",
});
console.log(signed.signature);

Explicit transports

// PAPI only (D9 Wallet browser)
await connector.papi.connect();

// WalletConnect only
const wc = await connector.walletConnect.connect({
  requiredMethods: ["d9_signMessage"],
});
// show wc.uri, then:
const handle = await wc.approval();
await handle.requestMessage({
  account: connector.getAccounts()[0]!.accountId!,
  message: "0x0102",
});

Snapshot / subscribe

const stop = connector.subscribe((snapshot) => {
  console.log(snapshot.status, snapshot.transport, snapshot.accounts);
});

// later
stop();
await connector.disconnect();

Protocol notes

| Surface | Value | | --- | --- | | Injected provider name | d9-wallet | | WalletConnect namespace | d9net | | Chain ID | d9net:<first 32 hex of genesis hash> | | Message method | d9_signMessage | | Transaction method | d9_signTransaction | | Auth method | d9_authenticate | | Account names (WC) | sessionProperties["d9.accountNames"] JSON map | | Display addresses | Dn... prefix (signer still uses chain address under the hood) |

Build / publish

pnpm --filter @d9-network/dapp-connector typecheck
pnpm --filter @d9-network/dapp-connector test:run
pnpm --filter @d9-network/dapp-connector build

# dry-run
pnpm --filter @d9-network/dapp-connector exec npm pack --dry-run

# publish (npm login first)
pnpm --filter @d9-network/dapp-connector publish --access public

prepublishOnly runs typecheck + tests + tsdown build.

Example app

See apps/example-dapp in this monorepo for a Vite + React demo of both transports.