Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion react/src/actions/actions/electrum.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -323,6 +323,8 @@ export function shepherdElectrumBip39Keys(seed, match) {
body: JSON.stringify({
seed,
match,
addressdepth,
accounts,
}),
})
.catch((error) => {
Expand Down
54 changes: 50 additions & 4 deletions react/src/components/dashboard/settings/settings.bip39KeysPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -35,6 +37,9 @@ class Bip39KeysPanel extends React.Component {
passphrase: '',
keys: null,
match: null,
accounts: 1,
addressdepth: 20,
seedInputVisibility: false,
}));
}
}
Expand Down Expand Up @@ -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',
});
Expand All @@ -110,7 +119,7 @@ class Bip39KeysPanel extends React.Component {
</h4>
<div>{ translate('SETTINGS.BIP39_DESC_P1') }</div>
<div>{ translate('SETTINGS.BIP39_DESC_P2') }</div>
<div>
<div className="bip39-search">
<div className="col-sm-12 no-padding-left margin-top-10">
<div className="form-group form-material floating">
<input
Expand Down Expand Up @@ -138,7 +147,7 @@ class Bip39KeysPanel extends React.Component {
htmlFor="passphrase">{ translate('INDEX.PASSPHRASE') }</label>
</div>
</div>
<div className="col-sm-4 no-padding-left text-center">
<div className="col-sm-5 no-padding-left">
<input
type="text"
className="form-control margin-top-10"
Expand All @@ -153,6 +162,43 @@ class Bip39KeysPanel extends React.Component {
disabled={ !this.state.match || !this.state.passphrase || this.state.passphrase.length < 2 }
onClick={ this._getBip39Keys }>Get key</button>
</div>
<div className="col-sm-2 no-padding-left text-center margin-top-10 margin-left-50">
<select
className="form-control form-material"
name="accounts"
value={ this.state.accounts }
onChange={ (event) => this.updateInput(event) }
autoFocus>
<option value="1">1 account</option>
<option value="2">2 accounts</option>
<option value="3">3 accounts</option>
<option value="4">4 accounts</option>
<option value="5">5 accounts</option>
<option value="6">6 accounts</option>
<option value="7">7 accounts</option>
<option value="8">8 accounts</option>
<option value="9">9 accounts</option>
<option value="10">10 accounts</option>
</select>
</div>
<div className="col-sm-2 no-padding-left text-center margin-top-10">
<select
className="form-control form-material"
name="addressdepth"
value={ this.state.addressdepth }
onChange={ (event) => this.updateInput(event) }
autoFocus>
<option value="20">20 addresses</option>
<option value="30">30 addresses</option>
<option value="40">40 addresses</option>
<option value="50">50 addresses</option>
<option value="60">60 addresses</option>
<option value="70">70 addresses</option>
<option value="80">80 addresses</option>
<option value="90">90 addresses</option>
<option value="100">100 addresses</option>
</select>
</div>
</div>
</div>
{ this.state.keys &&
Expand Down
6 changes: 6 additions & 0 deletions react/src/components/dashboard/settings/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,10 @@
100% {
max-height: none;
}
}

.bip39-search,
.bip39-search input,
.bip39-search textarea {
color: #757575 !important;
}
2 changes: 1 addition & 1 deletion react/src/translate/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down