LedgerInterface
type 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 `LedgerSigner`s created from it, run one at a time.
type LedgerInterface interface {
// Close the app running on the device and return to the dashboard.
//
// On Speculos, this ends the emulated app.
ExitApp() error
// Read the public key at a derivation path such as
// `m/44'/4218'/0'/0'/0'`.
GetPublicKey(path string) (*Ed25519PublicKey, error)
// 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.
IsAppOpen() (bool, error)
// 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.
OpenApp() error
// 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.
Signer(path string) (*LedgerSigner, error)
// Show the address at a derivation path on the device for the user to
// confirm, and return its public key.
VerifyAddress(path string) (*Ed25519PublicKey, error)
// Read the version of the IOTA app.
Version() (LedgerAppVersion, error)
}