/// import Transport from '@ledgerhq/hw-transport'; import { LedgerNetworkType, LedgerTransaction } from './sdk'; export interface AppVersion { majorVersion: number; minorVersion: number; patchVersion: number; } /** * The symbol ledger clients that knows who to talk to the symbol app installed in the ledger device. * * This facade simplifies provides an simplifies the basic methods. */ export declare class SymbolLedger { /** * The transport to be used when talking to ledger. */ private readonly transport; constructor(transport: Transport, scrambleKey: string); /** * Return true if the installed app version is above the supported Symbol app version * @return promise of boolean */ isAppSupported(): Promise; /** * Returns the minimum expected ledger version. * @return the expected version object */ getExpectedAppVersion(): AppVersion; /** * Compares the current app version to a expected version. Returns if the app version is greater equals te expected one * @param appVersion the app version * @param expectedVersion the expected version. */ isVersionSupported(appVersion: AppVersion, expectedVersion: AppVersion): boolean; /** * Get Symbol app version on Ledger device * @return an object contain major, minor, patch version of the Symbol app on Ledger device */ getAppVersion(): Promise; /** * get Symbol's address for a given BIP 44 path from the Ledger * * @param path a path in BIP 44 format * @param display optionally enable or not the display * @param networkType the symbol network type number * @param chainCode optionally enable or not the chainCode request * @param isOptinLedgerWallet if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519 * @return the public key of the account. */ getAccount(path: string, networkType: LedgerNetworkType, display: boolean, chainCode: boolean, isOptinLedgerWallet: boolean): Promise; /** * sign a Symbol transaction by account on Ledger at given BIP 44 path * * @param path a path in BIP 44 format * @param transaction a transaction needs to be signed * @param networkGenerationHash the network generation hash of block 1 * @param signerPublicKey the public key of signer * @param isOptinLedgerWallet if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519 * @return a signed Transaction which is signed by account at path on Ledger */ signTransaction(path: string, transaction: LedgerTransaction, networkGenerationHash: string, signerPublicKey: string, isOptinLedgerWallet: boolean): Promise<{ payload: string; signature: string; }>; /** * it signs a Symbol Cosignature transaction with a given BIP 44 path * * @param path a path in BIP 44 format * @param aggregateTransaction the original aggregate transaction transaction needs to be cosigned * @param aggregateTransactionHash the aggregate transaction hash * @param signerPublicKey the public key of signer * @param isOptinSymbolWallet if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519 * @return a Signed Cosignature Transaction which is signed by account at path on Ledger */ signCosignatureTransaction(path: string, aggregateTransaction: LedgerTransaction, aggregateTransactionHash: string, signerPublicKey: string, isOptinSymbolWallet: boolean): Promise; /** * It closes the transport. */ close(): Promise; /** * It handles sending and receiving packages between Ledger and Wallet * @param path a path in BIP 44 format * @param rawTx a raw payload transaction hex string * @param chainCode optionally enable or not the chainCode request * @param isOptinSymbolWallet if Opt-in Symbol wallet uses curve Secp256K1 else uses curve Ed25519 * @returns respond package from Ledger */ private ledgerMessageHandler; }