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

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

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

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

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

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);
import TransportU2F from "@ledgerhq/hw-transport-u2f";
const transport = await TransportU2F.create();
const ledgerSigner = new LedgerSigner(transport, "44'/1729'/0'/0'", true, DerivationType.SECP256K1);
import TransportU2F from "@ledgerhq/hw-transport-u2f";
const transport = await TransportU2F.create();
const ledgerSigner = new LedgerSigner(transport, "44'/1729'/6'/0'", true, DerivationType.BIP32_ED25519);

Implements

  • Signer

Constructors

Methods

  • Parameters

    • bytes: string
    • Optionalwatermark: Uint8Array

    Returns Promise<{
        bytes: string;
        prefixSig: string;
        sbytes: string;
        sig: string;
    }>