0.1.3 • Published 5 years ago
wallbox-sdk v0.1.3
wallbox-sdk
Wallet SDK for Bitcoin Cash
A tool for creating and managing a BCH wallet
This library is in early stages of development. It will have bugs, it will be unstable. Use at your own risk.
Example
Wallet
let SLPSDK = require('slp-sdk');
var SLP = new SLPSDK({
restURL: "https://trest.bitcoin.com/v2/"
});
let wallbox = require("wallbox-sdk")(SLP, "testnet");
(async () => {
try{
let hdNode = await wallbox.Seed.getNode()
let Wallet = new wallbox.Wallet(hdNode);
let address = await Wallet.getfreshAddress()
let options = {message: "Hello BCH Blockchain!", feePerByte: 1}
await Wallet.send(address, 100000, options)
let balance = await Wallet.getWalletBalance()
console.log("Balance = " + balance + " BCH")
}catch(error){
console.error(error);
}
})()