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

@hauska-sdk/wallet

v0.1.0

Published

CNS Protocol Wallet SDK - Secure wallet management and signing

Downloads

170

Readme

@hauska-sdk/wallet

Secure wallet management and signing for the CNS Protocol SDK.

Features

  • Automatic Wallet Creation - Generate new Ethereum wallets
  • Secure Encryption - AES-256-GCM encryption with PBKDF2 key derivation
  • Import/Export - Encrypted wallet backup and restore
  • Message Signing - EIP-191 and EIP-712 signature support
  • Seed Phrase Support - Create wallets from mnemonic phrases
  • Password Protection - All wallets encrypted with user passwords

Installation

npm install @hauska-sdk/wallet

Quick Start

import { WalletManager } from '@hauska-sdk/wallet';

const manager = new WalletManager();

// Create a new wallet
const wallet = await manager.createWallet({
  password: 'user-password-123',
  userId: 'user-123',
});

console.log('Wallet address:', wallet.address);

// Sign a message
const signature = await manager.signMessage(
  wallet.address,
  'Hello, World!',
  'user-password-123'
);

// Export wallet for backup
const exported = await manager.exportWallet(
  wallet.address,
  'user-password-123'
);

// Import wallet later
const imported = await manager.importWallet({
  encryptedJson: exported,
  password: 'user-password-123',
});

API Reference

WalletManager

createWallet(options)

Create a new wallet.

const wallet = await manager.createWallet({
  password: 'user-password',
  userId: 'user-123', // optional
});

getOrCreateWallet(userId, password)

Get existing wallet or create new one for user.

const wallet = await manager.getOrCreateWallet('user-123', 'password');

exportWallet(address, password)

Export wallet as encrypted JSON.

const exported = await manager.exportWallet(wallet.address, 'password');

importWallet(options)

Import wallet from encrypted JSON.

const wallet = await manager.importWallet({
  encryptedJson: exportedJson,
  password: 'password',
  userId: 'user-123', // optional
});

signMessage(address, message, password)

Sign a message (EIP-191).

const signature = await manager.signMessage(
  wallet.address,
  'Hello, World!',
  'password'
);

signTypedData(address, domain, types, value, password)

Sign typed data (EIP-712).

const signature = await manager.signTypedData(
  wallet.address,
  {
    name: 'MyApp',
    version: '1',
    chainId: 8453, // Base
  },
  {
    Message: [{ name: 'content', type: 'string' }],
  },
  { content: 'Hello' },
  'password'
);

createWalletFromSeedPhrase(mnemonic, password, userId?, accountIndex?)

Create wallet from BIP39 mnemonic.

const wallet = await manager.createWalletFromSeedPhrase(
  'abandon abandon abandon...',
  'password',
  'user-123',
  0 // account index
);

verifyPassword(address, password)

Verify wallet password without decrypting.

const isValid = await manager.verifyPassword(wallet.address, 'password');

Security

Encryption

  • Algorithm: AES-256-GCM
  • Key Derivation: PBKDF2 with 100,000+ iterations
  • Salt: Unique 32-byte salt per wallet
  • IV: Unique 16-byte IV per encryption

Best Practices

  1. Never store plaintext private keys
  2. Use strong passwords (minimum 12 characters)
  3. Store encrypted wallets securely
  4. Backup wallets using export functionality
  5. Verify passwords before operations

Storage

The WalletManager currently stores wallets in memory. In production, you should:

  1. Store encrypted wallets in a database
  2. Use secure key management
  3. Implement proper access controls
  4. Add audit logging

Testing

npm test

License

MIT