ccxt 3.1.21__py2.py3-none-any.whl → 3.1.24__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bitstamp.py +10 -0
- ccxt/abstract/bybit.py +1 -0
- ccxt/abstract/currencycom.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +5 -23
- ccxt/async_support/bitget.py +36 -14
- ccxt/async_support/bitstamp.py +10 -0
- ccxt/async_support/bybit.py +1 -0
- ccxt/async_support/currencycom.py +83 -44
- ccxt/async_support/poloniex.py +77 -16
- ccxt/async_support/xt.py +5 -1
- ccxt/base/exchange.py +5 -23
- ccxt/bitget.py +36 -14
- ccxt/bitstamp.py +10 -0
- ccxt/bybit.py +1 -0
- ccxt/currencycom.py +83 -44
- ccxt/poloniex.py +77 -16
- ccxt/pro/__init__.py +1 -1
- ccxt/xt.py +5 -1
- {ccxt-3.1.21.dist-info → ccxt-3.1.24.dist-info}/METADATA +4 -4
- {ccxt-3.1.21.dist-info → ccxt-3.1.24.dist-info}/RECORD +24 -24
- {ccxt-3.1.21.dist-info → ccxt-3.1.24.dist-info}/WHEEL +0 -0
- {ccxt-3.1.21.dist-info → ccxt-3.1.24.dist-info}/top_level.txt +0 -0
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '3.1.
|
7
|
+
__version__ = '3.1.24'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2406,21 +2406,10 @@ class Exchange(object):
|
|
2406
2406
|
})
|
2407
2407
|
|
2408
2408
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2412
|
-
|
2413
|
-
result = []
|
2414
|
-
for i in range(0, len(ohlcvc)):
|
2415
|
-
result.append([
|
2416
|
-
self.safe_integer(ohlcvc[i], 0),
|
2417
|
-
self.safe_number(ohlcvc[i], 1),
|
2418
|
-
self.safe_number(ohlcvc[i], 2),
|
2419
|
-
self.safe_number(ohlcvc[i], 3),
|
2420
|
-
self.safe_number(ohlcvc[i], 4),
|
2421
|
-
self.safe_number(ohlcvc[i], 5),
|
2422
|
-
])
|
2423
|
-
return result
|
2409
|
+
message = ''
|
2410
|
+
if self.has['fetchTrades']:
|
2411
|
+
message = '. If you want to build OHLCV candles from trade executions data, visit https://github.com/ccxt/ccxt/tree/master/examples/ and see "build-ohlcv-bars" file'
|
2412
|
+
raise NotSupported(self.id + ' fetchOHLCV() is not supported yet' + message)
|
2424
2413
|
|
2425
2414
|
def watch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
|
2426
2415
|
raise NotSupported(self.id + ' watchOHLCV() is not supported yet')
|
@@ -2887,13 +2876,6 @@ class Exchange(object):
|
|
2887
2876
|
ohlcvs[candle][i_count] = self.sum(ohlcvs[candle][i_count], 1)
|
2888
2877
|
return ohlcvs
|
2889
2878
|
|
2890
|
-
def fetch_ohlcvc(self, symbol, timeframe='1m', since: Optional[Any] = None, limit: Optional[int] = None, params={}):
|
2891
|
-
if not self.has['fetchTrades']:
|
2892
|
-
raise NotSupported(self.id + ' fetchOHLCV() is not supported yet')
|
2893
|
-
self.load_markets()
|
2894
|
-
trades = self.fetchTrades(symbol, since, limit, params)
|
2895
|
-
return self.build_ohlcvc(trades, timeframe, since, limit)
|
2896
|
-
|
2897
2879
|
def parse_trading_view_ohlcv(self, ohlcvs, market=None, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None):
|
2898
2880
|
result = self.convert_trading_view_to_ohlcv(ohlcvs)
|
2899
2881
|
return self.parse_ohlcvs(result, market, timeframe, since, limit)
|
ccxt/bitget.py
CHANGED
@@ -2360,19 +2360,22 @@ class bitget(Exchange, ImplicitAPI):
|
|
2360
2360
|
#
|
2361
2361
|
# spot
|
2362
2362
|
# {
|
2363
|
-
#
|
2364
|
-
#
|
2365
|
-
#
|
2366
|
-
#
|
2367
|
-
#
|
2368
|
-
#
|
2369
|
-
#
|
2370
|
-
#
|
2371
|
-
#
|
2372
|
-
#
|
2373
|
-
#
|
2374
|
-
#
|
2375
|
-
#
|
2363
|
+
# "accountId": "222222222",
|
2364
|
+
# "symbol": "TRXUSDT_SPBL",
|
2365
|
+
# "orderId": "1041901704004947968",
|
2366
|
+
# "clientOrderId": "c5e8a5e1-a07f-4202-8061-b88bd598b264",
|
2367
|
+
# "price": "0",
|
2368
|
+
# "quantity": "10.0000000000000000",
|
2369
|
+
# "orderType": "market",
|
2370
|
+
# "side": "buy",
|
2371
|
+
# "status": "full_fill",
|
2372
|
+
# "fillPrice": "0.0699782527055350",
|
2373
|
+
# "fillQuantity": "142.9015000000000000",
|
2374
|
+
# "fillTotalAmount": "9.9999972790000000",
|
2375
|
+
# "enterPointSource": "API",
|
2376
|
+
# "feeDetail": "{\"BGB\":{\"deduction\":true,\"feeCoinCode\":\"BGB\",\"totalDeductionFee\":-0.017118519726,\"totalFee\":-0.017118519726}}",
|
2377
|
+
# "orderSource": "market",
|
2378
|
+
# "cTime": "1684134644509"
|
2376
2379
|
# }
|
2377
2380
|
#
|
2378
2381
|
# swap
|
@@ -2434,6 +2437,22 @@ class bitget(Exchange, ImplicitAPI):
|
|
2434
2437
|
side = 'sell'
|
2435
2438
|
clientOrderId = self.safe_string_2(order, 'clientOrderId', 'clientOid')
|
2436
2439
|
fee = None
|
2440
|
+
feeCostString = self.safe_string(order, 'fee')
|
2441
|
+
if feeCostString is not None:
|
2442
|
+
# swap
|
2443
|
+
fee = {
|
2444
|
+
'cost': feeCostString,
|
2445
|
+
'currency': market['settle'],
|
2446
|
+
}
|
2447
|
+
feeDetail = self.safe_value(order, 'feeDetail')
|
2448
|
+
if feeDetail is not None:
|
2449
|
+
parsedFeeDetail = json.loads(feeDetail)
|
2450
|
+
feeValues = list(parsedFeeDetail.values())
|
2451
|
+
first = self.safe_value(feeValues, 0)
|
2452
|
+
fee = {
|
2453
|
+
'cost': self.safe_string(first, 'totalFee'),
|
2454
|
+
'currency': self.safe_currency_code(self.safe_string(first, 'feeCoinCode')),
|
2455
|
+
}
|
2437
2456
|
rawStatus = self.safe_string_2(order, 'status', 'state')
|
2438
2457
|
status = self.parse_order_status(rawStatus)
|
2439
2458
|
lastTradeTimestamp = self.safe_integer(order, 'uTime')
|
@@ -3307,7 +3326,10 @@ class bitget(Exchange, ImplicitAPI):
|
|
3307
3326
|
# }
|
3308
3327
|
#
|
3309
3328
|
data = self.safe_value(response, 'data')
|
3310
|
-
|
3329
|
+
if data is not None:
|
3330
|
+
return self.safe_value_2(data, 'orderList', 'data', [])
|
3331
|
+
parsedData = json.loads(response)
|
3332
|
+
return self.safe_value(parsedData, 'data', [])
|
3311
3333
|
|
3312
3334
|
def fetch_ledger(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
|
3313
3335
|
"""
|
ccxt/bitstamp.py
CHANGED
@@ -127,20 +127,26 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
127
127
|
'get': {
|
128
128
|
'ohlc/{pair}/': 1,
|
129
129
|
'order_book/{pair}/': 1,
|
130
|
+
'ticker/': 1,
|
130
131
|
'ticker_hour/{pair}/': 1,
|
131
132
|
'ticker/{pair}/': 1,
|
132
133
|
'transactions/{pair}/': 1,
|
133
134
|
'trading-pairs-info/': 1,
|
135
|
+
'currencies/': 1,
|
136
|
+
'eur_usd/': 1,
|
134
137
|
},
|
135
138
|
},
|
136
139
|
'private': {
|
137
140
|
'post': {
|
141
|
+
'account_balances/': 1,
|
142
|
+
'account_balances/{currency}/': 1,
|
138
143
|
'balance/': 1,
|
139
144
|
'balance/{pair}/': 1,
|
140
145
|
'bch_withdrawal/': 1,
|
141
146
|
'bch_address/': 1,
|
142
147
|
'user_transactions/': 1,
|
143
148
|
'user_transactions/{pair}/': 1,
|
149
|
+
'crypto-transactions/': 1,
|
144
150
|
'open_orders/all/': 1,
|
145
151
|
'open_orders/{pair}/': 1,
|
146
152
|
'order_status/': 1,
|
@@ -155,6 +161,10 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
155
161
|
'sell/instant/{pair}/': 1,
|
156
162
|
'transfer-to-main/': 1,
|
157
163
|
'transfer-from-main/': 1,
|
164
|
+
'my_trading_pairs/': 1,
|
165
|
+
'fees/trading/': 1,
|
166
|
+
'fees/withdrawal/': 1,
|
167
|
+
'fees/withdrawal/{currency}/': 1,
|
158
168
|
'withdrawal-requests/': 1,
|
159
169
|
'withdrawal/open/': 1,
|
160
170
|
'withdrawal/status/': 1,
|
ccxt/bybit.py
CHANGED
@@ -410,6 +410,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
410
410
|
# user
|
411
411
|
'v5/user/query-sub-members': 10,
|
412
412
|
'v5/user/query-api': 10,
|
413
|
+
'v5/customer/info': 10,
|
413
414
|
'v5/spot-cross-margin-trade/loan-info': 1, # 50/s => cost = 50 / 50 = 1
|
414
415
|
'v5/spot-cross-margin-trade/account': 1, # 50/s => cost = 50 / 50 = 1
|
415
416
|
'v5/spot-cross-margin-trade/orders': 1, # 50/s => cost = 50 / 50 = 1
|
ccxt/currencycom.py
CHANGED
@@ -88,7 +88,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
88
88
|
'fetchOHLCV': True,
|
89
89
|
'fetchOpenOrder': None,
|
90
90
|
'fetchOpenOrders': True,
|
91
|
-
'fetchOrder':
|
91
|
+
'fetchOrder': True,
|
92
92
|
'fetchOrderBook': True,
|
93
93
|
'fetchOrderBooks': None,
|
94
94
|
'fetchOrders': None,
|
@@ -214,6 +214,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
214
214
|
'v2/tradingPositionsHistory': 1,
|
215
215
|
'v2/transactions': 1,
|
216
216
|
'v2/withdrawals': 1,
|
217
|
+
'v2/fetchOrder': 1,
|
217
218
|
},
|
218
219
|
'post': {
|
219
220
|
'v1/order': 1,
|
@@ -269,6 +270,8 @@ class currencycom(Exchange, ImplicitAPI):
|
|
269
270
|
'Only leverage symbol allowed here:': BadSymbol, # when you fetchLeverage for non-leverage symbols, like 'BTC/USDT' instead of 'BTC/USDT_LEVERAGE': {"code":"-1128","msg":"Only leverage symbol allowed here: BTC/USDT"}
|
270
271
|
'market data service is not available': ExchangeNotAvailable, # {"code":"-1021","msg":"market data service is not available"}
|
271
272
|
'your time is ahead of server': InvalidNonce, # {"code":"-1021","msg":"your time is ahead of server"}
|
273
|
+
'Can not find account': BadRequest, # -1128
|
274
|
+
'You mentioned an invalid value for the price parameter': BadRequest, # -1030
|
272
275
|
},
|
273
276
|
'exact': {
|
274
277
|
'-1000': ExchangeNotAvailable, # {"code":-1000,"msg":"An unknown error occured while processing the request."}
|
@@ -279,7 +282,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
279
282
|
'-1100': InvalidOrder, # createOrder(symbol, 1, asdf) -> 'Illegal characters found in parameter 'price'
|
280
283
|
'-1104': ExchangeError, # Not all sent parameters were read, read 8 parameters but was sent 9
|
281
284
|
'-1025': AuthenticationError, # {"code":-1025,"msg":"Invalid API-key, IP, or permissions for action"}
|
282
|
-
'-1128': BadRequest, # {"code":-1128,"msg":"Combination of optional parameters invalid."} | {"code":"-1128","msg":"Combination of parameters invalid"} | {"code":"-1128","msg":"Invalid limit price"}
|
285
|
+
'-1128': BadRequest, # {"code":-1128,"msg":"Combination of optional parameters invalid."} | {"code":"-1128","msg":"Combination of parameters invalid"} | {"code":"-1128","msg":"Invalid limit price"} | {"code":"-1128","msg":"Can not find account: null"}
|
283
286
|
'-2010': ExchangeError, # generic error code for createOrder -> 'Account has insufficient balance for requested action.', {"code":-2010,"msg":"Rest API trading is not enabled."}, etc...
|
284
287
|
'-2011': OrderNotFound, # cancelOrder(1, 'BTC/USDT') -> 'UNKNOWN_ORDER'
|
285
288
|
'-2013': OrderNotFound, # fetchOrder(1, 'BTC/USDT') -> 'Order does not exist'
|
@@ -607,7 +610,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
607
610
|
result = []
|
608
611
|
for i in range(0, len(accounts)):
|
609
612
|
account = accounts[i]
|
610
|
-
accountId = self.
|
613
|
+
accountId = self.safe_string(account, 'accountId') # must be string, because the numeric value is far too big for integer, and causes bugs
|
611
614
|
currencyId = self.safe_string(account, 'asset')
|
612
615
|
currencyCode = self.safe_currency_code(currencyId)
|
613
616
|
result.append({
|
@@ -1077,28 +1080,14 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1077
1080
|
# "orderId": "00000000-0000-0000-0000-000006eacaa0",
|
1078
1081
|
# "transactTime": "1645281669295",
|
1079
1082
|
# "price": "30000.00000000",
|
1080
|
-
# "origQty": "0.0002",
|
1081
|
-
# "executedQty": "0.0",
|
1082
|
-
# "
|
1083
|
+
# "origQty": "0.0002", # might not be present for "market" order
|
1084
|
+
# "executedQty": "0.0", # positive for BUY, negative for SELL. This property might not be present in Leverage markets
|
1085
|
+
# "margin": 0.1, # present in leverage markets
|
1086
|
+
# "status": "NEW", # NEW, FILLED, ...
|
1083
1087
|
# "timeInForce": "GTC",
|
1084
|
-
# "type": "LIMIT",
|
1088
|
+
# "type": "LIMIT", # LIMIT, MARKET
|
1085
1089
|
# "side": "BUY",
|
1086
|
-
#
|
1087
|
-
#
|
1088
|
-
# market
|
1089
|
-
#
|
1090
|
-
# {
|
1091
|
-
# "symbol": "DOGE/USD",
|
1092
|
-
# "orderId": "00000000-0000-0000-0000-000006eab2ad",
|
1093
|
-
# "transactTime": "1645283022252",
|
1094
|
-
# "price": "0.14066000",
|
1095
|
-
# "origQty": "40",
|
1096
|
-
# "executedQty": "40.0", # positive for BUY, negative for SELL
|
1097
|
-
# "status": "FILLED",
|
1098
|
-
# "timeInForce": "FOK",
|
1099
|
-
# "type": "MARKET",
|
1100
|
-
# "side": "SELL",
|
1101
|
-
# "fills": [
|
1090
|
+
# "fills": [ # self field might not be present if there were no fills
|
1102
1091
|
# {
|
1103
1092
|
# "price": "0.14094",
|
1104
1093
|
# "qty": "40.0",
|
@@ -1108,6 +1097,32 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1108
1097
|
# ],
|
1109
1098
|
# }
|
1110
1099
|
#
|
1100
|
+
# fetchOrder(fetchOpenOrders is an array same structure, with some extra fields)
|
1101
|
+
#
|
1102
|
+
# {
|
1103
|
+
# "symbol": "BTC/USD_LEVERAGE",
|
1104
|
+
# "accountId": "123456789012345678",
|
1105
|
+
# "orderId": "00a01234-0123-54c4-0000-123451234567",
|
1106
|
+
# "price": "25779.35",
|
1107
|
+
# "status": "MODIFIED",
|
1108
|
+
# "type": "LIMIT",
|
1109
|
+
# "timeInForceType": "GTC",
|
1110
|
+
# "side": "BUY",
|
1111
|
+
# "guaranteedStopLoss": False,
|
1112
|
+
# "trailingStopLoss": False,
|
1113
|
+
# "margin": "0.05",
|
1114
|
+
# "takeProfit": "27020.00",
|
1115
|
+
# "stopLoss": "24500.35",
|
1116
|
+
# "fills": [], # might not be present
|
1117
|
+
# "timestamp": "1685958369623", # "time" in "fetchOpenOrders"
|
1118
|
+
# "expireTime": "1686167960000", # "expireTimestamp" in "fetchOpenOrders"
|
1119
|
+
# "quantity": "0.00040", # "origQty" in "fetchOpenOrders"
|
1120
|
+
# "executedQty": "0.0", # present in "fetchOpenOrders"
|
1121
|
+
# "updateTime": "1685958369542", # present in "fetchOpenOrders"
|
1122
|
+
# "leverage": True, # present in "fetchOpenOrders"
|
1123
|
+
# "working": True # present in "fetchOpenOrders"
|
1124
|
+
# }
|
1125
|
+
#
|
1111
1126
|
# cancelOrder
|
1112
1127
|
#
|
1113
1128
|
# {
|
@@ -1122,36 +1137,18 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1122
1137
|
# "side": "BUY",
|
1123
1138
|
# }
|
1124
1139
|
#
|
1125
|
-
# fetchOpenOrders
|
1126
|
-
#
|
1127
|
-
# {
|
1128
|
-
# "symbol": "DOGE/USD",
|
1129
|
-
# "orderId": "00000000-0000-0003-0000-000004bcc27a",
|
1130
|
-
# "price": "0.13",
|
1131
|
-
# "origQty": "39.0",
|
1132
|
-
# "executedQty": "0.0",
|
1133
|
-
# "status": "NEW",
|
1134
|
-
# "timeInForce": "GTC",
|
1135
|
-
# "type": "LIMIT",
|
1136
|
-
# "side": "BUY",
|
1137
|
-
# "time": "1645284216240",
|
1138
|
-
# "updateTime": "1645284216240",
|
1139
|
-
# "leverage": False, # whether it's swap or not
|
1140
|
-
# "working": True,
|
1141
|
-
# }
|
1142
|
-
#
|
1143
1140
|
marketId = self.safe_string(order, 'symbol')
|
1144
1141
|
symbol = self.safe_symbol(marketId, market, '/')
|
1145
1142
|
id = self.safe_string(order, 'orderId')
|
1146
1143
|
price = self.safe_string(order, 'price')
|
1147
|
-
amount = self.
|
1144
|
+
amount = self.safe_string_2(order, 'origQty', 'quantity')
|
1148
1145
|
filledRaw = self.safe_string(order, 'executedQty')
|
1149
1146
|
filled = Precise.string_abs(filledRaw)
|
1150
1147
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
1151
|
-
timeInForce = self.parse_order_time_in_force(self.
|
1148
|
+
timeInForce = self.parse_order_time_in_force(self.safe_string_2(order, 'timeInForce', 'timeInForceType'))
|
1152
1149
|
type = self.parse_order_type(self.safe_string(order, 'type'))
|
1153
1150
|
side = self.parse_order_side(self.safe_string(order, 'side'))
|
1154
|
-
timestamp = self.
|
1151
|
+
timestamp = self.safe_integer_n(order, ['time', 'transactTime', 'timestamp'])
|
1155
1152
|
fills = self.safe_value(order, 'fills')
|
1156
1153
|
return self.safe_order({
|
1157
1154
|
'info': order,
|
@@ -1179,6 +1176,8 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1179
1176
|
def parse_order_status(self, status):
|
1180
1177
|
statuses = {
|
1181
1178
|
'NEW': 'open',
|
1179
|
+
'CREATED': 'open',
|
1180
|
+
'MODIFIED': 'open',
|
1182
1181
|
'PARTIALLY_FILLED': 'open',
|
1183
1182
|
'FILLED': 'closed',
|
1184
1183
|
'CANCELED': 'canceled',
|
@@ -1304,6 +1303,46 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1304
1303
|
#
|
1305
1304
|
return self.parse_order(response, market)
|
1306
1305
|
|
1306
|
+
def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
|
1307
|
+
"""
|
1308
|
+
fetches information on an order made by the user
|
1309
|
+
see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getOrderUsingGET
|
1310
|
+
:param str symbol: unified symbol of the market the order was made in
|
1311
|
+
:param dict params: extra parameters specific to the currencycom api endpoint
|
1312
|
+
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1313
|
+
"""
|
1314
|
+
self.check_required_symbol('fetchOrder', symbol)
|
1315
|
+
self.load_markets()
|
1316
|
+
market = self.market(symbol)
|
1317
|
+
request = {
|
1318
|
+
'orderId': id,
|
1319
|
+
'symbol': market['id'],
|
1320
|
+
}
|
1321
|
+
response = self.privateGetV2FetchOrder(self.extend(request, params))
|
1322
|
+
#
|
1323
|
+
# {
|
1324
|
+
# "accountId": "109698017413125316",
|
1325
|
+
# "orderId": "2810f1c5-0079-54c4-0000-000080421601",
|
1326
|
+
# "quantity": "20.0",
|
1327
|
+
# "price": "0.06",
|
1328
|
+
# "timestamp": "1661157503788",
|
1329
|
+
# "status": "CREATED",
|
1330
|
+
# "type": "LIMIT",
|
1331
|
+
# "timeInForceType": "GTC",
|
1332
|
+
# "side": "BUY",
|
1333
|
+
# "margin": "0.1",
|
1334
|
+
# "fills": [ # might not be present
|
1335
|
+
# {
|
1336
|
+
# "price": "0.14094",
|
1337
|
+
# "qty": "40.0",
|
1338
|
+
# "commission": "0",
|
1339
|
+
# "commissionAsset": "dUSD"
|
1340
|
+
# }
|
1341
|
+
# ]
|
1342
|
+
# }
|
1343
|
+
#
|
1344
|
+
return self.parse_order(response)
|
1345
|
+
|
1307
1346
|
def fetch_open_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
|
1308
1347
|
"""
|
1309
1348
|
fetch all unfilled currently open orders
|
ccxt/poloniex.py
CHANGED
@@ -198,6 +198,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
198
198
|
'BDG': 'Badgercoin',
|
199
199
|
'BTM': 'Bitmark',
|
200
200
|
'CON': 'Coino',
|
201
|
+
'ETHTRON': 'ETH',
|
201
202
|
'GOLD': 'GoldEagles',
|
202
203
|
'GPUC': 'GPU',
|
203
204
|
'HOT': 'Hotcoin',
|
@@ -210,6 +211,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
210
211
|
'STR': 'XLM',
|
211
212
|
'SOC': 'SOCC',
|
212
213
|
'TRADE': 'Unitrade',
|
214
|
+
'TRXETH': 'TRX',
|
213
215
|
'XAP': 'API Coin',
|
214
216
|
# self is not documented in the API docs for Poloniex
|
215
217
|
# https://github.com/ccxt/ccxt/issues/7084
|
@@ -220,6 +222,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
220
222
|
# with a USDTTRON or a USDTETH currency id, respectfully
|
221
223
|
# therefore we have map them back to the original code USDT
|
222
224
|
# otherwise the returned withdrawals are filtered out
|
225
|
+
'USDTBSC': 'USDT',
|
223
226
|
'USDTTRON': 'USDT',
|
224
227
|
'USDTETH': 'USDT',
|
225
228
|
'UST': 'USTC',
|
@@ -234,6 +237,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
234
237
|
'BSC': 'BEP20',
|
235
238
|
'ETH': 'ERC20',
|
236
239
|
'TRON': 'TRC20',
|
240
|
+
'TRX': 'TRC20',
|
237
241
|
},
|
238
242
|
'limits': {
|
239
243
|
'cost': {
|
@@ -643,7 +647,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
643
647
|
:param dict params: extra parameters specific to the poloniex api endpoint
|
644
648
|
:returns dict: an associative dictionary of currencies
|
645
649
|
"""
|
646
|
-
response = self.publicGetCurrencies(params)
|
650
|
+
response = self.publicGetCurrencies(self.extend(params, {'includeMultiChainCurrencies': True}))
|
647
651
|
#
|
648
652
|
# [
|
649
653
|
# {
|
@@ -659,6 +663,8 @@ class poloniex(Exchange, ImplicitAPI):
|
|
659
663
|
# "delisted": False,
|
660
664
|
# "tradingState": "NORMAL",
|
661
665
|
# "walletState": "DISABLED",
|
666
|
+
# "walletDepositState": 'DISABLED',
|
667
|
+
# "walletWithdrawalState": 'DISABLED',
|
662
668
|
# "parentChain": null,
|
663
669
|
# "isMultiChain": False,
|
664
670
|
# "isChildChain": False,
|
@@ -674,36 +680,91 @@ class poloniex(Exchange, ImplicitAPI):
|
|
674
680
|
id = self.safe_value(ids, 0)
|
675
681
|
currency = self.safe_value(item, id)
|
676
682
|
code = self.safe_currency_code(id)
|
683
|
+
name = self.safe_string(currency, 'name')
|
684
|
+
networkId = self.safe_string(currency, 'blockchain')
|
685
|
+
networkCode = self.network_id_to_code(networkId, code)
|
677
686
|
delisted = self.safe_value(currency, 'delisted')
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
active =
|
687
|
+
walletEnabled = self.safe_string(currency, 'walletState') == 'ENABLED'
|
688
|
+
depositEnabled = self.safe_string(currency, 'walletDepositState') == 'ENABLED'
|
689
|
+
withdrawEnabled = self.safe_string(currency, 'walletWithdrawalState') == 'ENABLED'
|
690
|
+
active = not delisted and walletEnabled and depositEnabled and withdrawEnabled
|
682
691
|
numericId = self.safe_integer(currency, 'id')
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
692
|
+
feeString = self.safe_string(currency, 'withdrawalFee')
|
693
|
+
parentChain = self.safe_value(currency, 'parentChain')
|
694
|
+
noParentChain = parentChain is None
|
695
|
+
if self.safe_value(result, code) is None:
|
696
|
+
result[code] = {
|
697
|
+
'id': id,
|
698
|
+
'code': code,
|
699
|
+
'info': None,
|
700
|
+
'name': name,
|
701
|
+
'active': active,
|
702
|
+
'deposit': depositEnabled,
|
703
|
+
'withdraw': withdrawEnabled,
|
704
|
+
'fee': self.parse_number(feeString),
|
705
|
+
'precision': None,
|
706
|
+
'limits': {
|
707
|
+
'amount': {
|
708
|
+
'min': None,
|
709
|
+
'max': None,
|
710
|
+
},
|
711
|
+
'deposit': {
|
712
|
+
'min': None,
|
713
|
+
'max': None,
|
714
|
+
},
|
715
|
+
'withdraw': {
|
716
|
+
'min': None,
|
717
|
+
'max': None,
|
718
|
+
},
|
719
|
+
},
|
720
|
+
}
|
721
|
+
minFeeString = self.safe_string(result[code], 'fee')
|
722
|
+
if feeString is not None:
|
723
|
+
minFeeString = feeString if (minFeeString is None) else Precise.string_min(feeString, minFeeString)
|
724
|
+
depositAvailable = self.safe_value(result[code], 'deposit')
|
725
|
+
depositAvailable = depositEnabled if (depositEnabled) else depositAvailable
|
726
|
+
withdrawAvailable = self.safe_value(result[code], 'withdraw')
|
727
|
+
withdrawAvailable = withdrawEnabled if (withdrawEnabled) else withdrawAvailable
|
728
|
+
networks = self.safe_value(result[code], 'networks', {})
|
729
|
+
networks[networkCode] = {
|
688
730
|
'info': currency,
|
689
|
-
'
|
731
|
+
'id': networkId,
|
732
|
+
'network': networkCode,
|
733
|
+
'currencyId': id,
|
734
|
+
'numericId': numericId,
|
735
|
+
'deposit': depositEnabled,
|
736
|
+
'withdraw': withdrawEnabled,
|
690
737
|
'active': active,
|
691
|
-
'
|
692
|
-
'withdraw': None,
|
693
|
-
'fee': fee,
|
738
|
+
'fee': self.parse_number(feeString),
|
694
739
|
'precision': None,
|
695
|
-
'networks': {},
|
696
740
|
'limits': {
|
697
741
|
'amount': {
|
698
742
|
'min': None,
|
699
743
|
'max': None,
|
700
744
|
},
|
701
745
|
'withdraw': {
|
702
|
-
'min':
|
746
|
+
'min': None,
|
747
|
+
'max': None,
|
748
|
+
},
|
749
|
+
'deposit': {
|
750
|
+
'min': None,
|
703
751
|
'max': None,
|
704
752
|
},
|
705
753
|
},
|
706
754
|
}
|
755
|
+
result[code]['networks'] = networks
|
756
|
+
info = self.safe_value(result[code], 'info', [])
|
757
|
+
rawInfo = {}
|
758
|
+
rawInfo[id] = currency
|
759
|
+
info.append(rawInfo)
|
760
|
+
result[code]['info'] = info
|
761
|
+
if noParentChain:
|
762
|
+
result[code]['id'] = id
|
763
|
+
result[code]['name'] = name
|
764
|
+
result[code]['active'] = depositAvailable and withdrawAvailable
|
765
|
+
result[code]['deposit'] = depositAvailable
|
766
|
+
result[code]['withdraw'] = withdrawAvailable
|
767
|
+
result[code]['fee'] = self.parse_number(minFeeString)
|
707
768
|
return result
|
708
769
|
|
709
770
|
def fetch_ticker(self, symbol: str, params={}):
|
ccxt/pro/__init__.py
CHANGED
ccxt/xt.py
CHANGED
@@ -4341,7 +4341,11 @@ class xt(Exchange, ImplicitAPI):
|
|
4341
4341
|
timestamp = self.number_to_string(self.nonce())
|
4342
4342
|
body = query
|
4343
4343
|
if (payload == '/v4/order') or (payload == '/future/trade/v1/order/create') or (payload == '/future/trade/v1/entrust/create-plan') or (payload == '/future/trade/v1/entrust/create-profit') or (payload == '/future/trade/v1/order/create-batch'):
|
4344
|
-
|
4344
|
+
id = 'CCXT'
|
4345
|
+
if payload.find('future') > -1:
|
4346
|
+
body['clientMedia'] = id
|
4347
|
+
else:
|
4348
|
+
body['media'] = id
|
4345
4349
|
isUndefinedBody = ((method == 'GET') or (path == 'order/{orderId}'))
|
4346
4350
|
body = None if isUndefinedBody else self.json(body)
|
4347
4351
|
payloadString = None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 3.1.
|
3
|
+
Version: 3.1.24
|
4
4
|
Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 130+ exchanges
|
5
5
|
Home-page: https://ccxt.com
|
6
6
|
Author: Igor Kroitor
|
@@ -264,13 +264,13 @@ console.log(version, Object.keys(exchanges));
|
|
264
264
|
|
265
265
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
266
266
|
|
267
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@3.1.
|
268
|
-
* unpkg: https://unpkg.com/ccxt@3.1.
|
267
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@3.1.24/dist/ccxt.browser.js
|
268
|
+
* unpkg: https://unpkg.com/ccxt@3.1.24/dist/ccxt.browser.js
|
269
269
|
|
270
270
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
271
271
|
|
272
272
|
```HTML
|
273
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@3.1.
|
273
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@3.1.24/dist/ccxt.browser.js"></script>
|
274
274
|
```
|
275
275
|
|
276
276
|
Creates a global `ccxt` object:
|