Options
All
  • Public
  • Public/Protected
  • All
Menu
description

Implementation of the Signer interface that will allow signing operation from a Ledger Nano device

param

A transport instance from LedgerJS libraries depending on the platform used (e.g. Web, Node)

param

The ledger derivation path (default is "44'/1729'/0'/0'")

param

Whether to prompt the ledger for public key (default is true)

param

The value which defines the curve to use (DerivationType.ED25519(default), DerivationType.SECP256K1, DerivationType.P256)

example
import TransportNodeHid from "@ledgerhq/hw-transport-node-hid";
const transport = await TransportNodeHid.create();
const ledgerSigner = new LedgerSigner(transport, "44'/1729'/0'/0'", false, DerivationType.ED25519);
example
import TransportU2F from "@ledgerhq/hw-transport-u2f";
const transport = await TransportU2F.create();
const ledgerSigner = new LedgerSigner(transport, "44'/1729'/0'/0'", true, DerivationType.SECP256K1);

Hierarchy

  • LedgerSigner

Implements

Index

Constructors

constructor

  • new LedgerSigner(transport: Pick<default, "send" | "decorateAppAPIMethods" | "setScrambleKey">, path?: string, prompt?: boolean, derivationType?: DerivationType): LedgerSigner

Methods

publicKey

  • publicKey(): Promise<string>

publicKeyHash

  • publicKeyHash(): Promise<string>

secretKey

  • secretKey(): Promise<string>

sign

  • sign(bytes: string, watermark?: Uint8Array): Promise<{ bytes: string; prefixSig: string; sbytes: string; sig: string }>

Generated using TypeDoc