Skip to main content

LedgerSigner

@iota/signers


@iota/signers / ledger / LedgerSigner

Class: LedgerSigner

Defined in: signers/src/ledger/index.ts:32

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

Extends​

  • Signer

Constructors​

Constructor​

new LedgerSigner(__namedParameters): LedgerSigner

Defined in: signers/src/ledger/index.ts:45

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

Parameters​

__namedParameters​

LedgerSignerOptions

Returns​

LedgerSigner

Example​

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

Overrides​

Signer.constructor

Methods​

getKeyScheme()​

getKeyScheme(): "ED25519"

Defined in: signers/src/ledger/index.ts:56

Retrieves the key scheme used by this signer.

Returns​

"ED25519"

Overrides​

Signer.getKeyScheme


getPublicKey()​

getPublicKey(): Ed25519PublicKey

Defined in: signers/src/ledger/index.ts:64

Retrieves the public key associated with this signer.

Returns​

Ed25519PublicKey

The Ed25519PublicKey instance.

Overrides​

Signer.getPublicKey


sign()​

sign(): never

Defined in: signers/src/ledger/index.ts:149

Generic signing is not supported by Ledger.

Returns​

never

Throws​

Always throws an error indicating generic signing is unsupported.

Overrides​

Signer.sign


signPersonalMessage()​

signPersonalMessage(bytes): Promise<SignatureWithBytes>

Defined in: signers/src/ledger/index.ts:102

Signs the provided personal message.

Parameters​

bytes​

Uint8Array

Returns​

Promise<SignatureWithBytes>

The signed message bytes and signature.

Overrides​

Signer.signPersonalMessage


signTransaction()​

signTransaction(bytes): Promise<SignatureWithBytes>

Defined in: signers/src/ledger/index.ts:72

Signs the provided transaction bytes.

Parameters​

bytes​

Uint8Array

Returns​

Promise<SignatureWithBytes>

The signed transaction bytes and signature.

Overrides​

Signer.signTransaction


signWithIntent()​

signWithIntent(): never

Defined in: signers/src/ledger/index.ts:157

Generic signing is not supported by Ledger.

Returns​

never

Throws​

Always throws an error indicating generic signing is unsupported.

Overrides​

Signer.signWithIntent


toIotaAddress()​

toIotaAddress(): string

Defined in: typescript/dist/cjs/cryptography/keypair.d.ts:41

Returns​

string

Inherited from​

Signer.toIotaAddress


fromDerivationPath()​

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

Defined in: signers/src/ledger/index.ts:127

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​

derivationPath​

string

ledgerClient​

Iota

iotaClient​

IotaClient

Returns​

Promise<LedgerSigner>

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


signingDigest()​

static signingDigest(bytes, intent): Uint8Array

Defined in: typescript/dist/cjs/cryptography/keypair.d.ts:24

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

Parameters​

bytes​

Uint8Array

intent​

IntentScope

Returns​

Uint8Array

Inherited from​

Signer.signingDigest