Skip to main content

Class: LedgerSigner

Ledger integrates with the Iota blockchain to provide signing capabilities using Ledger devices.

Extends

  • Signer

Constructors

Constructor

new LedgerSigner(__namedParameters): LedgerSigner;

Creates an instance of LedgerSigner. It's expected to call the static fromDerivationPath method to create an instance.

Parameters

ParameterType
__namedParametersLedgerSignerOptions

Returns

LedgerSigner

Example

const signer = await LedgerSigner.fromDerivationPath(derivationPath, options);

Overrides

Signer.constructor

Methods

signingDigest()

static signingDigest(bytes, intent): Uint8Array;

Sign messages with a specific intent. By combining the message bytes with the intent before hashing. Returns the digest.

Parameters

ParameterType
bytesUint8Array
intentIntentScope

Returns

Uint8Array

Inherited from

Signer.signingDigest

toIotaAddress()

toIotaAddress(): string;

Returns

string

Inherited from

Signer.toIotaAddress

getKeyScheme()

getKeyScheme(): "ED25519";

Retrieves the key scheme used by this signer.

Returns

"ED25519"

Overrides

Signer.getKeyScheme

getPublicKey()

getPublicKey(): Ed25519PublicKey;

Retrieves the public key associated with this signer.

Returns

Ed25519PublicKey

The Ed25519PublicKey instance.

Overrides

Signer.getPublicKey

signTransaction()

signTransaction(bytes): Promise<SignatureWithBytes>;

Signs the provided transaction bytes.

Parameters

ParameterType
bytesUint8Array

Returns

Promise<SignatureWithBytes>

The signed transaction bytes and signature.

Overrides

Signer.signTransaction

signPersonalMessage()

signPersonalMessage(bytes): Promise<SignatureWithBytes>;

Signs the provided personal message.

Parameters

ParameterType
bytesUint8Array

Returns

Promise<SignatureWithBytes>

The signed message bytes and signature.

Overrides

Signer.signPersonalMessage

fromDerivationPath()

static fromDerivationPath(
derivationPath,
ledgerClient,
iotaClient): Promise<LedgerSigner>;

Prepares the signer by fetching and setting the public key from a Ledger device. It is recommended to initialize an LedgerSigner instance using this function.

Parameters

ParameterType
derivationPathstring
ledgerClientIotaLedgerClient
iotaClientIotaClient

Returns

Promise<LedgerSigner>

A promise that resolves once a LedgerSigner instance is prepared (public key is set).


sign()

sign(): never;

Generic signing is not supported by Ledger.

Returns

never

Throws

Always throws an error indicating generic signing is unsupported.

Overrides

Signer.sign

signWithIntent()

signWithIntent(): never;

Generic signing is not supported by Ledger.

Returns

never

Throws

Always throws an error indicating generic signing is unsupported.

Overrides

Signer.signWithIntent