forked from ccxt/ccxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtctradeim.js
56 lines (51 loc) · 1.92 KB
/
btctradeim.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
52
53
54
55
56
'use strict';
// ---------------------------------------------------------------------------
const coinegg = require ('./coinegg.js');
const { ExchangeError } = require ('./base/errors');
// ---------------------------------------------------------------------------
module.exports = class btctradeim extends coinegg {
describe () {
return this.deepExtend (super.describe (), {
'id': 'btctradeim',
'name': 'BtcTrade.im',
'countries': 'HK',
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/36770531-c2142444-1c5b-11e8-91e2-a4d90dc85fe8.jpg',
'api': {
'web': 'https://www.btctrade.im/coin',
'rest': 'https://api.btctrade.im/api/v1',
},
'www': 'https://www.btctrade.im',
'doc': 'https://www.btctrade.im/help.api.html',
'fees': 'https://www.btctrade.im/spend.price.html',
},
'fees': {
'trading': {
'maker': 0.2 / 100,
'taker': 0.2 / 100,
},
'funding': {
'withdraw': {
'BTC': 0.001,
},
},
},
});
}
async request (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
let response = await this.fetch2 (path, api, method, params, headers, body);
if (api === 'web') {
return response;
}
let data = this.safeValue (response, 'data');
if (data) {
let code = this.safeString (response, 'code');
if (code !== '0') {
let message = this.safeString (response, 'msg', 'Error');
throw new ExchangeError (message);
}
return data;
}
return response;
}
};