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

@binance/w3w-multichain-connector

v1.0.19

Published

A multichain connector for Binance Wallet

Downloads

329

Readme

@binance/w3w-multichain-connector

The @binance/w3w-multichain-connector package provides a wrapper for the Binance Wallet extension multichain connector.

Installation

pnpm add @binance/w3w-multichain-connector
# or
npm install @binance/w3w-multichain-connector

Usage

Importing

import { getMultichainWallet } from '@binance/w3w-multichain-connector'

Get Wallet Instance

const wallet = getMultichainWallet()
if (!wallet) {
  console.log('Binance Wallet extension not installed')
}

Check Extension Installed

import { checkExtensionInstalled } from '@binance/w3w-multichain-connector'

const isInstalled = checkExtensionInstalled()

Check Extension Feature Support

import { checkExtensionSupported, Features } from '@binance/w3w-multichain-connector'

const isSupported = checkExtensionSupported(Features.requestConnect)

Connect Wallet

const connectedWallets = await wallet.requestConnect(['56', 'CT_501'])

Connect with SAS

// Single wallet SAS
const { wallet: connectedWallet, aggreeEnableSAS } = await wallet.requestConnectWithSAS({
  binanceChainIds: ['56'],
  userId: 'user-id',
  enabledWalletInfo: [
    { walletType: 'SEED_PHRASE', chain: 'evm', userPublicKeyHex: '0x...' }
  ]
})

// Multi wallet SAS
const { walletList, enabledWalletIds } = await wallet.requestConnectWithMultiWalletSAS({
  binanceChainIds: ['56'],
  userId: 'user-id'
})

Check Connected Wallets

const wallets = await wallet.checkConnectedWallet()
// The user's active wallet will be the first element in the array

Get Wallet Info

const walletInfo = await wallet.getWalletInfo('0x...address', '56')

Switch Chain

await wallet.switchChain('56')

Disconnect

// Disconnect all wallets
await wallet.disconnect()

// Disconnect specific accounts
await wallet.disconnectWallets(['account-id-1', 'account-id-2'])

Sign Order

const signature = await wallet.signOrder({
  walletId: 'wallet-id',
  walletAddress: '0x...',
  binanceChainId: '56',
  txData: '...',
  feeAmount: '0.001',
  feeAmountLevel: 'Medium', // 'Low' | 'Medium' | 'High' | 'Custom'
  digest: '...',
  digestSign: '...'
})

Auto Sign

await wallet.requestAutoSign()
console.log('Auto sign enabled:', wallet.autoSignEnabled)

SAS Operations

// Enable SAS
const { aggreeEnableSAS } = await wallet.requestEnableSAS({
  walletId: 'wallet-id',
  userId: 'user-id',
  userEmail: '[email protected]'
})

// Enable multi-wallet SAS
const { enabledWalletIds } = await wallet.requestEnableMultiWalletSAS({
  walletIds: ['wallet-1', 'wallet-2'],
  userId: 'user-id',
  userEmail: '[email protected]'
})

// Get SAS Keyshare
const keyshares = await wallet.getSASKeyshare({
  walletIds: ['wallet-id'],
  userId: 'user-id',
  spsVersion: '1.0',
  isSilent: false // if true, won't prompt unlock when wallet is locked
})

// Sync SAS Status
await wallet.syncSASStatus({
  userId: 'user-id',
  statusList: [
    { walletId: 'wallet-id', enabled: true }
  ]
})

// Get ProofKey Signature (before placing order)
const { timeStamp, proofKeyPublicKey, timestampSignature } = await wallet.getSASProofKeySignature({
  walletId: 'wallet-id',
  userId: 'user-id'
})

// Get Connected Wallets with ProofKey
const walletsWithProofKey = await wallet.getConnectedWalletAndProofKey({
  userId: 'user-id'
})

Handle Events

const wallet = getMultichainWallet()

// Wallet lock status changed
wallet.on('walletLockedChanged', (isLocked) => {
  console.log('Wallet locked:', isLocked)
})

// Auto sign status changed
wallet.on('autoSignEnabledChanged', (isEnabled) => {
  console.log('Auto sign enabled:', isEnabled)
})

// Connected wallets changed
wallet.on('connectedWalletsChanged', (connectedWallets) => {
  console.log('Connected wallets:', connectedWallets)
})

// Connected chain changed
wallet.on('connectedChainIdChanged', (binanceChainId) => {
  console.log('Chain changed:', binanceChainId)
})

Properties

| Property | Type | Description | |---|---|---| | version | string | Current extension version | | autoSignEnabled | boolean | Whether auto sign is enabled | | walletLocked | boolean | Whether the wallet is locked | | extensionId | string | Extension unique identifier |

Types

IConnectedWallet

| Field | Type | Description | |---|---|---| | walletIcon | string | Wallet icon (base64) | | walletName | string | Wallet name | | walletId | string | Wallet unique identifier | | walletType | WalletType | Wallet type (privateKey / seedPhrase) | | addressList | Array<{ address, binanceChainId, publicKeyHex }> | Wallet address list | | groupID? | string | Wallet group ID | | groupName? | string | Wallet group name |

WalletType

| Value | Description | |---|---| | privateKey | Private key wallet | | seedPhrase (hd) | Seed phrase (mnemonic) wallet |

Features

| Value | Description | |---|---| | Connect | | | requestConnect | Connect wallet | | requestConnectWithSAS | Connect wallet with single-wallet SAS | | requestConnectWithMultiWalletSAS | Connect wallet with multi-wallet SAS | | checkConnectedWallet | Check connected wallets | | getWalletInfo | Get wallet info by address and chain | | disconnect | Disconnect all wallets | | disconnectWallets | Disconnect specific wallets | | switchChain | Switch chain | | SAS | | | requestEnableSAS | Request enable SAS (single wallet) | | requestEnableMultiWalletSAS | Request enable SAS (multi wallet) | | getSASKeyshare | Get SAS keyshare | | syncSASStatus | Sync SAS status | | getConnectedWalletAndProofKey | Get connected wallets with ProofKey | | getSASProofKeySignature | Get ProofKey signature before placing order | | Signing | | | requestAutoSign | Request auto sign | | signOrder | Sign transaction order | | Events | | | eventWalletLockedChanged | Wallet lock status changed event | | eventAutoSignEnabledChanged | Auto sign status changed event | | eventConnectedWalletsChanged | Connected wallets changed event | | eventConnectedChainIdChanged | Connected chain changed event |