npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zondax/ledger-substrate

v0.44.5

Published

TS / Node API for Substrate/Polkadot based apps running on Ledger devices

Downloads

10,032

Readme

ledger-substrate (JS Integration)

zondax

Main License npm version

This package provides a basic client library to communicate with Substrate Apps running in a Ledger Nano S/S+/X devices Additionally, it provides a hd_key_derivation function to retrieve the keys that Ledger apps generate with BIP32-ED25519. Warning: the hd_key_derivation function is not audited and depends on external packages. We recommend using the official Substrate Ledger apps in recovery mode.

Available commands

| Operation | Response | Command | | ---------- | ---------------- | ----------------------- | | getVersion | app version | --------------- | | getAddress | pubkey + address | path + ( showInDevice ) | | sign | signed message | path + message |

getAddress command requires that you set the derivation path (account, change, index) and has an option parameter to display the address on the device. By default, it will retrieve the information without confirmation from the user.

Add new chain

If you want to add support for your chain, you just need to create a PR in this repository adding the parameters that belong to the chain. Go to supported APPs and add a new entry at the end of the file.

{
  name: 'ChainName',
  cla: 0xFF,
  slip0044: 0x80000162,
  ss58_addr_type: 7391,
},

Take the last used CLA and pick the following number. This is just an ID for the app that is used in APDU protocol. This is probably the easiest way to get a free CLA.

For Slip0044 parameter, you might want to register here as well.

SS58 prefix have no limitation whatsoever, you just have to set an uint16 number that is used in your chain.

Testing with real devices

It is possible to test this package with a real Ledger Nano device. To accomplish that, you will need to follow these steps:

  • Install the application in the Ledger device
  • Install the dependencies from this project
  • Run tests
yarn install
yarn test

Example:

Visit and download the latest release from repository (in this case Kusama).

Download the installer script for your device but bear in mind that NanoX does not allow side loading applications. Give execution permission and run the script.

chmod +x installer_nano_device.sh
./installer_nano_device.sh load

Modify these values from testing script before running the tests:

const CHAIN = 'Kusama'
const YOUR_PUBKEY = 'd280b24dface41f31006e5a2783971fc5a66c862dd7d08f97603d2902b75e47a'
const YOUR_ADDRESS = 'HLKocKgeGjpXkGJU6VACtTYJK4ApTCfcGRw51E5jWntcsXv'
const YOUR_BLOB = '0400ffbc10f71d63e0da1b9e7ee2eb4037466551dc32b9d4641aafd73a65970fae4202286beed502000022040000b0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe280b332587f46c556aa806781884284f50d90b8c1b02488a059700673c93f41c'

Run tests and you will see how this module communicates with your device.

Who we are?

We are Zondax, a company pioneering blockchain services. If you want to know more about us, please visit us at zondax.ch