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

@newwallet/wallet-passkey

v0.8.4-alpha.6

Published

NewWallet SDK for web applications with blockchain and passkey integration

Readme

NewWallet Passkey SDK

A secure multi-chain hierarchical deterministic (HD) wallet library with passkey authentication for Ethereum, Solana, BSC, Base, Polygon, Arbitrum and other blockchain ecosystems.

Features

  • Multi-Network Support: Single wallet instance managing all blockchain networks
  • Passkey Authentication: Secure wallet access using WebAuthn passkeys
  • Account Sharing: EVM-compatible chains (Ethereum, BSC, Base, Polygon, Arbitrum) share the same accounts
  • HD Wallet Generation: Create multiple accounts from a single secure seed phrase
  • Transaction Signing: Sign transactions for any supported blockchain
  • Message Signing: Sign messages for both EVM and Solana chains
  • Account Management: Create, rename, and manage accounts across all networks

Installation

npm install @newwallet/wallet-passkey
yarn add @newwallet/wallet-passkey

Quick Start

import { WalletPass } from "@newwallet/wallet-passkey";

// Initialize wallet with multiple networks
async function createWallet() {
  const encryptionKey = new Uint8Array(32);
  crypto.getRandomValues(encryptionKey);
  const credentialID = "device-001";

  // Create wallet supporting multiple networks
  const networks = [
    "ETHEREUM_MAINNET",
    "BSC_MAINNET",
    "BASE_MAINNET",
    "SOLANA_MAINNET",
  ];

  const { wallet, deviceCrypto } = await WalletPass.createNewWallet(
    "[email protected]",
    networks,
    encryptionKey,
    credentialID,
  );

  // Add an account (creates for all networks)
  const accounts = await wallet.addAccount(
    "Main Account",
    credentialID,
    encryptionKey,
  );

  console.log("Created accounts:");
  accounts.forEach((account, coinType) => {
    console.log(`  CoinType ${coinType}: ${account.address}`);
  });

  return wallet;
}

Core Concepts

Network Architecture

The wallet supports multiple blockchain networks in a single instance. Networks are grouped by their coin type:

  • CoinType 60 (EVM): Ethereum, BSC, Base, and other EVM-compatible chains share accounts
  • CoinType 501 (Solana): Solana maintains separate accounts

Account Management

When you create an account, it's automatically available across all networks:

// Add account - creates for both EVM and Solana
const newAccounts = await wallet.addAccount(
  "Trading Account",
  credentialID,
  encryptionKey,
);

// Get accounts for specific network
const ethAccounts = wallet.getAccountsForNetwork("ETHEREUM_MAINNET");
const solAccounts = wallet.getAccountsForNetwork("SOLANA_MAINNET");

// EVM networks share accounts
const bscAccounts = wallet.getAccountsForNetwork("BSC_MAINNET");
console.log(ethAccounts === bscAccounts); // true (same accounts)

Working with Networks

Supported Networks

// Get all supported networks
const networks = wallet.getSupportedNetworks();
// ["ETHEREUM_MAINNET", "BSC_MAINNET", "BASE_MAINNET", "SOLANA_MAINNET"]

// Get network information
const ethInfo = wallet.getNetworkInfo("ETHEREUM_MAINNET");
console.log(ethInfo);
// {
//   networkName: "Ethereum",
//   chainId: 1,
//   coinType: 60,
//   symbol: "ETH",
//   rpcUrl: "https://ethereum-rpc.publicnode.com",
//   isTestnet: false
// }

Adding Networks

// Add testnet to existing wallet
await wallet.addNetwork("ETHEREUM_SEPOLIA", credentialID, encryptionKey);

// Testnet shares accounts with mainnet (same coinType)
const mainnetAccounts = wallet.getAccountsForNetwork("ETHEREUM_MAINNET");
const testnetAccounts = wallet.getAccountsForNetwork("ETHEREUM_SEPOLIA");
// Same addresses!

Transaction Signing

Ethereum/EVM Transaction

import { ethers } from "ethers";

const transaction = {
  to: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  value: ethers.parseEther("0.1"),
  gasLimit: 21000,
  gasPrice: ethers.parseUnits("20", "gwei"),
  nonce: 0,
  chainId: 1,
};

const signedTx = await wallet.signTransaction(
  "ETHEREUM_MAINNET",
  transaction,
  accountAddress,
  credentialID,
  encryptionKey,
);

Solana Transaction

import { Transaction, SystemProgram, PublicKey } from "@solana/web3.js";

const transaction = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: new PublicKey(solanaAccount.address),
    toPubkey: new PublicKey(recipientAddress),
    lamports: 100000000, // 0.1 SOL
  }),
);

transaction.recentBlockhash = "..."; // Get from network
transaction.feePayer = new PublicKey(solanaAccount.address);

const signedTx = await wallet.signTransaction(
  "SOLANA_MAINNET",
  transaction,
  solanaAccount.address,
  credentialID,
  encryptionKey,
);

Message Signing

const message = "Hello Blockchain!";

// Sign with Ethereum
const ethSignature = await wallet.callBlockchainMethod(
  "ETHEREUM_MAINNET",
  "signMessage",
  [message],
  ethAccount.address,
  credentialID,
  encryptionKey,
);

// Sign with Solana
const solSignature = await wallet.callBlockchainMethod(
  "SOLANA_MAINNET",
  "signMessage",
  [message],
  solAccount.address,
  credentialID,
  encryptionKey,
);

Export & Import

Export Wallet

// Export to JSON (without sensitive data)
const jsonData = wallet.exportToJSON();
fs.writeFileSync("wallet_backup.json", jsonData);

// Export mnemonic (requires authentication)
const mnemonic = await wallet.exportMnemonic(credentialID, encryptionKey);

Import Wallet

// Import from JSON
const jsonData = fs.readFileSync("wallet_backup.json", "utf-8");
const importedWallet = WalletPass.importFromJSON(jsonData);

// Add device after import
const deviceCrypto = {
  credentialID: "new-device",
  encryptedData: "...", // Encrypted mnemonic
};
importedWallet.updateDevices([deviceCrypto]);

Advanced Features

Multiple Devices

// Add new device to existing wallet
const newDevice = await wallet.addNewDevice(
  existingCredentialID,
  existingEncryptionKey,
  newCredentialID,
  newEncryptionKey,
);

Private Key Export

// Export private key for specific account
const privateKey = await wallet.exportPrivateKey(
  "ETHEREUM_MAINNET",
  accountAddress,
  credentialID,
  encryptionKey,
);

Account Operations

// Rename account
wallet.renameAccount("ETHEREUM_MAINNET", accountAddress, "New Name");

// Remove account (removes from all networks)
wallet.removeAccount(accountIndex);

// Get all accounts grouped by coinType
const allAccounts = wallet.getAllAccounts();

Complete Example

import { WalletPass } from "@newwallet/wallet-passkey";

async function walletExample() {
  // Setup
  const encryptionKey = new Uint8Array(32);
  crypto.getRandomValues(encryptionKey);
  const credentialID = "device-001";

  // 1. Create multi-network wallet
  const { wallet } = await WalletPass.createNewWallet(
    "[email protected]",
    ["ETHEREUM_MAINNET", "BSC_MAINNET", "SOLANA_MAINNET"],
    encryptionKey,
    credentialID,
  );

  // 2. Add accounts
  await wallet.addAccount("Main", credentialID, encryptionKey);
  await wallet.addAccount("Trading", credentialID, encryptionKey);

  // 3. Get accounts
  const ethAccounts = wallet.getAccountsForNetwork("ETHEREUM_MAINNET");
  const solAccounts = wallet.getAccountsForNetwork("SOLANA_MAINNET");

  console.log(`Ethereum accounts: ${ethAccounts.length}`);
  console.log(`Solana accounts: ${solAccounts.length}`);

  // 4. Sign transaction
  const tx = { to: "0x...", value: "1000000000000000000" };
  const signed = await wallet.signTransaction(
    "ETHEREUM_MAINNET",
    tx,
    ethAccounts[0].address,
    credentialID,
    encryptionKey,
  );

  // 5. Save wallet
  wallet.saveToFile("my_wallet.json");

  return wallet;
}

Network Support

| Network | CoinType | Mainnet | Testnet | | ------------------- | -------- | ------------------- | ------------------- | | Ethereum | 60 | ✅ ETHEREUM_MAINNET | ✅ ETHEREUM_SEPOLIA | | Binance Smart Chain | 60 | ✅ BSC_MAINNET | ✅ BSC_TESTNET | | Base | 60 | ✅ BASE_MAINNET | ✅ BASE_SEPOLIA | | Solana | 501 | ✅ SOLANA_MAINNET | ✅ SOLANA_TESTNET | | Polygon | 60 | ✅ POLYGON_MAINNET | ✅ POLYGON_AMOY | | Arbitrum | 60 | ✅ ARBITRUM_ONE | ✅ ARBITRUM_SEPOLIA |

Security

  • Encryption: All sensitive data is encrypted using AES-GCM
  • Passkey: WebAuthn integration for secure authentication
  • HD Wallet: BIP39/BIP44 standard for key derivation
  • No Plain Text: Private keys and mnemonics are never stored in plain text

License

ISC