Pushing Ledger JavaScript libraries to the next level

02/09/2018 | Blog posts, Developer

At Ledger, we are continuously improving our JavaScript stack. Recently, we have refactored the “ledgerco” mono-library by splitting it into many javascript libraries to improve scalability of our projects, each published on NPM under @ledgerhq scope. We are developing libraries for more and more platforms including Web, Node.js and React Native. For instance, we have many “transport” implementations (way to communicate with the device): node-hid, web U2F, react-native Bluetooth, and more will come in the future (such as working with web usb and web bluetooth).

The repository https://github.com/LedgerHQ/ledgerjs hosts all our libraries, with a common workflow (github workflow (PR with reviews), Travis tests, Lerna for managing the release). We are using latest technologies like Babel (ES6, async/await,…) and Flow.

This week, we have released create-dapp, a starter kit to write DApps, web apps backed by Ethereum smart contracts. The bootstrapped project have out of the box support of Ledger devices as well as Metamask. It generates an onboarding screen where you can select your wallet mode and your wallet address (like in MEW). It also includes an example contract that holds a value and allow users to change it on the blockchain.

This is just the beginning, we will have many other exciting things to cover in 2018! For instance, we will continue improving our documentation and our tests (for instance, as soon as we have a Ledger simulator, we will be able to run all our tests headless-ly!)