forked from ccxt/ccxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjubi.js
51 lines (46 loc) · 1.58 KB
/
jubi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
'use strict';
// ---------------------------------------------------------------------------
const btcbox = require ('./btcbox.js');
// ---------------------------------------------------------------------------
module.exports = class jubi extends btcbox {
describe () {
return this.deepExtend (super.describe (), {
'id': 'jubi',
'name': 'jubi.com',
'countries': 'CN',
'rateLimit': 1500,
'version': 'v1',
'has': {
'CORS': false,
'fetchTickers': true,
},
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/27766581-9d397d9a-5edd-11e7-8fb9-5d8236c0e692.jpg',
'api': 'https://www.jubi.com/api',
'www': 'https://www.jubi.com',
'doc': 'https://www.jubi.com/help/api.html',
},
});
}
async fetchMarkets () {
let markets = await this.publicGetAllticker ();
let keys = Object.keys (markets);
let result = [];
for (let p = 0; p < keys.length; p++) {
let id = keys[p];
let base = id.toUpperCase ();
let quote = 'CNY'; // todo
let symbol = base + '/' + quote;
base = this.commonCurrencyCode (base);
quote = this.commonCurrencyCode (quote);
result.push ({
'id': id,
'symbol': symbol,
'base': base,
'quote': quote,
'info': id,
});
}
return result;
}
};