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
| Parameter | Type |
|---|---|
__namedParameters | LedgerSignerOptions |
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
| Parameter | Type |
|---|---|
bytes | Uint8Array |
intent | IntentScope |
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
| Parameter | Type |
|---|---|
bytes | Uint8Array |
Returns
Promise<SignatureWithBytes>
The signed transaction bytes and signature.
Overrides
Signer.signTransaction
signPersonalMessage()
signPersonalMessage(bytes): Promise<SignatureWithBytes>;
Signs the provided personal message.
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array |
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
| Parameter | Type |
|---|---|
derivationPath | string |
ledgerClient | IotaLedgerClient |
iotaClient | IotaClient |
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