Skip to content

Commit

Permalink
feat: payrue driver
Browse files Browse the repository at this point in the history
  • Loading branch information
sajcics authored and nickpater committed Mar 20, 2020
1 parent 4b9d87c commit a6e90a3
Show file tree
Hide file tree
Showing 3 changed files with 1,163 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 @@ -190,6 +190,7 @@ exports.p2pb2b = require('./p2pb2b');
exports.paribu = require('./paribu');
exports.parsxc = require('./parsxc');
exports.paymium = require('./paymium');
exports.payrue = require('./payrue');
exports.poloniex = require('./poloniex');
exports.primebit = require('./primebit');
exports.prizmbit = require('./prizmbit');
Expand Down
21 changes: 21 additions & 0 deletions drivers/payrue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const request = require('../lib/request');
const Ticker = require('../models/ticker');
const { parseToFloat } = require('../lib/utils.js');

module.exports = async () => {
const { pairs: tickers } = await request(
'https://payrue.com:8090/api/v1/public/volumes',
);

return tickers.map((ticker) => {
const [base, quote] = ticker.symbol.split('/').reverse();

return new Ticker({
base,
quote,
close: parseToFloat(ticker.price),
baseVolume: parseToFloat(ticker.quote_volume), // reversed with base volume
quoteVolume: parseToFloat(ticker.base_volume),
});
});
};
Loading

0 comments on commit a6e90a3

Please sign in to comment.