Package Exports
- bitcoinjs-api
- bitcoinjs-api/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bitcoinjs-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
BitcoinJS (bitcoinjs-api)
A library to simplify the NPM package bitcoinjs-lib.
Released under the terms of the MIT LICENSE.
Installation
npm install bitcoinjs-api
npm install ecpair bip32 tiny-secp256k1
Documentation
- Generate Legacy key pair
const bitcoinjsapi = require('bitcoinjs-api');
const keypair = new bitcoinjsapi.Bitcoin().generateKeypairLegacy();
console.log(keypair.privateKey);
console.log(keypair.address);
- Generate Segwit key pair
const bitcoinjsapi = require('bitcoinjs-api');
const keypair = new bitcoinjsapi.Bitcoin().generateKeypairSegwit();
console.log(keypair.privateKey);
console.log(keypair.address);
- Generate Testnet key pair
const bitcoinjsapi = require('bitcoinjs-api');
const keypair = new bitcoinjsapi.Bitcoin().generateKeypairTestnet();
console.log(keypair.privateKey);
console.log(keypair.address);
- Generate Legacy address from WIF
const bitcoinjsapi = require('bitcoinjs-api');
const address = new bitcoinjsapi.Bitcoin().generateLegacyAddress(WIF);
console.log(address);
- Generate Segwit address from WIF
const bitcoinjsapi = require('bitcoinjs-api');
const address = new bitcoinjsapi.Bitcoin().generateSegwitAddress(WIF);
console.log(address);
- Generate P2SH, Pay-To-Multisig (2 of 3), address from Pubkeys
const bitcoinjsapi = require('bitcoinjs-api');
const address = new bitcoinjsapi.Bitcoin().generateP2SHAddress2of3(PUBKEY1, PUBKEY2, PUBKEY3);
console.log(address);