ccxt 4.4.96__py2.py3-none-any.whl → 4.4.97__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/binance.py +3 -0
- ccxt/abstract/binancecoinm.py +3 -0
- ccxt/abstract/binanceus.py +3 -0
- ccxt/abstract/binanceusdm.py +3 -0
- ccxt/abstract/phemex.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +6 -3
- ccxt/async_support/binance.py +90 -34
- ccxt/async_support/binancecoinm.py +5 -1
- ccxt/async_support/binanceus.py +3 -1
- ccxt/async_support/binanceusdm.py +3 -1
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/cryptocom.py +76 -2
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/foxbit.py +1 -1
- ccxt/async_support/gate.py +1 -2
- ccxt/async_support/hashkey.py +39 -0
- ccxt/async_support/hyperliquid.py +40 -25
- ccxt/async_support/independentreserve.py +35 -0
- ccxt/async_support/indodax.py +34 -0
- ccxt/async_support/kucoin.py +2 -1
- ccxt/async_support/latoken.py +42 -0
- ccxt/async_support/luno.py +36 -0
- ccxt/async_support/mercado.py +34 -0
- ccxt/async_support/mexc.py +3 -19
- ccxt/async_support/phemex.py +36 -31
- ccxt/base/decimal_to_precision.py +16 -10
- ccxt/base/exchange.py +55 -15
- ccxt/binance.py +90 -34
- ccxt/binancecoinm.py +5 -1
- ccxt/binanceus.py +3 -1
- ccxt/binanceusdm.py +3 -1
- ccxt/bingx.py +1 -1
- ccxt/cryptocom.py +76 -2
- ccxt/exmo.py +1 -1
- ccxt/foxbit.py +1 -1
- ccxt/gate.py +1 -2
- ccxt/hashkey.py +39 -0
- ccxt/hyperliquid.py +40 -25
- ccxt/independentreserve.py +35 -0
- ccxt/indodax.py +34 -0
- ccxt/kucoin.py +2 -1
- ccxt/latoken.py +42 -0
- ccxt/luno.py +36 -0
- ccxt/mercado.py +34 -0
- ccxt/mexc.py +3 -19
- ccxt/phemex.py +36 -31
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binancecoinm.py +3 -1
- ccxt/pro/binanceus.py +3 -1
- ccxt/pro/binanceusdm.py +3 -1
- ccxt/pro/bybit.py +33 -1
- {ccxt-4.4.96.dist-info → ccxt-4.4.97.dist-info}/METADATA +16 -16
- {ccxt-4.4.96.dist-info → ccxt-4.4.97.dist-info}/RECORD +58 -58
- {ccxt-4.4.96.dist-info → ccxt-4.4.97.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.96.dist-info → ccxt-4.4.97.dist-info}/WHEEL +0 -0
- {ccxt-4.4.96.dist-info → ccxt-4.4.97.dist-info}/top_level.txt +0 -0
ccxt/phemex.py
CHANGED
@@ -281,6 +281,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
281
281
|
# swap
|
282
282
|
'orders/replace': 1, # ?symbol=<symbol>&orderID=<orderID>&origClOrdID=<origClOrdID>&clOrdID=<clOrdID>&price=<price>&priceEp=<priceEp>&orderQty=<orderQty>&stopPx=<stopPx>&stopPxEp=<stopPxEp>&takeProfit=<takeProfit>&takeProfitEp=<takeProfitEp>&stopLoss=<stopLoss>&stopLossEp=<stopLossEp>&pegOffsetValueEp=<pegOffsetValueEp>&pegPriceType=<pegPriceType>
|
283
283
|
'g-orders/replace': 1, # ?symbol=<symbol>&orderID=<orderID>&origClOrdID=<origClOrdID>&clOrdID=<clOrdID>&price=<price>&priceEp=<priceEp>&orderQty=<orderQty>&stopPx=<stopPx>&stopPxEp=<stopPxEp>&takeProfit=<takeProfit>&takeProfitEp=<takeProfitEp>&stopLoss=<stopLoss>&stopLossEp=<stopLossEp>&pegOffsetValueEp=<pegOffsetValueEp>&pegPriceType=<pegPriceType>
|
284
|
+
'g-orders/create': 1,
|
284
285
|
'positions/leverage': 5, # ?symbol=<symbol>&leverage=<leverage>&leverageEr=<leverageEr>
|
285
286
|
'g-positions/leverage': 5, # ?symbol=<symbol>&leverage=<leverage>&leverageEr=<leverageEr>
|
286
287
|
'g-positions/switch-pos-mode-sync': 5, # ?symbol=<symbol>&targetPosMode=<targetPosMode>
|
@@ -1218,7 +1219,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
1218
1219
|
# 'id': 123456789, # optional request id
|
1219
1220
|
}
|
1220
1221
|
response = None
|
1221
|
-
|
1222
|
+
isStableSettled = (market['settle'] == 'USDT') or (market['settle'] == 'USDC')
|
1223
|
+
if market['linear'] and isStableSettled:
|
1222
1224
|
response = self.v2GetMdV2Orderbook(self.extend(request, params))
|
1223
1225
|
else:
|
1224
1226
|
if (limit is not None) and (limit <= 30):
|
@@ -1350,7 +1352,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
1350
1352
|
}
|
1351
1353
|
until = self.safe_integer_2(params, 'until', 'to')
|
1352
1354
|
params = self.omit(params, ['until'])
|
1353
|
-
|
1355
|
+
isStableSettled = (market['settle'] == 'USDT') or (market['settle'] == 'USDC')
|
1356
|
+
usesSpecialFromToEndpoint = ((market['linear'] or isStableSettled)) and ((since is not None) or (until is not None))
|
1354
1357
|
maxLimit = 1000
|
1355
1358
|
if usesSpecialFromToEndpoint:
|
1356
1359
|
maxLimit = 2000
|
@@ -1358,7 +1361,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1358
1361
|
limit = maxLimit
|
1359
1362
|
request['limit'] = min(limit, maxLimit)
|
1360
1363
|
response = None
|
1361
|
-
if market['linear'] or
|
1364
|
+
if market['linear'] or isStableSettled:
|
1362
1365
|
if (until is not None) or (since is not None):
|
1363
1366
|
candleDuration = self.parse_timeframe(timeframe)
|
1364
1367
|
if since is not None:
|
@@ -1614,7 +1617,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
1614
1617
|
# 'id': 123456789, # optional request id
|
1615
1618
|
}
|
1616
1619
|
response = None
|
1617
|
-
|
1620
|
+
isStableSettled = (market['settle'] == 'USDT') or (market['settle'] == 'USDC')
|
1621
|
+
if market['linear'] and isStableSettled:
|
1618
1622
|
response = self.v2GetMdV2Trade(self.extend(request, params))
|
1619
1623
|
else:
|
1620
1624
|
response = self.v1GetMdTrade(self.extend(request, params))
|
@@ -1853,7 +1857,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1853
1857
|
timestamp = self.safe_integer(trade, 'createdAt')
|
1854
1858
|
id = self.safe_string_2(trade, 'execId', 'execID')
|
1855
1859
|
orderId = self.safe_string(trade, 'orderID')
|
1856
|
-
if market['settle'] == 'USDT':
|
1860
|
+
if market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
1857
1861
|
sideId = self.safe_string_lower(trade, 'side')
|
1858
1862
|
if (sideId == 'buy') or (sideId == 'sell'):
|
1859
1863
|
side = sideId
|
@@ -2589,6 +2593,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2589
2593
|
stopLossDefined = (stopLoss is not None)
|
2590
2594
|
takeProfit = self.safe_value(params, 'takeProfit')
|
2591
2595
|
takeProfitDefined = (takeProfit is not None)
|
2596
|
+
isStableSettled = (market['settle'] == 'USDT') or (market['settle'] == 'USDC')
|
2592
2597
|
if clientOrderId is None:
|
2593
2598
|
brokerId = self.safe_string(self.options, 'brokerId', 'CCXT123456')
|
2594
2599
|
if brokerId is not None:
|
@@ -2598,7 +2603,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2598
2603
|
params = self.omit(params, ['clOrdID', 'clientOrderId'])
|
2599
2604
|
triggerPrice = self.safe_string_n(params, ['stopPx', 'stopPrice', 'triggerPrice'])
|
2600
2605
|
if triggerPrice is not None:
|
2601
|
-
if
|
2606
|
+
if isStableSettled:
|
2602
2607
|
request['stopPxRp'] = self.price_to_precision(symbol, triggerPrice)
|
2603
2608
|
else:
|
2604
2609
|
request['stopPxEp'] = self.to_ep(triggerPrice, market)
|
@@ -2647,7 +2652,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2647
2652
|
posSide = 'Merged'
|
2648
2653
|
posSide = self.capitalize(posSide)
|
2649
2654
|
request['posSide'] = posSide
|
2650
|
-
if
|
2655
|
+
if isStableSettled:
|
2651
2656
|
request['orderQtyRq'] = amount
|
2652
2657
|
else:
|
2653
2658
|
request['orderQty'] = self.parse_to_int(amount)
|
@@ -2675,7 +2680,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2675
2680
|
stopLossTriggerPrice = self.safe_value_2(stopLoss, 'triggerPrice', 'stopPrice')
|
2676
2681
|
if stopLossTriggerPrice is None:
|
2677
2682
|
raise InvalidOrder(self.id + ' createOrder() requires a trigger price in params["stopLoss"]["triggerPrice"] for a stop loss order')
|
2678
|
-
if
|
2683
|
+
if isStableSettled:
|
2679
2684
|
request['stopLossRp'] = self.price_to_precision(symbol, stopLossTriggerPrice)
|
2680
2685
|
else:
|
2681
2686
|
request['stopLossEp'] = self.to_ep(stopLossTriggerPrice, market)
|
@@ -2689,7 +2694,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2689
2694
|
takeProfitTriggerPrice = self.safe_value_2(takeProfit, 'triggerPrice', 'stopPrice')
|
2690
2695
|
if takeProfitTriggerPrice is None:
|
2691
2696
|
raise InvalidOrder(self.id + ' createOrder() requires a trigger price in params["takeProfit"]["triggerPrice"] for a take profit order')
|
2692
|
-
if
|
2697
|
+
if isStableSettled:
|
2693
2698
|
request['takeProfitRp'] = self.price_to_precision(symbol, takeProfitTriggerPrice)
|
2694
2699
|
else:
|
2695
2700
|
request['takeProfitEp'] = self.to_ep(takeProfitTriggerPrice, market)
|
@@ -2700,27 +2705,27 @@ class phemex(Exchange, ImplicitAPI):
|
|
2700
2705
|
if tpLimitPrice is not None:
|
2701
2706
|
request['tpPxRp'] = self.price_to_precision(symbol, tpLimitPrice)
|
2702
2707
|
if (type == 'Limit') or (type == 'StopLimit') or (type == 'LimitIfTouched'):
|
2703
|
-
if
|
2708
|
+
if isStableSettled:
|
2704
2709
|
request['priceRp'] = self.price_to_precision(symbol, price)
|
2705
2710
|
else:
|
2706
2711
|
priceString = self.number_to_string(price)
|
2707
2712
|
request['priceEp'] = self.to_ep(priceString, market)
|
2708
2713
|
takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
|
2709
2714
|
if takeProfitPrice is not None:
|
2710
|
-
if
|
2715
|
+
if isStableSettled:
|
2711
2716
|
request['takeProfitRp'] = self.price_to_precision(symbol, takeProfitPrice)
|
2712
2717
|
else:
|
2713
2718
|
request['takeProfitEp'] = self.to_ep(takeProfitPrice, market)
|
2714
2719
|
params = self.omit(params, 'takeProfitPrice')
|
2715
2720
|
stopLossPrice = self.safe_string(params, 'stopLossPrice')
|
2716
2721
|
if stopLossPrice is not None:
|
2717
|
-
if
|
2722
|
+
if isStableSettled:
|
2718
2723
|
request['stopLossRp'] = self.price_to_precision(symbol, stopLossPrice)
|
2719
2724
|
else:
|
2720
2725
|
request['stopLossEp'] = self.to_ep(stopLossPrice, market)
|
2721
2726
|
params = self.omit(params, 'stopLossPrice')
|
2722
2727
|
response = None
|
2723
|
-
if
|
2728
|
+
if isStableSettled:
|
2724
2729
|
response = self.privatePostGOrders(self.extend(request, params))
|
2725
2730
|
elif market['contract']:
|
2726
2731
|
response = self.privatePostOrders(self.extend(request, params))
|
@@ -2828,13 +2833,13 @@ class phemex(Exchange, ImplicitAPI):
|
|
2828
2833
|
}
|
2829
2834
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clOrdID')
|
2830
2835
|
params = self.omit(params, ['clientOrderId', 'clOrdID'])
|
2831
|
-
|
2836
|
+
isStableSettled = (market['settle'] == 'USDT') or (market['settle'] == 'USDC')
|
2832
2837
|
if clientOrderId is not None:
|
2833
2838
|
request['clOrdID'] = clientOrderId
|
2834
2839
|
else:
|
2835
2840
|
request['orderID'] = id
|
2836
2841
|
if price is not None:
|
2837
|
-
if
|
2842
|
+
if isStableSettled:
|
2838
2843
|
request['priceRp'] = self.price_to_precision(market['symbol'], price)
|
2839
2844
|
else:
|
2840
2845
|
request['priceEp'] = self.to_ep(price, market)
|
@@ -2844,19 +2849,19 @@ class phemex(Exchange, ImplicitAPI):
|
|
2844
2849
|
if finalQty is not None:
|
2845
2850
|
request['baseQtyEV'] = finalQty
|
2846
2851
|
elif amount is not None:
|
2847
|
-
if
|
2852
|
+
if isStableSettled:
|
2848
2853
|
request['orderQtyRq'] = self.amount_to_precision(market['symbol'], amount)
|
2849
2854
|
else:
|
2850
2855
|
request['baseQtyEV'] = self.to_ev(amount, market)
|
2851
2856
|
triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPx', 'stopPrice'])
|
2852
2857
|
if triggerPrice is not None:
|
2853
|
-
if
|
2858
|
+
if isStableSettled:
|
2854
2859
|
request['stopPxRp'] = self.price_to_precision(symbol, triggerPrice)
|
2855
2860
|
else:
|
2856
2861
|
request['stopPxEp'] = self.to_ep(triggerPrice, market)
|
2857
2862
|
params = self.omit(params, ['triggerPrice', 'stopPx', 'stopPrice'])
|
2858
2863
|
response = None
|
2859
|
-
if
|
2864
|
+
if isStableSettled:
|
2860
2865
|
posSide = self.safe_string(params, 'posSide')
|
2861
2866
|
if posSide is None:
|
2862
2867
|
request['posSide'] = 'Merged'
|
@@ -2894,7 +2899,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2894
2899
|
else:
|
2895
2900
|
request['orderID'] = id
|
2896
2901
|
response = None
|
2897
|
-
if market['settle'] == 'USDT':
|
2902
|
+
if market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
2898
2903
|
posSide = self.safe_string(params, 'posSide')
|
2899
2904
|
if posSide is None:
|
2900
2905
|
request['posSide'] = 'Merged'
|
@@ -2930,7 +2935,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2930
2935
|
if trigger:
|
2931
2936
|
request['untriggerred'] = trigger
|
2932
2937
|
response = None
|
2933
|
-
if market['settle'] == 'USDT':
|
2938
|
+
if market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
2934
2939
|
response = self.privateDeleteGOrdersAll(self.extend(request, params))
|
2935
2940
|
#
|
2936
2941
|
# {
|
@@ -2990,7 +2995,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2990
2995
|
else:
|
2991
2996
|
request['orderID'] = id
|
2992
2997
|
response = None
|
2993
|
-
if market['settle'] == 'USDT':
|
2998
|
+
if market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
2994
2999
|
response = self.privateGetApiDataGFuturesOrdersByOrderId(self.extend(request, params))
|
2995
3000
|
elif market['spot']:
|
2996
3001
|
response = self.privateGetApiDataSpotsOrdersByOrderId(self.extend(request, params))
|
@@ -3035,7 +3040,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3035
3040
|
if limit is not None:
|
3036
3041
|
request['limit'] = limit
|
3037
3042
|
response = None
|
3038
|
-
if market['settle'] == 'USDT':
|
3043
|
+
if market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
3039
3044
|
request['currency'] = market['settle']
|
3040
3045
|
response = self.privateGetExchangeOrderV2OrderList(self.extend(request, params))
|
3041
3046
|
elif market['swap']:
|
@@ -3070,7 +3075,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3070
3075
|
}
|
3071
3076
|
response = None
|
3072
3077
|
try:
|
3073
|
-
if market['settle'] == 'USDT':
|
3078
|
+
if market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
3074
3079
|
response = self.privateGetGOrdersActiveList(self.extend(request, params))
|
3075
3080
|
elif market['swap']:
|
3076
3081
|
response = self.privateGetOrdersActiveList(self.extend(request, params))
|
@@ -3875,8 +3880,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
3875
3880
|
raise BadRequest(self.id + ' fetchFundingHistory() limit argument cannot exceed 200')
|
3876
3881
|
request['limit'] = limit
|
3877
3882
|
response = None
|
3878
|
-
|
3879
|
-
if
|
3883
|
+
isStableSettled = market['settle'] == 'USDT' or market['settle'] == 'USDC'
|
3884
|
+
if isStableSettled:
|
3880
3885
|
response = self.privateGetApiDataGFuturesFundingFees(self.extend(request, params))
|
3881
3886
|
else:
|
3882
3887
|
response = self.privateGetApiDataFuturesFundingFees(self.extend(request, params))
|
@@ -3925,8 +3930,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
3925
3930
|
if value is None or currencyCode is None:
|
3926
3931
|
return value
|
3927
3932
|
# it was confirmed by phemex support, that USDT contracts use direct amounts in funding fees, while USD & INVERSE needs 'valueScale'
|
3928
|
-
|
3929
|
-
if not
|
3933
|
+
isStableSettled = market['settle'] == 'USDT' or market['settle'] == 'USDC'
|
3934
|
+
if not isStableSettled:
|
3930
3935
|
currency = self.safe_currency(currencyCode)
|
3931
3936
|
scale = self.safe_string(currency['info'], 'valueScale')
|
3932
3937
|
tickPrecision = self.parse_precision(scale)
|
@@ -4118,8 +4123,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
4118
4123
|
raise ArgumentsRequired(self.id + ' setMarginMode() requires a symbol argument')
|
4119
4124
|
self.load_markets()
|
4120
4125
|
market = self.market(symbol)
|
4121
|
-
if not market['swap'] or market['settle'] == 'USDT':
|
4122
|
-
raise BadSymbol(self.id + ' setMarginMode() supports swap(non USDT based) contracts only')
|
4126
|
+
if not market['swap'] or market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
4127
|
+
raise BadSymbol(self.id + ' setMarginMode() supports swap(non USDT/USDC based) contracts only')
|
4123
4128
|
marginMode = marginMode.lower()
|
4124
4129
|
if marginMode != 'isolated' and marginMode != 'cross':
|
4125
4130
|
raise BadRequest(self.id + ' setMarginMode() marginMode argument should be isolated or cross')
|
@@ -4355,7 +4360,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4355
4360
|
'symbol': market['id'],
|
4356
4361
|
}
|
4357
4362
|
response = None
|
4358
|
-
if market['settle'] == 'USDT':
|
4363
|
+
if market['settle'] == 'USDT' or market['settle'] == 'USDC':
|
4359
4364
|
if not isHedged and longLeverageRr is None and shortLeverageRr is None:
|
4360
4365
|
request['leverageRr'] = leverage
|
4361
4366
|
else:
|
@@ -4578,7 +4583,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4578
4583
|
raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() requires a symbol argument')
|
4579
4584
|
self.load_markets()
|
4580
4585
|
market = self.market(symbol)
|
4581
|
-
isUsdtSettled = market['settle'] == 'USDT'
|
4586
|
+
isUsdtSettled = market['settle'] == 'USDT' or market['settle'] == 'USDC'
|
4582
4587
|
if not market['swap']:
|
4583
4588
|
raise BadRequest(self.id + ' fetchFundingRateHistory() supports swap contracts only')
|
4584
4589
|
paginate = False
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/binancecoinm.py
CHANGED
ccxt/pro/binanceus.py
CHANGED
ccxt/pro/binanceusdm.py
CHANGED
@@ -19,7 +19,9 @@ class binanceusdm(binance):
|
|
19
19
|
'doc': 'https://developers.binance.com/en',
|
20
20
|
},
|
21
21
|
'options': {
|
22
|
-
'fetchMarkets':
|
22
|
+
'fetchMarkets': {
|
23
|
+
'types': ['linear'],
|
24
|
+
},
|
23
25
|
'defaultSubType': 'linear',
|
24
26
|
},
|
25
27
|
# https://binance-docs.github.io/apidocs/futures/en/#error-codes
|
ccxt/pro/bybit.py
CHANGED
@@ -49,6 +49,17 @@ class bybit(ccxt.async_support.bybit):
|
|
49
49
|
'watchTrades': True,
|
50
50
|
'watchPositions': True,
|
51
51
|
'watchTradesForSymbols': True,
|
52
|
+
'unWatchTicker': True,
|
53
|
+
'unWatchTickers': True,
|
54
|
+
'unWatchOHLCV': True,
|
55
|
+
'unWatchOHLCVForSymbols': True,
|
56
|
+
'unWatchOrderBook': True,
|
57
|
+
'unWatchOrderBookForSymbols': True,
|
58
|
+
'unWatchTrades': True,
|
59
|
+
'unWatchTradesForSymbols': True,
|
60
|
+
'unWatchMyTrades': True,
|
61
|
+
'unWatchOrders': True,
|
62
|
+
'unWatchPositions': True,
|
52
63
|
},
|
53
64
|
'urls': {
|
54
65
|
'api': {
|
@@ -1484,6 +1495,27 @@ class bybit(ccxt.async_support.bybit):
|
|
1484
1495
|
client.resolve(positions, messageHash)
|
1485
1496
|
client.resolve(newPositions, 'positions')
|
1486
1497
|
|
1498
|
+
async def un_watch_positions(self, symbols: Strings = None, params={}) -> Any:
|
1499
|
+
"""
|
1500
|
+
unWatches all open positions
|
1501
|
+
|
1502
|
+
https://bybit-exchange.github.io/docs/v5/websocket/private/position
|
1503
|
+
|
1504
|
+
:param str[] [symbols]: list of unified market symbols
|
1505
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1506
|
+
:returns dict: status of the unwatch request
|
1507
|
+
"""
|
1508
|
+
await self.load_markets()
|
1509
|
+
method = 'watchPositions'
|
1510
|
+
messageHash = 'unsubscribe:positions'
|
1511
|
+
subHash = 'positions'
|
1512
|
+
if not self.is_empty(symbols):
|
1513
|
+
raise NotSupported(self.id + ' unWatchPositions() does not support a symbol parameter, you must unwatch all orders')
|
1514
|
+
url = await self.get_url_by_market_type(None, True, method, params)
|
1515
|
+
await self.authenticate(url)
|
1516
|
+
topics = ['position']
|
1517
|
+
return await self.un_watch_topics(url, 'positions', symbols, [messageHash], [subHash], topics, params)
|
1518
|
+
|
1487
1519
|
async def watch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
|
1488
1520
|
"""
|
1489
1521
|
watch the public liquidations of a trading pair
|
@@ -2083,7 +2115,7 @@ class bybit(ccxt.async_support.bybit):
|
|
2083
2115
|
message = self.extend(request, params)
|
2084
2116
|
return await self.watch_multiple(url, messageHashes, message, messageHashes)
|
2085
2117
|
|
2086
|
-
async def un_watch_topics(self, url: str, topic: str, symbols:
|
2118
|
+
async def un_watch_topics(self, url: str, topic: str, symbols: Strings, messageHashes: List[str], subMessageHashes: List[str], topics, params={}, subExtension={}):
|
2087
2119
|
reqId = self.request_id()
|
2088
2120
|
request: dict = {
|
2089
2121
|
'op': 'unsubscribe',
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.4.
|
3
|
+
Version: 4.4.97
|
4
4
|
Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
|
5
5
|
Home-page: https://ccxt.com
|
6
6
|
Author: Igor Kroitor
|
@@ -80,23 +80,23 @@ Current feature list:
|
|
80
80
|
|logo |id |name |ver |type |certified |pro |discount |
|
81
81
|
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|-----------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
82
82
|
| [](https://accounts.binance.com/en/register?ref=D7YA7CLY) | binance | [Binance](https://accounts.binance.com/en/register?ref=D7YA7CLY) | [](https://developers.binance.com/en) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://accounts.binance.com/en/register?ref=D7YA7CLY) |
|
83
|
-
| [](https://accounts.binance.com/en/register?ref=D7YA7CLY) | binancecoinm | [Binance COIN-M](https://accounts.binance.com/en/register?ref=D7YA7CLY) | [](https://binance-docs.github.io/apidocs/delivery/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://accounts.binance.com/en/register?ref=D7YA7CLY) |
|
84
83
|
| [](https://accounts.binance.com/en/register?ref=D7YA7CLY) | binanceusdm | [Binance USDⓈ-M](https://accounts.binance.com/en/register?ref=D7YA7CLY) | [](https://binance-docs.github.io/apidocs/futures/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://accounts.binance.com/en/register?ref=D7YA7CLY) |
|
85
|
-
| [](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | bitget | [Bitget](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | [](https://www.bitget.com/api-doc/common/intro) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
87
|
-
| [](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [](https://developer-pro.bitmart.com/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](http://www.bitmart.com/?r=rQCFLh) |
|
88
|
-
| [](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [](https://www.bitmex.com/app/apiOverview) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.bitmex.com/app/register/NZTR1q) |
|
84
|
+
| [](https://accounts.binance.com/en/register?ref=D7YA7CLY) | binancecoinm | [Binance COIN-M](https://accounts.binance.com/en/register?ref=D7YA7CLY) | [](https://binance-docs.github.io/apidocs/delivery/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://accounts.binance.com/en/register?ref=D7YA7CLY) |
|
89
85
|
| [](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [](https://bybit-exchange.github.io/docs/inverse/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
90
|
-
| [](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://crypto.com/exch/kdacthrnxt) |
|
86
|
+
| [](https://www.okx.com/join/CCXT2023) | okx | [OKX](https://www.okx.com/join/CCXT2023) | [](https://www.okx.com/docs-v5/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.okx.com/join/CCXT2023) |
|
92
87
|
| [](https://www.gate.io/signup/2436035) | gate | [Gate.io](https://www.gate.io/signup/2436035) | [](https://www.gate.io/docs/developers/apiv4/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.gate.io/signup/2436035) |
|
93
|
-
| [](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | hashkey | [HashKey Global](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | [](https://hashkeyglobal-apidoc.readme.io/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
94
|
-
| [](https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223) | htx | [HTX](https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223) | [](https://huobiapi.github.io/docs/spot/v1/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223) |
|
95
|
-
| [](https://app.hyperliquid.xyz/) | hyperliquid | [Hyperliquid](https://app.hyperliquid.xyz/) | [](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
96
88
|
| [](https://www.kucoin.com/ucenter/signup?rcode=E5wkqe) | kucoin | [KuCoin](https://www.kucoin.com/ucenter/signup?rcode=E5wkqe) | [](https://docs.kucoin.com) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
97
89
|
| [](https://futures.kucoin.com/?rcode=E5wkqe) | kucoinfutures | [KuCoin Futures](https://futures.kucoin.com/?rcode=E5wkqe) | [](https://docs.kucoin.com/futures) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
90
|
+
| [](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | bitget | [Bitget](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | [](https://www.bitget.com/api-doc/common/intro) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
91
|
+
| [](https://app.hyperliquid.xyz/) | hyperliquid | [Hyperliquid](https://app.hyperliquid.xyz/) | [](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
92
|
+
| [](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [](https://www.bitmex.com/app/apiOverview) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.bitmex.com/app/register/NZTR1q) |
|
93
|
+
| [](https://bingx.com/invite/OHETOM) | bingx | [BingX](https://bingx.com/invite/OHETOM) | [](https://bingx-api.github.io/docs/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
94
|
+
| [](https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223) | htx | [HTX](https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223) | [](https://huobiapi.github.io/docs/spot/v1/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223) |
|
98
95
|
| [](https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1) | mexc | [MEXC Global](https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1) | [](https://mexcdevelop.github.io/apidocs/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
99
|
-
| [](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [](https://developer-pro.bitmart.com/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](http://www.bitmart.com/?r=rQCFLh) |
|
97
|
+
| [](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://crypto.com/exch/kdacthrnxt) |
|
98
|
+
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://docs.coinex.com/api/v2) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
99
|
+
| [](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | hashkey | [HashKey Global](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | [](https://hashkeyglobal-apidoc.readme.io/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
100
100
|
| [](https://woox.io/register?ref=DIJT0CNL) | woo | [WOO X](https://woox.io/register?ref=DIJT0CNL) | [](https://docs.woox.io/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://woox.io/register?ref=DIJT0CNL) |
|
101
101
|
| [](https://dex.woo.org/en/trade?ref=CCXT) | woofipro | [WOOFI PRO](https://dex.woo.org/en/trade?ref=CCXT) | [](https://orderly.network/docs/build-on-evm/building-on-evm) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://dex.woo.org/en/trade?ref=CCXT) |
|
102
102
|
|
@@ -160,7 +160,7 @@ Current feature list:
|
|
160
160
|
| [](https://www.ellipx.com) | ellipx | [Ellipx](https://www.ellipx.com) | [](https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM) |  | | |
|
161
161
|
| [](https://exmo.me/?ref=131685) | exmo | [EXMO](https://exmo.me/?ref=131685) | [](https://exmo.me/en/api_doc?ref=131685) |  | | |
|
162
162
|
| [](https://fmfw.io/referral/da948b21d6c92d69) | fmfwio | [FMFW.io](https://fmfw.io/referral/da948b21d6c92d69) | [](https://api.fmfw.io/) |  | | |
|
163
|
-
| [](https://app.foxbit.com.br) | foxbit | [Foxbit](https://app.foxbit.com.br) | [](https://docs.foxbit.com.br) |  | | |
|
164
164
|
| [](https://www.gate.io/signup/2436035) | gate | [Gate.io](https://www.gate.io/signup/2436035) | [](https://www.gate.io/docs/developers/apiv4/en/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
165
165
|
| [](https://gemini.com/) | gemini | [Gemini](https://gemini.com/) | [](https://docs.gemini.com/rest-api) |  | | [](https://ccxt.pro) |
|
166
166
|
| [](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | hashkey | [HashKey Global](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | [](https://hashkeyglobal-apidoc.readme.io/) |  | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
@@ -269,13 +269,13 @@ console.log(version, Object.keys(exchanges));
|
|
269
269
|
|
270
270
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
271
271
|
|
272
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.4.
|
273
|
-
* unpkg: https://unpkg.com/ccxt@4.4.
|
272
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.4.97/dist/ccxt.browser.min.js
|
273
|
+
* unpkg: https://unpkg.com/ccxt@4.4.97/dist/ccxt.browser.min.js
|
274
274
|
|
275
275
|
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.
|
276
276
|
|
277
277
|
```HTML
|
278
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.4.
|
278
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.4.97/dist/ccxt.browser.min.js"></script>
|
279
279
|
```
|
280
280
|
|
281
281
|
Creates a global `ccxt` object:
|