forked from ccxt/ccxt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbtctradeim.py
More file actions
59 lines (53 loc) · 2.15 KB
/
btctradeim.py
File metadata and controls
59 lines (53 loc) · 2.15 KB
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
57
58
59
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.coinegg import coinegg
from ccxt.base.errors import ExchangeError
class btctradeim (coinegg):
def describe(self):
result = self.deep_extend(super(btctradeim, self).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://api.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,
},
},
},
# see the fix below
# 'options': {
# 'quoteIds': ['btc', 'eth', 'usc'],
# },
})
# a fix for PHP array_merge not overwriting "lists"(integer-indexed arrays)
# https://github.com/ccxt/ccxt/issues/3343
result['options']['quoteIds'] = ['btc', 'eth', 'usc']
return result
def request(self, path, api='public', method='GET', params={}, headers=None, body=None):
response = self.fetch2(path, api, method, params, headers, body)
if api == 'web':
return response
data = self.safe_value(response, 'data')
if data:
code = self.safe_string(response, 'code')
if code != '0':
message = self.safe_string(response, 'msg', 'Error')
raise ExchangeError(message)
return data
return response