aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2017-09-01 12:25:45 +1000
committerIan Coleman <coleman.ian@gmail.com>2017-09-01 12:25:45 +1000
commit0cda44d5f6ca63520ad39e88771c374da2993d6c (patch)
treee63e575f92d2470a811b74d6f4e256b3e9f0c716 /src
parent7258b102c14c92fdbbae40e36401e0d29bd5c1eb (diff)
downloadBIP39-0cda44d5f6ca63520ad39e88771c374da2993d6c.tar.gz
BIP39-0cda44d5f6ca63520ad39e88771c374da2993d6c.tar.zst
BIP39-0cda44d5f6ca63520ad39e88771c374da2993d6c.zip
Rename bip49 to p2wpkhNestedInP2sh where suitable
Diffstat (limited to 'src')
-rw-r--r--src/js/index.js70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/js/index.js b/src/js/index.js
index 80c7fa8..45c7cb1 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -131,11 +131,11 @@
131 var networkIndex = e.target.value; 131 var networkIndex = e.target.value;
132 var network = networks[networkIndex]; 132 var network = networks[networkIndex];
133 network.onSelect(); 133 network.onSelect();
134 if (network.bip49available) { 134 if (network.p2wpkhNestedInP2shAvailable) {
135 showBip49(); 135 showP2wpkhNestedInP2shAvailable();
136 } 136 }
137 else { 137 else {
138 hideBip49(); 138 showP2wpkhNestedInP2shUnavailable();
139 } 139 }
140 if (seed != null) { 140 if (seed != null) {
141 phraseChanged(); 141 phraseChanged();
@@ -638,8 +638,8 @@
638 var self = this; 638 var self = this;
639 this.shouldGenerate = true; 639 this.shouldGenerate = true;
640 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked"); 640 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
641 var isBip49 = bip49TabSelected(); 641 var isP2wpkhNestedInP2sh = bip49TabSelected();
642 var bip49available = networkHasBip49(); 642 var p2wpkhNestedInP2shAvailable = networkHasBip49();
643 643
644 function init() { 644 function init() {
645 calculateValues(); 645 calculateValues();
@@ -684,8 +684,8 @@
684 address = convertRippleAdrr(address); 684 address = convertRippleAdrr(address);
685 } 685 }
686 // BIP49 addresses are different 686 // BIP49 addresses are different
687 if (isBip49) { 687 if (isP2wpkhNestedInP2sh) {
688 if (!bip49available) { 688 if (!p2wpkhNestedInP2shAvailable) {
689 return; 689 return;
690 } 690 }
691 var keyhash = bitcoinjs.bitcoin.crypto.hash160(key.getPublicKeyBuffer()); 691 var keyhash = bitcoinjs.bitcoin.crypto.hash160(key.getPublicKeyBuffer());
@@ -1166,7 +1166,7 @@
1166 } 1166 }
1167 1167
1168 function networkHasBip49() { 1168 function networkHasBip49() {
1169 return networks[DOM.network.val()].bip49available; 1169 return networks[DOM.network.val()].p2wpkhNestedInP2shAvailable;
1170 } 1170 }
1171 1171
1172 function bip49TabSelected() { 1172 function bip49TabSelected() {
@@ -1178,12 +1178,12 @@
1178 DOM.bip49coin.val(coinValue); 1178 DOM.bip49coin.val(coinValue);
1179 } 1179 }
1180 1180
1181 function showBip49() { 1181 function showP2wpkhNestedInP2shAvailable() {
1182 DOM.bip49unavailable.addClass("hidden"); 1182 DOM.bip49unavailable.addClass("hidden");
1183 DOM.bip49available.removeClass("hidden"); 1183 DOM.bip49available.removeClass("hidden");
1184 } 1184 }
1185 1185
1186 function hideBip49() { 1186 function showP2wpkhNestedInP2shUnavailable() {
1187 DOM.bip49available.addClass("hidden"); 1187 DOM.bip49available.addClass("hidden");
1188 DOM.bip49unavailable.removeClass("hidden"); 1188 DOM.bip49unavailable.removeClass("hidden");
1189 } 1189 }
@@ -1191,7 +1191,7 @@
1191 var networks = [ 1191 var networks = [
1192 { 1192 {
1193 name: "BCH - Bitcoin Cash", 1193 name: "BCH - Bitcoin Cash",
1194 bip49available: false, 1194 p2wpkhNestedInP2shAvailable: false,
1195 onSelect: function() { 1195 onSelect: function() {
1196 network = bitcoinjs.bitcoin.networks.bitcoin; 1196 network = bitcoinjs.bitcoin.networks.bitcoin;
1197 setHdCoin(145); 1197 setHdCoin(145);
@@ -1199,7 +1199,7 @@
1199 }, 1199 },
1200 { 1200 {
1201 name: "BTC - Bitcoin", 1201 name: "BTC - Bitcoin",
1202 bip49available: true, 1202 p2wpkhNestedInP2shAvailable: true,
1203 onSelect: function() { 1203 onSelect: function() {
1204 network = bitcoinjs.bitcoin.networks.bitcoin; 1204 network = bitcoinjs.bitcoin.networks.bitcoin;
1205 setHdCoin(0); 1205 setHdCoin(0);
@@ -1207,7 +1207,7 @@
1207 }, 1207 },
1208 { 1208 {
1209 name: "BTC - Bitcoin Testnet", 1209 name: "BTC - Bitcoin Testnet",
1210 bip49available: true, 1210 p2wpkhNestedInP2shAvailable: true,
1211 onSelect: function() { 1211 onSelect: function() {
1212 network = bitcoinjs.bitcoin.networks.testnet; 1212 network = bitcoinjs.bitcoin.networks.testnet;
1213 setHdCoin(1); 1213 setHdCoin(1);
@@ -1215,7 +1215,7 @@
1215 }, 1215 },
1216 { 1216 {
1217 name: "CLAM - Clams", 1217 name: "CLAM - Clams",
1218 bip49available: false, 1218 p2wpkhNestedInP2shAvailable: false,
1219 onSelect: function() { 1219 onSelect: function() {
1220 network = bitcoinjs.bitcoin.networks.clam; 1220 network = bitcoinjs.bitcoin.networks.clam;
1221 setHdCoin(23); 1221 setHdCoin(23);
@@ -1223,7 +1223,7 @@
1223 }, 1223 },
1224 { 1224 {
1225 name: "CRW - Crown", 1225 name: "CRW - Crown",
1226 bip49available: false, 1226 p2wpkhNestedInP2shAvailable: false,
1227 onSelect: function() { 1227 onSelect: function() {
1228 network = bitcoinjs.bitcoin.networks.crown; 1228 network = bitcoinjs.bitcoin.networks.crown;
1229 setHdCoin(72); 1229 setHdCoin(72);
@@ -1231,7 +1231,7 @@
1231 }, 1231 },
1232 { 1232 {
1233 name: "DASH - Dash", 1233 name: "DASH - Dash",
1234 bip49available: false, 1234 p2wpkhNestedInP2shAvailable: false,
1235 onSelect: function() { 1235 onSelect: function() {
1236 network = bitcoinjs.bitcoin.networks.dash; 1236 network = bitcoinjs.bitcoin.networks.dash;
1237 setHdCoin(5); 1237 setHdCoin(5);
@@ -1239,7 +1239,7 @@
1239 }, 1239 },
1240 { 1240 {
1241 name: "DASH - Dash Testnet", 1241 name: "DASH - Dash Testnet",
1242 bip49available: false, 1242 p2wpkhNestedInP2shAvailable: false,
1243 onSelect: function() { 1243 onSelect: function() {
1244 network = bitcoinjs.bitcoin.networks.dashtn; 1244 network = bitcoinjs.bitcoin.networks.dashtn;
1245 setHdCoin(1); 1245 setHdCoin(1);
@@ -1247,7 +1247,7 @@
1247 }, 1247 },
1248 { 1248 {
1249 name: "DOGE - Dogecoin", 1249 name: "DOGE - Dogecoin",
1250 bip49available: false, 1250 p2wpkhNestedInP2shAvailable: false,
1251 onSelect: function() { 1251 onSelect: function() {
1252 network = bitcoinjs.bitcoin.networks.dogecoin; 1252 network = bitcoinjs.bitcoin.networks.dogecoin;
1253 setHdCoin(3); 1253 setHdCoin(3);
@@ -1255,7 +1255,7 @@
1255 }, 1255 },
1256 { 1256 {
1257 name: "ETH - Ethereum", 1257 name: "ETH - Ethereum",
1258 bip49available: false, 1258 p2wpkhNestedInP2shAvailable: false,
1259 onSelect: function() { 1259 onSelect: function() {
1260 network = bitcoinjs.bitcoin.networks.bitcoin; 1260 network = bitcoinjs.bitcoin.networks.bitcoin;
1261 setHdCoin(60); 1261 setHdCoin(60);
@@ -1263,7 +1263,7 @@
1263 }, 1263 },
1264 { 1264 {
1265 name: "GAME - GameCredits", 1265 name: "GAME - GameCredits",
1266 bip49available: false, 1266 p2wpkhNestedInP2shAvailable: false,
1267 onSelect: function() { 1267 onSelect: function() {
1268 network = bitcoinjs.bitcoin.networks.game; 1268 network = bitcoinjs.bitcoin.networks.game;
1269 setHdCoin(101); 1269 setHdCoin(101);
@@ -1271,7 +1271,7 @@
1271 }, 1271 },
1272 { 1272 {
1273 name: "JBS - Jumbucks", 1273 name: "JBS - Jumbucks",
1274 bip49available: false, 1274 p2wpkhNestedInP2shAvailable: false,
1275 onSelect: function() { 1275 onSelect: function() {
1276 network = bitcoinjs.bitcoin.networks.jumbucks; 1276 network = bitcoinjs.bitcoin.networks.jumbucks;
1277 setHdCoin(26); 1277 setHdCoin(26);
@@ -1279,7 +1279,7 @@
1279 }, 1279 },
1280 { 1280 {
1281 name: "LTC - Litecoin", 1281 name: "LTC - Litecoin",
1282 bip49available: false, 1282 p2wpkhNestedInP2shAvailable: false,
1283 onSelect: function() { 1283 onSelect: function() {
1284 network = bitcoinjs.bitcoin.networks.litecoin; 1284 network = bitcoinjs.bitcoin.networks.litecoin;
1285 setHdCoin(2); 1285 setHdCoin(2);
@@ -1288,7 +1288,7 @@
1288 }, 1288 },
1289 { 1289 {
1290 name: "MAZA - Maza", 1290 name: "MAZA - Maza",
1291 bip49available: false, 1291 p2wpkhNestedInP2shAvailable: false,
1292 onSelect: function() { 1292 onSelect: function() {
1293 network = bitcoinjs.bitcoin.networks.maza; 1293 network = bitcoinjs.bitcoin.networks.maza;
1294 setHdCoin(13); 1294 setHdCoin(13);
@@ -1297,7 +1297,7 @@
1297 1297
1298 { 1298 {
1299 name: "NMC - Namecoin", 1299 name: "NMC - Namecoin",
1300 bip49available: false, 1300 p2wpkhNestedInP2shAvailable: false,
1301 onSelect: function() { 1301 onSelect: function() {
1302 network = bitcoinjs.bitcoin.networks.namecoin; 1302 network = bitcoinjs.bitcoin.networks.namecoin;
1303 setHdCoin(7); 1303 setHdCoin(7);
@@ -1305,7 +1305,7 @@
1305 }, 1305 },
1306 { 1306 {
1307 name: "PIVX - PIVX", 1307 name: "PIVX - PIVX",
1308 bip49available: false, 1308 p2wpkhNestedInP2shAvailable: false,
1309 onSelect: function() { 1309 onSelect: function() {
1310 network = bitcoinjs.bitcoin.networks.pivx; 1310 network = bitcoinjs.bitcoin.networks.pivx;
1311 setHdCoin(119); 1311 setHdCoin(119);
@@ -1313,7 +1313,7 @@
1313 }, 1313 },
1314 { 1314 {
1315 name: "PIVX - PIVX Testnet", 1315 name: "PIVX - PIVX Testnet",
1316 bip49available: false, 1316 p2wpkhNestedInP2shAvailable: false,
1317 onSelect: function() { 1317 onSelect: function() {
1318 network = bitcoinjs.bitcoin.networks.pivxtestnet; 1318 network = bitcoinjs.bitcoin.networks.pivxtestnet;
1319 setHdCoin(1); 1319 setHdCoin(1);
@@ -1321,7 +1321,7 @@
1321 }, 1321 },
1322 { 1322 {
1323 name: "PPC - Peercoin", 1323 name: "PPC - Peercoin",
1324 bip49available: false, 1324 p2wpkhNestedInP2shAvailable: false,
1325 onSelect: function() { 1325 onSelect: function() {
1326 network = bitcoinjs.bitcoin.networks.peercoin; 1326 network = bitcoinjs.bitcoin.networks.peercoin;
1327 setHdCoin(6); 1327 setHdCoin(6);
@@ -1329,7 +1329,7 @@
1329 }, 1329 },
1330 { 1330 {
1331 name: "SDC - ShadowCash", 1331 name: "SDC - ShadowCash",
1332 bip49available: false, 1332 p2wpkhNestedInP2shAvailable: false,
1333 onSelect: function() { 1333 onSelect: function() {
1334 network = bitcoinjs.bitcoin.networks.shadow; 1334 network = bitcoinjs.bitcoin.networks.shadow;
1335 setHdCoin(35); 1335 setHdCoin(35);
@@ -1337,7 +1337,7 @@
1337 }, 1337 },
1338 { 1338 {
1339 name: "SDC - ShadowCash Testnet", 1339 name: "SDC - ShadowCash Testnet",
1340 bip49available: false, 1340 p2wpkhNestedInP2shAvailable: false,
1341 onSelect: function() { 1341 onSelect: function() {
1342 network = bitcoinjs.bitcoin.networks.shadowtn; 1342 network = bitcoinjs.bitcoin.networks.shadowtn;
1343 setHdCoin(1); 1343 setHdCoin(1);
@@ -1345,7 +1345,7 @@
1345 }, 1345 },
1346 { 1346 {
1347 name: "SLM - Slimcoin", 1347 name: "SLM - Slimcoin",
1348 bip49available: false, 1348 p2wpkhNestedInP2shAvailable: false,
1349 onSelect: function() { 1349 onSelect: function() {
1350 network = bitcoinjs.bitcoin.networks.slimcoin; 1350 network = bitcoinjs.bitcoin.networks.slimcoin;
1351 setHdCoin(63); 1351 setHdCoin(63);
@@ -1353,7 +1353,7 @@
1353 }, 1353 },
1354 { 1354 {
1355 name: "SLM - Slimcoin Testnet", 1355 name: "SLM - Slimcoin Testnet",
1356 bip49available: false, 1356 p2wpkhNestedInP2shAvailable: false,
1357 onSelect: function() { 1357 onSelect: function() {
1358 network = bitcoinjs.bitcoin.networks.slimcointn; 1358 network = bitcoinjs.bitcoin.networks.slimcointn;
1359 setHdCoin(111); 1359 setHdCoin(111);
@@ -1361,7 +1361,7 @@
1361 }, 1361 },
1362 { 1362 {
1363 name: "VIA - Viacoin", 1363 name: "VIA - Viacoin",
1364 bip49available: false, 1364 p2wpkhNestedInP2shAvailable: false,
1365 onSelect: function() { 1365 onSelect: function() {
1366 network = bitcoinjs.bitcoin.networks.viacoin; 1366 network = bitcoinjs.bitcoin.networks.viacoin;
1367 setHdCoin(14); 1367 setHdCoin(14);
@@ -1369,7 +1369,7 @@
1369 }, 1369 },
1370 { 1370 {
1371 name: "VIA - Viacoin Testnet", 1371 name: "VIA - Viacoin Testnet",
1372 bip49available: false, 1372 p2wpkhNestedInP2shAvailable: false,
1373 onSelect: function() { 1373 onSelect: function() {
1374 network = bitcoinjs.bitcoin.networks.viacointestnet; 1374 network = bitcoinjs.bitcoin.networks.viacointestnet;
1375 setHdCoin(1); 1375 setHdCoin(1);
@@ -1377,7 +1377,7 @@
1377 }, 1377 },
1378 { 1378 {
1379 name: "XMY - Myriadcoin", 1379 name: "XMY - Myriadcoin",
1380 bip49available: false, 1380 p2wpkhNestedInP2shAvailable: false,
1381 onSelect: function() { 1381 onSelect: function() {
1382 network = bitcoinjs.bitcoin.networks.myriadcoin; 1382 network = bitcoinjs.bitcoin.networks.myriadcoin;
1383 setHdCoin(90); 1383 setHdCoin(90);
@@ -1385,7 +1385,7 @@
1385 }, 1385 },
1386 { 1386 {
1387 name: "XRP - Ripple", 1387 name: "XRP - Ripple",
1388 bip49available: false, 1388 p2wpkhNestedInP2shAvailable: false,
1389 onSelect: function() { 1389 onSelect: function() {
1390 network = bitcoinjs.bitcoin.networks.bitcoin; 1390 network = bitcoinjs.bitcoin.networks.bitcoin;
1391 setHdCoin(144); 1391 setHdCoin(144);