///
import * as Crypto from '@cardano-sdk/crypto';
import * as Ledger from '@cardano-foundation/ledgerjs-hw-app-cardano';
import { Cardano, Serialization } from '@cardano-sdk/core';
import { CommunicationType, KeyAgentBase, KeyAgentDependencies, KeyPurpose, SerializableLedgerKeyAgentData, SignBlobResult, SignTransactionContext, cip8 } from '@cardano-sdk/key-management';
import { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
import { HID } from 'node-hid';
import { LedgerTransportType } from './types';
import _LedgerConnection, { GetVersionResponse, Transaction, TransactionSigningMode } from '@cardano-foundation/ledgerjs-hw-app-cardano';
import type LedgerTransport from '@ledgerhq/hw-transport';
declare const LedgerConnection: typeof Ledger.Ada;
declare type LedgerConnection = _LedgerConnection;
export interface LedgerKeyAgentProps extends Omit {
deviceConnection?: LedgerConnection;
}
export interface CreateLedgerKeyAgentProps {
chainId: Cardano.ChainId;
accountIndex?: number;
communicationType: CommunicationType;
deviceConnection?: LedgerConnection | null;
purpose?: KeyPurpose;
}
export interface GetLedgerXpubProps {
deviceConnection?: LedgerConnection;
communicationType: CommunicationType;
accountIndex: number;
purpose: KeyPurpose;
}
export interface CreateLedgerTransportProps {
communicationType: CommunicationType;
nodeHidDevicePath?: string;
}
declare const establishDeviceConnectionMethodName = "establishDeviceConnection";
declare type DeviceConnectionsWithTheirInitialParams = {
deviceConnection: LedgerConnection;
} & ({
communicationType: CommunicationType.Node;
device?: HID;
nodeHidDevicePath?: string;
} | {
communicationType: CommunicationType.Web;
device?: USBDevice;
});
export declare class LedgerKeyAgent extends KeyAgentBase {
#private;
readonly deviceConnection?: LedgerConnection;
static deviceConnections: DeviceConnectionsWithTheirInitialParams[];
constructor({ deviceConnection, ...serializableData }: LedgerKeyAgentProps, dependencies: KeyAgentDependencies);
private static findConnectionByCommunicationTypeAndDevicePath;
private static getHidDeviceList;
private static attachDisconnectionCleanupHandler;
private static openTransportForDevice;
static createTransport({ communicationType, nodeHidDevicePath }: CreateLedgerTransportProps): Promise;
private static testConnection;
static createDeviceConnection(activeTransport: LedgerTransport): Promise;
private static rememberConnection;
static [establishDeviceConnectionMethodName](communicationType: CommunicationType): Promise;
static [establishDeviceConnectionMethodName](communicationType: CommunicationType, nodeHidDevicePath: string): Promise;
static [establishDeviceConnectionMethodName](communicationType: CommunicationType.Node, device: HID): Promise;
static [establishDeviceConnectionMethodName](communicationType: CommunicationType.Web, device: USBDevice): Promise;
static checkDeviceConnection(communicationType: CommunicationType, deviceConnection?: LedgerConnection): Promise;
static getXpub({ deviceConnection, communicationType, accountIndex, purpose }: GetLedgerXpubProps): Promise;
static getAppVersion(communicationType: CommunicationType, deviceConnection?: LedgerConnection): Promise;
static createWithDevice({ chainId, accountIndex, communicationType, deviceConnection, purpose }: CreateLedgerKeyAgentProps, dependencies: KeyAgentDependencies): Promise;
private static isKeyHashOrScriptHashVoter;
static getSigningMode(tx: Transaction): TransactionSigningMode;
signTransaction(txBody: Serialization.TransactionBody, { knownAddresses, txInKeyPathMap }: SignTransactionContext): Promise;
signCip8Data(request: cip8.Cip8SignDataContext): Promise;
signBlob(): Promise;
exportRootPrivateKey(): Promise;
}
export {};
//# sourceMappingURL=LedgerKeyAgent.d.ts.map