William O'Beirne e90cde75fd
Allow PIN Entry for TREZOR One in App (#1971)
* Create popup window for TREZOR pin.

* Address PR feedback. Move pin template into its own file loaded via raw-loader.

* Fix PIN not unlocking

* Dont minify electron main code
2018-07-05 12:59:17 -05:00
..

ETH Enclave

Enclave is the communication layer between hardware wallets and the Electron web view. This layer is necessary if you've disabled node integration, and enabled context isolation on your webview (Which is something you should do.)

Enclave uses Electron's Protocol API to open up an HTTP-like communication layer between Electron and the web view. You can read more about this approach here.

Setup

// Electron main js
import { registerServer } from 'enclave/server';
registerServer(app);
// Electron preload js
import { registerProtocol } from 'enclave/preload';
registerProtocol();

Usage

import EnclaveAPI, { WalletTypes } from 'enclave/client';
EnclaveAPI.getChainCode({
  walletType: WalletTypes.LEDGER,
  dpath: "m/44'/60'/0'/0"
}).then(({ publicKey, chainCode }) => {
  // ...
});