aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorIan Coleman <ian@iancoleman.io>2020-11-30 00:40:04 +0000
committerIan Coleman <ian@iancoleman.io>2020-11-30 00:40:04 +0000
commit32ade2fbf79415f8335d96c942b5f5569829820d (patch)
treeb2f1db7258b097974c145b7f88eef21bcd211ed0 /src/js
parentac7f150a798d9edb9ce7506e60c03ed1f33ebaa2 (diff)
downloadBIP39-32ade2fbf79415f8335d96c942b5f5569829820d.tar.gz
BIP39-32ade2fbf79415f8335d96c942b5f5569829820d.tar.zst
BIP39-32ade2fbf79415f8335d96c942b5f5569829820d.zip
Remove trailing spaces
Diffstat (limited to 'src/js')
-rw-r--r--src/js/index.js30
-rw-r--r--src/js/segwit-parameters.js2
2 files changed, 16 insertions, 16 deletions
diff --git a/src/js/index.js b/src/js/index.js
index e307e38..fd8c16b 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -96,7 +96,7 @@
96 DOM.bip84change = $("#bip84 .change"); 96 DOM.bip84change = $("#bip84 .change");
97 DOM.bip85 = $('.bip85'); 97 DOM.bip85 = $('.bip85');
98 DOM.showBip85 = $('.showBip85'); 98 DOM.showBip85 = $('.showBip85');
99 DOM.bip85Field = $('.bip85Field'); 99 DOM.bip85Field = $('.bip85Field');
100 DOM.bip85application = $('#bip85-application'); 100 DOM.bip85application = $('#bip85-application');
101 DOM.bip85mnemonicLanguage = $('#bip85-mnemonic-language'); 101 DOM.bip85mnemonicLanguage = $('#bip85-mnemonic-language');
102 DOM.bip85mnemonicLanguageInput = $('.bip85-mnemonic-language-input'); 102 DOM.bip85mnemonicLanguageInput = $('.bip85-mnemonic-language-input');
@@ -105,7 +105,7 @@
105 DOM.bip85index = $('#bip85-index'); 105 DOM.bip85index = $('#bip85-index');
106 DOM.bip85indexInput = $('.bip85-index-input'); 106 DOM.bip85indexInput = $('.bip85-index-input');
107 DOM.bip85bytes = $('#bip85-bytes'); 107 DOM.bip85bytes = $('#bip85-bytes');
108 DOM.bip85bytesInput = $('.bip85-bytes-input'); 108 DOM.bip85bytesInput = $('.bip85-bytes-input');
109 DOM.bip141unavailable = $("#bip141 .unavailable"); 109 DOM.bip141unavailable = $("#bip141 .unavailable");
110 DOM.bip141available = $("#bip141 .available"); 110 DOM.bip141available = $("#bip141 .available");
111 DOM.bip141path = $("#bip141-path"); 111 DOM.bip141path = $("#bip141-path");
@@ -166,7 +166,7 @@
166 DOM.bip85mnemonicLanguage.on('change', calcBip85); 166 DOM.bip85mnemonicLanguage.on('change', calcBip85);
167 DOM.bip85mnemonicLength.on('change', calcBip85); 167 DOM.bip85mnemonicLength.on('change', calcBip85);
168 DOM.bip85index.on('input', calcBip85); 168 DOM.bip85index.on('input', calcBip85);
169 DOM.bip85bytes.on('input', calcBip85); 169 DOM.bip85bytes.on('input', calcBip85);
170 DOM.bip141path.on("input", calcForDerivationPath); 170 DOM.bip141path.on("input", calcForDerivationPath);
171 DOM.bip141semantics.on("change", tabChanged); 171 DOM.bip141semantics.on("change", tabChanged);
172 DOM.tab.on("shown.bs.tab", tabChanged); 172 DOM.tab.on("shown.bs.tab", tabChanged);
@@ -469,13 +469,13 @@
469 DOM.bip85.addClass('hidden'); 469 DOM.bip85.addClass('hidden');
470 } 470 }
471 } 471 }
472 472
473 function toggleBip85Fields() { 473 function toggleBip85Fields() {
474 if (DOM.showBip85.prop('checked')) { 474 if (DOM.showBip85.prop('checked')) {
475 DOM.bip85mnemonicLanguageInput.addClass('hidden'); 475 DOM.bip85mnemonicLanguageInput.addClass('hidden');
476 DOM.bip85mnemonicLengthInput.addClass('hidden'); 476 DOM.bip85mnemonicLengthInput.addClass('hidden');
477 DOM.bip85bytesInput.addClass('hidden'); 477 DOM.bip85bytesInput.addClass('hidden');
478 478
479 var app = DOM.bip85application.val(); 479 var app = DOM.bip85application.val();
480 if (app === 'bip39') { 480 if (app === 'bip39') {
481 DOM.bip85mnemonicLanguageInput.removeClass('hidden'); 481 DOM.bip85mnemonicLanguageInput.removeClass('hidden');
@@ -485,16 +485,16 @@
485 } 485 }
486 } 486 }
487 } 487 }
488 488
489 function calcBip85() { 489 function calcBip85() {
490 if (!DOM.showBip85.prop('checked')) { 490 if (!DOM.showBip85.prop('checked')) {
491 return 491 return
492 } 492 }
493 493
494 toggleBip85Fields(); 494 toggleBip85Fields();
495 495
496 var app = DOM.bip85application.val(); 496 var app = DOM.bip85application.val();
497 497
498 var phrase = DOM.phrase.val(); 498 var phrase = DOM.phrase.val();
499 var passphrase = DOM.passphrase.val(); 499 var passphrase = DOM.passphrase.val();
500 if (!phrase) { 500 if (!phrase) {
@@ -502,15 +502,15 @@
502 } 502 }
503 try { 503 try {
504 var master = libs.bip85.BIP85.fromMnemonic(phrase, passphrase); 504 var master = libs.bip85.BIP85.fromMnemonic(phrase, passphrase);
505 505
506 var result; 506 var result;
507 507
508 const index = parseInt(DOM.bip85index.val(), 10); 508 const index = parseInt(DOM.bip85index.val(), 10);
509 509
510 if (app === 'bip39') { 510 if (app === 'bip39') {
511 const language = parseInt(DOM.bip85mnemonicLanguage.val(), 10); 511 const language = parseInt(DOM.bip85mnemonicLanguage.val(), 10);
512 const length = parseInt(DOM.bip85mnemonicLength.val(), 10); 512 const length = parseInt(DOM.bip85mnemonicLength.val(), 10);
513 513
514 result = master.deriveBIP39(language, length, index).toMnemonic(); 514 result = master.deriveBIP39(language, length, index).toMnemonic();
515 } else if (app === 'wif') { 515 } else if (app === 'wif') {
516 result = master.deriveWIF(index).toWIF(); 516 result = master.deriveWIF(index).toWIF();
@@ -518,10 +518,10 @@
518 result = master.deriveXPRV(index).toXPRV(); 518 result = master.deriveXPRV(index).toXPRV();
519 } else if (app === 'hex') { 519 } else if (app === 'hex') {
520 const bytes = parseInt(DOM.bip85bytes.val(), 10); 520 const bytes = parseInt(DOM.bip85bytes.val(), 10);
521 521
522 result = master.deriveHex(bytes, index).toEntropy(); 522 result = master.deriveHex(bytes, index).toEntropy();
523 } 523 }
524 524
525 hideValidationError(); 525 hideValidationError();
526 DOM.bip85Field.val(result); 526 DOM.bip85Field.val(result);
527 } catch (e) { 527 } catch (e) {
@@ -2683,7 +2683,7 @@
2683 network = libs.bitcoin.networks.bitcoin; 2683 network = libs.bitcoin.networks.bitcoin;
2684 setHdCoin(235); 2684 setHdCoin(235);
2685 }, 2685 },
2686 }, 2686 },
2687 { 2687 {
2688 name: "FIRO - Firo (Zcoin rebrand)", 2688 name: "FIRO - Firo (Zcoin rebrand)",
2689 onSelect: function() { 2689 onSelect: function() {
diff --git a/src/js/segwit-parameters.js b/src/js/segwit-parameters.js
index 997a0f8..74df12e 100644
--- a/src/js/segwit-parameters.js
+++ b/src/js/segwit-parameters.js
@@ -163,7 +163,7 @@ libs.bitcoin.networks.regtest.p2wshInP2sh = {
163 scriptHash: 0xc4, 163 scriptHash: 0xc4,
164 wif: 0xef 164 wif: 0xef
165}; 165};
166 166
167libs.bitcoin.networks.cranepay.p2wpkhInP2sh = { 167libs.bitcoin.networks.cranepay.p2wpkhInP2sh = {
168 baseNetwork: "cranepay", 168 baseNetwork: "cranepay",
169 messagePrefix: '\x18Bitcoin Signed Message:\n', 169 messagePrefix: '\x18Bitcoin Signed Message:\n',