Skip to content

Commit

Permalink
feat: saturn driver (test is failed
Browse files Browse the repository at this point in the history
  • Loading branch information
sajcics authored and nickpater committed Apr 15, 2020
1 parent 3e86a1c commit 4b3b0b9
Show file tree
Hide file tree
Showing 3 changed files with 6,760 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ exports.resfinex = require('./resfinex');
exports.rightbtc = require('./rightbtc');
exports.rudex = require('./rudex');
exports.satoexchange = require('./satoexchange');
exports.saturn = require('./saturn');
exports.shortex = require('./shortex');
exports.simex = require('./simex');
exports.sistemkoin = require('./sistemkoin');
Expand Down
23 changes: 23 additions & 0 deletions drivers/saturn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const request = require('../lib/request');
const Ticker = require('../models/ticker');
const { parseToFloat } = require('../lib/utils.js');

module.exports = async () => {
const markets = await request('https://ticker.saturn.network/returnTicker.json');

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

return new Ticker({
base,
quote: ticker.symbol,
quoteName: ticker.name,
close: parseToFloat(ticker.last),
bid: parseToFloat(ticker.highestBid),
ask: parseToFloat(ticker.lowestAsk),
baseVolume: parseToFloat(ticker.quoteVolume), // reversed with quote
quoteVolume: parseToFloat(ticker.baseVolume),
});
});
};
Loading

0 comments on commit 4b3b0b9

Please sign in to comment.