diff options
Diffstat (limited to 'packages/subproviders/src/types.ts')
-rw-r--r-- | packages/subproviders/src/types.ts | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts index 785547a22..11a178f69 100644 --- a/packages/subproviders/src/types.ts +++ b/packages/subproviders/src/types.ts @@ -1,45 +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: () => Promise<void>; } +/* + * The LedgerEthereumClient sends Ethereum-specific requests to the Ledger Nano S + * It uses an internal LedgerCommunicationClient to relay these requests. Currently + * NodeJs and Browser communication are supported. + */ export interface LedgerEthereumClient { getAddress: ( derivationPath: string, askForDeviceConfirmation?: boolean, shouldGetChainCode?: boolean, - ) => Promise<{ publicKey: string; address: string; chainCode: string }>; + ) => Promise<LedgerGetAddressResult>; signTransaction: (derivationPath: string, rawTxHex: string) => Promise<ECSignatureString>; signPersonalMessage: (derivationPath: string, messageHex: string) => Promise<ECSignature>; transport: LedgerCommunicationClient; } -/* - * The LedgerEthereumClient sends Ethereum-specific requests to the Ledger Nano S - * 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 ECSignatureString { v: string; r: string; |