X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fjs%2Findex.js;h=713b5e847c1a5da4046d89fccd790ca03e58c425;hb=545348d1594a428a604614b480a271f6450bf47a;hp=f7835fa9f92e208ddccfb7e31d8deb077cd3dc25;hpb=5b0b1a5c9aa61d3d5161ee1a7054bf49159dac70;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/src/js/index.js b/src/js/index.js index f7835fa..713b5e8 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1348,6 +1348,27 @@ address = libs.bchaddrSlp.toSlpAddress(address); } } + + // ZooBC address format may vary + if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") { + + var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44); + var coin = parseIntNoNaN(DOM.bip44coin.val(), 0); + var path = "m/"; + path += purpose + "'/"; + path += coin + "'/" + index + "'"; + var result = libs.zoobcUtil.getKeypair(path, seed); + + let publicKey = result.pubKey.slice(1, 33); + let privateKey = result.key; + + privkey = privateKey.toString('hex'); + pubkey = publicKey.toString('hex'); + + indexText = path; + address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC'); + } + // Segwit addresses are different if (isSegwit) { if (!segwitAvailable) { @@ -3547,6 +3568,13 @@ setHdCoin(136); }, }, + { + name: "ZBC - ZooBlockchain", + onSelect: function () { + network = libs.bitcoin.networks.zoobc; + setHdCoin(883); + }, + }, { name: "ZCL - Zclassic", onSelect: function() {