Skip to main content

Interface: LedgerLike

A connection to the IOTA app on a Ledger device.

Every call completes once the device answers, which for address verification includes waiting for the user to confirm on the device. Calls on the same Ledger, including through the LedgerSigners created from it, run one at a time.

Methods​

exitApp()​

exitApp(asyncOpts_?): Promise<void>;

Close the app running on the device and return to the dashboard.

On Speculos, this ends the emulated app.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<void>


getPublicKey()​

getPublicKey(path, asyncOpts_?): Promise<Ed25519PublicKeyLike>;

Read the public key at a derivation path such as m/44'/4218'/0'/0'/0'.

Parameters​

path​

string

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<Ed25519PublicKeyLike>


isAppOpen()​

isAppOpen(asyncOpts_?): Promise<boolean>;

Check whether the IOTA app is the app running on the device.

Speculos reports a placeholder app name unless started with SPECULOS_APPNAME=IOTA:<version>, so this returns false there.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<boolean>


openApp()​

openApp(asyncOpts_?): Promise<void>;

Open the IOTA app, from the dashboard or by closing another app first.

Does nothing if the IOTA app is already running, or on a speculos connection.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<void>


signer()​

signer(path, asyncOpts_?): Promise<LedgerSignerLike>;

Create a signer for the key at a derivation path such as m/44'/4218'/0'/0'/0', reading its public key from the device.

The signer shares this Ledger's connection, which stays usable.

Parameters​

path​

string

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<LedgerSignerLike>


verifyAddress()​

verifyAddress(path, asyncOpts_?): Promise<Ed25519PublicKeyLike>;

Show the address at a derivation path on the device for the user to confirm, and return its public key.

Parameters​

path​

string

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<Ed25519PublicKeyLike>


version()​

version(asyncOpts_?): Promise<LedgerAppVersion>;

Read the version of the IOTA app.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<LedgerAppVersion>