Add Starname (IOV) support

This commit is contained in:
Dave Puchyr
2021-02-25 15:51:45 +01:00
parent 23f393acfb
commit 20bd34b014
3 changed files with 34 additions and 10 deletions

View File

@@ -1350,21 +1350,21 @@
}
// ZooBC address format may vary
if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") {
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');
}
@@ -1425,7 +1425,14 @@
privkey = keyPair.d.toBuffer().toString("base64");
}
//Groestlcoin Addresses are different
if (networks[DOM.network.val()].name == "IOV - Starname") {
const hrp = "star";
address = CosmosBufferToAddress(keyPair.getPublicKeyBuffer(), hrp);
pubkey = CosmosBufferToPublic(keyPair.getPublicKeyBuffer(), hrp);
privkey = keyPair.d.toBuffer().toString("base64");
}
//Groestlcoin Addresses are different
if(isGRS()) {
if (isSegwit) {
@@ -2851,6 +2858,13 @@
},
},
{
name: "IOV - Starname",
onSelect: function() {
network = libs.bitcoin.networks.bitcoin;
setHdCoin(234);
},
},
{
name: "IXC - Ixcoin",
onSelect: function() {
network = libs.bitcoin.networks.ixcoin;