aboutsummaryrefslogtreecommitdiffstats
path: root/packages/typescript-typings/types/@ledgerhq/index.d.ts
diff options
context:
space:
mode:
authorHsuan Lee <boczeratul@gmail.com>2019-03-06 15:01:12 +0800
committerHsuan Lee <boczeratul@gmail.com>2019-03-06 15:01:12 +0800
commitc5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f (patch)
treee925fdefbe35304b71e57c09c89fd6d123c3ab40 /packages/typescript-typings/types/@ledgerhq/index.d.ts
parent69dc8110f4be576fe91d28a653906fd67904a899 (diff)
downloaddexon-sol-tools-c5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f.tar
dexon-sol-tools-c5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f.tar.gz
dexon-sol-tools-c5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f.tar.bz2
dexon-sol-tools-c5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f.tar.lz
dexon-sol-tools-c5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f.tar.xz
dexon-sol-tools-c5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f.tar.zst
dexon-sol-tools-c5a9c90c0b6dbeb59eb4d8bb6ad20a1afdc2450f.zip
Add typescript definitions
Diffstat (limited to 'packages/typescript-typings/types/@ledgerhq/index.d.ts')
-rw-r--r--packages/typescript-typings/types/@ledgerhq/index.d.ts45
1 files changed, 45 insertions, 0 deletions
diff --git a/packages/typescript-typings/types/@ledgerhq/index.d.ts b/packages/typescript-typings/types/@ledgerhq/index.d.ts
new file mode 100644
index 000000000..724dacb76
--- /dev/null
+++ b/packages/typescript-typings/types/@ledgerhq/index.d.ts
@@ -0,0 +1,45 @@
+// Ledgerco declarations
+interface ECSignatureString {
+ v: string;
+ r: string;
+ s: string;
+}
+interface ECSignature {
+ v: number;
+ r: string;
+ s: string;
+}
+
+interface LedgerTransport {
+ close(): Promise<void>;
+}
+
+declare module '@ledgerhq/hw-app-eth' {
+ class Eth {
+ public transport: LedgerTransport;
+ constructor(transport: LedgerTransport);
+ public getAddress(
+ path: string,
+ boolDisplay?: boolean,
+ boolChaincode?: boolean,
+ ): Promise<{ publicKey: string; address: string; chainCode: string }>;
+ public signTransaction(path: string, rawTxHex: string): Promise<ECSignatureString>;
+ public getAppConfiguration(): Promise<{ arbitraryDataEnabled: number; version: string }>;
+ public signPersonalMessage(path: string, messageHex: string): Promise<ECSignature>;
+ }
+ export default Eth;
+}
+
+declare module '@ledgerhq/hw-transport-u2f' {
+ export default class TransportU2F implements LedgerTransport {
+ public static create(): Promise<LedgerTransport>;
+ public close(): Promise<void>;
+ }
+}
+
+declare module '@ledgerhq/hw-transport-node-hid' {
+ export default class TransportNodeHid implements LedgerTransport {
+ public static create(): Promise<LedgerTransport>;
+ public close(): Promise<void>;
+ }
+}