var showPubKey = true;
var showPrivKey = true;
var showQr = false;
+ var litecoinUseLtub = false;
var entropyChangeTimeoutEvent = null;
var phraseChangeTimeoutEvent = null;
DOM.generate = $(".generate");
DOM.seed = $(".seed");
DOM.rootKey = $(".root-key");
+ DOM.litecoinLtubContainer = $(".litecoin-ltub-container");
+ DOM.litecoinUseLtub = $(".litecoin-use-ltub");
DOM.extendedPrivKey = $(".extended-priv-key");
DOM.extendedPubKey = $(".extended-pub-key");
DOM.bip32tab = $("#bip32-tab");
DOM.generate.on("click", generateClicked);
DOM.more.on("click", showMore);
DOM.rootKey.on("input", delayedRootKeyChanged);
+ DOM.litecoinUseLtub.on("change", litecoinUseLtubChanged);
DOM.bip32path.on("input", calcForDerivationPath);
DOM.bip44account.on("input", calcForDerivationPath);
DOM.bip44change.on("input", calcForDerivationPath);
function networkChanged(e) {
clearDerivedKeys();
clearAddressesList();
+ DOM.litecoinLtubContainer.addClass("hidden");
var networkIndex = e.target.value;
var network = networks[networkIndex];
network.onSelect();
function delayedPhraseChanged() {
hideValidationError();
+ seed = null;
+ bip32RootKey = null;
+ bip32ExtendedKey = null;
+ clearAddressesList();
showPending();
if (phraseChangeTimeoutEvent != null) {
clearTimeout(phraseChangeTimeoutEvent);
function phraseChanged() {
showPending();
- hideValidationError();
setMnemonicLanguage();
// Get the mnemonic phrase
var phrase = DOM.phrase.val();
var passphrase = DOM.passphrase.val();
calcBip32RootKeyFromSeed(phrase, passphrase);
calcForDerivationPath();
- hidePending();
}
function delayedEntropyChanged() {
calcForDerivationPath();
}
+ function litecoinUseLtubChanged() {
+ litecoinUseLtub = DOM.litecoinUseLtub.prop("checked");
+ if (litecoinUseLtub) {
+ network = bitcoinjs.bitcoin.networks.litecoinLtub;
+ }
+ else {
+ network = bitcoinjs.bitcoin.networks.litecoin;
+ }
+ phraseChanged();
+ }
+
function calcForDerivationPath() {
- showPending();
clearDerivedKeys();
clearAddressesList();
- hideValidationError();
+ showPending();
// Don't show bip49 if it's selected but network doesn't support it
if (bip49TabSelected() && !networkHasBip49()) {
return;
displayBip49Info();
}
displayBip32Info();
- hidePending();
}
function generateClicked() {
return "No root key";
}
// Check no hardened derivation path when using xpub keys
- var hardened = path.indexOf("'") > -1;
+ var hardenedPath = path.indexOf("'") > -1;
+ var hardenedAddresses = bip32TabSelected() && DOM.hardenedAddresses.prop("checked");
+ var hardened = hardenedPath || hardenedAddresses;
var isXpubkey = bip32RootKey.isNeutered();
if (hardened && isXpubkey) {
return "Hardened derivation path is invalid with xpub key";
for (var i=0; i<rows.length; i++) {
rows[i].shouldGenerate = false;
}
+ hidePending();
}
for (var i=0; i<total; i++) {
var index = i + start;
- rows.push(new TableRow(index));
+ var isLast = i == total - 1;
+ rows.push(new TableRow(index, isLast));
}
})());
}
- function TableRow(index) {
+ function TableRow(index, isLast) {
var self = this;
this.shouldGenerate = true;
address = bitcoinjs.bitcoin.address.fromOutputScript(scriptpubkey, network)
}
addAddressToList(indexText, address, pubkey, privkey);
+ if (isLast) {
+ hidePending();
+ }
}, 50)
}
onSelect: function() {
network = bitcoinjs.bitcoin.networks.litecoin;
setHdCoin(2);
+ DOM.litecoinLtubContainer.removeClass("hidden");
+ },
+ },
+ {
+ name: "MAZA - Maza",
+ bip49available: false,
+ onSelect: function() {
+ network = bitcoinjs.bitcoin.networks.maza;
+ setHdCoin(13);
},
},
+
{
name: "NMC - Namecoin",
bip49available: false,