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

@volt.id/sdk

v1.6.4

Published

volt javascript sdk

Readme

@volt.id/sdk

Volt wallet sdk for browser. currently only support Bitcoin SV.

Install

npm i -S @volt.id/sdk

Usage

Init

import { Bsv } from "@volt.id/sdk";
const bsv = new Bsv();

Connect to volt

Connect

Connect to volt wallet, if user has connected before and session is not expired, volt sdk will reconnect automatically on page loaded, otherwise, volt sdk will popup a qrcode to user to scan to connect.

await bsv.connectAccount({ network: "mainnet" }); // network: 'mainnet' | 'testnet'

note: don't call connectAccount on page load event, call connectAccount when use click your connect button and listen the accountChanged Event.


// bad
window.onload = function() {
  await bsv.connectAccount({ network: "mainnet" });
}



// good
bsv.on('accountChanged', (depositAddress) => {
  if (depositAddress) {
    console.log('connected', depositAddress)
    // your can transfer now
  } else {
    console.log('not connected')
  }
})

yourConnectButton.onclick = async function() {
  await bsv.connectAccount({network: 'mainnet'})
}

// change a account should disconnect before connecting
yourChangeAccountButton.onclick = async function() {
  await bsv.disconnectAccount()
  await bsv.connectAccount({network: 'mainnet'})
}

Disconnect

await bsv.disconnectAccount();

Get connection info

Get current network

const network = await bsv.getNetwork();

Get current deposit address

const depositAddress = await bsv.getDepositAddress();

Get current wallet bsv balance

const bsvBalance = await bsv.getBsvBalance(); // returns the current wallet balance can transfer (unit: sat)   e.g., {free: 300222}

Get current wallet sensible fungible token balance (list)

const sensibleFtBalance = await bsv.getSensibleFtBalance();

/**

return :

[
  {
    codehash: "777e4dd291059c9f7a0fd563f7204576dcceb791",
    free: "4167139",
    genesis: "c52b5ee305834e3ceb97ee931ed5e453543ba2d8",
    tokenDecimal: 8,
    tokenName: "bsv/TSC lp token",
  }
]

 * /

Transfer

Transfer bsv

note: where transfer bsv, list.length should be 1 and receivers.length should be 1.

const transferRes = await bsv.batchTransfer({
  noBroadcast: false, //  if set true, will not broadcast to bsv network, you need to broadcast it manually
  list: [
    {
      type: "bsv",
      data: {
        receivers: [{ address: depositeAddress, amount: "8000" }],
      },
    },
  ],
});

Transfer sensible fungible token

note: where transfer sensible fungible token, list.length should be 1 and receivers.length should be 1.

const transferRes = await bsv.batchTransfer({
  noBroadcast: true,
  list: [
    {
      type: "sensibleFt",
      data: {
        codehash: "514776383faa66e4a65808904d4d6724e4774fbe",
        genesis: "c57dd8e75cd6a3d11c4628328c9fa5f2d9d452b2",
        receivers: [{ address: depositeAddress, amount: "303" }],
      },
    },
  ],
});

Transfer bsv and sensible fungible token

note: where transfer sensible fungible token, list.length should be 2 and receivers.length should be 1.

const transferRes = await bsv.batchTransfer({
  noBroadcast: true,
  list: [
    {
      type: "bsv",
      data: {
        receivers: [{ address: depositeAddress, amount: "8000" }],
      },
    },
    {
      type: "sensibleFt",
      data: {
        codehash: "514776383faa66e4a65808904d4d6724e4774fbe",
        genesis: "c57dd8e75cd6a3d11c4628328c9fa5f2d9d452b2",
        receivers: [{ address: depositeAddress, amount: "303" }],
      },
    },
  ],
});

Sign

signTx

Get signature and publicKey, currently do not support sensibleFt utxo, p2pkh utxo.

const res = await await bsv.signTx({
  txHex: "xxx", // rawtx
  scriptHex: "xxx", // input locking script hex
  satoshis: "10000", // input satoshis
  inputIndex: 0, // input index
  address: "", // user address, usally deposit address
  sigHashType: 65, // optinal, default
});

/**

return:

{
  publicKey: 'xxx',
  sig: 'xxx'
}

 */

Event

accountChanged

Emitted after connected/disconnected/account changed


bsv.on('accountChanged', funciton(depositAddress) {
  // depositAddress is a bsv address (string) or null
})

networkChanged

Emitted when network changed

bsv.on('networkChanged', function(network) {})

close

Emitted after disconnected


bsv.on('close', function() {})