Socket
Socket
Sign inDemoInstall

@xchainjs/xchain-bitcoincash

Package Overview
Dependencies
100
Maintainers
10
Versions
58
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @xchainjs/xchain-bitcoincash

Custom bitcoincash client and utilities used by XChainJS clients


Version published
Maintainers
10
Created

Readme

Source

@xchainjs/xchain-bitcoincash

Modules

  • client - Custom client for communicating with Bitcoin Cash by using @psf/bitcoincashjs-lib

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:

FunctionServiceNotes
BalancesHaskoinhttps://api.haskoin.com/#/Address/getBalance
Transaction historyHaskoinhttps://api.haskoin.com/#/Address/getAddressTxsFull
Transaction details by hashHaskoinhttps://api.haskoin.com/#/Transaction/getTransaction
Transaction feesBitgohttps://app.bitgo.com/docs/#operation/v2.tx.getfeeestimate
Transaction broadcastBitcoin Cash Nodehttps://developer.bitcoin.org/reference/rpc/sendrawtransaction.html
ExplorerBlockchain.comhttps://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 Nine Realms endpoints

If you plan on using the publically accessible endpoints provided by Nine Realms(listed below), ensure that you add a valid 'x-client-id' to all requests

Example

import cosmosclient from '@cosmos-client/core'
import axios from 'axios'
import { register9Rheader } from '@xchainjs/xchain-util'

register9Rheader(axios)
register9Rheader(cosmosclient.config.globalAxios)

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

FAQs

Last updated on 29 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc