///
import { CoinType } from '@glif/filecoin-address';
import Transport from '@ledgerhq/hw-transport';
import { LotusMessage, SignedLotusMessage } from '@glif/filecoin-message';
import { SemanticVersion, WalletType } from '../../types';
import { WalletSubProvider } from '../../wallet-sub-provider';
import { AccountStore } from '../../utils/accountStore';
type LedgerResponse = {
return_code: number;
error_message: string;
device_locked: boolean;
};
export type LedgerVersion = LedgerResponse & SemanticVersion & {
test_mode: boolean;
target_id: string;
};
export type LedgerShowAddrAndPubKey = LedgerResponse & {
addrString: string;
};
export type LedgerSignature = LedgerResponse & {
signature_compact: Buffer;
};
export type LedgerSubProvider = WalletSubProvider & {
getVersion: () => Promise;
showAddressAndPubKey: (_: string) => Promise;
resetTransport: (_: Transport) => Promise;
ready: () => Promise;
};
export declare class LedgerProvider extends AccountStore implements LedgerSubProvider {
type: WalletType;
ledgerBusy: boolean;
minLedgerVersion: SemanticVersion;
private transport;
constructor({ transport, minLedgerVersion }: {
transport: Transport;
minLedgerVersion: SemanticVersion;
});
/**
* getVersion call rejects if it takes too long to respond,
* meaning the Ledger device is locked
*/
getVersion: () => Promise;
ready: () => Promise;
sign: (from: string, message: LotusMessage) => Promise;
getAccounts: (nStart?: number, nEnd?: number, coinType?: CoinType) => Promise;
showAddressAndPubKey: (path: string) => Promise;
keyDerive: (_: string) => Promise;
resetTransport: (_transport: Transport) => Promise;
}
export {};
//# sourceMappingURL=index.d.ts.map