Javascript SDK to communicate with BNB Beacon Chain.
Javascript SDK to communicate with BNB Beacon Chain.
The BNB Beacon Chain JavaScript SDK allows browsers and Node.js clients to interact with BNB Beacon Chain. It includes the following core components.
You can find more detailed documentation and examples in our Documentation pages.
If you do not need Ledger support with Node.js:
$ npm i @bnb-chain/javascript-sdk --no-optional
# Or:
$ yarn add @bnb-chain/javascript-sdk --no-optionalIf you need Ledger support with Node.js:
$ npm i @bnb-chain/javascript-sdk
# Or:
$ yarn add @bnb-chain/javascript-sdkWindows users: Please install windows-build-tools first.
Mac users: Make sure XCode Command Line Tools are installed:
xcode-select --install.
Linux users: Note that Ubuntu Xenial and newer distributions are recommended, especially when using Travis or other CI systems. You may need some dev packages to be installed on your system for USB support. On Debian-based distributions (like Ubuntu) you should install them with this command:
$ sudo apt-get install libudev-dev libusb-dev usbutilsWe often see Webpack builds failing with the SDK due to the usb dependency,
but adding this to your Webpack config should fix that:
module.exports = {
plugins: [new webpack.IgnorePlugin(/^usb$/)],
}All new code changes should be covered with unit tests. You can run the tests with the following command:
$ yarn testTests for the Ledger hardware wallet integration have their own suite that runs in both node and in the browser:
$ yarn test:ledger
$ yarn test:ledger:browserContributions to the BNB Beacon Chain JavaScript SDK are welcome. Please ensure that you have tested the changes with a local client and have added unit test coverage for your code.
No open issues yet, or sync has not completed.