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 🙏

© 2024 – Pkg Stats / Ryan Hefner

qip-wallet

v1.2.4

Published

qip-wallet-lib provides set of tools for working with Bitcoin transactions and keys. It is written in javascript and works in node.js enviroment

Downloads

923

Readme

qip-wallet-lib

Documentation for the QIP Wallet Library qip-wallet-lib provides set of tools for working with Bitcoin transactions and keys. It is written in javascript and works in node.js enviroment

Features

  • Create HD wallet
  • Create transaction
  • Sign transaction and PSBT
  • Create inscriptions with special sat

Installation

npm install qip-wallet-lib

Usage

/**
 * Wallet
 */
const {wallet} = require('qip-wallet-lib');

// Create a new wallet
const passPhrase = wallet.createPassPhrase();
console.log("passPhrase: ",passPhrase);

// Create a new address
const accountKeys = wallet.accountKeys({passPhrase: passPhrase, networkName: 'testnet', path:0});
console.log("accountKeys: ",accountKeys);

// Create a new address
const address = wallet.getAllAddress({privateKey: accountKeys.privateKey, networkName: 'testnet'});

// Create a new transaction
const tx = wallet.createTransaction2({
    input:[{txid:"133c3dcf862b1ed6a01efaa70da27acbf9449bc766ef268edaac4a711be3eb36", vout:1, value:8332}], 
    output:[{address:"tb1q4myftf8sc0rzpwnmluaq06ygykprq9ld0fz60c", value:550}],
    publicKey: "e6c357476d31cfd13b8e75d5b29b94cbff062d489a7965baaabf0bddd68db2c0",
    addressType:"taproot",
    networkName:"testnet",
    feeRate: 10,
        change: "tb1pump4w3mdx88azwuwwh2m9xu5e0lsvt2gnfuktw42hu9am45dktqq3rfjtj",
    });

console.log("tx: ",tx);

// Sign transaction
const signedTx = wallet.signTransaction({
    psbt: {psbtBase64: "cHNidP8BAH0CAAAAATbr4xtxSqzajibvZsebRPnLeqINp/oeoNYeK4bPPTwTAQAAAAD/////AiYCAAAAAAAAFgAUrsiVpPDDxiC6e/86B+iIJYIwF+1KHQAAAAAAACJRIObDV0dtMc/RO4511bKblMv/Bi1Imnlluqq/C93WjbLAAAAAAAABASuMIAAAAAAAACJRIObDV0dtMc/RO4511bKblMv/Bi1Imnlluqq/C93WjbLAARcg5sNXR20xz9E7jnXVspuUy/8GLUiaeWW6qr8L3daNssAAAAA="}, privateKey:accountKeys.privateKey, 
    networkName: 'testnet'
    });

console.log("signedTx: ",signedTx);

/**
 * Inscription
 */

const {inscription} = require('qip-wallet-lib');

// Create a new inscription

//These are optional parameters used to create inscription
const options = {   
    metadata: {creator: "arch.xyz", collection: "test collection", platform: "inscribable.xyz"},
    satTx: {
        txid: "9225058961e6e73273d9b58748dbcd5f832a3f0cebbb88daf424e0c15314ab56",
        vout: 0,
        value: 1000
    }
}

//get inscription keyPair
const inscriptionKeyPair = inscription.getKeyPair({networkName: 'testnet'});
console.log("inscriptionKeyPair: ",inscriptionKeyPair);

//get inscription initlization data
//this returns all the data required to create inscription including the funding address
const initData = getInitData({networkName: "testnet", privateKey: inscriptionKeyPair.privateKey});
console.log("initData: ",initData);


//get all inscription
//this returns an array of inscriptions and the total cost of inscriptions
let filePaths = [`${process.cwd()}/test.png`]
let feeRate = 21
let padding = 550

const inscriptionData = inscription.getInscriptions({
    filePaths: filePaths, 
    publicKey: inscriptionKeyPair.publicKey, 
    networkName: "testnet", 
    feerate: feeRate, 
    padding: padding, 
    options: options 
    });

console.log("inscriptionData: ",inscriptionData);

/**
 now you fund the address from initData.fundingAddress with the value of inscriptionData.total_fees
 NB: If satTx is provided in options, the sat utxo has to be in the funding address as well
*/

//split funded utxo to different inscription addresses
//It returns a signed transaction to be broadcasted in hexadecimal(HEX) format, as well as the transaction id(txid)
const splitFunds = inscription.splitFunds({
    filePaths: filePaths, 
    privateKey: inscriptionKeyPair.privateKey, 
    networkName: "testnet", 
    feerate: feeRate, 
    padding: padding, 
    options: options
    })

console.log("splitFunds: ",splitFunds);

//create inscription(s)
//It returns an array of signed inscription transaction to be broadcasted in hexadecimal(HEX) format, 
//their transaction ids as well as the inscriptiond id.
const createInscription = inscription.createInscription({
    filePaths:filePaths, 
    privateKey:privateKey, 
    receiveAddress:"tb1pxlsh06u5ej72gjvmcl9ktuq4jw8ja2pzx5jqgypyxzfw0c32j0ysppm29h", 
    networkName:"testnet", 
    feerate:feeRate, 
    padding:padding, 
    options:options
    })

console.log("createInscription: ",createInscription);