1.0.4 • Published 3 years ago
btcd-client v1.0.4
Bitcoin Core Json RPC Client
Typescript btcd client. Connect to your bitcoin core node.
How to use
1 Install package
npm install btcd-client- Import package
 
import { BitcoinCoreClient } from 'btcd-client'- Initalize
 
const credentials = {
  url: process.env.BITCOIN_RPC_URL!,
  username: process.env.BITCOIN_RPC_USERNAME!,
  password: process.env.BITCOIN_RPC_PASSWORD!,
}
const btcdClient = new BitcoinCoreClient(credentials)- Use the client
 
const blockchainInfo = await btcdClient.getBlockchainInfo()Wallet Specific
const walletInfo = await btcdClient.getWalletInfo(walletName)With params
const transaction = await btcdClient.getTransaction(
        walletName!,
        [txReq.txid],
      )