Skip to content

Commit

Permalink
feat: sigen pro driver
Browse files Browse the repository at this point in the history
  • Loading branch information
sajcics authored and nickpater committed Apr 15, 2020
1 parent 562faa3 commit b8f40fc
Show file tree
Hide file tree
Showing 3 changed files with 131 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 @@ -211,6 +211,7 @@ exports.rudex = require('./rudex');
exports.satoexchange = require('./satoexchange');
exports.saturn = require('./saturn');
exports.shortex = require('./shortex');
exports.sigenpro = require('./sigenpro');
exports.simex = require('./simex');
exports.sistemkoin = require('./sistemkoin');
exports.southxchange = require('./southxchange');
Expand Down
24 changes: 24 additions & 0 deletions drivers/sigenpro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const request = require('../lib/request');
const Ticker = require('../models/ticker');
const { parseToFloat } = require('../lib/utils.js');

module.exports = async () => {
const { data: { pairs: markets } } = await request(' https://sigen.pro/v1/web-public/exchange/summary');

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

return new Ticker({
base,
quote,
high: parseToFloat(ticker.high24hr),
low: parseToFloat(ticker.low24hr),
close: parseToFloat(ticker.last),
bid: parseToFloat(ticker.lowestAsk),
ask: parseToFloat(ticker.highestBid),
baseVolume: parseToFloat(ticker.baseVolume),
quoteVolume: parseToFloat(ticker.quoteVolume),
});
});
};
106 changes: 106 additions & 0 deletions tests/fixtures/sigenpro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[
{
"scope": "https://sigen.pro:443",
"method": "GET",
"path": "/v1/web-public/exchange/summary",
"body": "",
"status": 200,
"response": {
"success": true,
"data": {
"pairs": {
"PZM_BTC": {
"id": 11,
"last": "0.00001112",
"lowestAsk": "0.00001112",
"highestBid": "0.013341332015675",
"percentChange": "-5.44217687",
"baseVolume": "65226.44522336",
"quoteVolume": "0.75010412",
"isFrozen": 0,
"high24hr": "0.00001176",
"low24hr": "0.00001103"
},
"ETH_BTC": {
"id": 9,
"last": "0.00525",
"lowestAsk": "0.005",
"highestBid": "0.0400439679978015",
"percentChange": "0.96153846",
"baseVolume": "0.27321515",
"quoteVolume": "0.00143438",
"isFrozen": 0,
"high24hr": "0.15",
"low24hr": "0.0052"
},
"LTC_BTC": {
"id": 1,
"last": "0.00003844",
"lowestAsk": "0.0000103",
"highestBid": false,
"percentChange": "0.00000000",
"baseVolume": 0,
"quoteVolume": "0.00000000",
"isFrozen": 0,
"high24hr": "0.00003844",
"low24hr": "0.00003844"
}
},
"coins": {
"PZM": {
"name": "PRIZM",
"withdraw": "ON",
"deposit": "ON"
},
"BTC": {
"name": "BITCOIN",
"withdraw": "ON",
"deposit": "ON"
},
"ETH": {
"name": "Etherium",
"withdraw": "ON",
"deposit": "ON"
},
"LTC": {
"name": "LITECOIN",
"withdraw": "ON",
"deposit": "ON"
}
}
},
"run_time": 0.09318399429321289
},
"rawHeaders": [
"Date",
"Thu, 09 Apr 2020 21:14:23 GMT",
"Content-Type",
"application/json; charset=UTF-8",
"Transfer-Encoding",
"chunked",
"Connection",
"keep-alive",
"Set-Cookie",
"__cfduid=d215606df3bad91da6a82e95cb580b14b1586466862; expires=Sat, 09-May-20 21:14:22 GMT; path=/; domain=.sigen.pro; HttpOnly; SameSite=Lax; Secure",
"Set-Cookie",
"PHPSESSID=v47ivv0iqjvr492koeb6qr6ij8; path=/; HttpOnly",
"Expires",
"Thu, 19 Nov 1981 08:52:00 GMT",
"Cache-Control",
"no-store, no-cache, must-revalidate",
"Pragma",
"no-cache",
"CF-Cache-Status",
"DYNAMIC",
"Expect-CT",
"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
"Strict-Transport-Security",
"max-age=15552000; preload",
"X-Content-Type-Options",
"nosniff",
"Server",
"cloudflare"
],
"responseIsBinary": false
}
]

0 comments on commit b8f40fc

Please sign in to comment.