diff options
author | iancoleman <1281387+iancoleman@users.noreply.github.com> | 2021-02-11 12:55:36 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 12:55:36 +1100 |
commit | 8835afe8a2a01bb189a8712c0797ea60566f553a (patch) | |
tree | 60a337d4347bff529aeac0bc79c952c243176c52 /src/js/index.js | |
parent | 71573cb3800ff7708ae19dd22aecf15660a41cc4 (diff) | |
parent | 6d2e202083c4166aa4be8557789a8a461df6bd5c (diff) | |
download | BIP39-8835afe8a2a01bb189a8712c0797ea60566f553a.tar.gz BIP39-8835afe8a2a01bb189a8712c0797ea60566f553a.tar.zst BIP39-8835afe8a2a01bb189a8712c0797ea60566f553a.zip |
Merge pull request #462 from zoobc/master
Add ZooBC coin support
Diffstat (limited to 'src/js/index.js')
-rw-r--r-- | src/js/index.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/js/index.js b/src/js/index.js index fd8c16b..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) { |
@@ -3541,6 +3562,13 @@ | |||
3541 | }, | 3562 | }, |
3542 | }, | 3563 | }, |
3543 | { | 3564 | { |
3565 | name: "ZBC - ZooBlockchain", | ||
3566 | onSelect: function () { | ||
3567 | network = libs.bitcoin.networks.zoobc; | ||
3568 | setHdCoin(883); | ||
3569 | }, | ||
3570 | }, | ||
3571 | { | ||
3544 | name: "ZCL - Zclassic", | 3572 | name: "ZCL - Zclassic", |
3545 | onSelect: function() { | 3573 | onSelect: function() { |
3546 | network = libs.bitcoin.networks.zclassic; | 3574 | network = libs.bitcoin.networks.zclassic; |