ccxt 4.4.41__py2.py3-none-any.whl → 4.4.43__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 +3 -1
- ccxt/abstract/binance.py +3 -0
- ccxt/abstract/binancecoinm.py +3 -0
- ccxt/abstract/binanceus.py +3 -0
- ccxt/abstract/binanceusdm.py +3 -0
- ccxt/abstract/bingx.py +4 -0
- ccxt/abstract/bitstamp.py +1 -0
- ccxt/abstract/myokx.py +340 -0
- ccxt/ace.py +1 -1
- ccxt/alpaca.py +0 -1
- ccxt/ascendex.py +0 -1
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/alpaca.py +0 -1
- ccxt/async_support/ascendex.py +0 -1
- ccxt/async_support/base/exchange.py +15 -15
- ccxt/async_support/bigone.py +0 -1
- ccxt/async_support/binance.py +3 -0
- ccxt/async_support/bingx.py +27 -7
- ccxt/async_support/bitfinex.py +122 -0
- ccxt/async_support/bitstamp.py +54 -0
- ccxt/async_support/blofin.py +16 -7
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +8 -9
- ccxt/async_support/coinbaseexchange.py +5 -6
- ccxt/async_support/coinbaseinternational.py +7 -8
- ccxt/async_support/coincatch.py +0 -1
- ccxt/async_support/coincheck.py +0 -1
- ccxt/async_support/coinex.py +91 -6
- ccxt/async_support/coinlist.py +3 -4
- ccxt/async_support/coinmate.py +1 -3
- ccxt/async_support/coinmetro.py +4 -5
- ccxt/async_support/coinone.py +0 -1
- ccxt/async_support/coinsph.py +7 -8
- ccxt/async_support/cryptocom.py +3 -0
- ccxt/async_support/currencycom.py +3 -4
- ccxt/async_support/defx.py +6 -7
- ccxt/async_support/deribit.py +1 -3
- ccxt/async_support/digifinex.py +0 -1
- ccxt/async_support/ellipx.py +0 -2
- ccxt/async_support/exmo.py +1 -2
- ccxt/async_support/gate.py +1 -2
- ccxt/async_support/gemini.py +63 -6
- ccxt/async_support/hashkey.py +79 -67
- ccxt/async_support/hitbtc.py +47 -5
- ccxt/async_support/hollaex.py +4 -6
- ccxt/async_support/htx.py +1 -3
- ccxt/async_support/huobijp.py +0 -1
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/idex.py +8 -8
- ccxt/async_support/independentreserve.py +0 -1
- ccxt/async_support/indodax.py +0 -1
- ccxt/async_support/kraken.py +63 -3
- ccxt/async_support/krakenfutures.py +75 -3
- ccxt/async_support/kucoin.py +1 -3
- ccxt/async_support/kucoinfutures.py +10 -9
- ccxt/async_support/kuna.py +1 -3
- ccxt/async_support/latoken.py +1 -3
- ccxt/async_support/lbank.py +0 -1
- ccxt/async_support/luno.py +0 -1
- ccxt/async_support/lykke.py +0 -1
- ccxt/async_support/mercado.py +0 -1
- ccxt/async_support/mexc.py +3 -4
- ccxt/async_support/myokx.py +35 -0
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +4 -6
- ccxt/async_support/oceanex.py +0 -1
- ccxt/async_support/okcoin.py +1 -3
- ccxt/async_support/okx.py +1 -3
- ccxt/async_support/onetrading.py +1 -3
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paradex.py +5 -7
- ccxt/async_support/phemex.py +14 -14
- ccxt/async_support/poloniex.py +1 -3
- ccxt/async_support/poloniexfutures.py +6 -6
- ccxt/async_support/probit.py +0 -1
- ccxt/async_support/timex.py +0 -1
- ccxt/async_support/tokocrypto.py +11 -14
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/upbit.py +0 -1
- ccxt/async_support/vertex.py +63 -4
- ccxt/async_support/wavesexchange.py +4 -5
- ccxt/async_support/whitebit.py +8 -9
- ccxt/async_support/woo.py +100 -14
- ccxt/async_support/woofipro.py +96 -15
- ccxt/async_support/xt.py +3 -2
- ccxt/async_support/yobit.py +0 -1
- ccxt/async_support/zaif.py +0 -1
- ccxt/async_support/zonda.py +1 -2
- ccxt/base/exchange.py +21 -17
- ccxt/bigone.py +0 -1
- ccxt/binance.py +3 -0
- ccxt/bingx.py +27 -7
- ccxt/bitfinex.py +122 -0
- ccxt/bitstamp.py +54 -0
- ccxt/blofin.py +16 -7
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +8 -9
- ccxt/coinbaseexchange.py +5 -6
- ccxt/coinbaseinternational.py +7 -8
- ccxt/coincatch.py +0 -1
- ccxt/coincheck.py +0 -1
- ccxt/coinex.py +91 -6
- ccxt/coinlist.py +3 -4
- ccxt/coinmate.py +1 -3
- ccxt/coinmetro.py +4 -5
- ccxt/coinone.py +0 -1
- ccxt/coinsph.py +7 -8
- ccxt/cryptocom.py +3 -0
- ccxt/currencycom.py +3 -4
- ccxt/defx.py +6 -7
- ccxt/deribit.py +1 -3
- ccxt/digifinex.py +0 -1
- ccxt/ellipx.py +0 -2
- ccxt/exmo.py +1 -2
- ccxt/gate.py +1 -2
- ccxt/gemini.py +63 -6
- ccxt/hashkey.py +79 -67
- ccxt/hitbtc.py +47 -5
- ccxt/hollaex.py +4 -6
- ccxt/htx.py +1 -3
- ccxt/huobijp.py +0 -1
- ccxt/hyperliquid.py +1 -1
- ccxt/idex.py +8 -8
- ccxt/independentreserve.py +0 -1
- ccxt/indodax.py +0 -1
- ccxt/kraken.py +63 -3
- ccxt/krakenfutures.py +75 -3
- ccxt/kucoin.py +1 -3
- ccxt/kucoinfutures.py +10 -9
- ccxt/kuna.py +1 -3
- ccxt/latoken.py +1 -3
- ccxt/lbank.py +0 -1
- ccxt/luno.py +0 -1
- ccxt/lykke.py +0 -1
- ccxt/mercado.py +0 -1
- ccxt/mexc.py +3 -4
- ccxt/myokx.py +35 -0
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +4 -6
- ccxt/oceanex.py +0 -1
- ccxt/okcoin.py +1 -3
- ccxt/okx.py +1 -3
- ccxt/onetrading.py +1 -3
- ccxt/p2b.py +1 -1
- ccxt/paradex.py +5 -7
- ccxt/phemex.py +14 -14
- ccxt/poloniex.py +1 -3
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/myokx.py +23 -0
- ccxt/probit.py +0 -1
- ccxt/timex.py +0 -1
- ccxt/tokocrypto.py +11 -14
- ccxt/tradeogre.py +1 -1
- ccxt/upbit.py +0 -1
- ccxt/vertex.py +63 -4
- ccxt/wavesexchange.py +4 -5
- ccxt/whitebit.py +8 -9
- ccxt/woo.py +100 -14
- ccxt/woofipro.py +96 -15
- ccxt/xt.py +3 -2
- ccxt/yobit.py +0 -1
- ccxt/zaif.py +0 -1
- ccxt/zonda.py +1 -2
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/METADATA +37 -35
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/RECORD +170 -173
- ccxt/async_support/bitbay.py +0 -17
- ccxt/async_support/bitfinex2.py +0 -3625
- ccxt/async_support/hitbtc3.py +0 -16
- ccxt/bitbay.py +0 -17
- ccxt/bitfinex2.py +0 -3624
- ccxt/hitbtc3.py +0 -16
- ccxt/pro/bitfinex2.py +0 -1086
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/WHEEL +0 -0
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/top_level.txt +0 -0
ccxt/async_support/woofipro.py
CHANGED
@@ -308,6 +308,88 @@ class woofipro(Exchange, ImplicitAPI):
|
|
308
308
|
'brokerId': 'CCXT',
|
309
309
|
'verifyingContractAddress': '0x6F7a338F2aA472838dEFD3283eB360d4Dff5D203',
|
310
310
|
},
|
311
|
+
'features': {
|
312
|
+
'default': {
|
313
|
+
'sandbox': True,
|
314
|
+
'createOrder': {
|
315
|
+
'marginMode': False,
|
316
|
+
'triggerPrice': True,
|
317
|
+
'triggerPriceType': None,
|
318
|
+
'triggerDirection': False,
|
319
|
+
'stopLossPrice': False, # todo by triggerPrice
|
320
|
+
'takeProfitPrice': False, # todo by triggerPrice
|
321
|
+
'attachedStopLossTakeProfit': None,
|
322
|
+
'timeInForce': {
|
323
|
+
'IOC': True,
|
324
|
+
'FOK': True,
|
325
|
+
'PO': True,
|
326
|
+
'GTD': False,
|
327
|
+
},
|
328
|
+
'hedged': False,
|
329
|
+
'trailing': True,
|
330
|
+
# exchange specific
|
331
|
+
# 'iceberg': True,
|
332
|
+
},
|
333
|
+
'createOrders': {
|
334
|
+
'max': 10,
|
335
|
+
},
|
336
|
+
'fetchMyTrades': {
|
337
|
+
'marginMode': False,
|
338
|
+
'limit': 500,
|
339
|
+
'daysBack': None,
|
340
|
+
'untilDays': 100000,
|
341
|
+
},
|
342
|
+
'fetchOrder': {
|
343
|
+
'marginMode': False,
|
344
|
+
'trigger': True,
|
345
|
+
'trailing': False,
|
346
|
+
},
|
347
|
+
'fetchOpenOrders': {
|
348
|
+
'marginMode': False,
|
349
|
+
'limit': 500,
|
350
|
+
'trigger': True,
|
351
|
+
'trailing': False,
|
352
|
+
},
|
353
|
+
'fetchOrders': None,
|
354
|
+
'fetchClosedOrders': {
|
355
|
+
'marginMode': False,
|
356
|
+
'limit': 500,
|
357
|
+
'daysBackClosed': None,
|
358
|
+
'daysBackCanceled': None,
|
359
|
+
'untilDays': 100000,
|
360
|
+
'trigger': True,
|
361
|
+
'trailing': False,
|
362
|
+
},
|
363
|
+
'fetchOHLCV': {
|
364
|
+
'limit': 1000,
|
365
|
+
},
|
366
|
+
},
|
367
|
+
'spot': {
|
368
|
+
'extends': 'default',
|
369
|
+
},
|
370
|
+
'forDerivatives': {
|
371
|
+
'extends': 'default',
|
372
|
+
'createOrder': {
|
373
|
+
# todo: implementation needs unification
|
374
|
+
'triggerPriceType': None,
|
375
|
+
'attachedStopLossTakeProfit': {
|
376
|
+
# todo: implementation needs unification
|
377
|
+
'triggerPriceType': None,
|
378
|
+
'limitPrice': False,
|
379
|
+
},
|
380
|
+
},
|
381
|
+
},
|
382
|
+
'swap': {
|
383
|
+
'linear': {
|
384
|
+
'extends': 'forDerivatives',
|
385
|
+
},
|
386
|
+
'inverse': None,
|
387
|
+
},
|
388
|
+
'future': {
|
389
|
+
'linear': None,
|
390
|
+
'inverse': None,
|
391
|
+
},
|
392
|
+
},
|
311
393
|
'commonCurrencies': {},
|
312
394
|
'exceptions': {
|
313
395
|
'exact': {
|
@@ -1162,7 +1244,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1162
1244
|
fee = self.safe_value_2(order, 'total_fee', 'totalFee')
|
1163
1245
|
feeCurrency = self.safe_string_2(order, 'fee_asset', 'feeAsset')
|
1164
1246
|
transactions = self.safe_value(order, 'Transactions')
|
1165
|
-
|
1247
|
+
triggerPrice = self.safe_number(order, 'triggerPrice')
|
1166
1248
|
takeProfitPrice: Num = None
|
1167
1249
|
stopLossPrice: Num = None
|
1168
1250
|
childOrders = self.safe_value(order, 'childOrders')
|
@@ -1191,8 +1273,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1191
1273
|
'reduceOnly': self.safe_bool(order, 'reduce_only'),
|
1192
1274
|
'side': side,
|
1193
1275
|
'price': price,
|
1194
|
-
'
|
1195
|
-
'triggerPrice': stopPrice,
|
1276
|
+
'triggerPrice': triggerPrice,
|
1196
1277
|
'takeProfitPrice': takeProfitPrice,
|
1197
1278
|
'stopLossPrice': stopLossPrice,
|
1198
1279
|
'average': average,
|
@@ -1260,11 +1341,11 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1260
1341
|
'symbol': market['id'],
|
1261
1342
|
'side': orderSide,
|
1262
1343
|
}
|
1263
|
-
|
1344
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
1264
1345
|
stopLoss = self.safe_value(params, 'stopLoss')
|
1265
1346
|
takeProfit = self.safe_value(params, 'takeProfit')
|
1266
1347
|
algoType = self.safe_string(params, 'algoType')
|
1267
|
-
isConditional =
|
1348
|
+
isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
1268
1349
|
isMarket = orderType == 'MARKET'
|
1269
1350
|
timeInForce = self.safe_string_lower(params, 'timeInForce')
|
1270
1351
|
postOnly = self.is_post_only(isMarket, None, params)
|
@@ -1290,8 +1371,8 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1290
1371
|
clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
|
1291
1372
|
if clientOrderId is not None:
|
1292
1373
|
request['client_order_id'] = clientOrderId
|
1293
|
-
if
|
1294
|
-
request['trigger_price'] = self.price_to_precision(symbol,
|
1374
|
+
if triggerPrice is not None:
|
1375
|
+
request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
|
1295
1376
|
request['algo_type'] = 'STOP'
|
1296
1377
|
elif (stopLoss is not None) or (takeProfit is not None):
|
1297
1378
|
request['algo_type'] = 'TP_SL'
|
@@ -1352,10 +1433,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1352
1433
|
await self.load_markets()
|
1353
1434
|
market = self.market(symbol)
|
1354
1435
|
request = self.create_order_request(symbol, type, side, amount, price, params)
|
1355
|
-
|
1436
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
1356
1437
|
stopLoss = self.safe_value(params, 'stopLoss')
|
1357
1438
|
takeProfit = self.safe_value(params, 'takeProfit')
|
1358
|
-
isConditional =
|
1439
|
+
isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
1359
1440
|
response = None
|
1360
1441
|
if isConditional:
|
1361
1442
|
response = await self.v1PrivatePostAlgoOrder(request)
|
@@ -1414,10 +1495,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1414
1495
|
amount = self.safe_value(rawOrder, 'amount')
|
1415
1496
|
price = self.safe_value(rawOrder, 'price')
|
1416
1497
|
orderParams = self.safe_dict(rawOrder, 'params', {})
|
1417
|
-
|
1498
|
+
triggerPrice = self.safe_string_2(orderParams, 'triggerPrice', 'stopPrice')
|
1418
1499
|
stopLoss = self.safe_value(orderParams, 'stopLoss')
|
1419
1500
|
takeProfit = self.safe_value(orderParams, 'takeProfit')
|
1420
|
-
isConditional =
|
1501
|
+
isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
|
1421
1502
|
if isConditional:
|
1422
1503
|
raise NotSupported(self.id + 'createOrders() only support non-stop order')
|
1423
1504
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
@@ -1471,10 +1552,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1471
1552
|
request: dict = {
|
1472
1553
|
'order_id': id,
|
1473
1554
|
}
|
1474
|
-
|
1475
|
-
if
|
1476
|
-
request['triggerPrice'] = self.price_to_precision(symbol,
|
1477
|
-
isConditional = (
|
1555
|
+
triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
|
1556
|
+
if triggerPrice is not None:
|
1557
|
+
request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1558
|
+
isConditional = (triggerPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
|
1478
1559
|
orderQtyKey = 'quantity' if isConditional else 'order_quantity'
|
1479
1560
|
priceKey = 'price' if isConditional else 'order_price'
|
1480
1561
|
if price is not None:
|
ccxt/async_support/xt.py
CHANGED
@@ -2232,7 +2232,8 @@ class xt(Exchange, ImplicitAPI):
|
|
2232
2232
|
:param str [params.timeInForce]: 'GTC', 'IOC', 'FOK' or 'GTX'
|
2233
2233
|
:param str [params.entrustType]: 'TAKE_PROFIT', 'STOP', 'TAKE_PROFIT_MARKET', 'STOP_MARKET', 'TRAILING_STOP_MARKET', required if stopPrice is defined, currently isn't functioning on xt's side
|
2234
2234
|
:param str [params.triggerPriceType]: 'INDEX_PRICE', 'MARK_PRICE', 'LATEST_PRICE', required if stopPrice is defined
|
2235
|
-
:param float [params.
|
2235
|
+
:param float [params.triggerPrice]: price to trigger a stop order
|
2236
|
+
:param float [params.stopPrice]: alias for triggerPrice
|
2236
2237
|
:param float [params.stopLoss]: price to set a stop-loss on an open position
|
2237
2238
|
:param float [params.takeProfit]: price to set a take-profit on an open position
|
2238
2239
|
:returns dict: an `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
@@ -3334,7 +3335,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3334
3335
|
'postOnly': None,
|
3335
3336
|
'side': self.safe_string_lower_2(order, 'side', 'orderSide'),
|
3336
3337
|
'price': self.safe_number(order, 'price'),
|
3337
|
-
'
|
3338
|
+
'triggerPrice': self.safe_number(order, 'stopPrice'),
|
3338
3339
|
'stopLoss': self.safe_number(order, 'triggerStopPrice'),
|
3339
3340
|
'takeProfit': self.safe_number(order, 'triggerProfitPrice'),
|
3340
3341
|
'amount': amount,
|
ccxt/async_support/yobit.py
CHANGED
ccxt/async_support/zaif.py
CHANGED
ccxt/async_support/zonda.py
CHANGED
@@ -505,7 +505,6 @@ class zonda(Exchange, ImplicitAPI):
|
|
505
505
|
'postOnly': postOnly,
|
506
506
|
'side': self.safe_string_lower(order, 'offerType'),
|
507
507
|
'price': self.safe_string(order, 'rate'),
|
508
|
-
'stopPrice': None,
|
509
508
|
'triggerPrice': None,
|
510
509
|
'amount': amount,
|
511
510
|
'cost': None,
|
@@ -1400,7 +1399,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1400
1399
|
response = None
|
1401
1400
|
if isStopOrder:
|
1402
1401
|
if not isStopLossPrice:
|
1403
|
-
raise ExchangeError(self.id + ' createOrder() zonda requires `triggerPrice`
|
1402
|
+
raise ExchangeError(self.id + ' createOrder() zonda requires `triggerPrice` parameter for stop-limit or stop-market orders')
|
1404
1403
|
request['stopRate'] = self.price_to_precision(symbol, stopLossPrice)
|
1405
1404
|
response = await self.v1_01PrivatePostTradingStopOfferSymbol(self.extend(request, params))
|
1406
1405
|
else:
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.43'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -4550,10 +4550,14 @@ class Exchange(object):
|
|
4550
4550
|
|
4551
4551
|
def handle_option_and_params_2(self, params: object, methodName1: str, optionName1: str, optionName2: str, defaultValue=None):
|
4552
4552
|
value = None
|
4553
|
-
value, params = self.handle_option_and_params(params, methodName1, optionName1
|
4553
|
+
value, params = self.handle_option_and_params(params, methodName1, optionName1)
|
4554
|
+
if value is not None:
|
4555
|
+
# omit optionName2 too from params
|
4556
|
+
params = self.omit(params, optionName2)
|
4557
|
+
return [value, params]
|
4554
4558
|
# if still None, try optionName2
|
4555
4559
|
value2 = None
|
4556
|
-
value2, params = self.handle_option_and_params(params, methodName1, optionName2,
|
4560
|
+
value2, params = self.handle_option_and_params(params, methodName1, optionName2, defaultValue)
|
4557
4561
|
return [value2, params]
|
4558
4562
|
|
4559
4563
|
def handle_option(self, methodName: str, optionName: str, defaultValue=None):
|
@@ -5454,44 +5458,44 @@ class Exchange(object):
|
|
5454
5458
|
query = self.extend(params, {'reduceOnly': True})
|
5455
5459
|
return self.create_order_ws(symbol, type, side, amount, price, query)
|
5456
5460
|
|
5457
|
-
def create_stop_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None,
|
5461
|
+
def create_stop_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, triggerPrice: Num = None, params={}):
|
5458
5462
|
if not self.has['createStopOrder']:
|
5459
5463
|
raise NotSupported(self.id + ' createStopOrder() is not supported yet')
|
5460
|
-
if
|
5464
|
+
if triggerPrice is None:
|
5461
5465
|
raise ArgumentsRequired(self.id + ' create_stop_order() requires a stopPrice argument')
|
5462
|
-
query = self.extend(params, {'stopPrice':
|
5466
|
+
query = self.extend(params, {'stopPrice': triggerPrice})
|
5463
5467
|
return self.create_order(symbol, type, side, amount, price, query)
|
5464
5468
|
|
5465
|
-
def create_stop_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None,
|
5469
|
+
def create_stop_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, triggerPrice: Num = None, params={}):
|
5466
5470
|
if not self.has['createStopOrderWs']:
|
5467
5471
|
raise NotSupported(self.id + ' createStopOrderWs() is not supported yet')
|
5468
|
-
if
|
5472
|
+
if triggerPrice is None:
|
5469
5473
|
raise ArgumentsRequired(self.id + ' createStopOrderWs() requires a stopPrice argument')
|
5470
|
-
query = self.extend(params, {'stopPrice':
|
5474
|
+
query = self.extend(params, {'stopPrice': triggerPrice})
|
5471
5475
|
return self.create_order_ws(symbol, type, side, amount, price, query)
|
5472
5476
|
|
5473
|
-
def create_stop_limit_order(self, symbol: str, side: OrderSide, amount: float, price: float,
|
5477
|
+
def create_stop_limit_order(self, symbol: str, side: OrderSide, amount: float, price: float, triggerPrice: float, params={}):
|
5474
5478
|
if not self.has['createStopLimitOrder']:
|
5475
5479
|
raise NotSupported(self.id + ' createStopLimitOrder() is not supported yet')
|
5476
|
-
query = self.extend(params, {'stopPrice':
|
5480
|
+
query = self.extend(params, {'stopPrice': triggerPrice})
|
5477
5481
|
return self.create_order(symbol, 'limit', side, amount, price, query)
|
5478
5482
|
|
5479
|
-
def create_stop_limit_order_ws(self, symbol: str, side: OrderSide, amount: float, price: float,
|
5483
|
+
def create_stop_limit_order_ws(self, symbol: str, side: OrderSide, amount: float, price: float, triggerPrice: float, params={}):
|
5480
5484
|
if not self.has['createStopLimitOrderWs']:
|
5481
5485
|
raise NotSupported(self.id + ' createStopLimitOrderWs() is not supported yet')
|
5482
|
-
query = self.extend(params, {'stopPrice':
|
5486
|
+
query = self.extend(params, {'stopPrice': triggerPrice})
|
5483
5487
|
return self.create_order_ws(symbol, 'limit', side, amount, price, query)
|
5484
5488
|
|
5485
|
-
def create_stop_market_order(self, symbol: str, side: OrderSide, amount: float,
|
5489
|
+
def create_stop_market_order(self, symbol: str, side: OrderSide, amount: float, triggerPrice: float, params={}):
|
5486
5490
|
if not self.has['createStopMarketOrder']:
|
5487
5491
|
raise NotSupported(self.id + ' createStopMarketOrder() is not supported yet')
|
5488
|
-
query = self.extend(params, {'stopPrice':
|
5492
|
+
query = self.extend(params, {'stopPrice': triggerPrice})
|
5489
5493
|
return self.create_order(symbol, 'market', side, amount, None, query)
|
5490
5494
|
|
5491
|
-
def create_stop_market_order_ws(self, symbol: str, side: OrderSide, amount: float,
|
5495
|
+
def create_stop_market_order_ws(self, symbol: str, side: OrderSide, amount: float, triggerPrice: float, params={}):
|
5492
5496
|
if not self.has['createStopMarketOrderWs']:
|
5493
5497
|
raise NotSupported(self.id + ' createStopMarketOrderWs() is not supported yet')
|
5494
|
-
query = self.extend(params, {'stopPrice':
|
5498
|
+
query = self.extend(params, {'stopPrice': triggerPrice})
|
5495
5499
|
return self.create_order_ws(symbol, 'market', side, amount, None, query)
|
5496
5500
|
|
5497
5501
|
def safe_currency_code(self, currencyId: Str, currency: Currency = None):
|
ccxt/bigone.py
CHANGED
ccxt/binance.py
CHANGED
@@ -657,6 +657,8 @@ class binance(Exchange, ImplicitAPI):
|
|
657
657
|
'portfolio/bnb-transfer': 150, # Weight(IP): 1500 => cost = 0.1 * 1500 = 150
|
658
658
|
'portfolio/repay-futures-switch': 150, # Weight(IP): 1500 => cost = 0.1 * 1500 = 150
|
659
659
|
'portfolio/repay-futures-negative-balance': 150, # Weight(IP): 1500 => cost = 0.1 * 1500 = 150
|
660
|
+
'portfolio/mint': 20,
|
661
|
+
'portfolio/redeem': 20,
|
660
662
|
'lending/auto-invest/plan/add': 0.1, # Weight(IP): 1 => cost = 0.1 * 1 = 0.1
|
661
663
|
'lending/auto-invest/plan/edit': 0.1, # Weight(IP): 1 => cost = 0.1 * 1 = 0.1
|
662
664
|
'lending/auto-invest/plan/edit-status': 0.1, # Weight(IP): 1 => cost = 0.1 * 1 = 0.1
|
@@ -985,6 +987,7 @@ class binance(Exchange, ImplicitAPI):
|
|
985
987
|
'block/order/orders': 5,
|
986
988
|
'block/order/execute': 5,
|
987
989
|
'block/user-trades': 5,
|
990
|
+
'blockTrades': 5,
|
988
991
|
},
|
989
992
|
'post': {
|
990
993
|
'order': 1,
|
ccxt/bingx.py
CHANGED
@@ -399,12 +399,26 @@ class bingx(Exchange, ImplicitAPI):
|
|
399
399
|
'get': {
|
400
400
|
'uid': 1,
|
401
401
|
'apiKey/query': 2,
|
402
|
+
'account/apiPermissions': 5,
|
402
403
|
},
|
403
404
|
'post': {
|
404
405
|
'innerTransfer/authorizeSubAccount': 1,
|
405
406
|
},
|
406
407
|
},
|
407
408
|
},
|
409
|
+
'transfer': {
|
410
|
+
'v1': {
|
411
|
+
'private': {
|
412
|
+
'get': {
|
413
|
+
'subAccount/asset/transferHistory': 1,
|
414
|
+
},
|
415
|
+
'post': {
|
416
|
+
'subAccount/transferAsset/supportCoins': 1,
|
417
|
+
'subAccount/transferAsset': 1,
|
418
|
+
},
|
419
|
+
},
|
420
|
+
},
|
421
|
+
},
|
408
422
|
},
|
409
423
|
'user': {
|
410
424
|
'auth': {
|
@@ -5344,6 +5358,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
5344
5358
|
elif market['swap']:
|
5345
5359
|
request['endTs'] = now
|
5346
5360
|
if market['spot']:
|
5361
|
+
if limit is not None:
|
5362
|
+
request['limit'] = limit # default 500, maximum 1000
|
5347
5363
|
response = self.spotV1PrivateGetTradeMyTrades(self.extend(request, params))
|
5348
5364
|
data = self.safe_dict(response, 'data', {})
|
5349
5365
|
fills = self.safe_list(data, 'fills', [])
|
@@ -6142,13 +6158,17 @@ class bingx(Exchange, ImplicitAPI):
|
|
6142
6158
|
if isSandbox and (type != 'swap'):
|
6143
6159
|
raise NotSupported(self.id + ' does not have a testnet/sandbox URL for ' + type + ' endpoints')
|
6144
6160
|
url = self.implode_hostname(self.urls['api'][type])
|
6145
|
-
if type == 'spot' and version == 'v3':
|
6146
|
-
url += '/api'
|
6147
|
-
else:
|
6148
|
-
url += '/' + type
|
6149
|
-
url += '/' + version + '/'
|
6150
6161
|
path = self.implode_params(path, params)
|
6151
|
-
|
6162
|
+
if version == 'transfer':
|
6163
|
+
type = 'account/transfer'
|
6164
|
+
version = section[2]
|
6165
|
+
access = section[3]
|
6166
|
+
if path != 'account/apiPermissions':
|
6167
|
+
if type == 'spot' and version == 'v3':
|
6168
|
+
url += '/api'
|
6169
|
+
else:
|
6170
|
+
url += '/' + type
|
6171
|
+
url += '/' + version + '/' + path
|
6152
6172
|
params = self.omit(params, self.extract_params(path))
|
6153
6173
|
params['timestamp'] = self.nonce()
|
6154
6174
|
params = self.keysort(params)
|
@@ -6157,7 +6177,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
6157
6177
|
url += '?' + self.urlencode(params)
|
6158
6178
|
elif access == 'private':
|
6159
6179
|
self.check_required_credentials()
|
6160
|
-
isJsonContentType = ((type == 'subAccount') and (method == 'POST'))
|
6180
|
+
isJsonContentType = (((type == 'subAccount') or (type == 'account/transfer')) and (method == 'POST'))
|
6161
6181
|
parsedParams = self.parse_params(params)
|
6162
6182
|
signature = self.hmac(self.encode(self.rawencode(parsedParams)), self.encode(self.secret), hashlib.sha256)
|
6163
6183
|
headers = {
|
ccxt/bitfinex.py
CHANGED
@@ -100,6 +100,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
100
100
|
'fetchOHLCV': True,
|
101
101
|
'fetchOpenInterest': True,
|
102
102
|
'fetchOpenInterestHistory': True,
|
103
|
+
'fetchOpenInterests': True,
|
103
104
|
'fetchOpenOrder': True,
|
104
105
|
'fetchOpenOrders': True,
|
105
106
|
'fetchOrder': True,
|
@@ -419,6 +420,75 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
419
420
|
'TETHERUSE': 'ERC20',
|
420
421
|
},
|
421
422
|
},
|
423
|
+
'features': {
|
424
|
+
'default': {
|
425
|
+
'sandbox': False,
|
426
|
+
'createOrder': {
|
427
|
+
'marginMode': True,
|
428
|
+
'triggerPrice': True,
|
429
|
+
'triggerPriceType': None,
|
430
|
+
'triggerDirection': False,
|
431
|
+
'stopLossPrice': True,
|
432
|
+
'takeProfitPrice': True,
|
433
|
+
'attachedStopLossTakeProfit': None,
|
434
|
+
'timeInForce': {
|
435
|
+
'IOC': True,
|
436
|
+
'FOK': True,
|
437
|
+
'PO': True,
|
438
|
+
'GTD': False,
|
439
|
+
},
|
440
|
+
'hedged': False,
|
441
|
+
'trailing': True, # todo: unify
|
442
|
+
# todo: leverage unify
|
443
|
+
},
|
444
|
+
'createOrders': {
|
445
|
+
'max': 75,
|
446
|
+
},
|
447
|
+
'fetchMyTrades': {
|
448
|
+
'marginMode': False,
|
449
|
+
'limit': 2500,
|
450
|
+
'daysBack': None,
|
451
|
+
'untilDays': 100000, # todo: implement
|
452
|
+
},
|
453
|
+
'fetchOrder': {
|
454
|
+
'marginMode': False,
|
455
|
+
'trigger': False,
|
456
|
+
'trailing': False,
|
457
|
+
},
|
458
|
+
'fetchOpenOrders': {
|
459
|
+
'marginMode': False,
|
460
|
+
'limit': None,
|
461
|
+
'trigger': False,
|
462
|
+
'trailing': False,
|
463
|
+
},
|
464
|
+
'fetchOrders': None,
|
465
|
+
'fetchClosedOrders': {
|
466
|
+
'marginMode': False,
|
467
|
+
'limit': None,
|
468
|
+
'daysBackClosed': None,
|
469
|
+
'daysBackCanceled': None,
|
470
|
+
'untilDays': 100000,
|
471
|
+
'trigger': False,
|
472
|
+
'trailing': False,
|
473
|
+
},
|
474
|
+
'fetchOHLCV': {
|
475
|
+
'limit': 10000,
|
476
|
+
},
|
477
|
+
},
|
478
|
+
'spot': {
|
479
|
+
'extends': 'default',
|
480
|
+
},
|
481
|
+
'swap': {
|
482
|
+
'linear': {
|
483
|
+
'extends': 'default',
|
484
|
+
},
|
485
|
+
'inverse': None,
|
486
|
+
},
|
487
|
+
'future': {
|
488
|
+
'linear': None,
|
489
|
+
'inverse': None,
|
490
|
+
},
|
491
|
+
},
|
422
492
|
'exceptions': {
|
423
493
|
'exact': {
|
424
494
|
'11010': RateLimitExceeded,
|
@@ -3116,6 +3186,58 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
3116
3186
|
'previousFundingDatetime': None,
|
3117
3187
|
}
|
3118
3188
|
|
3189
|
+
def fetch_open_interests(self, symbols: Strings = None, params={}):
|
3190
|
+
"""
|
3191
|
+
Retrieves the open interest for a list of symbols
|
3192
|
+
|
3193
|
+
https://docs.bitfinex.com/reference/rest-public-derivatives-status
|
3194
|
+
|
3195
|
+
:param str[] [symbols]: a list of unified CCXT market symbols
|
3196
|
+
:param dict [params]: exchange specific parameters
|
3197
|
+
:returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
3198
|
+
"""
|
3199
|
+
self.load_markets()
|
3200
|
+
symbols = self.market_symbols(symbols)
|
3201
|
+
marketIds = ['ALL']
|
3202
|
+
if symbols is not None:
|
3203
|
+
marketIds = self.market_ids(symbols)
|
3204
|
+
request: dict = {
|
3205
|
+
'keys': ','.join(marketIds),
|
3206
|
+
}
|
3207
|
+
response = self.publicGetStatusDeriv(self.extend(request, params))
|
3208
|
+
#
|
3209
|
+
# [
|
3210
|
+
# [
|
3211
|
+
# "tXRPF0:USTF0", # market id
|
3212
|
+
# 1706256986000, # millisecond timestamp
|
3213
|
+
# null,
|
3214
|
+
# 0.512705, # derivative mid price
|
3215
|
+
# 0.512395, # underlying spot mid price
|
3216
|
+
# null,
|
3217
|
+
# 37671483.04, # insurance fund balance
|
3218
|
+
# null,
|
3219
|
+
# 1706284800000, # timestamp of next funding
|
3220
|
+
# 0.00002353, # accrued funding for next period
|
3221
|
+
# 317, # next funding step
|
3222
|
+
# null,
|
3223
|
+
# 0, # current funding
|
3224
|
+
# null,
|
3225
|
+
# null,
|
3226
|
+
# 0.5123016, # mark price
|
3227
|
+
# null,
|
3228
|
+
# null,
|
3229
|
+
# 2233562.03115, # open interest in contracts
|
3230
|
+
# null,
|
3231
|
+
# null,
|
3232
|
+
# null,
|
3233
|
+
# 0.0005, # average spread without funding payment
|
3234
|
+
# 0.0025 # funding payment cap
|
3235
|
+
# ]
|
3236
|
+
# ]
|
3237
|
+
#
|
3238
|
+
result = self.parse_open_interests(response)
|
3239
|
+
return self.filter_by_array(result, 'symbol', symbols)
|
3240
|
+
|
3119
3241
|
def fetch_open_interest(self, symbol: str, params={}):
|
3120
3242
|
"""
|
3121
3243
|
retrieves the open interest of a contract trading pair
|
ccxt/bitstamp.py
CHANGED
@@ -165,6 +165,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
165
165
|
'user_transactions/': 1,
|
166
166
|
'user_transactions/{pair}/': 1,
|
167
167
|
'crypto-transactions/': 1,
|
168
|
+
'open_order': 1,
|
168
169
|
'open_orders/all/': 1,
|
169
170
|
'open_orders/{pair}/': 1,
|
170
171
|
'order_status/': 1,
|
@@ -505,6 +506,59 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
505
506
|
'Ensure that there are no more than': InvalidOrder, # {"status": "error", "reason": {"amount": ["Ensure that there are no more than 0 decimal places."], "__all__": [""]}}
|
506
507
|
},
|
507
508
|
},
|
509
|
+
'features': {
|
510
|
+
'spot': {
|
511
|
+
'sandbox': False,
|
512
|
+
'createOrder': {
|
513
|
+
'marginMode': False,
|
514
|
+
'triggerPrice': False,
|
515
|
+
'triggerPriceType': None,
|
516
|
+
'triggerDirection': False,
|
517
|
+
'stopLossPrice': False,
|
518
|
+
'takeProfitPrice': False,
|
519
|
+
'attachedStopLossTakeProfit': None,
|
520
|
+
'timeInForce': {
|
521
|
+
'IOC': True,
|
522
|
+
'FOK': True,
|
523
|
+
'PO': True,
|
524
|
+
'GTD': True,
|
525
|
+
},
|
526
|
+
'hedged': False,
|
527
|
+
'trailing': False,
|
528
|
+
},
|
529
|
+
'createOrders': None,
|
530
|
+
'fetchMyTrades': {
|
531
|
+
'marginMode': False,
|
532
|
+
'limit': 1000,
|
533
|
+
'daysBack': None,
|
534
|
+
'untilDays': 30,
|
535
|
+
},
|
536
|
+
'fetchOrder': {
|
537
|
+
'marginMode': False,
|
538
|
+
'trigger': False,
|
539
|
+
'trailing': False,
|
540
|
+
},
|
541
|
+
'fetchOpenOrders': {
|
542
|
+
'marginMode': False,
|
543
|
+
'limit': None,
|
544
|
+
'trigger': False,
|
545
|
+
'trailing': False,
|
546
|
+
},
|
547
|
+
'fetchOrders': None,
|
548
|
+
'fetchClosedOrders': None,
|
549
|
+
'fetchOHLCV': {
|
550
|
+
'limit': 1000,
|
551
|
+
},
|
552
|
+
},
|
553
|
+
'swap': {
|
554
|
+
'linear': None,
|
555
|
+
'inverse': None,
|
556
|
+
},
|
557
|
+
'future': {
|
558
|
+
'linear': None,
|
559
|
+
'inverse': None,
|
560
|
+
},
|
561
|
+
},
|
508
562
|
})
|
509
563
|
|
510
564
|
def fetch_markets(self, params={}) -> List[Market]:
|