aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/src/types.ts
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-03-06 10:05:30 +0800
committerJacob Evans <jacob@dekz.net>2018-03-06 10:05:30 +0800
commit8521775389b2e7ddefec20f1d06331e4bc3d0540 (patch)
treeb1e040548183f51e52ffdaa7f593e95311d4829b /packages/subproviders/src/types.ts
parent994935b5da0b15796958a32c5bab0a25b9430b5a (diff)
downloaddexon-0x-contracts-8521775389b2e7ddefec20f1d06331e4bc3d0540.tar
dexon-0x-contracts-8521775389b2e7ddefec20f1d06331e4bc3d0540.tar.gz
dexon-0x-contracts-8521775389b2e7ddefec20f1d06331e4bc3d0540.tar.bz2
dexon-0x-contracts-8521775389b2e7ddefec20f1d06331e4bc3d0540.tar.lz
dexon-0x-contracts-8521775389b2e7ddefec20f1d06331e4bc3d0540.tar.xz
dexon-0x-contracts-8521775389b2e7ddefec20f1d06331e4bc3d0540.tar.zst
dexon-0x-contracts-8521775389b2e7ddefec20f1d06331e4bc3d0540.zip
Update ledgerco packages
Diffstat (limited to 'packages/subproviders/src/types.ts')
-rw-r--r--packages/subproviders/src/types.ts44
1 files changed, 31 insertions, 13 deletions
diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts
index 65b7f6c8f..785547a22 100644
--- a/packages/subproviders/src/types.ts
+++ b/packages/subproviders/src/types.ts
@@ -1,7 +1,25 @@
import * as _ from 'lodash';
+declare class LedgerTransport {
+ // tslint:disable-next-line:async-suffix
+ public static create(): Promise<LedgerTransport>;
+ // tslint:disable-next-line:async-suffix
+ public static close(): Promise<void>;
+}
+
export interface LedgerCommunicationClient {
- close_async: () => Promise<void>;
+ close: () => Promise<void>;
+}
+
+export interface LedgerEthereumClient {
+ getAddress: (
+ derivationPath: string,
+ askForDeviceConfirmation?: boolean,
+ shouldGetChainCode?: boolean,
+ ) => Promise<{ publicKey: string; address: string; chainCode: string }>;
+ signTransaction: (derivationPath: string, rawTxHex: string) => Promise<ECSignatureString>;
+ signPersonalMessage: (derivationPath: string, messageHex: string) => Promise<ECSignature>;
+ transport: LedgerCommunicationClient;
}
/*
@@ -9,18 +27,18 @@ export interface LedgerCommunicationClient {
* It uses an internal LedgerCommunicationClient to relay these requests. Currently
* NodeJs and Browser communication are supported.
*/
-export interface LedgerEthereumClient {
- // shouldGetChainCode is defined as `true` instead of `boolean` because other types rely on the assumption
- // that we get back the chain code and we don't have dependent types to express it properly
- getAddress_async: (
- derivationPath: string,
- askForDeviceConfirmation: boolean,
- shouldGetChainCode: true,
- ) => Promise<LedgerGetAddressResult>;
- signPersonalMessage_async: (derivationPath: string, messageHex: string) => Promise<ECSignature>;
- signTransaction_async: (derivationPath: string, txHex: string) => Promise<ECSignatureString>;
- comm: LedgerCommunicationClient;
-}
+// export interface LedgerEthereumClient {
+// // shouldGetChainCode is defined as `true` instead of `boolean` because other types rely on the assumption
+// // that we get back the chain code and we don't have dependent types to express it properly
+// getAddress_async: (
+// derivationPath: string,
+// askForDeviceConfirmation: boolean,
+// shouldGetChainCode: true,
+// ) => Promise<LedgerGetAddressResult>;
+// signPersonalMessage_async: (derivationPath: string, messageHex: string) => Promise<ECSignature>;
+// signTransaction_async: (derivationPath: string, txHex: string) => Promise<ECSignatureString>;
+// comm: LedgerCommunicationClient;
+// }
export interface ECSignatureString {
v: string;