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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@choppu/shelljs

v1.0.1

Published

Keycard Shell Communication Layer

Readme

ShellJS

Keycard Shell Library based on @ledgerhq/hw-app-eth and @ledgerhq/hw-transport.


Who should use ShellJS?

ShellJS permits you to communicate with Keycard Shell through websites and through nodejs-based native applications.


API

Table of Contents

Commands

Ethereum API

Parameters

  • transport Transport

Examples

import ShellJS from "Shelljs";
const cmd = new ShellJS.Commands(transport);

getPublicKey

get public key for a given BIP 32 path.

Parameters
Examples
const resp = await cmd.getPublicKey("44'/60'/0'/0/0");
console.log(resp.address);

Returns Promise<{publicKey: string, address: string, chainCode: string?}> an object with a publicKey, address and (optionally) chainCode

signEthTransaction

sign a transaction and retrieve v, r, s given the raw transaction and the BIP 32 path of the account to sign.

Parameters
  • path string : the BIP32 path to sign the transaction on
  • rawTxHex string : the raw ethereum transaction in hexadecimal to sign
Examples
const tx = "e8018504e3b292008252089428ee52a8f3d6e5d15f8b131996950d7f296c7952872bd72a2487400080"; // raw tx to sign
const resp = cmd.signEthTransaction("44'/60'/0'/0/0", tx);
console.log(resp);

Returns Promise<{s: string, v: string, r: string}>

getAppConfiguration

get firmware and database version installed on device, Keycard Shell serial number and public key.

Examples
const {fwVersion, dbVersion, serialNumber, publicKey} = await cmd.getAppConfiguration();
console.log(fwVersion);
console.log(dbVersion);
console.log(serialNumber);
console.log(publicKey);

Returns Promise<{fwVersion: string, dbVersion: number, serialNumber: string, publicKey: string}>

signPSBT

sign a PSBT and return signed PSBT.

Parameters
  • psbt ArrayBuffer : partially signed bitcoin transaction
Examples
const resp = await cmd.signPSBT(psbt);
console.log(resp);

Returns Promise<ArrayBuffer>

signEthPersonalMessage

sign an Eth personal message and retrieve v, r, s given the message and the BIP 32 path of the account to sign.

Parameters
  • path string
  • pMessage string
  • enc string? : buffer encoding, optional parameter, default: "utf-8"
Examples
const resp = await cmd.signEthPersonalMessage("44'/60'/0'/0/0", "Hello world!");
let v = resp['v'] - 27;
v = v.toString(16);
if (v.length < 2) {
  v = "0" + v;
}
console.log("Signature 0x" + resp['r'] + resp['s'] + v);

Returns Promise<{v: number, s: string, r: string}>

signEIP712Message

sign an EIP-712 formatted message

Parameters
  • path String derivationPath
  • jsonMessage Object message to sign
Examples
const resp = await cmd.signEIP712Message("44'/60'/0'/0/0", {
domain: {
chainId: 69,
name: "Da Domain",
verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
version: "1"
},
types: {
"EIP712Domain": [
{ name: "name", type: "string" },
{ name: "version", type: "string" },
{ name: "chainId", type: "uint256" },
{ name: "verifyingContract", type: "address" }
],
"Test": [
{ name: "contents", type: "string" }
]
},
primaryType: "Test",
message: {contents: "Hello, Bob!"},
});

Returns Promise<{v: number, s: string, r: string}>

loadFirmware

load Keycard Shell firmware

Parameters
Examples
const fs = require('fs'),
let f = fs.readFileSync('./firmware.bin');
let fw = new Uint8Array(f);
await cmd.loadFirmware(fw);

Returns Promise<number>

loadDatabase

load Keycard Shell database

Parameters
Examples
const fs = require('fs'),
let f = fs.readFileSync('./db.bin');
let db = new Uint8Array(f);
await cmd.loadDatabase(db);

Returns Promise<number>

Live Demo

You can check a demo at Shell Web HID Example Page.