mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-06 02:43:49 +00:00
Standalone has hardened addresses checkbox
This commit is contained in:
@@ -190,6 +190,13 @@
|
||||
<input id="bip32-path" type="text" class="path form-control" value="m/0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<label class="col-sm-10">
|
||||
<input class="hardened-addresses" type="checkbox">
|
||||
Use hardened addresses
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Hive Wallet</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -208,6 +215,15 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control no-border">
|
||||
Use path <code>m/0'/0'</code> with hardened addresses.
|
||||
For more info see the <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -14853,6 +14869,7 @@ var Mnemonic = function(language) {
|
||||
DOM.bip44account = $("#bip44 .account");
|
||||
DOM.bip44change = $("#bip44 .change");
|
||||
DOM.strength = $(".strength");
|
||||
DOM.hardenedAddresses = $(".hardened-addresses");
|
||||
DOM.addresses = $(".addresses");
|
||||
DOM.rowsToAdd = $(".rows-to-add");
|
||||
DOM.more = $(".more");
|
||||
@@ -14876,6 +14893,7 @@ var Mnemonic = function(language) {
|
||||
DOM.bip44account.on("input", calcForDerivationPath);
|
||||
DOM.bip44change.on("input", calcForDerivationPath);
|
||||
DOM.tab.on("shown.bs.tab", calcForDerivationPath);
|
||||
DOM.hardenedAddresses.on("change", calcForDerivationPath);
|
||||
DOM.indexToggle.on("click", toggleIndexes);
|
||||
DOM.addressToggle.on("click", toggleAddresses);
|
||||
DOM.privateKeyToggle.on("click", togglePrivateKeys);
|
||||
@@ -15180,16 +15198,27 @@ var Mnemonic = function(language) {
|
||||
|
||||
function TableRow(index) {
|
||||
|
||||
var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
|
||||
|
||||
function init() {
|
||||
calculateValues();
|
||||
}
|
||||
|
||||
function calculateValues() {
|
||||
setTimeout(function() {
|
||||
var key = bip32ExtendedKey.derive(index);
|
||||
var key = "";
|
||||
if (useHardenedAddresses) {
|
||||
key = bip32ExtendedKey.deriveHardened(index);
|
||||
}
|
||||
else {
|
||||
key = bip32ExtendedKey.derive(index);
|
||||
}
|
||||
var address = key.getAddress().toString();
|
||||
var privkey = key.privKey.toWIF(network);
|
||||
var indexText = getDerivationPath() + "/" + index;
|
||||
if (useHardenedAddresses) {
|
||||
indexText = indexText + "'";
|
||||
}
|
||||
addAddressToList(indexText, address, privkey);
|
||||
}, 50)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user