Browse Source

34 new coins

insight-spv
pbca26 7 years ago
parent
commit
53cc07670e
  1. 529
      routes/electrumjs/electrumjs.networks.js
  2. 51
      routes/shepherd/electrum/insight.js
  3. 18
      routes/shepherd/electrum/network.js

529
routes/electrumjs/electrumjs.networks.js

@ -56,18 +56,16 @@ networks.monacoin = {
dustThreshold: 546, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/core.h#L151-L162
};
// https://github.com/gamecredits-project/GameCredits/blob/master/src/chainparams.cpp#L136
networks.game = {
messagePrefix: '\x19GameCredits Signed Message:\n',
bip32: {
public: 0x043587cf,
private: 0x04358394,
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef,
dustThreshold: 546, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/core.h#L151-L162
pubKeyHash: 0x26,
scriptHash: 0x5,
wif: 0xA6,
dustThreshold: 546,
};
// https://github.com/dashpay/dash/blob/master/src/chainparams.cpp#L171
@ -84,11 +82,11 @@ networks.dash = {
};
// https://github.com/zcoinofficial/zcoin/blob/c93eccb39b07a6132cb3d787ac18be406b24c3fa/src/base58.h#L275
networks.zcoin = {
networks.xzc = {
messagePrefix: '\x19ZCoin Signed Message:\n',
bip32: {
public: 0x0488b21e, // todo
private: 0x0488ade4, // todo
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x52,
scriptHash: 0x07,
@ -375,7 +373,7 @@ networks.grs = { // fails to gen a proper addr
};
networks.aby = {
messagePrefix: '\x19Crown Signed Message:\n',
messagePrefix: '\x19ArtByte Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
@ -386,6 +384,513 @@ networks.aby = {
dustThreshold: 1000,
};
networks.mac = {
messagePrefix: '\x19Machinecoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x32,
scriptHash: 0x5,
wif: 0xB2,
dustThreshold: 1000,
};
networks.vot = {
messagePrefix: '\x19VoteCoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x05358394,
},
pubKeyHash: 0x1cb8,
scriptHash: 0x1cbd,
wif: 0x80,
dustThreshold: 1000,
};
networks.iop = {
messagePrefix: '\x19IOP Signed Message:\n',
bip32: {
public: 0x2780915F,
private: 0xAE3416F6,
},
pubKeyHash: 0x75,
scriptHash: 0xAE,
wif: 0x31,
dustThreshold: 1000,
};
networks.bdl = {
messagePrefix: '\x19Bitdeal Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x26,
scriptHash: 0x5,
wif: 0xB0,
dustThreshold: 1000,
};
networks.btcp = {
messagePrefix: '\x19BitcoinPrivate Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x1325,
scriptHash: 0x13AF,
wif: 0x80,
dustThreshold: 1000,
};
// https://github.com/zencashio/zen/blob/master/src/chainparams.cpp#L118
networks.zen = { // new address type
messagePrefix: '\x19Zencashio Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x2089,
scriptHash: 0x2086,
wif: 0x80,
dustThreshold: 1000,
};
networks.sys = { // zec based
messagePrefix: '\x19Syscoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x3F,
scriptHash: 0x5,
wif: 0x80,
dustThreshold: 1000,
};
networks.emc2 = {
messagePrefix: '\x19Einsteinium Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x21,
scriptHash: 0x5,
wif: 0x37,
dustThreshold: 1000,
};
// https://github.com/BTA-BATA/BATA-SOURCE/blob/master/src/chainparams.cpp#L156
networks.bta = {
messagePrefix: '\x19Bata Signed Message:\n',
bip32: {
public: 0xA40C86FA,
private: 0xA40B91BD,
},
pubKeyHash: 0x19,
scriptHash: 0x5,
wif: 0x55,
dustThreshold: 1000,
};
// https://github.com/EuropecoinEUORG/Europecoin-V3/blob/master/src/chainparams.cpp#L139
networks.erc = {
messagePrefix: '\x19Europecoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x21,
scriptHash: 0x5,
wif: 0x28 + 128,
dustThreshold: 1000,
};
// https://github.com/lbryio/lbrycrd/blob/master/src/chainparams.cpp#L176
networks.lbc = {
messagePrefix: '\x19LBRY Credits Signed Message:\n',
bip32: {
public: 0x019C354f,
private: 0x019C3118,
},
pubKeyHash: 0x55,
scriptHash: 0x7a,
wif: 0x1c,
dustThreshold: 1000,
};
// https://github.com/LIMXTEC/BitSend/blob/master/src/chainparams.cpp#L136
networks.bsd = {
messagePrefix: '\x19Bitsend Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x66,
scriptHash: 0x5,
wif: 0xCC,
dustThreshold: 1000,
};
// https://github.com/gobytecoin/gobyte/blob/master/src/chainparams.cpp#L127
networks.gbx = {
messagePrefix: '\x19GoByte Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x26,
scriptHash: 0xA,
wif: 0xC6,
dustThreshold: 1000,
};
// https://github.com/Electronic-Gulden-Foundation/egulden/blob/master/src/chainparams.cpp#L139
networks.efl = {
messagePrefix: '\x19E-Gulden Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x30,
scriptHash: 0x5,
wif: 0xB0,
dustThreshold: 1000,
};
// https://github.com/Whitecoin-org/whitecoin/blob/master/src/chainparams.cpp#L91
networks.xwc = { // wrong address generated
messagePrefix: '\x19Whitecoin Signed Message:\n',
bip32: {
public: 0x043587CF,
private: 0x04358394,
},
pubKeyHash: 0x6F,
scriptHash: 0xC4,
wif: 0xEF,
dustThreshold: 1000,
};
// https://github.com/vivocoin/vivo/blob/master/src/chainparams.cpp#L133
networks.vivo = {
messagePrefix: '\x19Vivo Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x46,
scriptHash: 0xA,
wif: 0xC6,
dustThreshold: 1000,
};
networks.xvg = {
messagePrefix: '\x19Verge Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x1e,
scriptHash: 0x9e,
wif: 0x6,
dustThreshold: 1000,
};
networks.vcash = { // wrong address generated
messagePrefix: '\x19Vcash Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x47,
scriptHash: 0xc7,
wif: 0x6,
dustThreshold: 1000,
};
// https://github.com/unobtanium-official/Unobtanium/blob/master/src/chainparams.cpp#L157
networks.uno = {
messagePrefix: '\x19Unobtanium Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x82,
scriptHash: 0x1E,
wif: 0xBF,
dustThreshold: 1000,
};
networks.smart = { // wrong address generated
messagePrefix: '\x19Smartcash Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x3F,
scriptHash: 0x12,
wif: 0xBF,
dustThreshold: 1000,
};
// https://github.com/reddcoin-project/reddcoin/blob/master/src/chainparams.cpp#L79
networks.rdd = {
messagePrefix: '\x19Reddcoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x3D,
scriptHash: 0x5,
wif: 0xBD,
dustThreshold: 1000,
};
// https://github.com/PIVX-Project/PIVX/blob/master/src/chainparams.cpp#L180
networks.pivx = {
messagePrefix: '\x19Pivx Signed Message:\n',
bip32: {
public: 0x022D2533,
private: 0x0221312B,
},
pubKeyHash: 0x1E,
scriptHash: 0xD,
wif: 0xD4,
dustThreshold: 1000,
};
// https://github.com/OmniLayer/omnicore/blob/master/src/chainparams.cpp#L128
networks.omni = {
messagePrefix: '\x19OmniLayer Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x0,
scriptHash: 0x5,
wif: 0x80,
dustThreshold: 1000,
};
networks.ok = {
messagePrefix: '\x19OKCash Signed Message:\n',
bip32: {
public: 0x03CC23D7,
private: 0x03CC1C73,
},
pubKeyHash: 0x37,
scriptHash: 0x1C,
wif: 0xB7,
dustThreshold: 1000,
};
networks.neos = {
messagePrefix: '\x19Neoscoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x35,
scriptHash: 0x5,
wif: 0xB1,
dustThreshold: 1000,
};
// https://github.com/NAVCoin/navcoin-core/blob/master/src/chainparams.cpp#L160
networks.nav = {
messagePrefix: '\x19Navcoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x35,
scriptHash: 0x55,
wif: 0x96,
dustThreshold: 1000,
};
// https://github.com/minexcoin/minexcoin/blob/master/src/chainparams.cpp#L259
networks.mnx = {
messagePrefix: '\x19Minexcoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x4B,
scriptHash: 0x5,
wif: 0x80,
dustThreshold: 1000,
};
networks.lcc = {
messagePrefix: '\x19Litecoin Cash Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x1C,
scriptHash: 0x5,
wif: 0x32,
dustThreshold: 1000,
};
// https://github.com/Gulden/gulden-official/blob/master/src/chainparams.cpp#L128
networks.nlg = {
messagePrefix: '\x19Gulden Cash Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x26,
scriptHash: 0x62,
wif: 0x26 + 128,
dustThreshold: 1000,
};
// https://github.com/fujicoin/fujicoin/blob/master/src/chainparams.cpp#L132
networks.fjc = {
messagePrefix: '\x19Fujicoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x24,
scriptHash: 0x10,
wif: 0xA4,
dustThreshold: 1000,
};
// https://github.com/flash-coin/bitcore-lib/commit/97d72267f3577173ee90d46b43553af801b214f2#diff-014a66be6f0ee0e90f9357d497267195R144
networks.flash = {
messagePrefix: '\x19Flash Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x44,
scriptHash: 0x82,
wif: 0xc4,
dustThreshold: 1000,
};
// https://github.com/FeatherCoin/Feathercoin/blob/master-0.13/src/chainparams.cpp#L132
networks.ftc = {
messagePrefix: '\x19FeatherCoin Signed Message:\n',
bip32: {
public: 0x048BC26,
private: 0x0488DAEE,
},
pubKeyHash: 0xE,
scriptHash: 0x5,
wif: 0x8E,
dustThreshold: 1000,
};
// https://github.com/exclfork/ExclusiveCoin/blob/master/src/chainparams.cpp#L82
networks.excl = {
messagePrefix: '\x19ExclusiveCoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x21,
scriptHash: 0x89,
wif: 0xA1,
dustThreshold: 1000,
};
// https://github.com/DMDcoin/Diamond/blob/master/src/chainparams.cpp#L166
networks.dmd = {
messagePrefix: '\x19Diamond Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x5A,
scriptHash: 0x8,
wif: 0xDA,
dustThreshold: 1000,
};
// https://github.com/CooleRRSA/crave/blob/master/src/chainparams.cpp#L99
networks.crave = { // wrong address generated, another fork is used?
messagePrefix: '\x19Crave Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x1B,
scriptHash: 0x55,
wif: 0x99,
dustThreshold: 1000,
};
// https://github.com/BitClubDev/ClubCoin/blob/master/src/chainparams.cpp#L114
networks.club = {
messagePrefix: '\x19ClubCoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x1C,
scriptHash: 0x55,
wif: 0x99,
dustThreshold: 1000,
};
// https://github.com/nochowderforyou/clams/blob/master/src/chainparams.cpp#L93
networks.clam = {
messagePrefix: '\x19Clams Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x89,
scriptHash: 0xD,
wif: 0x85,
dustThreshold: 1000,
};
// https://github.com/bitcoin-atom/bitcoin-atom/blob/master/src/chainparams.cpp#L168
networks.bca = {
messagePrefix: '\x19Bitcoin Atom Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x17,
scriptHash: 0xA,
wif: 0x80,
dustThreshold: 1000,
};
// https://github.com/aurarad/Auroracoin/blob/master/src/chainparams.cpp#L77
networks.aur = {
messagePrefix: '\x19Auroracoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x17,
scriptHash: 0xA,
wif: 0xB0,
dustThreshold: 1000,
};
// https://github.com/adcoin-project/AdCoin/blob/master/src/chainparams.cpp#L129
networks.acc = {
messagePrefix: '\x19AdCoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x17,
scriptHash: 0x5,
wif: 0xB0,
dustThreshold: 1000,
};
networks.btc = networks.bitcoin;
networks.crw = networks.crown;
networks.dgb = networks.digibyte;

51
routes/shepherd/electrum/insight.js

@ -16,6 +16,34 @@ module.exports = (shepherd) => {
shepherd.insightJSCoreActiveCoin = electrumServer;
}
const apiRoutes = (type, address) => {
if (shepherd.insightJSCoreActiveCoin.nonStdApi) {
switch (type) {
case 'transactions':
return shepherd.insightJSCoreActiveCoin.nonStdApi.transactions.replace('{address}', address);
break;
case 'utxo':
return shepherd.insightJSCoreActiveCoin.nonStdApi.transactions.replace('{utxo}', address);
break;
case 'push':
return shepherd.insightJSCoreActiveCoin.nonStdApi.push;
break;
}
} else {
switch (type) {
case 'transactions':
return `txs/?address=${address}`;
break;
case 'utxo':
return `addr/${address}/utxo`;
break;
case 'push':
return 'tx/send';
break;
}
}
};
return {
insight: true,
connect: () => {
@ -29,11 +57,11 @@ module.exports = (shepherd) => {
return new shepherd.Promise((resolve, reject) => {
let options = {
url: `${shepherd.insightJSCoreActiveCoin.address}/api/addr/${address}/utxo`,
url: `${shepherd.insightJSCoreActiveCoin.address}/${apiRoutes('utxo', address)}`,
method: 'GET',
};
console.log(`${shepherd.insightJSCoreActiveCoin.address}/api/addr/${address}/utxo`);
console.log(`${shepherd.insightJSCoreActiveCoin.address}/${apiRoutes('utxo', address)}`);
// send back body on both success and error
// this bit replicates iguana core's behaviour
@ -71,11 +99,11 @@ module.exports = (shepherd) => {
return new shepherd.Promise((resolve, reject) => {
let options = {
url: `${shepherd.insightJSCoreActiveCoin.address}/api/addr/${address}/utxo`,
url: `${shepherd.insightJSCoreActiveCoin.address}/${apiRoutes('utxo', address)}`,
method: 'GET',
};
console.log(`${shepherd.insightJSCoreActiveCoin.address}/api/addr/${address}/utxo`);
console.log(`${shepherd.insightJSCoreActiveCoin.address}/${apiRoutes('utxo', address)}`);
// send back body on both success and error
// this bit replicates iguana core's behaviour
@ -90,6 +118,10 @@ module.exports = (shepherd) => {
if (_parsedBody) {
let _utxos = [];
if (_parsedBody.utxo) {
_parsedBody = _parsedBody.utxo;
}
for (let i = 0; i < _parsedBody.length; i++) {
_utxos.push({
txid: _parsedBody[i].txid,
@ -120,25 +152,26 @@ module.exports = (shepherd) => {
return new shepherd.Promise((resolve, reject) => {
let options = {
url: `${shepherd.insightJSCoreActiveCoin.address}/api/txs/?address=${address}`,
url: `${shepherd.insightJSCoreActiveCoin.address}/${apiRoutes('transactions', address)}`,
method: 'GET',
};
console.log(`${shepherd.insightJSCoreActiveCoin.address}/api/txs/?address=${address}`);
console.log(`${shepherd.insightJSCoreActiveCoin.address}/${apiRoutes('transactions', address)}`);
// send back body on both success and error
// this bit replicates iguana core's behaviour
request(options, (error, response, body) => {
console.log(body);
if (response &&
response.statusCode &&
response.statusCode === 200) {
try {
const _parsedBody = JSON.parse(body);
console.log(_parsedBody.txs);
console.log(_parsedBody.txs || _parsedBody.transactions);
if (_parsedBody &&
_parsedBody.txs) {
const _txs = _parsedBody.txs;
(_parsedBody.txs || _parsedBody.transactions)) {
const _txs = _parsedBody.txs || _parsedBody.transactions;
let txs = [];
for (let i = 0; i < _txs.length; i++) {

18
routes/shepherd/electrum/network.js

@ -17,7 +17,19 @@ module.exports = (shepherd) => {
network === 'ZCL' ||
network === 'zcl' ||
network === 'BTCZ' ||
network === 'btcz') {
network === 'btcz' ||
network === 'VOT' ||
network === 'vot' ||
network === 'BTCP' ||
network === 'btcp' ||
network === 'XZC' ||
network === 'xzc' ||
network === 'ZEN' ||
network === 'zen' ||
network === 'SYS' ||
network === 'sys' ||
network === 'SMART' ||
network === 'smart') {
return true;
}
};
@ -26,7 +38,9 @@ module.exports = (shepherd) => {
if (network === 'BLK' ||
network === 'blk' ||
network === 'DNR' ||
network === 'dnr') {
network === 'dnr' ||
network === 'XWC' ||
network === 'xwc') {
return true;
}
};

Loading…
Cancel
Save