From 4d81c484ff9c6bef4e71c5d9d3e411c82274946d Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 7 Dec 2017 19:55:35 +0300 Subject: [PATCH] extend mm --- routes/shepherd.js | 4 ++- routes/shepherd/dex/electrumServersList.js | 39 ++++++++++++++++++++++ routes/shepherd/dex/mmControl.js | 13 +++++++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 routes/shepherd/dex/electrumServersList.js diff --git a/routes/shepherd.js b/routes/shepherd.js index 3fff883..e192537 100644 --- a/routes/shepherd.js +++ b/routes/shepherd.js @@ -48,8 +48,9 @@ shepherd.mmPublic = { isAuth: false, rates: {}, prices: [], - coinsHelper: [], + coinsHelper: {}, stats: [], + electrumServersList: {}, }; // spv vars and libs @@ -102,6 +103,7 @@ shepherd = require('./shepherd/electrum/estimate.js')(shepherd); shepherd = require('./shepherd/dex/coind.js')(shepherd); shepherd = require('./shepherd/dex/mmControl.js')(shepherd); shepherd = require('./shepherd/dex/mmRequest.js')(shepherd); +shepherd = require('./shepherd/dex/electrumServersList.js')(shepherd); // core shepherd = require('./shepherd/addCoinShortcuts.js')(shepherd); diff --git a/routes/shepherd/dex/electrumServersList.js b/routes/shepherd/dex/electrumServersList.js new file mode 100644 index 0000000..5f20781 --- /dev/null +++ b/routes/shepherd/dex/electrumServersList.js @@ -0,0 +1,39 @@ +// TODO: merge with spv mode + +const electrumServersList = { + "ARG": [{"173.212.225.176": 50081},{"136.243.45.140": 50081}], + "BET": [{"electrum2.cipig.net":10012},{"electrum1.cipig.net":10012}], + "BTC": [{"electrum2.cipig.net":10000},{"electrum1.cipig.net":10000}], + "BOTS": [{"electrum2.cipig.net":10007},{"electrum1.cipig.net":10007}], + "CHIPS": [{"173.212.225.176": 50076},{"136.243.45.140": 50076}], + "COQUI": [{"electrum2.cipig.net":10011},{"electrum1.cipig.net":10011}], + "CRW": [{"173.212.225.176": 50041},{"136.243.45.140": 50041}], + "CRYPTO": [{"electrum2.cipig.net":10008},{"electrum1.cipig.net":10008}], + "DASH": [{"173.212.225.176": 50098},{"136.243.45.140": 50098}], + "DEX": [{"electrum2.cipig.net":10006},{"electrum1.cipig.net":10006}], + "DGB": [{"136.243.45.140": 50022},{"173.212.225.176": 50022}], + "DOGE": [{"173.212.225.176": 50015},{"136.243.45.140": 50015}], + "EMC2": [{"173.212.225.176": 50079},{"136.243.45.140": 50079}], + "FAIR": [{"173.212.225.176": 50005},{"136.243.45.140": 50005}], + "HODL": [{"electrum2.cipig.net":10009},{"electrum1.cipig.net":10009}], + "HUSH": [{"173.212.225.176": 50013},{"136.243.45.140": 50013}], + "JUMBLR": [{"electrum2.cipig.net": 10004},{"electrum1.cipig.net": 10004}], + "KMD": [{"electrum2.cipig.net":10001},{"electrum1.cipig.net":10001}], + "LTC": [{"173.212.225.176": 50012},{"136.243.45.140": 50012}], + "MNZ": [{"electrum2.cipig.net":10002},{"electrum1.cipig.net":10002}], + "MONA": [{"173.212.225.176": 50002},{"136.243.45.140": 50002}], + "MSHARK": [{"electrum2.cipig.net": 10013},{"electrum1.cipig.net": 10013}], + "NMC": [{"173.212.225.176": 50036},{"136.243.45.140": 50036}], + "PANGEA": [{"electrum2.cipig.net": 10010},{"electrum1.cipig.net": 10010}], + "REVS": [{"electrum2.cipig.net": 10003},{"electrum1.cipig.net": 10003}], + "SUPERNET": [{"electrum2.cipig.net": 10005},{"electrum1.cipig.net": 10005}], + "VIA": [{"173.212.225.176": 50033},{"136.243.45.140": 50033}], + "VTC": [{"173.212.225.176": 50088},{"136.243.45.140": 50088}], + "WLC": [{"electrum2.cipig.net": 10014},{"electrum1.cipig.net": 10014}], + "ZEC": [{"173.212.225.176": 50032},{"136.243.45.140": 50032}] +}; + +module.exports = (shepherd) => { + shepherd.electrumServersList = electrumServersList; + return shepherd; +}; \ No newline at end of file diff --git a/routes/shepherd/dex/mmControl.js b/routes/shepherd/dex/mmControl.js index a34a7e2..aff51d4 100644 --- a/routes/shepherd/dex/mmControl.js +++ b/routes/shepherd/dex/mmControl.js @@ -62,7 +62,18 @@ module.exports = (shepherd) => { shepherd.getCoinsHelper = () => { const defaultCoinsListFile = path.join(__dirname, '../dex/coins.json'); - shepherd.mmPublic.coinsHelper = fs.readJsonSync(defaultCoinsListFile, { throws: false }); + const _coins = fs.readJsonSync(defaultCoinsListFile, { throws: false }); + let coins = {}; + + for (let i = 0; i < _coins.length; i++) { + coins[_coins[i].coin] = _coins[i]; + } + coins.MNZ.name = 'Monaize'; + coins.KMD = { coin: 'KMD', name: 'Komodo' }; + coins.BTC = { coin: 'BTC', name: 'Bitcoin' }; + coins.IOP.name = 'Internet of People'; + + shepherd.mmPublic.coinsHelper = coins; } shepherd.getRates = () => {