Skip to main content

Ledger

open class Ledger : Disposable, AutoCloseable, LedgerInterface

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.

Functions​

NameSummary
close@Synchronized
open override fun close()
destroyopen override fun destroy()
exitAppopen suspend override fun exitApp()
Close the app running on the device and return to the dashboard.
getPublicKeyopen suspend override fun getPublicKey(path: String): Ed25519PublicKey
Read the public key at a derivation path such as m/44'/4218'/0'/0'/0'.
isAppOpenopen suspend override fun isAppOpen(): Boolean
Check whether the IOTA app is the app running on the device.
openAppopen suspend override fun openApp()
Open the IOTA app, from the dashboard or by closing another app first.
signeropen suspend override fun signer(path: String): LedgerSigner
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.
verifyAddressopen suspend override fun verifyAddress(path: String): Ed25519PublicKey
Show the address at a derivation path on the device for the user to confirm, and return its public key.
versionopen suspend override fun version(): LedgerAppVersion
Read the version of the IOTA app.

Companion object functions​

NameSummary
fromTransportfun fromTransport(transport: LedgerTransport): Ledger
Communicate with the device through a transport implemented in the host language.
nativeHidfun nativeHid(): Ledger
Connect to the first Ledger device attached over USB.
speculosfun speculos(host: String, port: UShort): Ledger
Connect to the APDU port of a Speculos emulator (by default this is 127.0.0.1:9999 in the emulator).