UNPKG

@iota/ledgerjs-hw-app-iota

Version:

Ledger Hardware Wallet IOTA Application API

48 lines (47 loc) 1.46 kB
import type Transport from '@ledgerhq/hw-transport'; export type GetPublicKeyResult = { publicKey: Uint8Array; address: Uint8Array; }; export type SignTransactionResult = { signature: Uint8Array; }; export type GetVersionResult = { major: number; minor: number; patch: number; }; /** * Iota API * * @example * import Iota from "@iota/ledgerjs-hw-app-iota"; * const iota = new Iota(transport) */ export default class Iota { #private; transport: Transport; constructor(transport: Transport, scrambleKey?: string, verbose?: boolean); /** * Retrieves the public key associated with a particular BIP32 path from the Ledger app. * * @param path - the path to retrieve. * @param displayOnDevice - whether or not the address should be displayed on the device. * */ getPublicKey(path: string, displayOnDevice?: boolean): Promise<GetPublicKeyResult>; /** * Sign a transaction with the key at a BIP32 path. * * @param txn - The transaction bytes to sign. * @param path - The path to use when signing the transaction. * @param options - Additional options used for clear signing purposes. */ signTransaction(path: string, txn: Uint8Array, options?: { bcsObjects: Uint8Array[]; }): Promise<SignTransactionResult>; /** * Retrieve the app version on the attached Ledger device. */ getVersion(): Promise<GetVersionResult>; }