mirror of
https://github.com/alexgo-io/redstone-node.git
synced 2026-06-10 06:30:17 +08:00
Hatskier/config generation scripts (#15)
* script for config generation created * implemented scripts for token list generation for new fetchers * unused files removed * script structure created for token config generation script * script for token config generation created
This commit is contained in:
@@ -4,3 +4,7 @@
|
||||
```bash
|
||||
yarn start:dev --config ./sample-config.json
|
||||
```
|
||||
|
||||
## Adding new source
|
||||
- Don't forget to update color for it in tools/config/predefined-sources-config.json and run /tools/config/generate-sources-config.js
|
||||
- Create a manifest with the name of the newly added source and place it in `manifests` folder
|
||||
|
||||
272
src/config/sources.json
Normal file
272
src/config/sources.json
Normal file
@@ -0,0 +1,272 @@
|
||||
{
|
||||
"api-dojo-rapid": {
|
||||
"imgURI": "https://rapidapi.com/cdn/images?url=https://rapidapi-prod-apis.s3.amazonaws.com/f1/efaf50769f4fe1914234b035c3ff12/04b2a24093095ca016e1d83107aff2b9.png",
|
||||
"url": "https://rapidapi.com/apidojo/api/yahoo-finance1",
|
||||
"color": "#4d9fd1"
|
||||
},
|
||||
"yf-unofficial": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/YahooFinanceLogo.png/1200px-YahooFinanceLogo.png",
|
||||
"url": "https://www.npmjs.com/package/yahoo-finance",
|
||||
"color": "#531cc4"
|
||||
},
|
||||
"coingecko": {
|
||||
"imgURI": "https://static.coingecko.com/s/thumbnail-007177f3eca19695592f0b8b0eabbdae282b54154e1be912285c9034ea6cbaf2.png",
|
||||
"url": "https://www.coingecko.com/",
|
||||
"color": "#98c355"
|
||||
},
|
||||
"sushiswap": {
|
||||
"imgURI": "https://sushi.com/static/media/logo.dec926df.png",
|
||||
"url": "https://sushi.com/",
|
||||
"color": "#e45d9d"
|
||||
},
|
||||
"coinbase": {
|
||||
"imgURI": "https://images.ctfassets.net/q5ulk4bp65r7/1rFQCqoq8hipvVJSKdU3fQ/21ab733af7a8ab404e29b873ffb28348/coinbase-icon2.svg",
|
||||
"url": "https://www.coinbase.com/",
|
||||
"color": "#2a67d0"
|
||||
},
|
||||
"uniswap": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Uniswap_Logo.svg/1026px-Uniswap_Logo.svg.png",
|
||||
"url": "https://uniswap.org/",
|
||||
"color": "#e23275"
|
||||
},
|
||||
"kyber": {
|
||||
"imgURI": "https://cdn-images-1.medium.com/max/130/1*MwDrRuiVNgzyYfscMdW27g@2x.png",
|
||||
"url": "https://kyber.network/",
|
||||
"color": "#62c19c"
|
||||
},
|
||||
"verto": {
|
||||
"imgURI": "https://avatars.githubusercontent.com/u/69314266?s=200&v=4",
|
||||
"url": "https://verto.exchange/",
|
||||
"color": "#a176c2"
|
||||
},
|
||||
"ecb": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Logo_European_Central_Bank.svg/1242px-Logo_European_Central_Bank.svg.png",
|
||||
"url": "https://www.ecb.europa.eu/home/html/index.en.html",
|
||||
"color": "#10338e"
|
||||
},
|
||||
"aax": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/104140087-a27f2580-53c0-11eb-87c1-5d9e81208fe9.jpg",
|
||||
"url": "https://www.aaxpro.com",
|
||||
"color": "#327aee"
|
||||
},
|
||||
"aofex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/77670271-056d1080-6f97-11ea-9ac2-4268e9ed0c1f.jpg",
|
||||
"url": "https://aofex.com",
|
||||
"color": "#e4653d"
|
||||
},
|
||||
"ascendex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/112027508-47984600-8b48-11eb-9e17-d26459cc36c6.jpg",
|
||||
"url": "https://ascendex.com",
|
||||
"color": "#69cbe5"
|
||||
},
|
||||
"bequant": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/55248342-a75dfe00-525a-11e9-8aa2-05e9dca943c6.jpg",
|
||||
"url": "https://bequant.io",
|
||||
"color": "#e6e37f"
|
||||
},
|
||||
"bibox": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/77257418-3262b000-6c85-11ea-8fb8-20bdf20b3592.jpg",
|
||||
"url": "https://www.bibox365.com",
|
||||
"color": "#7196db"
|
||||
},
|
||||
"binance": {
|
||||
"imgURI": "https://cryptologos.cc/logos/binance-coin-bnb-logo.svg",
|
||||
"url": "https://www.binance.com/",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"binancecoinm": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg",
|
||||
"url": "https://www.binance.com",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"binanceus": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/65177307-217b7c80-da5f-11e9-876e-0b748ba0a358.jpg",
|
||||
"url": "https://www.binance.us",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"binanceusdm": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg",
|
||||
"url": "https://www.binance.com",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"bitcoincom": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/97296144-514fa300-1861-11eb-952b-3d55d492200b.jpg",
|
||||
"url": "https://exchange.bitcoin.com",
|
||||
"color": "#56bb8a"
|
||||
},
|
||||
"bitfinex": {
|
||||
"imgURI": "https://iconape.com/wp-content/png_logo_vector/bitfinex-leaf.png",
|
||||
"url": "https://www.bitfinex.com/",
|
||||
"color": "#769340"
|
||||
},
|
||||
"bitfinex2": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766244-e328a50c-5ed2-11e7-947b-041416579bb3.jpg",
|
||||
"url": "https://www.bitfinex.com",
|
||||
"color": "#769340"
|
||||
},
|
||||
"bitmex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766319-f653c6e6-5ed4-11e7-933d-f0bc3699ae8f.jpg",
|
||||
"url": "https://www.bitmex.com",
|
||||
"color": "#5759aa"
|
||||
},
|
||||
"bittrex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87153921-edf53180-c2c0-11ea-96b9-f2a9a95a455b.jpg",
|
||||
"url": "https://bittrex.com",
|
||||
"color": "#55b4f1"
|
||||
},
|
||||
"bitz": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87443304-fec5e000-c5fd-11ea-98f8-ba8e67f7eaff.jpg",
|
||||
"url": "https://www.bitz.com",
|
||||
"color": "#153086"
|
||||
},
|
||||
"btcturk": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87153926-efbef500-c2c0-11ea-9842-05b63612c4b9.jpg",
|
||||
"url": "https://www.btcturk.com",
|
||||
"color": "#1d54ed"
|
||||
},
|
||||
"bw": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/69436317-31128c80-0d52-11ea-91d1-eb7bb5818812.jpg",
|
||||
"url": "https://www.bw.com",
|
||||
"color": "#cc2c25"
|
||||
},
|
||||
"bybit": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg",
|
||||
"url": "https://www.bybit.com",
|
||||
"color": "#ecad42"
|
||||
},
|
||||
"cdax": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/102157692-fd406280-3e90-11eb-8d46-4511b617cd17.jpg",
|
||||
"url": "https://cdax.io",
|
||||
"color": "#5e94e2"
|
||||
},
|
||||
"cex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg",
|
||||
"url": "https://cex.io",
|
||||
"color": "#53b1b0"
|
||||
},
|
||||
"coinex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg",
|
||||
"url": "https://www.coinex.com",
|
||||
"color": "#68d9b6"
|
||||
},
|
||||
"crex24": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/47813922-6f12cc00-dd5d-11e8-97c6-70f957712d47.jpg",
|
||||
"url": "https://crex24.com",
|
||||
"color": "#4a9b9a"
|
||||
},
|
||||
"currencycom": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/83718672-36745c00-a63e-11ea-81a9-677b1f789a4d.jpg",
|
||||
"url": "https://www.currency.com",
|
||||
"color": "#55ba70"
|
||||
},
|
||||
"delta": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/99450025-3be60a00-2931-11eb-9302-f4fd8d8589aa.jpg",
|
||||
"url": "https://www.delta.exchange",
|
||||
"color": "#4eafe3"
|
||||
},
|
||||
"exx": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/37770292-fbf613d0-2de4-11e8-9f79-f2dc451b8ccb.jpg",
|
||||
"url": "https://www.exx.com/",
|
||||
"color": "#e5a740"
|
||||
},
|
||||
"ftx": {
|
||||
"imgURI": "https://cryptologos.cc/logos/ftx-token-ftt-logo.png",
|
||||
"url": "https://ftx.com/",
|
||||
"color": "#479eb9"
|
||||
},
|
||||
"hitbtc": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766555-8eaec20e-5edc-11e7-9c5b-6dc69fc42f5e.jpg",
|
||||
"url": "https://hitbtc.com",
|
||||
"color": "#5fabd6"
|
||||
},
|
||||
"hollaex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/75841031-ca375180-5ddd-11ea-8417-b975674c23cb.jpg",
|
||||
"url": "https://hollaex.com",
|
||||
"color": "#000"
|
||||
},
|
||||
"huobipro": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/76137448-22748a80-604e-11ea-8069-6e389271911d.jpg",
|
||||
"url": "https://www.huobi.com",
|
||||
"color": "#51a1d0"
|
||||
},
|
||||
"kraken": {
|
||||
"imgURI": "https://cdn.worldvectorlogo.com/logos/kraken-2.svg",
|
||||
"url": "https://www.kraken.com/",
|
||||
"color": "#5044ca"
|
||||
},
|
||||
"kucoin": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87295558-132aaf80-c50e-11ea-9801-a2fb0c57c799.jpg",
|
||||
"url": "https://www.kucoin.com",
|
||||
"color": "#3f91db"
|
||||
},
|
||||
"lbank": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/38063602-9605e28a-3302-11e8-81be-64b1e53c4cfb.jpg",
|
||||
"url": "https://www.lbank.info",
|
||||
"color": "#357cc0"
|
||||
},
|
||||
"liquid": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/45798859-1a872600-bcb4-11e8-8746-69291ce87b04.jpg",
|
||||
"url": "https://www.liquid.com",
|
||||
"color": "#2057ed"
|
||||
},
|
||||
"oceanex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/58385970-794e2d80-8001-11e9-889c-0567cd79b78e.jpg",
|
||||
"url": "https://www.oceanex.pro.com",
|
||||
"color": "#6bc2e4"
|
||||
},
|
||||
"okcoin": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87295551-102fbf00-c50e-11ea-90a9-462eebba5829.jpg",
|
||||
"url": "https://www.okcoin.com",
|
||||
"color": "#305ddc"
|
||||
},
|
||||
"okex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg",
|
||||
"url": "https://www.okex.com",
|
||||
"color": "#4071df"
|
||||
},
|
||||
"okex3": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg",
|
||||
"url": "https://www.okex.com",
|
||||
"color": "#4071df"
|
||||
},
|
||||
"okex5": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg",
|
||||
"url": "https://www.okex.com",
|
||||
"color": "#4071df"
|
||||
},
|
||||
"poloniex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766817-e9456312-5ee6-11e7-9b3c-b628ca5626a5.jpg",
|
||||
"url": "https://www.poloniex.com",
|
||||
"color": "#295c61"
|
||||
},
|
||||
"probit": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/79268032-c4379480-7ea2-11ea-80b3-dd96bb29fd0d.jpg",
|
||||
"url": "https://www.probit.com",
|
||||
"color": "#3c35ba"
|
||||
},
|
||||
"qtrade": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/80491487-74a99c00-896b-11ea-821e-d307e832f13e.jpg",
|
||||
"url": "https://qtrade.io",
|
||||
"color": "#e37b40"
|
||||
},
|
||||
"stex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/69680782-03fd0b80-10bd-11ea-909e-7f603500e9cc.jpg",
|
||||
"url": "https://www.stex.com",
|
||||
"color": "#000"
|
||||
},
|
||||
"tidebit": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87460811-1e690280-c616-11ea-8652-69f187305add.jpg",
|
||||
"url": "https://www.tidebit.com",
|
||||
"color": "#5892d5"
|
||||
},
|
||||
"timex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/70423869-6839ab00-1a7f-11ea-8f94-13ae72c31115.jpg",
|
||||
"url": "https://timex.io",
|
||||
"color": "#6a5bcb"
|
||||
},
|
||||
"vcc": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/100545356-8427f500-326c-11eb-9539-7d338242d61b.jpg",
|
||||
"url": "https://vcc.exchange",
|
||||
"color": "#3b89e0"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
61300
src/config/tokens.json
Normal file
61300
src/config/tokens.json
Normal file
File diff suppressed because one or more lines are too long
3
src/fetchers/api-dojo-rapid/generate-list.js
Normal file
3
src/fetchers/api-dojo-rapid/generate-list.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const symbolToApiDojoSymbol = require("./symbol-to-api-dojo-symbol.json");
|
||||
|
||||
exports.getTokenList = () => Object.keys(symbolToApiDojoSymbol);
|
||||
51
src/fetchers/api-dojo-rapid/symbol-to-api-dojo-symbol.json
Normal file
51
src/fetchers/api-dojo-rapid/symbol-to-api-dojo-symbol.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"TSLA": "TSLA",
|
||||
"AAPL": "AAPL",
|
||||
"IBM": "IBM",
|
||||
"AMZN": "AMZN",
|
||||
"GOOG": "GOOG",
|
||||
"COST": "COST",
|
||||
"DIS": "DIS",
|
||||
"FB": "FB",
|
||||
"MA": "MA",
|
||||
"MSFT": "MSFT",
|
||||
"NFLX": "NFLX",
|
||||
"NKE": "NKE",
|
||||
"PINS": "PINS",
|
||||
"SHOP": "SHOP",
|
||||
"SPOT": "SPOT",
|
||||
"TDOC": "TDOC",
|
||||
"SPY": "SPY",
|
||||
"QQQ": "QQQ",
|
||||
"ONEQ": "ONEQ",
|
||||
"IWM": "IWM",
|
||||
"EFA": "EFA",
|
||||
"VGK": "VGK",
|
||||
"INDA": "INDA",
|
||||
"RSX": "RSX",
|
||||
"ZC=F": "ZC=F",
|
||||
"ZS=F": "ZS=F",
|
||||
"ZM=F": "ZM=F",
|
||||
"ZW=F": "ZW=F",
|
||||
"KE=F": "KE=F",
|
||||
"ZO=F": "ZO=F",
|
||||
"ZR=F": "ZR=F",
|
||||
"CL=F": "CL=F",
|
||||
"RB=F": "RB=F",
|
||||
"NG=F": "NG=F",
|
||||
"QA=F": "QA=F",
|
||||
"EH=F": "EH=F",
|
||||
"GC=F": "GC=F",
|
||||
"SI=F": "SI=F",
|
||||
"HG=F": "HG=F",
|
||||
"PL=F": "PL=F",
|
||||
"PA=F": "PA=F",
|
||||
"LE=F": "LE=F",
|
||||
"GF=F": "GF=F",
|
||||
"HE=F": "HE=F",
|
||||
"PRK=F": "PRK=F",
|
||||
"DC=F": "DC=F",
|
||||
"GNF=F": "GNF=F",
|
||||
"CB=F": "CB=F",
|
||||
"CSC=F": "CSC=F"
|
||||
}
|
||||
16
src/fetchers/ccxt/generate-list-for-all-ccxt-sources.js
Normal file
16
src/fetchers/ccxt/generate-list-for-all-ccxt-sources.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const allSupportedExchanges = require("./all-supported-exchanges.json");
|
||||
|
||||
function getCcxtTokenList() {
|
||||
const result = {};
|
||||
for (const exchange of allSupportedExchanges) {
|
||||
result[exchange] = getSupportedTokensFromManifest(exchange);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getSupportedTokensFromManifest(exchangeName) {
|
||||
const manifest = require(`../../../manifests/${exchangeName}.json`);
|
||||
return Object.keys(manifest.tokens);
|
||||
}
|
||||
|
||||
module.exports = { getCcxtTokenList };
|
||||
@@ -1,11 +1,3 @@
|
||||
const axios = require("axios");
|
||||
const vertSymbolToId = require("./verto-symbol-to-id.json");
|
||||
|
||||
const URL = "https://v2.cache.verto.exchange/tokens";
|
||||
|
||||
async function getTokenList() {
|
||||
const response = await axios.get(URL);
|
||||
|
||||
return response.data.map(token => token.ticker);
|
||||
}
|
||||
|
||||
exports.getTokenList = getTokenList;
|
||||
exports.getTokenList = () => Object.keys(vertSymbolToId);
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
const axios = require("axios");
|
||||
const symbolToYfSymbol = require("./symbol-to-yf-symbol.json");
|
||||
|
||||
const URL = "https://api.kyber.network/api/tokens/pairs";
|
||||
|
||||
async function getTokenList() {
|
||||
const response = await axios.get(URL);
|
||||
return Object.values(response.data).map(pair => pair.symbol);
|
||||
}
|
||||
|
||||
exports.getTokenList = getTokenList;
|
||||
exports.getTokenList = () => Object.keys(symbolToYfSymbol);
|
||||
|
||||
51
src/fetchers/yf-unofficial/symbol-to-yf-symbol.json
Normal file
51
src/fetchers/yf-unofficial/symbol-to-yf-symbol.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"TSLA": "TSLA",
|
||||
"AAPL": "AAPL",
|
||||
"IBM": "IBM",
|
||||
"AMZN": "AMZN",
|
||||
"GOOG": "GOOG",
|
||||
"COST": "COST",
|
||||
"DIS": "DIS",
|
||||
"FB": "FB",
|
||||
"MA": "MA",
|
||||
"MSFT": "MSFT",
|
||||
"NFLX": "NFLX",
|
||||
"NKE": "NKE",
|
||||
"PINS": "PINS",
|
||||
"SHOP": "SHOP",
|
||||
"SPOT": "SPOT",
|
||||
"TDOC": "TDOC",
|
||||
"SPY": "SPY",
|
||||
"QQQ": "QQQ",
|
||||
"ONEQ": "ONEQ",
|
||||
"IWM": "IWM",
|
||||
"EFA": "EFA",
|
||||
"VGK": "VGK",
|
||||
"INDA": "INDA",
|
||||
"RSX": "RSX",
|
||||
"ZC=F": "ZC=F",
|
||||
"ZS=F": "ZS=F",
|
||||
"ZM=F": "ZM=F",
|
||||
"ZW=F": "ZW=F",
|
||||
"KE=F": "KE=F",
|
||||
"ZO=F": "ZO=F",
|
||||
"ZR=F": "ZR=F",
|
||||
"CL=F": "CL=F",
|
||||
"RB=F": "RB=F",
|
||||
"NG=F": "NG=F",
|
||||
"QA=F": "QA=F",
|
||||
"EH=F": "EH=F",
|
||||
"GC=F": "GC=F",
|
||||
"SI=F": "SI=F",
|
||||
"HG=F": "HG=F",
|
||||
"PL=F": "PL=F",
|
||||
"PA=F": "PA=F",
|
||||
"LE=F": "LE=F",
|
||||
"GF=F": "GF=F",
|
||||
"HE=F": "HE=F",
|
||||
"PRK=F": "PRK=F",
|
||||
"DC=F": "DC=F",
|
||||
"GNF=F": "GNF=F",
|
||||
"CB=F": "CB=F",
|
||||
"CSC=F": "CSC=F"
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const supportedTokens = require('./supported-tokens.json');
|
||||
|
||||
async function generateTokenConfig() {
|
||||
|
||||
const fetchers = fs.readdirSync('../fetchers', { withFileTypes: true })
|
||||
.filter(
|
||||
dirent => {
|
||||
return dirent.isDirectory();
|
||||
}
|
||||
)
|
||||
.map(
|
||||
dirent => {
|
||||
return dirent.name;
|
||||
}
|
||||
)
|
||||
|
||||
for (const fetcher of fetchers) {
|
||||
try {
|
||||
const generateList = require('../fetchers/' + fetcher + '/generate-list.js');
|
||||
if (generateList) {
|
||||
console.log('Fetching list for: ' + fetcher)
|
||||
let fetchedList = await generateList.getTokenList();
|
||||
fetchedList.forEach(
|
||||
token => {
|
||||
if (token in supportedTokens) {
|
||||
if (!supportedTokens[token].source) {
|
||||
supportedTokens[token].source = [];
|
||||
}
|
||||
supportedTokens[token].source.push(fetcher)
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('Error when getting a token list for: ' + fetcher)
|
||||
}
|
||||
}
|
||||
|
||||
const standard = require('./standard-lists');
|
||||
const standardLists = await standard.getStandardList();
|
||||
|
||||
for (const symbol in supportedTokens) {
|
||||
let standarizedInfo;
|
||||
let index = 0;
|
||||
while (index < standardLists.length && !standarizedInfo) {
|
||||
standarizedInfo = standardLists[index].find(
|
||||
el => {
|
||||
return el.symbol === symbol;
|
||||
}
|
||||
)
|
||||
index++;
|
||||
}
|
||||
|
||||
if (standarizedInfo) {
|
||||
supportedTokens[symbol].data = standarizedInfo
|
||||
}
|
||||
}
|
||||
|
||||
var json = JSON.stringify(supportedTokens);
|
||||
|
||||
fs.writeFileSync('token-config.json', json);
|
||||
|
||||
}
|
||||
|
||||
generateTokenConfig();
|
||||
@@ -1,21 +0,0 @@
|
||||
const axios = require("axios");
|
||||
|
||||
let standardListsURLs = [
|
||||
'https://tokens.coingecko.com/uniswap/all.json',
|
||||
'https://zapper.fi/api/token-list',
|
||||
'https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokenlist.aave.eth.link',
|
||||
'https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokens.1inch.eth.link',
|
||||
'https://wispy-bird-88a7.uniswap.workers.dev/?url=http://t2crtokens.eth.link',
|
||||
'https://uniswap.mycryptoapi.com/'
|
||||
]
|
||||
|
||||
async function getList(url) {
|
||||
let response = await axios.get(url);
|
||||
return response.data.tokens;
|
||||
}
|
||||
|
||||
async function getStandardList() {
|
||||
return await Promise.all(standardListsURLs.map(async url => { return await getList(url)}))
|
||||
}
|
||||
|
||||
exports.getStandardList = getStandardList;
|
||||
File diff suppressed because one or more lines are too long
@@ -1,12 +1,12 @@
|
||||
const ccxt = require("ccxt");
|
||||
const fs = require("fs");
|
||||
const predefinedSourcesConfig = require("./predefined-sources-config.json");
|
||||
const predefinedSourcesConfig = require("./predefined-configs/sources.json");
|
||||
const fetchers = require("../../dist/src/fetchers/index");
|
||||
|
||||
// NOTE! Before running this script you should build redstone-node source code
|
||||
// to dist folder (use `yarn build`)
|
||||
|
||||
const OUTPUT_FILE = "./src/config/sources-list.json";
|
||||
const OUTPUT_FILE = "./src/config/sources.json";
|
||||
|
||||
main();
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
const axios = require("axios");
|
||||
const Coingecko = require("coingecko-api");
|
||||
const { tokens } = require("../../manifests/all-supported-tokens.json");
|
||||
|
||||
const DEFAULT_TOKEN_LOGO_URI = "";
|
||||
const DEFAULT_TOKEN_URL = "";
|
||||
|
||||
main();
|
||||
|
||||
async function main() {
|
||||
const allSupportedSymbols = Object.keys(tokens);
|
||||
const coingeckoConfig = await getTokenConfigFromCoinGecko();
|
||||
const hardcodedConfig = getHarcodedConfig();
|
||||
|
||||
const allTokens = {};
|
||||
for (const token of coingeckoConfig.tokens) {
|
||||
allTokens[token.symbol] = token;
|
||||
}
|
||||
|
||||
let result = {};
|
||||
for (const symbol of allSupportedSymbols) {
|
||||
if (hardcodedConfig[symbol]) {
|
||||
result[symbol] = hardcodedConfig[symbol];
|
||||
} else {
|
||||
const token = allTokens[symbol];
|
||||
if (token !== undefined) {
|
||||
result[symbol] = {
|
||||
name: token.name || symbol,
|
||||
logoURI: token.logoURI || DEFAULT_TOKEN_LOGO_URI,
|
||||
url: token.url || DEFAULT_TOKEN_URL,
|
||||
};
|
||||
} else {
|
||||
result[symbol] = {
|
||||
name: symbol,
|
||||
logoURI: DEFAULT_TOKEN_LOGO_URI,
|
||||
url: DEFAULT_TOKEN_URL,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(sortSymbols(result), null, 2));
|
||||
}
|
||||
|
||||
async function getTokenConfigFromCoinGecko() {
|
||||
const url = "https://tokens.coingecko.com/uniswap/all.json";
|
||||
const response = await axios.get(url);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
function sortSymbols(tokensConfig) {
|
||||
const minIndices = {
|
||||
"AR": 1,
|
||||
"ETH": 2,
|
||||
"BTC": 3,
|
||||
"COMP": 4,
|
||||
"MKR": 5,
|
||||
};
|
||||
|
||||
function getMinIndexForSymbol(symbol) {
|
||||
return minIndices[symbol] || 10;
|
||||
}
|
||||
|
||||
function compareSymbols(symbol1, symbol2) {
|
||||
return getMinIndexForSymbol(symbol1) - getMinIndexForSymbol(symbol2);
|
||||
}
|
||||
|
||||
const sortedKeys = Object.keys(tokensConfig).sort(compareSymbols);
|
||||
|
||||
const result = {};
|
||||
for (const symbol of sortedKeys) {
|
||||
result[symbol] = tokensConfig[symbol];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function getHarcodedConfig() {
|
||||
const config = {
|
||||
"BTC": {
|
||||
name: "Bitcoin",
|
||||
logoURI: "https://assets.coingecko.com/coins/images/1/small/bitcoin.png",
|
||||
url: "https://bitcoin.org/",
|
||||
},
|
||||
"ETH": {
|
||||
name: "Ethereum",
|
||||
logoURI: "https://assets.coingecko.com/coins/images/279/small/ethereum.png",
|
||||
url: "https://ethereum.org/",
|
||||
},
|
||||
"AR": {
|
||||
name: "Arweave",
|
||||
logoURI: "https://assets.coingecko.com/coins/images/4343/small/oRt6SiEN_400x400.jpg",
|
||||
url: "https://www.arweave.org/",
|
||||
},
|
||||
"BNB": {
|
||||
name: "Binance Coin",
|
||||
logoURI: "https://assets.coingecko.com/coins/images/825/small/binance-coin-logo.png",
|
||||
url: "https://www.binance.com/",
|
||||
},
|
||||
};
|
||||
|
||||
return config;
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
const fs = require("fs");
|
||||
const supportedTokens = require("./supported-tokens.json");
|
||||
|
||||
async function generateTokenConfig() {
|
||||
|
||||
const fetchers = fs.readdirSync("src/fetchers", { withFileTypes: true })
|
||||
.filter(
|
||||
dirent => {
|
||||
return dirent.isDirectory();
|
||||
}
|
||||
)
|
||||
.map(
|
||||
dirent => {
|
||||
return dirent.name;
|
||||
}
|
||||
);
|
||||
|
||||
for (const fetcher of fetchers) {
|
||||
try {
|
||||
const generateList = require("../../src/fetchers/" + fetcher + "/generate-list.js");
|
||||
if (generateList) {
|
||||
console.log("Fetching list for: " + fetcher);
|
||||
let fetchedList = await generateList.getTokenList();
|
||||
fetchedList.forEach(
|
||||
token => {
|
||||
if (token in supportedTokens) {
|
||||
if (!supportedTokens[token].source) {
|
||||
supportedTokens[token].source = [];
|
||||
}
|
||||
supportedTokens[token].source.push(fetcher);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Error when getting a token list for: " + fetcher);
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
|
||||
const standard = require("./standard-lists");
|
||||
const standardLists = await standard.getStandardList();
|
||||
|
||||
for (const symbol in supportedTokens) {
|
||||
let standarizedInfo;
|
||||
let index = 0;
|
||||
while (index < standardLists.length && !standarizedInfo) {
|
||||
standarizedInfo = standardLists[index].find(
|
||||
el => {
|
||||
return el.symbol === symbol;
|
||||
}
|
||||
)
|
||||
index++;
|
||||
}
|
||||
|
||||
if (standarizedInfo) {
|
||||
supportedTokens[symbol].data = standarizedInfo;
|
||||
}
|
||||
}
|
||||
|
||||
const json = JSON.stringify(supportedTokens, null, 2) + "\n";
|
||||
|
||||
fs.writeFileSync("src/config/token-config.json", json);
|
||||
|
||||
}
|
||||
|
||||
generateTokenConfig();
|
||||
147
tools/config/generate-tokens-config.js
Normal file
147
tools/config/generate-tokens-config.js
Normal file
@@ -0,0 +1,147 @@
|
||||
const fs = require("fs");
|
||||
const fetchers = require("../../src/config/sources.json");
|
||||
const ccxtSupportedExchanges = require("../../src/fetchers/ccxt/all-supported-exchanges.json");
|
||||
const predefinedTokensConfig = require("./predefined-configs/tokens.json");
|
||||
const { getStandardLists } = require("./standard-lists");
|
||||
const { getCcxtTokenList } = require("../../src/fetchers/ccxt/generate-list-for-all-ccxt-sources");
|
||||
const providerToManifest = {
|
||||
"redstone-rapid": require("../../manifests/rapid.json"),
|
||||
"redstone-stocks": require("../../manifests/stocks.json"),
|
||||
"redstone": require("../../manifests/all-supported-tokens.json"),
|
||||
};
|
||||
|
||||
// Note: Before running this script you should generate sources.json config
|
||||
// You can do this using tools/config/generate-sources-config.js script
|
||||
|
||||
const OUTPUT_FILE = "./src/config/tokens.json";
|
||||
const tokensConfig = {};
|
||||
|
||||
main();
|
||||
|
||||
async function main() {
|
||||
await generateTokensConfig();
|
||||
saveTokensConfigToFile();
|
||||
}
|
||||
|
||||
async function generateTokensConfig() {
|
||||
// Adding tokens with sources
|
||||
for (const fetcher of Object.keys(fetchers)) {
|
||||
try {
|
||||
if (!isCcxtFetcher(fetcher)) {
|
||||
await addAllTokensForSource(fetcher);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Error when getting a token list for: " + fetcher);
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
await addAllTokensForCcxtSources();
|
||||
|
||||
// Adding token details
|
||||
const standardLists = await getStandardLists();
|
||||
for (const token of Object.keys(tokensConfig)) {
|
||||
console.log(`Loading details for token: ${token}`);
|
||||
tokensConfig[token] = getAllDetailsForSymbol(token, standardLists);
|
||||
}
|
||||
}
|
||||
|
||||
// This function should handle
|
||||
// - getting details (imgURL, url, chainId...)
|
||||
// - getting providers
|
||||
// - getting tags
|
||||
function getAllDetailsForSymbol(symbol, standardLists) {
|
||||
const providers = getProvidersForSymbol(symbol);
|
||||
const tags = getTagsForSymbol(symbol);
|
||||
const details = getDetailsForSymbol(symbol, standardLists);
|
||||
|
||||
return {
|
||||
...details,
|
||||
tags,
|
||||
providers,
|
||||
};
|
||||
}
|
||||
|
||||
function getDetailsForSymbol(symbol, standardLists) {
|
||||
// Checking if predefined config contains details for the symbol
|
||||
const details = predefinedTokensConfig[symbol];
|
||||
if (details) {
|
||||
return details;
|
||||
}
|
||||
|
||||
// Searching for token details in popular standard token lists
|
||||
for (const standardList of standardLists) {
|
||||
const symbolDetails = standardList.find(el => el.symbol === symbol);
|
||||
if (symbolDetails) {
|
||||
return symbolDetails;
|
||||
}
|
||||
}
|
||||
|
||||
// Returning empty details
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
function getProvidersForSymbol(symbol) {
|
||||
return Object.keys(providerToManifest)
|
||||
.filter(p => symbol in providerToManifest[p].tokens);
|
||||
}
|
||||
|
||||
// This function can work based on manifests and predefined config
|
||||
// Returning "crypto" as a default tag
|
||||
function getTagsForSymbol(symbol) {
|
||||
let tags = [];
|
||||
if (predefinedTokensConfig[symbol] && predefinedTokensConfig[symbol].tags) {
|
||||
tags = predefinedTokensConfig[symbol].tags;
|
||||
}
|
||||
|
||||
if (tags.length === 0 && !providerToManifest["redstone-stocks"][symbol]) {
|
||||
tags.push("crypto");
|
||||
}
|
||||
|
||||
return tags;
|
||||
}
|
||||
|
||||
function isCcxtFetcher(fetcherName) {
|
||||
return ccxtSupportedExchanges.includes(fetcherName);
|
||||
}
|
||||
|
||||
async function addAllTokensForCcxtSources() {
|
||||
console.log("Fetching tokens for all ccxt feetchers");
|
||||
const ccxtFetchersWithTokens = await getCcxtTokenList();
|
||||
for (const ccxtFetcher in ccxtFetchersWithTokens) {
|
||||
addTokensToConfig(
|
||||
ccxtFetchersWithTokens[ccxtFetcher],
|
||||
ccxtFetcher);
|
||||
}
|
||||
}
|
||||
|
||||
async function addAllTokensForSource(source) {
|
||||
console.log("Fetching supported tokens for: " + source);
|
||||
const { getTokenList } = require(
|
||||
`../../src/fetchers/${source}/generate-list`);
|
||||
const tokens = await getTokenList();
|
||||
addTokensToConfig(tokens, source);
|
||||
}
|
||||
|
||||
function addTokensToConfig(tokens, source) {
|
||||
for (const token of tokens) {
|
||||
addTokenToConfig(token, source);
|
||||
}
|
||||
}
|
||||
|
||||
function addTokenToConfig(token, source) {
|
||||
if (token in tokensConfig) {
|
||||
if (Array.isArray(tokensConfig[token].source)) {
|
||||
tokensConfig[token].source.push(source);
|
||||
} else {
|
||||
tokensConfig[token].source = [source];
|
||||
}
|
||||
} else {
|
||||
tokensConfig[token] = { source: [source] };
|
||||
}
|
||||
}
|
||||
|
||||
function saveTokensConfigToFile() {
|
||||
const json = JSON.stringify(tokensConfig, null, 2) + "\n";
|
||||
fs.writeFileSync(OUTPUT_FILE, json);
|
||||
}
|
||||
@@ -1,258 +1,322 @@
|
||||
{
|
||||
"api-dojo-rapid": {
|
||||
"imgURI": "https://rapidapi.com/cdn/images?url=https://rapidapi-prod-apis.s3.amazonaws.com/f1/efaf50769f4fe1914234b035c3ff12/04b2a24093095ca016e1d83107aff2b9.png",
|
||||
"url": "https://rapidapi.com/apidojo/api/yahoo-finance1"
|
||||
"url": "https://rapidapi.com/apidojo/api/yahoo-finance1",
|
||||
"color": "#4d9fd1"
|
||||
},
|
||||
"yf-unofficial": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/YahooFinanceLogo.png/1200px-YahooFinanceLogo.png",
|
||||
"url": "https://www.npmjs.com/package/yahoo-finance"
|
||||
"url": "https://www.npmjs.com/package/yahoo-finance",
|
||||
"color": "#531cc4"
|
||||
},
|
||||
"coingecko": {
|
||||
"imgURI": "https://static.coingecko.com/s/thumbnail-007177f3eca19695592f0b8b0eabbdae282b54154e1be912285c9034ea6cbaf2.png",
|
||||
"url": "https://www.coingecko.com/"
|
||||
"url": "https://www.coingecko.com/",
|
||||
"color": "#98c355"
|
||||
},
|
||||
"sushiswap": {
|
||||
"imgURI": "https://sushi.com/static/media/logo.dec926df.png",
|
||||
"url": "https://sushi.com/"
|
||||
"url": "https://sushi.com/",
|
||||
"color": "#e45d9d"
|
||||
},
|
||||
"coinbase": {
|
||||
"imgURI": "https://images.ctfassets.net/q5ulk4bp65r7/1rFQCqoq8hipvVJSKdU3fQ/21ab733af7a8ab404e29b873ffb28348/coinbase-icon2.svg",
|
||||
"url": "https://www.coinbase.com/"
|
||||
"url": "https://www.coinbase.com/",
|
||||
"color": "#2a67d0"
|
||||
},
|
||||
"uniswap": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Uniswap_Logo.svg/1026px-Uniswap_Logo.svg.png",
|
||||
"url": "https://uniswap.org/"
|
||||
"url": "https://uniswap.org/",
|
||||
"color": "#e23275"
|
||||
},
|
||||
"kyber": {
|
||||
"imgURI": "https://cdn-images-1.medium.com/max/130/1*MwDrRuiVNgzyYfscMdW27g@2x.png",
|
||||
"url": "https://kyber.network/"
|
||||
"url": "https://kyber.network/",
|
||||
"color": "#62c19c"
|
||||
},
|
||||
"verto": {
|
||||
"imgURI": "https://avatars.githubusercontent.com/u/69314266?s=200&v=4",
|
||||
"url": "https://verto.exchange/"
|
||||
"url": "https://verto.exchange/",
|
||||
"color": "#a176c2"
|
||||
},
|
||||
"ecb": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Logo_European_Central_Bank.svg/1242px-Logo_European_Central_Bank.svg.png",
|
||||
"url": "https://www.ecb.europa.eu/home/html/index.en.html"
|
||||
"url": "https://www.ecb.europa.eu/home/html/index.en.html",
|
||||
"color": "#10338e"
|
||||
},
|
||||
"aax": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/104140087-a27f2580-53c0-11eb-87c1-5d9e81208fe9.jpg",
|
||||
"url": "https://www.aaxpro.com"
|
||||
"url": "https://www.aaxpro.com",
|
||||
"color": "#327aee"
|
||||
},
|
||||
"aofex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/77670271-056d1080-6f97-11ea-9ac2-4268e9ed0c1f.jpg",
|
||||
"url": "https://aofex.com"
|
||||
"url": "https://aofex.com",
|
||||
"color": "#e4653d"
|
||||
},
|
||||
"ascendex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/112027508-47984600-8b48-11eb-9e17-d26459cc36c6.jpg",
|
||||
"url": "https://ascendex.com"
|
||||
"url": "https://ascendex.com",
|
||||
"color": "#69cbe5"
|
||||
},
|
||||
"bequant": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/55248342-a75dfe00-525a-11e9-8aa2-05e9dca943c6.jpg",
|
||||
"url": "https://bequant.io"
|
||||
"url": "https://bequant.io",
|
||||
"color": "#e6e37f"
|
||||
},
|
||||
"bibox": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/77257418-3262b000-6c85-11ea-8fb8-20bdf20b3592.jpg",
|
||||
"url": "https://www.bibox365.com"
|
||||
"url": "https://www.bibox365.com",
|
||||
"color": "#7196db"
|
||||
},
|
||||
"binance": {
|
||||
"imgURI": "https://cryptologos.cc/logos/binance-coin-bnb-logo.svg",
|
||||
"url": "https://www.binance.com/"
|
||||
"url": "https://www.binance.com/",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"binancecoinm": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg",
|
||||
"url": "https://www.binance.com"
|
||||
"url": "https://www.binance.com",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"binanceus": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/65177307-217b7c80-da5f-11e9-876e-0b748ba0a358.jpg",
|
||||
"url": "https://www.binance.us"
|
||||
"url": "https://www.binance.us",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"binanceusdm": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg",
|
||||
"url": "https://www.binance.com"
|
||||
"url": "https://www.binance.com",
|
||||
"color": "#d6ab3c"
|
||||
},
|
||||
"bitcoincom": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/97296144-514fa300-1861-11eb-952b-3d55d492200b.jpg",
|
||||
"url": "https://exchange.bitcoin.com"
|
||||
"url": "https://exchange.bitcoin.com",
|
||||
"color": "#56bb8a"
|
||||
},
|
||||
"bitfinex": {
|
||||
"imgURI": "https://iconape.com/wp-content/png_logo_vector/bitfinex-leaf.png",
|
||||
"url": "https://www.bitfinex.com/"
|
||||
"url": "https://www.bitfinex.com/",
|
||||
"color": "#769340"
|
||||
},
|
||||
"bitfinex2": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766244-e328a50c-5ed2-11e7-947b-041416579bb3.jpg",
|
||||
"url": "https://www.bitfinex.com"
|
||||
"url": "https://www.bitfinex.com",
|
||||
"color": "#769340"
|
||||
},
|
||||
"bitget": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/88317935-a8a21c80-cd22-11ea-8e2b-4b9fac5975eb.jpg",
|
||||
"url": "https://www.bitget.com"
|
||||
"url": "https://www.bitget.com",
|
||||
"color": "#1b1f5c"
|
||||
},
|
||||
"bitmart": {
|
||||
"imgURI": "https://iconape.com/wp-content/png_logo_vector/bitmart.png",
|
||||
"url": "https://www.bitmart.com/"
|
||||
"url": "https://www.bitmart.com/",
|
||||
"color": "#50a09f"
|
||||
},
|
||||
"bitmex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766319-f653c6e6-5ed4-11e7-933d-f0bc3699ae8f.jpg",
|
||||
"url": "https://www.bitmex.com"
|
||||
"url": "https://www.bitmex.com",
|
||||
"color": "#5759aa"
|
||||
},
|
||||
"bittrex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87153921-edf53180-c2c0-11ea-96b9-f2a9a95a455b.jpg",
|
||||
"url": "https://bittrex.com"
|
||||
"url": "https://bittrex.com",
|
||||
"color": "#55b4f1"
|
||||
},
|
||||
"bitz": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87443304-fec5e000-c5fd-11ea-98f8-ba8e67f7eaff.jpg",
|
||||
"url": "https://www.bitz.com"
|
||||
"url": "https://www.bitz.com",
|
||||
"color": "#153086"
|
||||
},
|
||||
"btcturk": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87153926-efbef500-c2c0-11ea-9842-05b63612c4b9.jpg",
|
||||
"url": "https://www.btcturk.com"
|
||||
"url": "https://www.btcturk.com",
|
||||
"color": "#1d54ed"
|
||||
},
|
||||
"bw": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/69436317-31128c80-0d52-11ea-91d1-eb7bb5818812.jpg",
|
||||
"url": "https://www.bw.com"
|
||||
"url": "https://www.bw.com",
|
||||
"color": "#cc2c25"
|
||||
},
|
||||
"bybit": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg",
|
||||
"url": "https://www.bybit.com"
|
||||
"url": "https://www.bybit.com",
|
||||
"color": "#ecad42"
|
||||
},
|
||||
"cdax": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/102157692-fd406280-3e90-11eb-8d46-4511b617cd17.jpg",
|
||||
"url": "https://cdax.io"
|
||||
"url": "https://cdax.io",
|
||||
"color": "#5e94e2"
|
||||
},
|
||||
"cex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg",
|
||||
"url": "https://cex.io"
|
||||
"url": "https://cex.io",
|
||||
"color": "#53b1b0"
|
||||
},
|
||||
"coinex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg",
|
||||
"url": "https://www.coinex.com"
|
||||
"url": "https://www.coinex.com",
|
||||
"color": "#68d9b6"
|
||||
},
|
||||
"crex24": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/47813922-6f12cc00-dd5d-11e8-97c6-70f957712d47.jpg",
|
||||
"url": "https://crex24.com"
|
||||
"url": "https://crex24.com",
|
||||
"color": "#4a9b9a"
|
||||
},
|
||||
"currencycom": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/83718672-36745c00-a63e-11ea-81a9-677b1f789a4d.jpg",
|
||||
"url": "https://www.currency.com"
|
||||
"url": "https://www.currency.com",
|
||||
"color": "#55ba70"
|
||||
},
|
||||
"delta": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/99450025-3be60a00-2931-11eb-9302-f4fd8d8589aa.jpg",
|
||||
"url": "https://www.delta.exchange"
|
||||
"url": "https://www.delta.exchange",
|
||||
"color": "#4eafe3"
|
||||
},
|
||||
"digifinex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87443315-01283a00-c5fe-11ea-8628-c2a0feaf07ac.jpg",
|
||||
"url": "https://www.digifinex.com"
|
||||
"url": "https://www.digifinex.com",
|
||||
"color": "#6548ab"
|
||||
},
|
||||
"exmo": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766491-1b0ea956-5eda-11e7-9225-40d67b481b8d.jpg",
|
||||
"url": "https://exmo.me"
|
||||
"url": "https://exmo.me",
|
||||
"color": "#5189d0"
|
||||
},
|
||||
"exx": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/37770292-fbf613d0-2de4-11e8-9f79-f2dc451b8ccb.jpg",
|
||||
"url": "https://www.exx.com/"
|
||||
"url": "https://www.exx.com/",
|
||||
"color": "#e5a740"
|
||||
},
|
||||
"ftx": {
|
||||
"imgURI": "https://cryptologos.cc/logos/ftx-token-ftt-logo.png",
|
||||
"url": "https://ftx.com/"
|
||||
"url": "https://ftx.com/",
|
||||
"color": "#479eb9"
|
||||
},
|
||||
"gemini": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27816857-ce7be644-6096-11e7-82d6-3c257263229c.jpg",
|
||||
"url": "https://gemini.com/"
|
||||
"url": "https://gemini.com/",
|
||||
"color": "#60d2ee"
|
||||
},
|
||||
"hbtc": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/80134449-70663300-85a7-11ea-8942-e204cdeaab5d.jpg",
|
||||
"url": "https://www.hbtc.com"
|
||||
"url": "https://www.hbtc.com",
|
||||
"color": "#4272d2"
|
||||
},
|
||||
"hitbtc": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766555-8eaec20e-5edc-11e7-9c5b-6dc69fc42f5e.jpg",
|
||||
"url": "https://hitbtc.com"
|
||||
"url": "https://hitbtc.com",
|
||||
"color": "#5fabd6"
|
||||
},
|
||||
"hollaex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/75841031-ca375180-5ddd-11ea-8417-b975674c23cb.jpg",
|
||||
"url": "https://hollaex.com"
|
||||
"url": "https://hollaex.com",
|
||||
"color": "#000"
|
||||
},
|
||||
"huobipro": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/76137448-22748a80-604e-11ea-8069-6e389271911d.jpg",
|
||||
"url": "https://www.huobi.com"
|
||||
"url": "https://www.huobi.com",
|
||||
"color": "#51a1d0"
|
||||
},
|
||||
"kraken": {
|
||||
"imgURI": "https://cdn.worldvectorlogo.com/logos/kraken-2.svg",
|
||||
"url": "https://www.kraken.com/"
|
||||
"url": "https://www.kraken.com/",
|
||||
"color": "#5044ca"
|
||||
},
|
||||
"kucoin": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87295558-132aaf80-c50e-11ea-9801-a2fb0c57c799.jpg",
|
||||
"url": "https://www.kucoin.com"
|
||||
"url": "https://www.kucoin.com",
|
||||
"color": "#3f91db"
|
||||
},
|
||||
"latoken": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/61511972-24c39f00-aa01-11e9-9f7c-471f1d6e5214.jpg",
|
||||
"url": "https://latoken.com"
|
||||
"url": "https://latoken.com",
|
||||
"color": "#1e2039"
|
||||
},
|
||||
"lbank": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/38063602-9605e28a-3302-11e8-81be-64b1e53c4cfb.jpg",
|
||||
"url": "https://www.lbank.info"
|
||||
"url": "https://www.lbank.info",
|
||||
"color": "#357cc0"
|
||||
},
|
||||
"liquid": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/45798859-1a872600-bcb4-11e8-8746-69291ce87b04.jpg",
|
||||
"url": "https://www.liquid.com"
|
||||
"url": "https://www.liquid.com",
|
||||
"color": "#2057ed"
|
||||
},
|
||||
"novadax": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/92337550-2b085500-f0b3-11ea-98e7-5794fb07dd3b.jpg",
|
||||
"url": "https://www.novadax.com.br"
|
||||
"url": "https://www.novadax.com.br",
|
||||
"color": "#3a7769"
|
||||
},
|
||||
"oceanex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/58385970-794e2d80-8001-11e9-889c-0567cd79b78e.jpg",
|
||||
"url": "https://www.oceanex.pro.com"
|
||||
"url": "https://www.oceanex.pro.com",
|
||||
"color": "#6bc2e4"
|
||||
},
|
||||
"okcoin": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87295551-102fbf00-c50e-11ea-90a9-462eebba5829.jpg",
|
||||
"url": "https://www.okcoin.com"
|
||||
"url": "https://www.okcoin.com",
|
||||
"color": "#305ddc"
|
||||
},
|
||||
"okex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg",
|
||||
"url": "https://www.okex.com"
|
||||
"url": "https://www.okex.com",
|
||||
"color": "#4071df"
|
||||
},
|
||||
"okex3": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg",
|
||||
"url": "https://www.okex.com"
|
||||
"url": "https://www.okex.com",
|
||||
"color": "#4071df"
|
||||
},
|
||||
"okex5": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg",
|
||||
"url": "https://www.okex.com"
|
||||
"url": "https://www.okex.com",
|
||||
"color": "#4071df"
|
||||
},
|
||||
"poloniex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/27766817-e9456312-5ee6-11e7-9b3c-b628ca5626a5.jpg",
|
||||
"url": "https://www.poloniex.com"
|
||||
"url": "https://www.poloniex.com",
|
||||
"color": "#295c61"
|
||||
},
|
||||
"probit": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/79268032-c4379480-7ea2-11ea-80b3-dd96bb29fd0d.jpg",
|
||||
"url": "https://www.probit.com"
|
||||
"url": "https://www.probit.com",
|
||||
"color": "#3c35ba"
|
||||
},
|
||||
"qtrade": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/80491487-74a99c00-896b-11ea-821e-d307e832f13e.jpg",
|
||||
"url": "https://qtrade.io"
|
||||
"url": "https://qtrade.io",
|
||||
"color": "#e37b40"
|
||||
},
|
||||
"stex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/69680782-03fd0b80-10bd-11ea-909e-7f603500e9cc.jpg",
|
||||
"url": "https://www.stex.com"
|
||||
"url": "https://www.stex.com",
|
||||
"color": "#000"
|
||||
},
|
||||
"tidebit": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/51840849/87460811-1e690280-c616-11ea-8652-69f187305add.jpg",
|
||||
"url": "https://www.tidebit.com"
|
||||
"url": "https://www.tidebit.com",
|
||||
"color": "#5892d5"
|
||||
},
|
||||
"timex": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/70423869-6839ab00-1a7f-11ea-8f94-13ae72c31115.jpg",
|
||||
"url": "https://timex.io"
|
||||
"url": "https://timex.io",
|
||||
"color": "#6a5bcb"
|
||||
},
|
||||
"vcc": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/100545356-8427f500-326c-11eb-9539-7d338242d61b.jpg",
|
||||
"url": "https://vcc.exchange"
|
||||
"url": "https://vcc.exchange",
|
||||
"color": "#3b89e0"
|
||||
},
|
||||
"whitebit": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/66732963-8eb7dd00-ee66-11e9-849b-10d9282bb9e0.jpg",
|
||||
"url": "https://www.whitebit.com"
|
||||
"url": "https://www.whitebit.com",
|
||||
"color": "#bcad62"
|
||||
},
|
||||
"zb": {
|
||||
"imgURI": "https://user-images.githubusercontent.com/1294454/32859187-cd5214f0-ca5e-11e7-967d-96568e2e2bd1.jpg",
|
||||
"url": "https://www.zb.com"
|
||||
"url": "https://www.zb.com",
|
||||
"color": "#d5382b"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"api-dojo-rapid": {
|
||||
"imgURI": "https://rapidapi.com/cdn/images?url=https://rapidapi-prod-apis.s3.amazonaws.com/f1/efaf50769f4fe1914234b035c3ff12/04b2a24093095ca016e1d83107aff2b9.png",
|
||||
"url": "https://rapidapi.com/apidojo/api/yahoo-finance1"
|
||||
},
|
||||
"barchart": {
|
||||
"imgURI": "https://www.barchart.com/img/barchart-og.png",
|
||||
"url": "https://www.barchart.com/"
|
||||
},
|
||||
"binance": {
|
||||
"imgURI": "https://cryptologos.cc/logos/binance-coin-bnb-logo.svg",
|
||||
"url": "https://www.binance.com/"
|
||||
},
|
||||
"bitfinex": {
|
||||
"imgURI": "https://iconape.com/wp-content/png_logo_vector/bitfinex-leaf.png",
|
||||
"url": "https://www.bitfinex.com/"
|
||||
},
|
||||
"bitmart": {
|
||||
"imgURI": "https://iconape.com/wp-content/png_logo_vector/bitmart.png",
|
||||
"url": "https://www.bitmart.com/"
|
||||
},
|
||||
"coinbase": {
|
||||
"imgURI": "https://images.ctfassets.net/q5ulk4bp65r7/1rFQCqoq8hipvVJSKdU3fQ/21ab733af7a8ab404e29b873ffb28348/coinbase-icon2.svg",
|
||||
"url": "https://www.coinbase.com/"
|
||||
},
|
||||
"coingecko": {
|
||||
"imgURI": "https://static.coingecko.com/s/thumbnail-007177f3eca19695592f0b8b0eabbdae282b54154e1be912285c9034ea6cbaf2.png",
|
||||
"url": "https://www.coingecko.com/"
|
||||
},
|
||||
"ecb": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Logo_European_Central_Bank.svg/1242px-Logo_European_Central_Bank.svg.png",
|
||||
"url": "https://www.ecb.europa.eu/home/html/index.en.html"
|
||||
},
|
||||
"ftx": {
|
||||
"imgURI": "https://cryptologos.cc/logos/ftx-token-ftt-logo.png",
|
||||
"url": "https://ftx.com/"
|
||||
},
|
||||
"huobi": {
|
||||
"imgURI": "https://cryptologos.cc/logos/huobi-token-ht-logo.png",
|
||||
"url": "https://www.huobi.com/"
|
||||
},
|
||||
"kraken": {
|
||||
"imgURI": "https://cdn.worldvectorlogo.com/logos/kraken-2.svg",
|
||||
"url": "https://www.kraken.com/"
|
||||
},
|
||||
"kyber": {
|
||||
"imgURI": "https://cdn-images-1.medium.com/max/130/1*MwDrRuiVNgzyYfscMdW27g@2x.png",
|
||||
"url": "https://kyber.network/"
|
||||
},
|
||||
"sushiswap": {
|
||||
"imgURI": "https://sushi.com/static/media/logo.dec926df.png",
|
||||
"url": "https://sushi.com/"
|
||||
},
|
||||
"uniswap": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Uniswap_Logo.svg/1026px-Uniswap_Logo.svg.png",
|
||||
"url": "https://uniswap.org/"
|
||||
},
|
||||
"verto": {
|
||||
"imgURI": "https://avatars.githubusercontent.com/u/69314266?s=200&v=4",
|
||||
"url": "https://verto.exchange/"
|
||||
},
|
||||
"yf-unofficial": {
|
||||
"imgURI": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/YahooFinanceLogo.png/1200px-YahooFinanceLogo.png",
|
||||
"url": "https://www.npmjs.com/package/yahoo-finance"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,22 @@
|
||||
const axios = require("axios");
|
||||
|
||||
let standardListsURLs = [
|
||||
"https://zapper.fi/api/token-list",
|
||||
"https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokenlist.aave.eth.link",
|
||||
"https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokens.1inch.eth.link",
|
||||
"https://wispy-bird-88a7.uniswap.workers.dev/?url=http://t2crtokens.eth.link",
|
||||
"https://uniswap.mycryptoapi.com/",
|
||||
"https://tokens.coingecko.com/uniswap/all.json"
|
||||
]
|
||||
"https://zapper.fi/api/token-list",
|
||||
"https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokenlist.aave.eth.link",
|
||||
"https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokens.1inch.eth.link",
|
||||
"https://wispy-bird-88a7.uniswap.workers.dev/?url=http://t2crtokens.eth.link",
|
||||
"https://uniswap.mycryptoapi.com/",
|
||||
"https://tokens.coingecko.com/uniswap/all.json"
|
||||
];
|
||||
|
||||
async function getList(url) {
|
||||
let response = await axios.get(url);
|
||||
return response.data.tokens;
|
||||
const response = await axios.get(url);
|
||||
return response.data.tokens;
|
||||
}
|
||||
|
||||
async function getStandardList() {
|
||||
return await Promise.all(standardListsURLs.map(async url => { return await getList(url)}));
|
||||
async function getStandardLists() {
|
||||
const promises = standardListsURLs.map(async url => await getList(url));
|
||||
return await Promise.all(promises);
|
||||
}
|
||||
|
||||
exports.getStandardList = getStandardList;
|
||||
module.exports = { getStandardLists };
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user