1 |
|
2 | interface ECSignatureString {
|
3 | v: string;
|
4 | r: string;
|
5 | s: string;
|
6 | }
|
7 | interface ECSignature {
|
8 | v: number;
|
9 | r: string;
|
10 | s: string;
|
11 | }
|
12 |
|
13 | interface LedgerTransport {
|
14 | close(): Promise<void>;
|
15 | }
|
16 |
|
17 | declare module '@ledgerhq/hw-app-eth' {
|
18 | class Eth {
|
19 | public transport: LedgerTransport;
|
20 | constructor(transport: LedgerTransport);
|
21 | public getAddress(
|
22 | path: string,
|
23 | boolDisplay?: boolean,
|
24 | boolChaincode?: boolean,
|
25 | ): Promise<{ publicKey: string; address: string; chainCode: string }>;
|
26 | public signTransaction(path: string, rawTxHex: string): Promise<ECSignatureString>;
|
27 | public getAppConfiguration(): Promise<{ arbitraryDataEnabled: number; version: string }>;
|
28 | public signPersonalMessage(path: string, messageHex: string): Promise<ECSignature>;
|
29 | }
|
30 | export default Eth;
|
31 | }
|
32 |
|
33 | declare module '@ledgerhq/hw-transport-webusb' {
|
34 | export default class TransportWebUSB implements LedgerTransport {
|
35 | public static create(): Promise<LedgerTransport>;
|
36 | public close(): Promise<void>;
|
37 | }
|
38 | }
|
39 |
|
40 | declare module '@ledgerhq/hw-transport-node-hid' {
|
41 | export default class TransportNodeHid implements LedgerTransport {
|
42 | public static create(): Promise<LedgerTransport>;
|
43 | public close(): Promise<void>;
|
44 | }
|
45 | }
|