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

@engrave/ledger-app-hive

v3.5.6

Published

Ledger Hardware Wallet HIVE JavaScript/TypeScript bindings

Downloads

111

Readme

@engrave/ledger-app-hive

Ledger Hardware Wallet HIVE JavaScript/TypeScript bindings.

Example usage

import Hive from '@engrave/ledger-app-hive';
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';

const transport = await TransportNodeHid.create();
const hive = new Hive(transport);

const version = await hive.getAppVersion();
console.log("Current version:", version);

const name = await hive.getAppName();
console.log("App name:", name);

const publicKey = await hive.getPublicKey(`48'/13'/0'/0'/0'`);
console.log("Public key:", publicKey);

const signature = await hive.signMessage('This is a message to sign', `48'/13'/0'/0'/0'`);
console.log("Signature:", signature);

For more examples, visit examples directory.

API

getAppVersion

Get current version for HIVE App installed on a Ledger.

async getAppVersion(): Promise<string>

getAppName

Get name for HIVE App installed on a Ledger.

async getAppName(): Promise<string>

getPublicKey

Retrieve public key from specified BIP32 path. You can set additional parameter confirm: boolean which will ask the user to confirm the Public Key on his Ledger before returning it.

async getPublicKey(path: string, confirm?: boolean): Promise<string>

getSettings

Read settings from Ledger. This can be used to determine if the user has enabled the "blind signing" option in the HIVE App.

async getSettings(): Promise<Settings>

signTransaction

Sign basic transaction with specified key path. This method will return signed transaction (transaction with additional signatures property). Please note that extensions are not yet supported for most transactions and operations (except beneficiaries for comment_options and end_date for update_proposal). Transaction cannot contain more than one operation, otherwise ledger will refuse the transaction.

async signTransaction(tx: Transaction, path: string, chainId?: string): Promise<SignedTransaction>

You can also provide optional chainId which may be useful for tests on Hive testnet. If not provided, Ledger will use production chainId.

signHash

Sign transaction digest with specified key path. This method will return a single signature. Please note that this method requires blind signing mode enabled in settings, otherwise ledger will refuse it.

async signHash(digest: string, path: string): Promise<string>

Transaction need to he serialized with proper chainId up front. This can be done with static method called getTransactionDigest

signMessage

Sign message with specified key path. This method will return a single signature. May be used to prove ownership of a private key.

async signMessage(message: string, path: string): Promise<string>

Please note there is a limit of 512 characters for the message.