How to use
Installation
yarn add @xchainjs/xchain-bitcoinPeer Dependencies
Testing
yarn install
yarn testExamples
Connect Wallet to New Client and Access Class Methods
//Imports
import { Client } from "@xchainjs/xchain-bitcoin"
// Connect wallet to new btc client
const connectWallet = async () => {
let phrase = "phrase"
const btcClient = new Client({ phrase})
let address = btcClient.getAddress()
console.log(`Asset Address is: ${address}`)
let balances = await btcClient.getBalance(address)
try {
let assetAmount = (baseToAsset(balances[0].amount)).amount()
console.log(`Asset address balance: ${assetAmount}`)
} catch (error) {
console.log('Address has no balance')
}
}Transfer BTC Using btcClient
Transfer & Set feeRate
Get Fees & FeeRates Estimations
Get Transaction Data
Get Transaction History
Last updated