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

@tonsprotocol/hdwallet

v0.0.1

Published

HD multistand wallet

Readme

Tonspack HD generator

This repo is the wallet generator base on BIP44 & HD-wallet of Tonspack wallet .

Allows user to generate keypair to different chain stander from a sigle EVM-privateKey .

Chains support

Currently Tonspack HD wallet sdk support follow chains

  • EVM

  • TON

  • SOLANA

Now working on chains support TODO :

  • TRON

  • BTC

  • SUI

  • APTOS

  • COSMOS

How to use this SDK ?

Tonsprotocol/HDwallet SDK support many actions including

  • Generate new wallet

  • Generate keypairs for different chains stander

  • Sign message in different stander

  • Sign and get the signed transaction (Limited chains)

Generate the keypair

You can create a wallet by new it .

import { HDWallet } from "@tonsprotocol/hdwallet";

new HDWallet()

Or you can add password

import { HDWallet } from "@tonsprotocol/hdwallet";

new HDWallet(
  {
    pwd:"helloworld", // Optional
    path:123, //Optional . default 1 
  }
)

Get the keypairs

You will got the Keypair for the support chains :

interface objKP {
  naclKp: {
    publicKey: Uint8Array;
    secretKey: Uint8Array;
  };
  evmKp: {
    address: string;
    privateKey: string;
  };
  solKp: {
    address: string;
    privateKey: string;
  };
  tonKp: any;
}

Recover from master keypair

You can recover your keypair with path/password via :

HDWallet.fromPrivateKey(
  {
        sk:"2Lte2V623NW7pafsAbpzGTQQ8y6Kbnzwop39RyybkPFessboN92d2pUfZi4Xi8KkFccqmC1zyRZ6wfRY2EKgqDu6",
        pwd:"1234",
        path:16
  }
)

or

HDWallet.fromPrivateKey(
  {
        sk:"2dnv6i5vLQFRFFQKpyVhxvijQHE7orgReQJVJ12PboKw",
  }
)

How it works ?

You can check the source code for details .

The core is base on BIP-44 (will add BIP-39 soon)

  private fromPk(sec:string,path:number,pwd?:string) {
    let rawKey : Buffer;
    if(pwd)
    {
      rawKey = Buffer.from(bs58.decode(
        decryptByDES(sec,pwd)
      ))
    }else{
      rawKey = Buffer.from(
        bs58.decode(sec)
      );
    }
    const master = hd.hdkey.fromMasterSeed(
      Buffer.from(
        bs58.decode(sec))
      )
      ;
    const derive = master.deriveChild(path);
    const evmWallet = derive.getWallet();
    const naclKp = nacl.sign.keyPair.fromSeed(
      Uint8Array.from(evmWallet.getPrivateKey())
    );


    return {
      naclKp: naclKp,
      evmKp: {
        address: evmWallet.getAddressString(),
        privateKey: evmWallet.getPrivateKeyString(),
      },
      solKp: {
        address: bs58.encode(naclKp.publicKey),
        privateKey: bs58.encode(naclKp.secretKey),
      },
      tonKp: ton.getTonWalletV4KeyPair(Buffer.from(naclKp.secretKey), 0),
    } as objKP;
  }