Skip to content

dexlab-io/dex-btc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dex-btc

Bitcoin wallet helpers for React Native

Install

Prepare your React Native app following those steps

API

API documentation can be found here

Quickstart

Create a BitcoinWallet instance

const Wallet  = require("dex-btc")
const wallet  = new Wallet("testnet")

//OPTIONAL: default blockcypher API
wallet.setProvider("blockcypher")

Get the balance

// Get balance of address
wallet.getBalance("2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF").then(console.log)

Unlock the privatekey

//set the privatekey for signing
wallet.privateKeyToAccount("<privateKey>")

//Now the default account has been set
console.log(wallet.defaultAccount)

Send a transaction to a

address

//Send the actual transaction to an address with the amount of satoshi comprhensive of actual value + fee
wallet.sendTransaction(addressTo, 20000).then(console.log).catch(console.log)

Development

Requirements

  • Node/npm >= 8

Install

Install Dependencies

npm install

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published