Save the KeyPath of the WalletKeyPathRoot of the hardware wallet so we don't have to scan for it

This commit is contained in:
nicolas.dorier
2018-12-26 14:04:00 +09:00
parent af22d6a4e3
commit caa6978d80
6 changed files with 37 additions and 11 deletions

View File

@@ -31,15 +31,17 @@
showFeedback("no-ledger-info");
}
}
$("#DerivationScheme").change(function () {
$("#KeyPath").val("");
});
$(".ledger-info-recommended").on("click", function (elem) {
elem.preventDefault();
showFeedback("ledger-validate");
var account = elem.currentTarget.getAttribute("data-ledgeraccount");
var keypath = elem.currentTarget.getAttribute("data-ledgerkeypath");
var cryptoCode = GetSelectedCryptoCode();
bridge.sendCommand("getxpub", "cryptoCode=" + cryptoCode + "&account=" + account)
bridge.sendCommand("getxpub", "cryptoCode=" + cryptoCode + "&keypath=" + keypath)
.then(function (result) {
if (cryptoCode !== GetSelectedCryptoCode())
return;
@@ -48,6 +50,7 @@
$("#DerivationScheme").val(result.extPubKey);
$("#DerivationSchemeFormat").val("BTCPay");
$("#KeyPath").val(keypath);
})
.catch(function (reason) { Write('check', 'error', reason); });
return false;