Skip to content

Commit

Permalink
The changes here reflect the changes specified in the following guide…
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyphillips committed Jul 5, 2019
1 parent 932d2bf commit 0eeecde
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 7 deletions.
9 changes: 6 additions & 3 deletions nodejs-assets/nodejs-project/api.js
Expand Up @@ -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: []
};
}

Expand Down
Expand Up @@ -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"
]
}
Binary file added src/assets/vertcoin.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/components/TransactionDetail.js
Expand Up @@ -124,6 +124,7 @@ class TransactionDetail extends PureComponent <Props> {
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);
};

Expand All @@ -134,6 +135,7 @@ class TransactionDetail extends PureComponent <Props> {
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);
};

Expand All @@ -144,6 +146,7 @@ class TransactionDetail extends PureComponent <Props> {
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);
};

Expand All @@ -163,6 +166,9 @@ class TransactionDetail extends PureComponent <Props> {
case "litecoinTestnet":
url = `https://chain.so/tx/LTCTEST/${tx}`;
break;
case "vertcoin":
url = `https://insight.vertcoin.org/tx/${tx}`;
break;
default:
return;
}
Expand Down
30 changes: 26 additions & 4 deletions src/utils/networks.js
Expand Up @@ -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.
Expand All @@ -53,14 +64,16 @@ const supportsRbf = {
bitcoin: true,
bitcoinTestnet: true,
litecoin: false,
litecoinTestnet: false
litecoinTestnet: false,
vertcoin: false
};

const zeroValueItems = {
bitcoin: 0,
bitcoinTestnet: 0,
litecoin: 0,
litecoinTestnet: 0,
vertcoin: 0,
timestamp: null
};

Expand All @@ -69,6 +82,7 @@ const arrayTypeItems = {
bitcoinTestnet: [],
litecoin: [],
litecoinTestnet: [],
vertcoin: [],
timestamp: null
};

Expand All @@ -77,6 +91,7 @@ const objectTypeItems = {
bitcoinTestnet: {},
litecoin: {},
litecoinTestnet: {},
vertcoin: {},
timestamp: null
};

Expand All @@ -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
};
Expand All @@ -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`);
}
Expand Down Expand Up @@ -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" };
Expand Down
5 changes: 5 additions & 0 deletions src/utils/walletApi.js
Expand Up @@ -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: "" };
Expand Down

0 comments on commit 0eeecde

Please sign in to comment.