Skip to content

Commit aac59ed

Browse files
committed
0.5.1 - passphrase support
1 parent a069171 commit aac59ed

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

index.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ <h3>Choose Wallet Type</h3>
999999

10001000
<div class="mnemonic-fields hidden">
10011001
<textarea id="phrase" class="phrase" placeholder="Enter your mnemonic (e.g. 24 recovery words)"></textarea>
1002-
<input type="text" id="mnemonicpassphrase" placeholder="Enter your mnemonic passphrase (if required)" spellcheck="false" autocomplete="off" class="bordered-centered" />
1002+
<input type="text" id="mnemonic_passphrase" placeholder="Enter your mnemonic passphrase (if required)" spellcheck="false" autocomplete="off" class="bordered-centered" />
10031003
</div>
10041004

10051005
<div class="secret-fields">
@@ -91660,7 +91660,7 @@ <h3 class="order-fields hidden">Transaction details</h3>
9166091660
</script>
9166191661
<script>(function() {
9166291662

91663-
var version = '0.5.0';
91663+
var version = '0.5.1';
9166491664
var testnet = false;
9166591665
var bithomp = 'https://bithomp.com';
9166691666
var bithompTestnet = 'https://test.bithomp.com';
@@ -91703,7 +91703,7 @@ <h3 class="order-fields hidden">Transaction details</h3>
9170391703
DOM.switchMnemonic = $('#switch_mnemonic');
9170491704
DOM.mnemonicFields = $('.mnemonic-fields');
9170591705
DOM.phrase = $("#phrase");
91706-
DOM.mnemonicpassphrase = $("#mnemonicpassphrase");
91706+
DOM.mnemonicPassphrase = $("#mnemonic_passphrase");
9170791707
DOM.switchHwElement = $('.switch_hw');
9170891708
DOM.switchHW = $('#switch_hw');
9170991709
DOM.HwFields = $('.hw-fields');
@@ -91817,7 +91817,7 @@ <h3 class="order-fields hidden">Transaction details</h3>
9181791817
thisYear();
9181891818
DOM.termsButton.on("click", termsAgreed);
9181991819
DOM.phrase.on("input", delayedPhraseChanged);
91820-
DOM.mnemonicpassphrase.on("input", delayedPhraseChanged);
91820+
DOM.mnemonicPassphrase.on("input", delayedPhraseChanged);
9182191821
hideValidationError();
9182291822
DOM.switchOnline.on("click", switchOnline);
9182391823
DOM.switchOffline.on("click", switchOffline);
@@ -94133,11 +94133,7 @@ <h3 class="order-fields hidden">Transaction details</h3>
9413394133
}
9413494134

9413594135
function calcBip32RootKeyFromSeed(phrase) {
94136-
var passphrase = ''
94137-
var passphraseEl = document.getElementById('mnemonicpassphrase')
94138-
if (passphraseEl && passphraseEl.value.trim() !== '') {
94139-
passphrase = passphraseEl.value.trim()
94140-
}
94136+
var passphrase = DOM.mnemonicPassphrase.val().trim();
9414194137
seed = mnemonic.toSeed(phrase, passphrase);
9414294138
bip32RootKey = bitcoinjs.bitcoin.HDNode.fromSeedHex(seed, network);
9414394139
}

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ <h3>Choose Wallet Type</h3>
355355

356356
<div class="mnemonic-fields hidden">
357357
<textarea id="phrase" class="phrase" placeholder="Enter your mnemonic (e.g. 24 recovery words)"></textarea>
358-
<input type="text" id="mnemonicpassphrase" placeholder="Enter your mnemonic passphrase (if required)" spellcheck="false" autocomplete="off" class="bordered-centered" />
358+
<input type="text" id="mnemonic_passphrase" placeholder="Enter your mnemonic passphrase (if required)" spellcheck="false" autocomplete="off" class="bordered-centered" />
359359
</div>
360360

361361
<div class="secret-fields">

src/js/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function() {
22

3-
var version = '0.5.0';
3+
var version = '0.5.1';
44
var testnet = false;
55
var bithomp = 'https://bithomp.com';
66
var bithompTestnet = 'https://test.bithomp.com';
@@ -43,7 +43,7 @@ DOM.secretHidden = $('#secret_hidden');
4343
DOM.switchMnemonic = $('#switch_mnemonic');
4444
DOM.mnemonicFields = $('.mnemonic-fields');
4545
DOM.phrase = $("#phrase");
46-
DOM.mnemonicpassphrase = $("#mnemonicpassphrase");
46+
DOM.mnemonicPassphrase = $("#mnemonic_passphrase");
4747
DOM.switchHwElement = $('.switch_hw');
4848
DOM.switchHW = $('#switch_hw');
4949
DOM.HwFields = $('.hw-fields');
@@ -157,7 +157,7 @@ function init() {
157157
thisYear();
158158
DOM.termsButton.on("click", termsAgreed);
159159
DOM.phrase.on("input", delayedPhraseChanged);
160-
DOM.mnemonicpassphrase.on("input", delayedPhraseChanged);
160+
DOM.mnemonicPassphrase.on("input", delayedPhraseChanged);
161161
hideValidationError();
162162
DOM.switchOnline.on("click", switchOnline);
163163
DOM.switchOffline.on("click", switchOffline);
@@ -2473,11 +2473,7 @@ function calcBip32ExtendedKey(path) {
24732473
}
24742474

24752475
function calcBip32RootKeyFromSeed(phrase) {
2476-
var passphrase = ''
2477-
var passphraseEl = document.getElementById('mnemonicpassphrase')
2478-
if (passphraseEl && passphraseEl.value.trim() !== '') {
2479-
passphrase = passphraseEl.value.trim()
2480-
}
2476+
var passphrase = DOM.mnemonicPassphrase.val().trim();
24812477
seed = mnemonic.toSeed(phrase, passphrase);
24822478
bip32RootKey = bitcoinjs.bitcoin.HDNode.fromSeedHex(seed, network);
24832479
}

0 commit comments

Comments
 (0)