npm.io
2.3.0 • Published yesterday

@xchainjs/xchain-bitcoincash

Licence
MIT
Version
2.3.0
Deps
11
Size
121 kB
Vulns
0
Weekly
0
Stars
133

@xchainjs/xchain-bitcoincash

Modules

Installation

yarn add @xchainjs/xchain-bitcoincash

Following peer dependencies have to be installed into your project. These are not included in @xchainjs/xchain-bitcoincash.

yarn add @xchainjs/xchain-client @xchainjs/xchain-crypto @xchainjs/xchain-util axios @psf/bitcoincashjs-lib bchaddrjs

Documentation

xchain bitcoincash

How xchain-bitcoincash works
How to use xchain-bitcoincash

Service Providers

This package uses the following service providers:

Function Service Notes
Balances Haskoin https://api.haskoin.com/#/Address/getBalance
Transaction history Haskoin https://api.haskoin.com/#/Address/getAddressTxsFull
Transaction details by hash Haskoin https://api.haskoin.com/#/Transaction/getTransaction
Transaction fees Bitgo https://app.bitgo.com/docs/#operation/v2.tx.getfeeestimate
Transaction broadcast Bitcoin Cash Node https://developer.bitcoin.org/reference/rpc/sendrawtransaction.html
Explorer Blockchain.com https://www.blockchain.com/explorer?view=bch

Haskoin API rate limits: No

Bitgo API rate limits: https://app.bitgo.com/docs/#section/Rate-Limiting (10 requests/second)

Setting Headers for public endpoints

If you plan on using the publicly accessible endpoints listed below, ensure that you add a valid 'x-client-id' to all requests

For a complete example please see this test

UtxoOnlineDataProviders

default providers

Creating a no-arg BCH Client will default to the following settings:

defaultBCHParams: UtxoClientParams = {
  network: Network.Mainnet,
  phrase: '',
  explorerProviders: explorerProviders,
  dataProviders: [HaskoinDataProviders],
  rootDerivationPaths: {
    [Network.Mainnet]: `m/44'/145'/0'/0/`,
    [Network.Testnet]: `m/44'/1'/0'/0/`,
    [Network.Stagenet]: `m/44'/145'/0'/0/`,
  },
  feeBounds: {
    lower: LOWER_FEE_BOUND,
    upper: UPPER_FEE_BOUND,
  },
}

Note: Haskoin is the default online data provider (to fetch realtime utxos, balances, etc)

Keywords