@xchainjs/xchain-bsc
v2.0.27
Published
Binance Smart Chain EVM client for XChainJS
Readme
@xchainjs/xchain-bsc
Modules
client- Custom client for communicating with binance smart chain by usingethers
Installation
yarn add @xchainjs/xchain-bscFollowing peer dependencies have to be installed into your project. These are not included in @xchainjs/xchain-bsc.
yarn add @xchainjs/xchain-evm @xchainjs/xchain-client @xchainjs/xchain-crypto @xchainjs/xchain-util axios ethersDocumentation
xchain bsc
How xchain-bsc worksHow to use xchain-bsc
Service Providers
This package uses the following service providers:
| Function | Service | Notes |
| ------------------------- | --------- | --------------------------------------------------------------------------- |
| BNB balances | Public RPC, or Ankr | https://bsc-dataseed.binance.org, or https://rpc.ankr.com/bsc when ANKR_API_KEY is set |
| Token balances | Etherscan | https://docs.etherscan.io/api-reference/endpoint/tokenbalance (chainid 56) |
| BNB transaction history | Etherscan | https://docs.etherscan.io/api-reference/endpoint/txlist (chainid 56) |
| Token transaction history | Etherscan | https://docs.etherscan.io/api-reference/endpoint/tokentx (chainid 56) |
| Explorer | BscScan | https://bscscan.com/ |
History and token balances use Etherscan API v2 (https://api.etherscan.io/v2). Etherscan API rate limits: https://docs.etherscan.io/resources/rate-limits
- This package uses
etherjslibrary, by default it uses several providers. (https://docs.ethers.io/v5/api-keys/)
Environment variables
ETHERSCAN_API_KEY={YOUR_ETHERSCAN_API_KEY}
ANKR_API_KEY={YOUR_ANKR_API_KEY}Default config can access.
process.env.ETHERSCAN_API_KEY
process.env.ANKR_API_KEY