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

@fxwallet/kaspa-lib

v1.0.7

Published

Kaspa SDK used by FxWallet: key derivation, address generation/validation, transaction signing, txId calculation, and message signing.

Downloads

28

Readme

fx-kaspa-lib

Kaspa SDK used by FxWallet to interact with the Kaspa blockchain. It provides key derivation, address generation, address validation, transaction signing, txId calculation, and message signing.

Installation

npm install fx-kaspa-lib

Usage

Derive privateKey

import { KaspaWallet } from "fx-kaspa-lib";

const wallet = new KaspaWallet();
const privateKey = await wallet.getDerivedPrivateKey({
    mnemonic: "reopen vivid parent want raw main filter rotate earth true fossil dream",
    hdPath: "m/44'/111111'/0'/0/0",
});

New address

import { KaspaWallet } from "fx-kaspa-lib";

const wallet = new KaspaWallet();
const address = await wallet.getNewAddress({
    privateKey: "d636a23d4f49fe4e0d59fcf7a6c2ab3846ff2d3a54007b3817a11dff770d06ff",
});

Validate address

import { KaspaWallet } from "fx-kaspa-lib";

const wallet = new KaspaWallet();
const result = await wallet.validAddress({
    address: "kaspa:qrcnkrtrjptghtrntvyqkqafj06f9tamn0pnqvelmt2vmz68yp4gqj5lnal2h",
});

Transfer

import { KaspaWallet } from "fx-kaspa-lib";

const wallet = new KaspaWallet();
const tx = await wallet.signTransaction({
    data: {
        inputs: [
            {
                txId: "ec62c785badb0ee693435841d35bd05da9c8a40aa2d568dddb0dd47410e7e78a",
                vOut: 1,
                address: "kaspa:qqpet37fwqlql7q4jczr7zj7qp5ylps2r2c0ynz6jjf368sdjnztufeghvc9x",
                amount: 597700,
            },
        ],
        outputs: [
            {
                address: "kaspa:qqpet37fwqlql7q4jczr7zj7qp5ylps2r2c0ynz6jjf368sdjnztufeghvc9x",
                amount: 587700,
            },
        ],
        address: "kaspa:qqpet37fwqlql7q4jczr7zj7qp5ylps2r2c0ynz6jjf368sdjnztufeghvc9x",
        fee: 10000,
    },
    privateKey: "d636a23d4f49fe4e0d59fcf7a6c2ab3846ff2d3a54007b3817a11dff770d06ff",
});

Calculate txId

import { KaspaWallet } from "fx-kaspa-lib";

const wallet = new KaspaWallet();
const txId = await wallet.calcTxHash({
    data: {
        transaction: {
            version: 0,
            inputs: [
                {
                    previousOutpoint: {
                        transactionId: "ec62c785badb0ee693435841d35bd05da9c8a40aa2d568dddb0dd47410e7e78a",
                        index: 1,
                    },
                    signatureScript: "411687d956de8e3cc53b9dbf20ede3922b422595abbad31ecf38ff90c0cf8ef7c3b5ae71628e041a3a0f1b9ad6e14bb6d49dd7c35f06c46316b67c10d477c29ac001",
                    sequence: 0,
                    sigOpCount: 1,
                },
            ],
            outputs: [
                {
                    scriptPublicKey: {
                        version: 0,
                        scriptPublicKey: "200395c7c9703e0ff81596043f0a5e00684f860a1ab0f24c5a94931d1e0d94c4beac",
                    },
                    amount: 587700,
                },
            ],
            lockTime: 0,
            subnetworkId: "0000000000000000000000000000000000000000",
        },
        allowOrphan: false,
    },
});

Sign message

import { KaspaWallet } from "fx-kaspa-lib";

const wallet = new KaspaWallet();
const signature = await wallet.signMessage({
    data: {
        message: "Hello Kaspa!",
    },
    privateKey: "d636a23d4f49fe4e0d59fcf7a6c2ab3846ff2d3a54007b3817a11dff770d06ff",
});

Build

npm install
npm run build

Test

npm test

License

MIT