aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorjhonkus <putukn@gmail.com>2020-12-07 20:25:25 +0800
committerjhonkus <putukn@gmail.com>2020-12-07 20:25:25 +0800
commit6d2e202083c4166aa4be8557789a8a461df6bd5c (patch)
treef360db3ad1a2de8fe1f5fda0f864f0a2134d4c4c /src/js
parent0cb81e1117053c93debfa501a5bdb11169636dd2 (diff)
downloadBIP39-6d2e202083c4166aa4be8557789a8a461df6bd5c.tar.gz
BIP39-6d2e202083c4166aa4be8557789a8a461df6bd5c.tar.zst
BIP39-6d2e202083c4166aa4be8557789a8a461df6bd5c.zip
Add ZooBC address format
Diffstat (limited to 'src/js')
-rw-r--r--src/js/index.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/js/index.js b/src/js/index.js
index 61a2dd5..1f4cc1f 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -1348,6 +1348,27 @@
1348 address = libs.bchaddrSlp.toSlpAddress(address); 1348 address = libs.bchaddrSlp.toSlpAddress(address);
1349 } 1349 }
1350 } 1350 }
1351
1352 // ZooBC address format may vary
1353 if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") {
1354
1355 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
1356 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
1357 var path = "m/";
1358 path += purpose + "'/";
1359 path += coin + "'/" + index + "'";
1360 var result = libs.zoobcUtil.getKeypair(path, seed);
1361
1362 let publicKey = result.pubKey.slice(1, 33);
1363 let privateKey = result.key;
1364
1365 privkey = privateKey.toString('hex');
1366 pubkey = publicKey.toString('hex');
1367
1368 indexText = path;
1369 address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC');
1370 }
1371
1351 // Segwit addresses are different 1372 // Segwit addresses are different
1352 if (isSegwit) { 1373 if (isSegwit) {
1353 if (!segwitAvailable) { 1374 if (!segwitAvailable) {