Skip to content

Commit

Permalink
Merge pull request #1015 from coinranking/feature/cr-2583-cex-listing…
Browse files Browse the repository at this point in the history
…-exolo

Feature/cr 2583 cex listing exolo
  • Loading branch information
wouthoekstra authored Mar 22, 2024
2 parents 651099b + f6a4d13 commit 205730d
Show file tree
Hide file tree
Showing 5 changed files with 433 additions and 9 deletions.
33 changes: 33 additions & 0 deletions drivers/exolo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const Driver = require('../models/driver');
const request = require('../lib/request');
const Ticker = require('../models/ticker');
const { parseToFloat } = require('../lib/utils');

/**
* @memberof Driver
* @augments Driver
*/
class Exolo extends Driver {
/**
* @augments Driver.fetchTickers
* @returns {Promise.Array<Ticker>} Returns a promise of an array with tickers.
*/
async fetchTickers() {
const markets = await request('https://openapi.exolo.org/open/v2/pub/ticker');

return Object.keys(markets).map((market) => {
const ticker = markets[market];
const [base, quote] = market.split('_');

return new Ticker({
base,
quote,
close: parseToFloat(ticker.last_price),
baseVolume: parseToFloat(ticker['24_base_volume']),
quoteVolume: parseToFloat(ticker['24_quote_volume']),
});
});
}
}

module.exports = Exolo;
1 change: 1 addition & 0 deletions drivers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ exports.Exenium = require('./exenium');
exports.Exmarkets = require('./exmarkets');
exports.Exmo = require('./exmo');
exports.Exnce = require('./exnce');
exports.Exolo = require('./exolo');
exports.Extstock = require('./extstock');
exports.Exx = require('./exx');
exports.Fameex = require('./fameex');
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"license": "MIT",
"dependencies": {
"cloudscraper": "^4.6.0",
"commander": "^12.0.0",
"commander": "^11.1.0",
"request": "^2.88.2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 205730d

Please sign in to comment.