diff --git a/nodejs-assets/nodejs-project/api.js b/nodejs-assets/nodejs-project/api.js index 82952cf..6feddf5 100644 --- a/nodejs-assets/nodejs-project/api.js +++ b/nodejs-assets/nodejs-project/api.js @@ -5,19 +5,22 @@ class API { bitcoin: false, litecoin: false, bitcoinTestnet: false, - litecoinTestnet: false + litecoinTestnet: false, + vertcoin: false }; this.peer = { bitcoin: {}, litecoin: {}, bitcoinTestnet: {}, - litecoinTestnet: {} + litecoinTestnet: {}, + vertcoin: {} }; this.peers = { bitcoin: [], litecoin: [], bitcoinTestnet: [], - litecoinTestnet: [] + litecoinTestnet: [], + vertcoin: [] }; } diff --git a/nodejs-assets/nodejs-project/electrum-host-parse/fixture/peers.json b/nodejs-assets/nodejs-project/electrum-host-parse/fixture/peers.json index 7d877f2..433dd30 100644 --- a/nodejs-assets/nodejs-project/electrum-host-parse/fixture/peers.json +++ b/nodejs-assets/nodejs-project/electrum-host-parse/fixture/peers.json @@ -22,5 +22,16 @@ "litecoinTestnet": [ "electrum-ltc.bysh.me s51002 t51001", "electrum.ltc.xurious.com s51002 t51001" + ], + "vertcoin": [ + "fr1.vtconline.org t55001 s55002", + "uk1.vtconline.org t55001 s55002", + "vtc.horriblecoders.com t55001 s55002", + "vtc.lukechilds.co t55001 s55002", + "vtc-cce-1.coinomi.net t55001 s55002", + "vtc-cce-2.coinomi.net t55001 s55002", + "electrum.catpool.io t55001 s55002", + "electrum2.catpool.io t55001 s55002", + "www.verters.com t55001 s55002" ] } diff --git a/src/assets/vertcoin.png b/src/assets/vertcoin.png new file mode 100644 index 0000000..5c3e8fc Binary files /dev/null and b/src/assets/vertcoin.png differ diff --git a/src/components/TransactionDetail.js b/src/components/TransactionDetail.js index 9adb8d5..68cc99b 100644 --- a/src/components/TransactionDetail.js +++ b/src/components/TransactionDetail.js @@ -124,6 +124,7 @@ class TransactionDetail extends PureComponent { if (selectedCrypto === "bitcoinTestnet") url = `https://blockstream.info/testnet/tx/${txid}`; if (selectedCrypto === "litecoin") url = `https://chain.so/tx/LTC/${txid}`; if (selectedCrypto === "litecoinTestnet") url = `https://chain.so/tx/LTCTEST/${txid}`; + if (selectedCrypto === "vertcoin") url = `https://insight.vertcoin.org/tx/${txid}`; openUrl(url); }; @@ -134,6 +135,7 @@ class TransactionDetail extends PureComponent { if (selectedCrypto === "bitcoinTestnet") url = `https://blockstream.info/testnet/block-height/${block}`; if (selectedCrypto === "litecoin") url = `https://chain.so/block/LTC/${block}`; if (selectedCrypto === "litecoinTestnet") url = `https://chain.so/block/LTC/${block}`; + if (selectedCrypto === "vertcoin") url = `https://insight.vertcoin.org/block/${block}`; openUrl(url); }; @@ -144,6 +146,7 @@ class TransactionDetail extends PureComponent { if (selectedCrypto === "bitcoinTestnet") url = `https://blockstream.info/testnet/address/${address}`; if (selectedCrypto === "litecoin") url = `https://chain.so/address/LTC/${address}`; if (selectedCrypto === "litecoinTestnet") url = `https://chain.so/address/LTCTEST/${address}`; + if (selectedCrypto === "vertcoin") url = `https://insight.vertcoin.org/address/${address}`; openUrl(url); }; @@ -163,6 +166,9 @@ class TransactionDetail extends PureComponent { case "litecoinTestnet": url = `https://chain.so/tx/LTCTEST/${tx}`; break; + case "vertcoin": + url = `https://insight.vertcoin.org/tx/${tx}`; + break; default: return; } diff --git a/src/utils/networks.js b/src/utils/networks.js index 7f01ef0..c5f947d 100644 --- a/src/utils/networks.js +++ b/src/utils/networks.js @@ -43,7 +43,18 @@ const networks = { pubKeyHash: 0x6f, scriptHash: 0x3a, wif: 0xef - } + }, + vertcoin: { + messagePrefix: '\x18Vertcoin Signed Message:\n', + bech32: 'vtc', + bip32: { + public: 0x0488b21e, + private: 0x0488ade4 + }, + pubKeyHash: 0x47, + scriptHash: 0x05, + wif: 0x80 + }, }; //Returns an array of all available coins from the networks object. @@ -53,7 +64,8 @@ const supportsRbf = { bitcoin: true, bitcoinTestnet: true, litecoin: false, - litecoinTestnet: false + litecoinTestnet: false, + vertcoin: false }; const zeroValueItems = { @@ -61,6 +73,7 @@ const zeroValueItems = { bitcoinTestnet: 0, litecoin: 0, litecoinTestnet: 0, + vertcoin: 0, timestamp: null }; @@ -69,6 +82,7 @@ const arrayTypeItems = { bitcoinTestnet: [], litecoin: [], litecoinTestnet: [], + vertcoin: [], timestamp: null }; @@ -77,6 +91,7 @@ const objectTypeItems = { bitcoinTestnet: {}, litecoin: {}, litecoinTestnet: {}, + vertcoin: {}, timestamp: null }; @@ -97,13 +112,15 @@ const defaultWalletShape = { bitcoin: "84", bitcoinTestnet: "84", litecoin: "84", - litecoinTestnet: "84" + litecoinTestnet: "84", + vertcoin: "84" }, addressType: { //Accepts bech32, segwit, legacy bitcoin: "bech32", bitcoinTestnet: "bech32", litecoin: "bech32", - litecoinTestnet: "bech32" + litecoinTestnet: "bech32", + vertcoin: "bech32" }, rbfData: objectTypeItems }; @@ -118,6 +135,8 @@ const getCoinImage = (coin = "bitcoin") => { return require(`../assets/bitcoin.png`); case "litecoin": return require(`../assets/litecoin.png`); + case "vertcoin": + return require(`../assets/vertcoin.png`); default: return require(`../assets/bitcoin.png`); } @@ -145,6 +164,9 @@ const getCoinData = ({ selectedCrypto = "bitcoin", cryptoUnit = "satoshi" }) => satoshi = "litoshi"; acronym = cryptoUnit === "satoshi" ? "lits" : "LTC"; return { acronym, label: "Litecoin Testnet", crypto: "LTC", satoshi }; + case "vertcoin": + acronym = cryptoUnit === "satoshi" ? "sats" : "VTC"; + return { acronym, label: "Vertcoin", crypto: "VTC", satoshi }; default: acronym = cryptoUnit === "satoshi" ? "sats" : "BTC"; return { acronym, label: "Bitcoin", crypto: "BTC" }; diff --git a/src/utils/walletApi.js b/src/utils/walletApi.js index 6de0008..ed93a62 100644 --- a/src/utils/walletApi.js +++ b/src/utils/walletApi.js @@ -414,6 +414,11 @@ const fallbackBroadcastTransaction = async ({ rawTx = "", selectedCrypto = "bitc response = await response.json(); response = response.status === "success" ? response.data.txid : ""; break; + case "vertcoin": + response = await fetch(`https://insight.vertcoin.org/insight-vtc-api/tx/send`, fetchData("POST", { rawtx: rawTx })); + response = await response.json(); + response = response.status === "success" ? response.data.txid : ""; + break; } if (response !== "") return { error: false, data: response }; return { error: true, data: "" };