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
| Name | Summary |
|---|---|
| close | @Synchronized open override fun close() |
| destroy | open override fun destroy() |
| exitApp | open suspend override fun exitApp() Close the app running on the device and return to the dashboard. |
| getPublicKey | open suspend override fun getPublicKey(path: String): Ed25519PublicKey Read the public key at a derivation path such as m/44'/4218'/0'/0'/0'. |
| isAppOpen | open suspend override fun isAppOpen(): Boolean Check whether the IOTA app is the app running on the device. |
| openApp | open suspend override fun openApp() Open the IOTA app, from the dashboard or by closing another app first. |
| signer | open 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. |
| verifyAddress | open 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. |
| version | open suspend override fun version(): LedgerAppVersion Read the version of the IOTA app. |
Companion object functions
| Name | Summary |
|---|---|
| fromTransport | fun fromTransport(transport: LedgerTransport): Ledger Communicate with the device through a transport implemented in the host language. |
| nativeHid | fun nativeHid(): Ledger Connect to the first Ledger device attached over USB. |
| speculos | fun 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). |