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/hashkey.py
CHANGED
@@ -361,6 +361,84 @@ class hashkey(Exchange, ImplicitAPI):
|
|
361
361
|
},
|
362
362
|
'defaultNetwork': 'ERC20',
|
363
363
|
},
|
364
|
+
'features': {
|
365
|
+
'default': {
|
366
|
+
'sandbox': True,
|
367
|
+
'createOrder': {
|
368
|
+
'marginMode': False,
|
369
|
+
'triggerPrice': False,
|
370
|
+
'triggerPriceType': None,
|
371
|
+
'triggerDirection': False,
|
372
|
+
'stopLossPrice': False,
|
373
|
+
'takeProfitPrice': False,
|
374
|
+
'attachedStopLossTakeProfit': None,
|
375
|
+
'timeInForce': {
|
376
|
+
'IOC': True,
|
377
|
+
'FOK': True,
|
378
|
+
'PO': True,
|
379
|
+
'GTD': False,
|
380
|
+
},
|
381
|
+
'hedged': False,
|
382
|
+
'trailing': False,
|
383
|
+
# exchange-supported features
|
384
|
+
# 'marketBuyRequiresPrice': False,
|
385
|
+
# 'marketBuyByCost': False,
|
386
|
+
# 'selfTradePrevention': True,
|
387
|
+
# 'twap': False,
|
388
|
+
# 'iceberg': False,
|
389
|
+
# 'oco': False,
|
390
|
+
},
|
391
|
+
'createOrders': {
|
392
|
+
'max': 20,
|
393
|
+
},
|
394
|
+
'fetchMyTrades': {
|
395
|
+
'marginMode': False,
|
396
|
+
'limit': 1000,
|
397
|
+
'daysBack': 30,
|
398
|
+
'untilDays': 30,
|
399
|
+
},
|
400
|
+
'fetchOrder': {
|
401
|
+
'marginMode': False,
|
402
|
+
'trigger': False,
|
403
|
+
'trailing': False,
|
404
|
+
},
|
405
|
+
'fetchOpenOrders': {
|
406
|
+
'marginMode': False,
|
407
|
+
'limit': 1000,
|
408
|
+
'trigger': False,
|
409
|
+
'trailing': False,
|
410
|
+
},
|
411
|
+
'fetchOrders': None,
|
412
|
+
'fetchClosedOrders': None, # todo
|
413
|
+
'fetchOHLCV': {
|
414
|
+
'limit': 1000,
|
415
|
+
},
|
416
|
+
},
|
417
|
+
'spot': {
|
418
|
+
'extends': 'default',
|
419
|
+
},
|
420
|
+
'forDerivatives': {
|
421
|
+
'extends': 'default',
|
422
|
+
'createOrder': {
|
423
|
+
'triggerPrice': True,
|
424
|
+
'selfTradePrevention': True,
|
425
|
+
},
|
426
|
+
'fetchOpenOrders': {
|
427
|
+
'trigger': True,
|
428
|
+
'limit': 500,
|
429
|
+
},
|
430
|
+
},
|
431
|
+
'swap': {
|
432
|
+
'linear': {
|
433
|
+
'extends': 'forDerivatives',
|
434
|
+
},
|
435
|
+
'inverse': None,
|
436
|
+
},
|
437
|
+
'future': {
|
438
|
+
'linear': None,
|
439
|
+
'inverse': None,
|
440
|
+
},
|
441
|
+
},
|
364
442
|
'commonCurrencies': {},
|
365
443
|
'exceptions': {
|
366
444
|
'exact': {
|
@@ -582,11 +660,7 @@ class hashkey(Exchange, ImplicitAPI):
|
|
582
660
|
:param str [params.symbol]: the id of the market to fetch
|
583
661
|
:returns dict[]: an array of objects representing market data
|
584
662
|
"""
|
585
|
-
symbol: Str = None
|
586
663
|
request: dict = {}
|
587
|
-
symbol, params = self.handle_option_and_params(params, 'fetchMarkets', 'symbol')
|
588
|
-
if symbol is not None:
|
589
|
-
request['symbol'] = symbol
|
590
664
|
response = await self.publicGetApiV1ExchangeInfo(self.extend(request, params))
|
591
665
|
#
|
592
666
|
# {
|
@@ -1254,10 +1328,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
1254
1328
|
if marketType == 'spot':
|
1255
1329
|
if market is not None:
|
1256
1330
|
request['symbol'] = market['id']
|
1257
|
-
clientOrderId: Str = None
|
1258
|
-
clientOrderId, params = self.handle_option_and_params(params, methodName, 'clientOrderId')
|
1259
|
-
if clientOrderId is not None:
|
1260
|
-
request['clientOrderId'] = clientOrderId
|
1261
1331
|
if accountId is not None:
|
1262
1332
|
request['accountId'] = accountId
|
1263
1333
|
response = await self.privateGetApiV1AccountTrades(self.extend(request, params))
|
@@ -1601,10 +1671,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
1601
1671
|
await self.load_markets()
|
1602
1672
|
symbols = self.market_symbols(symbols)
|
1603
1673
|
request: dict = {}
|
1604
|
-
symbol: Str = None
|
1605
|
-
symbol, params = self.handle_option_and_params(params, 'fetchLastPrices', 'symbol')
|
1606
|
-
if symbol is not None:
|
1607
|
-
request['symbol'] = symbol
|
1608
1674
|
response = await self.publicGetQuoteV1TickerPrice(self.extend(request, params))
|
1609
1675
|
#
|
1610
1676
|
# [
|
@@ -1662,10 +1728,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
1662
1728
|
balance = self.safe_dict(response, 0, {})
|
1663
1729
|
return self.parse_swap_balance(balance)
|
1664
1730
|
elif marketType == 'spot':
|
1665
|
-
accountId: Str = None
|
1666
|
-
accountId, params = self.handle_option_and_params(params, methodName, 'accountId')
|
1667
|
-
if accountId is not None:
|
1668
|
-
request['accountId'] = accountId
|
1669
1731
|
response = await self.privateGetApiV1Account(self.extend(request, params))
|
1670
1732
|
#
|
1671
1733
|
# {
|
@@ -1931,18 +1993,10 @@ class hashkey(Exchange, ImplicitAPI):
|
|
1931
1993
|
}
|
1932
1994
|
if tag is not None:
|
1933
1995
|
request['addressExt'] = tag
|
1934
|
-
clientOrderId: Str = None
|
1935
|
-
clientOrderId, params = self.handle_option_and_params(params, 'withdraw', 'clientOrderId')
|
1936
|
-
if clientOrderId is not None:
|
1937
|
-
request['clientOrderId'] = clientOrderId
|
1938
1996
|
networkCode: Str = None
|
1939
1997
|
networkCode, params = self.handle_network_code_and_params(params)
|
1940
1998
|
if networkCode is not None:
|
1941
1999
|
request['chainType'] = self.network_code_to_id(networkCode)
|
1942
|
-
platform: Str = None
|
1943
|
-
platform, params = self.handle_option_and_params(params, 'withdraw', 'platform')
|
1944
|
-
if platform is not None:
|
1945
|
-
request['platform'] = platform
|
1946
2000
|
response = await self.privatePostApiV1AccountWithdraw(self.extend(request, params))
|
1947
2001
|
#
|
1948
2002
|
# {
|
@@ -2081,14 +2135,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2081
2135
|
'fromAccountId': fromAccount,
|
2082
2136
|
'toAccountId': toAccount,
|
2083
2137
|
}
|
2084
|
-
clientOrderId: Str = None
|
2085
|
-
clientOrderId, params = self.handle_option_and_params(params, 'transfer', 'clientOrderId')
|
2086
|
-
if clientOrderId is not None:
|
2087
|
-
request['clientOrderId'] = clientOrderId
|
2088
|
-
remark: Str = None
|
2089
|
-
remark, params = self.handle_option_and_params(params, 'transfer', 'remark')
|
2090
|
-
if remark is not None:
|
2091
|
-
request['remark'] = remark
|
2092
2138
|
response = await self.privatePostApiV1AccountAssetTransfer(self.extend(request, params))
|
2093
2139
|
#
|
2094
2140
|
# {
|
@@ -2926,10 +2972,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2926
2972
|
if marketType == 'spot':
|
2927
2973
|
if clientOrderId is not None:
|
2928
2974
|
request['origClientOrderId'] = clientOrderId
|
2929
|
-
accountId: Str = None
|
2930
|
-
accountId, params = self.handle_option_and_params(params, methodName, 'accountId')
|
2931
|
-
if accountId is not None:
|
2932
|
-
request['accountId'] = accountId
|
2933
2975
|
response = await self.privateGetApiV1SpotOrder(self.extend(request, params))
|
2934
2976
|
#
|
2935
2977
|
# {
|
@@ -3065,14 +3107,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3065
3107
|
request['symbol'] = market['id']
|
3066
3108
|
if limit is not None:
|
3067
3109
|
request['limit'] = limit
|
3068
|
-
orderId: Str = None
|
3069
|
-
orderId, params = self.handle_option_and_params(params, methodName, 'orderId')
|
3070
|
-
if orderId is not None:
|
3071
|
-
request['orderId'] = orderId
|
3072
|
-
side: Str = None
|
3073
|
-
side, params = self.handle_option_and_params(params, methodName, 'side')
|
3074
|
-
if side is not None:
|
3075
|
-
request['side'] = side.upper()
|
3076
3110
|
response = await self.privateGetApiV1SpotOpenOrders(self.extend(request, params))
|
3077
3111
|
#
|
3078
3112
|
# [
|
@@ -3138,10 +3172,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3138
3172
|
request['type'] = 'LIMIT'
|
3139
3173
|
if limit is not None:
|
3140
3174
|
request['limit'] = limit
|
3141
|
-
fromOrderId: Str = None
|
3142
|
-
fromOrderId, params = self.handle_option_and_params(params, methodName, 'fromOrderId')
|
3143
|
-
if fromOrderId is not None:
|
3144
|
-
request['fromOrderId'] = fromOrderId
|
3145
3175
|
response = None
|
3146
3176
|
accountId: Str = None
|
3147
3177
|
accountId, params = self.handle_option_and_params(params, methodName, 'accountId')
|
@@ -3240,14 +3270,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3240
3270
|
if marketType == 'spot':
|
3241
3271
|
if market is not None:
|
3242
3272
|
request['symbol'] = market['id']
|
3243
|
-
orderId: Str = None
|
3244
|
-
orderId, params = self.handle_option_and_params(params, methodName, 'orderId')
|
3245
|
-
if orderId is not None:
|
3246
|
-
request['orderId'] = orderId
|
3247
|
-
side: Str = None
|
3248
|
-
side, params = self.handle_option_and_params(params, methodName, 'side')
|
3249
|
-
if side is not None:
|
3250
|
-
request['side'] = side.upper()
|
3251
3273
|
if accountId is not None:
|
3252
3274
|
request['accountId'] = accountId
|
3253
3275
|
response = await self.privateGetApiV1SpotTradeOrders(self.extend(request, params))
|
@@ -3290,10 +3312,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3290
3312
|
request['type'] = 'STOP'
|
3291
3313
|
else:
|
3292
3314
|
request['type'] = 'LIMIT'
|
3293
|
-
fromOrderId: Str = None
|
3294
|
-
fromOrderId, params = self.handle_option_and_params(params, methodName, 'fromOrderId')
|
3295
|
-
if fromOrderId is not None:
|
3296
|
-
request['fromOrderId'] = fromOrderId
|
3297
3315
|
if accountId is not None:
|
3298
3316
|
request['subAccountId'] = accountId
|
3299
3317
|
response = await self.privateGetApiV1FuturesSubAccountHistoryOrders(self.extend(request, params))
|
@@ -3477,7 +3495,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3477
3495
|
feeCurrncyId = self.safe_string(order, 'feeCoin')
|
3478
3496
|
if feeCurrncyId == '':
|
3479
3497
|
feeCurrncyId = None
|
3480
|
-
triggerPrice = self.omit_zero(self.safe_string(order, 'stopPrice'))
|
3481
3498
|
return self.safe_order({
|
3482
3499
|
'id': self.safe_string(order, 'orderId'),
|
3483
3500
|
'clientOrderId': self.safe_string(order, 'clientOrderId'),
|
@@ -3495,8 +3512,7 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3495
3512
|
'amount': self.omit_zero(self.safe_string(order, 'origQty')),
|
3496
3513
|
'filled': self.safe_string(order, 'executedQty'),
|
3497
3514
|
'remaining': None,
|
3498
|
-
'
|
3499
|
-
'triggerPrice': triggerPrice,
|
3515
|
+
'triggerPrice': self.omit_zero(self.safe_string(order, 'stopPrice')),
|
3500
3516
|
'takeProfitPrice': None,
|
3501
3517
|
'stopLossPrice': None,
|
3502
3518
|
'cost': self.omit_zero(self.safe_string_2(order, 'cumulativeQuoteQty', 'cummulativeQuoteQty')),
|
@@ -3730,10 +3746,6 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3730
3746
|
request: dict = {
|
3731
3747
|
'symbol': market['id'],
|
3732
3748
|
}
|
3733
|
-
side: Str = None
|
3734
|
-
side, params = self.handle_option_and_params(params, methodName, 'side')
|
3735
|
-
if side is not None:
|
3736
|
-
request['side'] = side.upper()
|
3737
3749
|
response = await self.privateGetApiV1FuturesPositions(self.extend(request, params))
|
3738
3750
|
#
|
3739
3751
|
# [
|
ccxt/async_support/hitbtc.py
CHANGED
@@ -92,6 +92,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
92
92
|
'fetchOHLCV': True,
|
93
93
|
'fetchOpenInterest': True,
|
94
94
|
'fetchOpenInterestHistory': False,
|
95
|
+
'fetchOpenInterests': True,
|
95
96
|
'fetchOpenOrder': True,
|
96
97
|
'fetchOpenOrders': True,
|
97
98
|
'fetchOrder': True,
|
@@ -2254,7 +2255,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2254
2255
|
elif type == 'market':
|
2255
2256
|
request['type'] = 'stopMarket'
|
2256
2257
|
elif (type == 'stopLimit') or (type == 'stopMarket') or (type == 'takeProfitLimit') or (type == 'takeProfitMarket'):
|
2257
|
-
raise ExchangeError(self.id + ' createOrder() requires a
|
2258
|
+
raise ExchangeError(self.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders')
|
2258
2259
|
params = self.omit(params, ['triggerPrice', 'timeInForce', 'stopPrice', 'stop_price', 'reduceOnly', 'postOnly'])
|
2259
2260
|
if marketType == 'swap':
|
2260
2261
|
# set default margin mode to cross
|
@@ -2363,7 +2364,6 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2363
2364
|
postOnly = self.safe_value(order, 'post_only')
|
2364
2365
|
timeInForce = self.safe_string(order, 'time_in_force')
|
2365
2366
|
rawTrades = self.safe_value(order, 'trades')
|
2366
|
-
stopPrice = self.safe_string(order, 'stop_price')
|
2367
2367
|
return self.safe_order({
|
2368
2368
|
'info': order,
|
2369
2369
|
'id': id,
|
@@ -2387,8 +2387,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2387
2387
|
'average': average,
|
2388
2388
|
'trades': rawTrades,
|
2389
2389
|
'fee': None,
|
2390
|
-
'
|
2391
|
-
'triggerPrice': stopPrice,
|
2390
|
+
'triggerPrice': self.safe_string(order, 'stop_price'),
|
2392
2391
|
'takeProfitPrice': None,
|
2393
2392
|
'stopLossPrice': None,
|
2394
2393
|
}, market)
|
@@ -2954,7 +2953,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2954
2953
|
datetime = self.safe_string(interest, 'timestamp')
|
2955
2954
|
value = self.safe_number(interest, 'open_interest')
|
2956
2955
|
return self.safe_open_interest({
|
2957
|
-
'symbol': market
|
2956
|
+
'symbol': self.safe_symbol(None, market),
|
2958
2957
|
'openInterestAmount': None,
|
2959
2958
|
'openInterestValue': value,
|
2960
2959
|
'timestamp': self.parse8601(datetime),
|
@@ -2962,6 +2961,49 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2962
2961
|
'info': interest,
|
2963
2962
|
}, market)
|
2964
2963
|
|
2964
|
+
async def fetch_open_interests(self, symbols: Strings = None, params={}):
|
2965
|
+
"""
|
2966
|
+
Retrieves the open interest for a list of symbols
|
2967
|
+
|
2968
|
+
https://api.hitbtc.com/#futures-info
|
2969
|
+
|
2970
|
+
:param str[] [symbols]: a list of unified CCXT market symbols
|
2971
|
+
:param dict [params]: exchange specific parameters
|
2972
|
+
:returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
2973
|
+
"""
|
2974
|
+
await self.load_markets()
|
2975
|
+
request: dict = {}
|
2976
|
+
symbols = self.market_symbols(symbols)
|
2977
|
+
marketIds = None
|
2978
|
+
if symbols is not None:
|
2979
|
+
marketIds = self.market_ids(symbols)
|
2980
|
+
request['symbols'] = ','.join(marketIds)
|
2981
|
+
response = await self.publicGetPublicFuturesInfo(self.extend(request, params))
|
2982
|
+
#
|
2983
|
+
# {
|
2984
|
+
# "BTCUSDT_PERP": {
|
2985
|
+
# "contract_type": "perpetual",
|
2986
|
+
# "mark_price": "97291.83",
|
2987
|
+
# "index_price": "97298.61",
|
2988
|
+
# "funding_rate": "-0.000183473092423284",
|
2989
|
+
# "open_interest": "94.1503",
|
2990
|
+
# "next_funding_time": "2024-12-20T08:00:00.000Z",
|
2991
|
+
# "indicative_funding_rate": "-0.00027495203277752",
|
2992
|
+
# "premium_index": "-0.000789474900583786",
|
2993
|
+
# "avg_premium_index": "-0.000683473092423284",
|
2994
|
+
# "interest_rate": "0.0001",
|
2995
|
+
# "timestamp": "2024-12-20T04:57:33.693Z"
|
2996
|
+
# }
|
2997
|
+
# }
|
2998
|
+
#
|
2999
|
+
results = []
|
3000
|
+
markets = list(response.keys())
|
3001
|
+
for i in range(0, len(markets)):
|
3002
|
+
marketId = markets[i]
|
3003
|
+
marketInner = self.safe_market(marketId)
|
3004
|
+
results.append(self.parse_open_interest(response[marketId], marketInner))
|
3005
|
+
return self.filter_by_array(results, 'symbol', symbols)
|
3006
|
+
|
2965
3007
|
async def fetch_open_interest(self, symbol: str, params={}):
|
2966
3008
|
"""
|
2967
3009
|
Retrieves the open interest of a derivative trading pair
|
ccxt/async_support/hollaex.py
CHANGED
@@ -1098,7 +1098,6 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1098
1098
|
type = self.safe_string(order, 'type')
|
1099
1099
|
side = self.safe_string(order, 'side')
|
1100
1100
|
price = self.safe_string(order, 'price')
|
1101
|
-
stopPrice = self.safe_string(order, 'stop')
|
1102
1101
|
amount = self.safe_string(order, 'size')
|
1103
1102
|
filled = self.safe_string(order, 'filled')
|
1104
1103
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
@@ -1117,8 +1116,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1117
1116
|
'postOnly': postOnly,
|
1118
1117
|
'side': side,
|
1119
1118
|
'price': price,
|
1120
|
-
'
|
1121
|
-
'triggerPrice': stopPrice,
|
1119
|
+
'triggerPrice': self.safe_string(order, 'stop'),
|
1122
1120
|
'amount': amount,
|
1123
1121
|
'filled': filled,
|
1124
1122
|
'remaining': None,
|
@@ -1156,7 +1154,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1156
1154
|
# 'stop': float(self.price_to_precision(symbol, stopPrice)),
|
1157
1155
|
# 'meta': {}, # other options such
|
1158
1156
|
}
|
1159
|
-
|
1157
|
+
triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop'])
|
1160
1158
|
meta = self.safe_value(params, 'meta', {})
|
1161
1159
|
exchangeSpecificParam = self.safe_bool(meta, 'post_only', False)
|
1162
1160
|
isMarketOrder = type == 'market'
|
@@ -1164,8 +1162,8 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1164
1162
|
if not isMarketOrder:
|
1165
1163
|
convertedPrice = float(self.price_to_precision(symbol, price))
|
1166
1164
|
request['price'] = self.normalize_number_if_needed(convertedPrice)
|
1167
|
-
if
|
1168
|
-
request['stop'] = self.normalize_number_if_needed(float(self.price_to_precision(symbol,
|
1165
|
+
if triggerPrice is not None:
|
1166
|
+
request['stop'] = self.normalize_number_if_needed(float(self.price_to_precision(symbol, triggerPrice)))
|
1169
1167
|
if postOnly:
|
1170
1168
|
request['meta'] = {'post_only': True}
|
1171
1169
|
params = self.omit(params, ['postOnly', 'timeInForce', 'stopPrice', 'triggerPrice', 'stop'])
|
ccxt/async_support/htx.py
CHANGED
@@ -4970,7 +4970,6 @@ class htx(Exchange, ImplicitAPI):
|
|
4970
4970
|
'cost': feeCost,
|
4971
4971
|
'currency': feeCurrency,
|
4972
4972
|
}
|
4973
|
-
stopPrice = self.safe_string_2(order, 'stop-price', 'trigger_price')
|
4974
4973
|
average = self.safe_string(order, 'trade_avg_price')
|
4975
4974
|
trades = self.safe_value(order, 'trades')
|
4976
4975
|
reduceOnlyInteger = self.safe_integer(order, 'reduce_only')
|
@@ -4990,8 +4989,7 @@ class htx(Exchange, ImplicitAPI):
|
|
4990
4989
|
'postOnly': None,
|
4991
4990
|
'side': side,
|
4992
4991
|
'price': price,
|
4993
|
-
'
|
4994
|
-
'triggerPrice': stopPrice,
|
4992
|
+
'triggerPrice': self.safe_string_2(order, 'stop-price', 'trigger_price'),
|
4995
4993
|
'average': average,
|
4996
4994
|
'cost': cost,
|
4997
4995
|
'amount': amount,
|
ccxt/async_support/huobijp.py
CHANGED
ccxt/async_support/idex.py
CHANGED
@@ -1098,7 +1098,6 @@ class idex(Exchange, ImplicitAPI):
|
|
1098
1098
|
'postOnly': None,
|
1099
1099
|
'side': side,
|
1100
1100
|
'price': price,
|
1101
|
-
'stopPrice': None,
|
1102
1101
|
'triggerPrice': None,
|
1103
1102
|
'amount': amount,
|
1104
1103
|
'cost': None,
|
@@ -1163,11 +1162,12 @@ class idex(Exchange, ImplicitAPI):
|
|
1163
1162
|
'takeProfit': 5,
|
1164
1163
|
'takeProfitLimit': 6,
|
1165
1164
|
}
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1165
|
+
triggerPrice = self.safe_string(params, 'triggerPrice', 'stopPrice')
|
1166
|
+
triggerPriceString = None
|
1167
|
+
if (type == 'stopLossLimit') or (type == 'takeProfitLimit'):
|
1168
|
+
if triggerPrice is None:
|
1169
|
+
raise BadRequest(self.id + ' createOrder() triggerPrice is a required parameter for ' + type + 'orders')
|
1170
|
+
triggerPriceString = self.price_to_precision(symbol, triggerPrice)
|
1171
1171
|
limitTypeEnums: dict = {
|
1172
1172
|
'limit': 1,
|
1173
1173
|
'limitMaker': 2,
|
@@ -1245,7 +1245,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1245
1245
|
encodedPrice = self.encode(priceString)
|
1246
1246
|
byteArray.append(encodedPrice)
|
1247
1247
|
if type in stopLossTypeEnums:
|
1248
|
-
encodedPrice = self.encode(
|
1248
|
+
encodedPrice = self.encode(triggerPriceString or priceString)
|
1249
1249
|
byteArray.append(encodedPrice)
|
1250
1250
|
clientOrderId = self.safe_string(params, 'clientOrderId')
|
1251
1251
|
if clientOrderId is not None:
|
@@ -1275,7 +1275,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1275
1275
|
if limitOrder:
|
1276
1276
|
request['parameters']['price'] = priceString
|
1277
1277
|
if type in stopLossTypeEnums:
|
1278
|
-
request['parameters']['stopPrice'] =
|
1278
|
+
request['parameters']['stopPrice'] = triggerPriceString or priceString
|
1279
1279
|
if amountEnum == 0:
|
1280
1280
|
request['parameters']['quantity'] = amountString
|
1281
1281
|
else:
|
@@ -437,7 +437,6 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
437
437
|
'postOnly': None,
|
438
438
|
'side': side,
|
439
439
|
'price': self.safe_string(order, 'Price'),
|
440
|
-
'stopPrice': None,
|
441
440
|
'triggerPrice': None,
|
442
441
|
'cost': self.safe_string(order, 'Value'),
|
443
442
|
'average': self.safe_string(order, 'AvgPrice'),
|
ccxt/async_support/indodax.py
CHANGED
ccxt/async_support/kraken.py
CHANGED
@@ -445,6 +445,67 @@ class kraken(Exchange, ImplicitAPI):
|
|
445
445
|
'Celestia': 'TIA',
|
446
446
|
},
|
447
447
|
},
|
448
|
+
'features': {
|
449
|
+
'spot': {
|
450
|
+
'sandbox': False,
|
451
|
+
'createOrder': {
|
452
|
+
'marginMode': False,
|
453
|
+
'triggerPrice': False, # todo
|
454
|
+
'triggerPriceType': None,
|
455
|
+
'triggerDirection': False,
|
456
|
+
'stopLossPrice': True,
|
457
|
+
'takeProfitPrice': True,
|
458
|
+
'attachedStopLossTakeProfit': None,
|
459
|
+
'timeInForce': {
|
460
|
+
'IOC': True,
|
461
|
+
'FOK': True,
|
462
|
+
'PO': True,
|
463
|
+
'GTD': False,
|
464
|
+
},
|
465
|
+
'hedged': False,
|
466
|
+
'trailing': True,
|
467
|
+
},
|
468
|
+
'createOrders': None,
|
469
|
+
'fetchMyTrades': {
|
470
|
+
'marginMode': False,
|
471
|
+
'limit': None,
|
472
|
+
'daysBack': None,
|
473
|
+
'untilDays': None,
|
474
|
+
},
|
475
|
+
'fetchOrder': {
|
476
|
+
'marginMode': False,
|
477
|
+
'trigger': False,
|
478
|
+
'trailing': False,
|
479
|
+
},
|
480
|
+
'fetchOpenOrders': {
|
481
|
+
'marginMode': False,
|
482
|
+
'limit': None,
|
483
|
+
'trigger': False,
|
484
|
+
'trailing': False,
|
485
|
+
},
|
486
|
+
'fetchOrders': None,
|
487
|
+
'fetchClosedOrders': {
|
488
|
+
'marginMode': False,
|
489
|
+
'limit': None,
|
490
|
+
'daysBackClosed': None,
|
491
|
+
'daysBackCanceled': None,
|
492
|
+
'untilDays': 100000,
|
493
|
+
'trigger': False,
|
494
|
+
'trailing': False,
|
495
|
+
},
|
496
|
+
'fetchOHLCV': {
|
497
|
+
'limit': 720,
|
498
|
+
},
|
499
|
+
},
|
500
|
+
'swap': {
|
501
|
+
'linear': None,
|
502
|
+
'inverse': None,
|
503
|
+
},
|
504
|
+
'future': {
|
505
|
+
'linear': None,
|
506
|
+
'inverse': None,
|
507
|
+
},
|
508
|
+
},
|
448
509
|
'precisionMode': TICK_SIZE,
|
449
510
|
'exceptions': {
|
450
511
|
'exact': {
|
@@ -1008,7 +1069,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1008
1069
|
"""
|
1009
1070
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1010
1071
|
|
1011
|
-
https://docs.kraken.com/rest
|
1072
|
+
https://docs.kraken.com/api/docs/rest-api/get-ohlc-data
|
1012
1073
|
|
1013
1074
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1014
1075
|
:param str timeframe: the length of time each candle represents
|
@@ -1775,7 +1836,6 @@ class kraken(Exchange, ImplicitAPI):
|
|
1775
1836
|
'postOnly': isPostOnly,
|
1776
1837
|
'side': side,
|
1777
1838
|
'price': price,
|
1778
|
-
'stopPrice': triggerPrice,
|
1779
1839
|
'triggerPrice': triggerPrice,
|
1780
1840
|
'takeProfitPrice': takeProfitPrice,
|
1781
1841
|
'stopLossPrice': stopLossPrice,
|
@@ -2123,7 +2183,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2123
2183
|
"""
|
2124
2184
|
fetch all trades made by the user
|
2125
2185
|
|
2126
|
-
https://docs.kraken.com/rest
|
2186
|
+
https://docs.kraken.com/api/docs/rest-api/get-trade-history
|
2127
2187
|
|
2128
2188
|
:param str symbol: unified market symbol
|
2129
2189
|
:param int [since]: the earliest time in ms to fetch trades for
|