From 6b561c08f3634bc0524f7dc032bc7b5578f669e9 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 4 Dec 2017 15:06:51 +0300 Subject: [PATCH] settings bip39 user select options --- react/src/actions/actions/electrum.js | 4 +- .../settings/settings.bip39KeysPanel.js | 54 +++++++++++++++++-- .../dashboard/settings/settings.scss | 6 +++ react/src/translate/en.js | 2 +- 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/react/src/actions/actions/electrum.js b/react/src/actions/actions/electrum.js index 312b4fcbb..915eede75 100644 --- a/react/src/actions/actions/electrum.js +++ b/react/src/actions/actions/electrum.js @@ -313,7 +313,7 @@ export function shepherdElectrumListunspent(coin, address) { }); } -export function shepherdElectrumBip39Keys(seed, match) { +export function shepherdElectrumBip39Keys(seed, match, addressdepth, accounts) { return new Promise((resolve, reject) => { fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/electrum/seed/bip39/match`, { method: 'POST', @@ -323,6 +323,8 @@ export function shepherdElectrumBip39Keys(seed, match) { body: JSON.stringify({ seed, match, + addressdepth, + accounts, }), }) .catch((error) => { diff --git a/react/src/components/dashboard/settings/settings.bip39KeysPanel.js b/react/src/components/dashboard/settings/settings.bip39KeysPanel.js index 756a5d560..7190a8d14 100644 --- a/react/src/components/dashboard/settings/settings.bip39KeysPanel.js +++ b/react/src/components/dashboard/settings/settings.bip39KeysPanel.js @@ -17,6 +17,8 @@ class Bip39KeysPanel extends React.Component { passphrase: '', seedInputVisibility: false, trimPassphraseTimer: null, + addressdepth: 20, + accounts: 1, }; this._getBip39Keys = this._getBip39Keys.bind(this); this.updateInput = this.updateInput.bind(this); @@ -35,6 +37,9 @@ class Bip39KeysPanel extends React.Component { passphrase: '', keys: null, match: null, + accounts: 1, + addressdepth: 20, + seedInputVisibility: false, })); } } @@ -86,8 +91,12 @@ class Bip39KeysPanel extends React.Component { } _getBip39Keys() { - shepherdElectrumBip39Keys(this.state.passphrase, this.state.match) - .then((res) => { + shepherdElectrumBip39Keys( + this.state.passphrase, + this.state.match, + this.state.addressdepth, + this.state.accounts + ).then((res) => { this.setState({ keys: res.result.priv ? res.result : 'empty', }); @@ -110,7 +119,7 @@ class Bip39KeysPanel extends React.Component {
{ translate('SETTINGS.BIP39_DESC_P1') }
{ translate('SETTINGS.BIP39_DESC_P2') }
-
+
{ translate('INDEX.PASSPHRASE') }
-
+
Get key
+
+ +
+
+ +
{ this.state.keys && diff --git a/react/src/components/dashboard/settings/settings.scss b/react/src/components/dashboard/settings/settings.scss index 8b74696a7..be7c5d169 100644 --- a/react/src/components/dashboard/settings/settings.scss +++ b/react/src/components/dashboard/settings/settings.scss @@ -143,4 +143,10 @@ 100% { max-height: none; } +} + +.bip39-search, +.bip39-search input, +.bip39-search textarea { + color: #757575 !important; } \ No newline at end of file diff --git a/react/src/translate/en.js b/react/src/translate/en.js index e559d9c77..9e7dc80ba 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -605,7 +605,7 @@ export const _lang = { }, 'SETTINGS': { 'BIP39_DISC': 'Hardware wallets disclaimer: by using this form you\'re acknowledging risks of exposing your seed', - 'BIP39_DESC_P1': 'Description: the form below is going to search for a pub key in a range of 20 accounts with 50 addresses depth each (1000 keys).', + 'BIP39_DESC_P1': 'Description: the form below is going to search for a pub key depending on a range of key path combinations is chosen (No of accounts * account address path depth).', 'BIP39_DESC_P2': 'The app might temporary freeze for several seconds during search procedure.', 'SHOW_APP_RUNTIME_LOG': 'Show app runtime log', 'WRONG_PASSPHRASE': 'Wrong passphrase!',