ccxt 4.3.9__py2.py3-none-any.whl → 4.3.10__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/kucoinfutures.py +2 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/coinex.py +169 -148
- ccxt/async_support/kucoinfutures.py +148 -12
- ccxt/base/exchange.py +4 -4
- ccxt/base/types.py +2 -0
- ccxt/bitget.py +1 -1
- ccxt/coinex.py +169 -148
- ccxt/kucoinfutures.py +148 -12
- ccxt/pro/__init__.py +1 -1
- {ccxt-4.3.9.dist-info → ccxt-4.3.10.dist-info}/METADATA +4 -4
- {ccxt-4.3.9.dist-info → ccxt-4.3.10.dist-info}/RECORD +17 -17
- {ccxt-4.3.9.dist-info → ccxt-4.3.10.dist-info}/WHEEL +0 -0
- {ccxt-4.3.9.dist-info → ccxt-4.3.10.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/kucoinfutures.py
CHANGED
@@ -184,6 +184,8 @@ class ImplicitAPI:
|
|
184
184
|
futuresprivate_get_withdrawal_list = futuresPrivateGetWithdrawalList = Entry('withdrawal-list', 'futuresPrivate', 'GET', {'cost': 1})
|
185
185
|
futuresprivate_get_sub_api_key = futuresPrivateGetSubApiKey = Entry('sub/api-key', 'futuresPrivate', 'GET', {'cost': 1})
|
186
186
|
futuresprivate_get_trade_statistics = futuresPrivateGetTradeStatistics = Entry('trade-statistics', 'futuresPrivate', 'GET', {'cost': 1})
|
187
|
+
futuresprivate_get_trade_fees = futuresPrivateGetTradeFees = Entry('trade-fees', 'futuresPrivate', 'GET', {'cost': 1})
|
188
|
+
futuresprivate_get_history_positions = futuresPrivateGetHistoryPositions = Entry('history-positions', 'futuresPrivate', 'GET', {'cost': 1})
|
187
189
|
futuresprivate_post_transfer_out = futuresPrivatePostTransferOut = Entry('transfer-out', 'futuresPrivate', 'POST', {'cost': 1})
|
188
190
|
futuresprivate_post_transfer_in = futuresPrivatePostTransferIn = Entry('transfer-in', 'futuresPrivate', 'POST', {'cost': 1})
|
189
191
|
futuresprivate_post_orders = futuresPrivatePostOrders = Entry('orders', 'futuresPrivate', 'POST', {'cost': 1.33})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/bitget.py
CHANGED
@@ -7864,7 +7864,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7864
7864
|
"""
|
7865
7865
|
fetches historical positions
|
7866
7866
|
:see: https://www.bitget.com/api-doc/contract/position/Get-History-Position
|
7867
|
-
:param str [
|
7867
|
+
:param str[] [symbols]: unified contract symbols
|
7868
7868
|
:param int [since]: timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months
|
7869
7869
|
:param int [limit]: the maximum amount of records to fetch, default=20, max=100
|
7870
7870
|
:param dict params: extra parameters specific to the exchange api endpoint
|
ccxt/async_support/coinex.py
CHANGED
@@ -1689,7 +1689,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1689
1689
|
# "client_id": "",
|
1690
1690
|
# }
|
1691
1691
|
#
|
1692
|
-
# Spot and Margin cancelOrder,
|
1692
|
+
# Spot and Margin cancelOrder, fetchOrder
|
1693
1693
|
#
|
1694
1694
|
# {
|
1695
1695
|
# "amount":"1.5",
|
@@ -1884,49 +1884,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1884
1884
|
# "user_id": 3620173
|
1885
1885
|
# }
|
1886
1886
|
#
|
1887
|
-
#
|
1888
|
-
#
|
1889
|
-
# {
|
1890
|
-
# "amount": "0.0005",
|
1891
|
-
# "client_id": "x-167673045-b0cee0c584718b65",
|
1892
|
-
# "create_time": 1701233683.294231,
|
1893
|
-
# "deal_asset_fee": "0.00000000000000000000",
|
1894
|
-
# "deal_fee": "0.00000000000000000000",
|
1895
|
-
# "deal_profit": "0.00000000000000000000",
|
1896
|
-
# "deal_stock": "0.00000000000000000000",
|
1897
|
-
# "effect_type": 1,
|
1898
|
-
# "fee_asset": "",
|
1899
|
-
# "fee_discount": "0.00000000000000000000",
|
1900
|
-
# "last_deal_amount": "0.00000000000000000000",
|
1901
|
-
# "last_deal_id": 0,
|
1902
|
-
# "last_deal_price": "0.00000000000000000000",
|
1903
|
-
# "last_deal_role": 0,
|
1904
|
-
# "last_deal_time": 0,
|
1905
|
-
# "last_deal_type": 0,
|
1906
|
-
# "left": "0.0005",
|
1907
|
-
# "leverage": "3",
|
1908
|
-
# "maker_fee": "0.00030",
|
1909
|
-
# "market": "BTCUSDT",
|
1910
|
-
# "option": 0,
|
1911
|
-
# "order_id": 115940476323,
|
1912
|
-
# "position_id": 0,
|
1913
|
-
# "position_type": 2,
|
1914
|
-
# "price": "25000.00",
|
1915
|
-
# "side": 2,
|
1916
|
-
# "source": "api.v1",
|
1917
|
-
# "stop_id": 0,
|
1918
|
-
# "stop_loss_price": "0.00000000000000000000",
|
1919
|
-
# "stop_loss_type": 0,
|
1920
|
-
# "take_profit_price": "0.00000000000000000000",
|
1921
|
-
# "take_profit_type": 0,
|
1922
|
-
# "taker_fee": "0.00050",
|
1923
|
-
# "target": 0,
|
1924
|
-
# "type": 1,
|
1925
|
-
# "update_time": 1701233721.718884,
|
1926
|
-
# "user_id": 3620173
|
1927
|
-
# }
|
1928
|
-
#
|
1929
|
-
# Spot and Margin createOrder, createOrders v2
|
1887
|
+
# Spot and Margin createOrder, createOrders, cancelOrders v2
|
1930
1888
|
#
|
1931
1889
|
# {
|
1932
1890
|
# "amount": "0.0001",
|
@@ -1958,7 +1916,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1958
1916
|
# "stop_id": 117180138153
|
1959
1917
|
# }
|
1960
1918
|
#
|
1961
|
-
# Swap createOrder, createOrders v2
|
1919
|
+
# Swap createOrder, createOrders, cancelOrders v2
|
1962
1920
|
#
|
1963
1921
|
# {
|
1964
1922
|
# "amount": "0.0001",
|
@@ -2018,6 +1976,24 @@ class coinex(Exchange, ImplicitAPI):
|
|
2018
1976
|
# "updated_at": 1714119054559
|
2019
1977
|
# }
|
2020
1978
|
#
|
1979
|
+
# Swap and Spot stop cancelOrders v2
|
1980
|
+
#
|
1981
|
+
# {
|
1982
|
+
# "amount": "0.0001",
|
1983
|
+
# "client_id": "x-167673045-a7d7714c6478acf6",
|
1984
|
+
# "created_at": 1714187923820,
|
1985
|
+
# "market": "BTCUSDT",
|
1986
|
+
# "market_type": "FUTURES",
|
1987
|
+
# "price": "61000",
|
1988
|
+
# "side": "buy",
|
1989
|
+
# "stop_id": 136984426097,
|
1990
|
+
# "trigger_direction": "higher",
|
1991
|
+
# "trigger_price": "62000",
|
1992
|
+
# "trigger_price_type": "latest_price",
|
1993
|
+
# "type": "limit",
|
1994
|
+
# "updated_at": 1714187974363
|
1995
|
+
# }
|
1996
|
+
#
|
2021
1997
|
rawStatus = self.safe_string(order, 'status')
|
2022
1998
|
timestamp = self.safe_timestamp(order, 'create_time')
|
2023
1999
|
if timestamp is None:
|
@@ -2076,8 +2052,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
2076
2052
|
'reduceOnly': None,
|
2077
2053
|
'side': side,
|
2078
2054
|
'price': self.safe_string(order, 'price'),
|
2079
|
-
'stopPrice': self.
|
2080
|
-
'triggerPrice': self.
|
2055
|
+
'stopPrice': self.safe_string_2(order, 'stop_price', 'trigger_price'),
|
2056
|
+
'triggerPrice': self.safe_string_2(order, 'stop_price', 'trigger_price'),
|
2081
2057
|
'takeProfitPrice': self.safe_number(order, 'take_profit_price'),
|
2082
2058
|
'stopLossPrice': self.safe_number(order, 'stop_loss_price'),
|
2083
2059
|
'cost': self.safe_string_2(order, 'deal_money', 'filled_value'),
|
@@ -2616,11 +2592,14 @@ class coinex(Exchange, ImplicitAPI):
|
|
2616
2592
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
2617
2593
|
"""
|
2618
2594
|
cancel multiple orders
|
2619
|
-
:see: https://
|
2620
|
-
:see: https://
|
2595
|
+
:see: https://docs.coinex.com/api/v2/spot/order/http/cancel-batch-order
|
2596
|
+
:see: https://docs.coinex.com/api/v2/spot/order/http/cancel-batch-stop-order
|
2597
|
+
:see: https://docs.coinex.com/api/v2/futures/order/http/cancel-batch-order
|
2598
|
+
:see: https://docs.coinex.com/api/v2/futures/order/http/cancel-batch-stop-order
|
2621
2599
|
:param str[] ids: order ids
|
2622
2600
|
:param str symbol: unified market symbol
|
2623
2601
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2602
|
+
:param boolean [params.stop]: set to True for canceling stop orders
|
2624
2603
|
:returns dict: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2625
2604
|
"""
|
2626
2605
|
if symbol is None:
|
@@ -2630,111 +2609,153 @@ class coinex(Exchange, ImplicitAPI):
|
|
2630
2609
|
request = {
|
2631
2610
|
'market': market['id'],
|
2632
2611
|
}
|
2633
|
-
|
2612
|
+
stop = self.safe_bool_2(params, 'stop', 'trigger')
|
2613
|
+
params = self.omit(params, ['stop', 'trigger'])
|
2634
2614
|
response = None
|
2615
|
+
if stop:
|
2616
|
+
request['stop_ids'] = ids
|
2617
|
+
else:
|
2618
|
+
request['order_ids'] = ids
|
2635
2619
|
if market['spot']:
|
2636
|
-
|
2637
|
-
|
2620
|
+
if stop:
|
2621
|
+
response = await self.v2PrivatePostSpotCancelBatchStopOrder(self.extend(request, params))
|
2622
|
+
#
|
2623
|
+
# {
|
2624
|
+
# "code": 0,
|
2625
|
+
# "data": [
|
2626
|
+
# {
|
2627
|
+
# "code": 0,
|
2628
|
+
# "data": {
|
2629
|
+
# "amount": "0.0001",
|
2630
|
+
# "ccy": "BTC",
|
2631
|
+
# "client_id": "x-167673045-8e33d6f4a4bcb022",
|
2632
|
+
# "created_at": 1714188827291,
|
2633
|
+
# "market": "BTCUSDT",
|
2634
|
+
# "market_type": "SPOT",
|
2635
|
+
# "price": "61000",
|
2636
|
+
# "side": "buy",
|
2637
|
+
# "stop_id": 117248845854,
|
2638
|
+
# "trigger_direction": "higher",
|
2639
|
+
# "trigger_price": "62000",
|
2640
|
+
# "trigger_price_type": "mark_price",
|
2641
|
+
# "type": "limit",
|
2642
|
+
# "updated_at": 1714188827291
|
2643
|
+
# },
|
2644
|
+
# "message": "OK"
|
2645
|
+
# },
|
2646
|
+
# ],
|
2647
|
+
# "message": "OK"
|
2648
|
+
# }
|
2649
|
+
#
|
2650
|
+
else:
|
2651
|
+
response = await self.v2PrivatePostSpotCancelBatchOrder(self.extend(request, params))
|
2652
|
+
#
|
2653
|
+
# {
|
2654
|
+
# "code": 0,
|
2655
|
+
# "data": [
|
2656
|
+
# {
|
2657
|
+
# "code": 0,
|
2658
|
+
# "data": {
|
2659
|
+
# "amount": "0.0001",
|
2660
|
+
# "base_fee": "0",
|
2661
|
+
# "ccy": "BTC",
|
2662
|
+
# "client_id": "x-167673045-c1cc78e5b42d8c4e",
|
2663
|
+
# "created_at": 1714188449497,
|
2664
|
+
# "discount_fee": "0",
|
2665
|
+
# "filled_amount": "0",
|
2666
|
+
# "filled_value": "0",
|
2667
|
+
# "last_fill_amount": "0",
|
2668
|
+
# "last_fill_price": "0",
|
2669
|
+
# "maker_fee_rate": "0.002",
|
2670
|
+
# "market": "BTCUSDT",
|
2671
|
+
# "market_type": "SPOT",
|
2672
|
+
# "order_id": 117248494358,
|
2673
|
+
# "price": "60000",
|
2674
|
+
# "quote_fee": "0",
|
2675
|
+
# "side": "buy",
|
2676
|
+
# "taker_fee_rate": "0.002",
|
2677
|
+
# "type": "limit",
|
2678
|
+
# "unfilled_amount": "0.0001",
|
2679
|
+
# "updated_at": 1714188449497
|
2680
|
+
# },
|
2681
|
+
# "message": ""
|
2682
|
+
# },
|
2683
|
+
# ],
|
2684
|
+
# "message": "OK"
|
2685
|
+
# }
|
2686
|
+
#
|
2638
2687
|
else:
|
2639
|
-
request['
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2659
|
-
|
2660
|
-
|
2661
|
-
|
2662
|
-
|
2663
|
-
|
2664
|
-
|
2665
|
-
|
2666
|
-
|
2667
|
-
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2676
|
-
|
2677
|
-
|
2678
|
-
|
2679
|
-
|
2680
|
-
|
2681
|
-
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
|
2692
|
-
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
|
2697
|
-
|
2698
|
-
|
2699
|
-
|
2700
|
-
|
2701
|
-
|
2702
|
-
|
2703
|
-
|
2704
|
-
|
2705
|
-
|
2706
|
-
# "leverage": "3",
|
2707
|
-
# "maker_fee": "0.00030",
|
2708
|
-
# "market": "BTCUSDT",
|
2709
|
-
# "option": 0,
|
2710
|
-
# "order_id": 115940476323,
|
2711
|
-
# "position_id": 0,
|
2712
|
-
# "position_type": 2,
|
2713
|
-
# "price": "25000.00",
|
2714
|
-
# "side": 2,
|
2715
|
-
# "source": "api.v1",
|
2716
|
-
# "stop_id": 0,
|
2717
|
-
# "stop_loss_price": "0.00000000000000000000",
|
2718
|
-
# "stop_loss_type": 0,
|
2719
|
-
# "take_profit_price": "0.00000000000000000000",
|
2720
|
-
# "take_profit_type": 0,
|
2721
|
-
# "taker_fee": "0.00050",
|
2722
|
-
# "target": 0,
|
2723
|
-
# "type": 1,
|
2724
|
-
# "update_time": 1701233721.718884,
|
2725
|
-
# "user_id": 3620173
|
2726
|
-
# }
|
2727
|
-
# },
|
2728
|
-
# ],
|
2729
|
-
# "message": "OK"
|
2730
|
-
# }
|
2731
|
-
#
|
2732
|
-
data = self.safe_value(response, 'data', [])
|
2688
|
+
request['market_type'] = 'FUTURES'
|
2689
|
+
if stop:
|
2690
|
+
response = await self.v2PrivatePostFuturesCancelBatchStopOrder(self.extend(request, params))
|
2691
|
+
#
|
2692
|
+
# {
|
2693
|
+
# "code": 0,
|
2694
|
+
# "data": [
|
2695
|
+
# {
|
2696
|
+
# "code": 0,
|
2697
|
+
# "data": {
|
2698
|
+
# "amount": "0.0001",
|
2699
|
+
# "client_id": "x-167673045-a7d7714c6478acf6",
|
2700
|
+
# "created_at": 1714187923820,
|
2701
|
+
# "market": "BTCUSDT",
|
2702
|
+
# "market_type": "FUTURES",
|
2703
|
+
# "price": "61000",
|
2704
|
+
# "side": "buy",
|
2705
|
+
# "stop_id": 136984426097,
|
2706
|
+
# "trigger_direction": "higher",
|
2707
|
+
# "trigger_price": "62000",
|
2708
|
+
# "trigger_price_type": "latest_price",
|
2709
|
+
# "type": "limit",
|
2710
|
+
# "updated_at": 1714187974363
|
2711
|
+
# },
|
2712
|
+
# "message": ""
|
2713
|
+
# },
|
2714
|
+
# ],
|
2715
|
+
# "message": "OK"
|
2716
|
+
# }
|
2717
|
+
#
|
2718
|
+
else:
|
2719
|
+
response = await self.v2PrivatePostFuturesCancelBatchOrder(self.extend(request, params))
|
2720
|
+
#
|
2721
|
+
# {
|
2722
|
+
# "code": 0,
|
2723
|
+
# "data": [
|
2724
|
+
# {
|
2725
|
+
# "code": 0,
|
2726
|
+
# "data": {
|
2727
|
+
# "amount": "0.0001",
|
2728
|
+
# "client_id": "x-167673045-9f80fde284339a72",
|
2729
|
+
# "created_at": 1714187491784,
|
2730
|
+
# "fee": "0",
|
2731
|
+
# "fee_ccy": "USDT",
|
2732
|
+
# "filled_amount": "0",
|
2733
|
+
# "filled_value": "0",
|
2734
|
+
# "last_filled_amount": "0",
|
2735
|
+
# "last_filled_price": "0",
|
2736
|
+
# "maker_fee_rate": "0.0003",
|
2737
|
+
# "market": "BTCUSDT",
|
2738
|
+
# "market_type": "FUTURES",
|
2739
|
+
# "order_id": 136983851788,
|
2740
|
+
# "price": "61000",
|
2741
|
+
# "realized_pnl": "0",
|
2742
|
+
# "side": "buy",
|
2743
|
+
# "taker_fee_rate": "0.0005",
|
2744
|
+
# "type": "limit",
|
2745
|
+
# "unfilled_amount": "0.0001",
|
2746
|
+
# "updated_at": 1714187567079
|
2747
|
+
# },
|
2748
|
+
# "message": ""
|
2749
|
+
# },
|
2750
|
+
# ],
|
2751
|
+
# "message": "OK"
|
2752
|
+
# }
|
2753
|
+
#
|
2754
|
+
data = self.safe_list(response, 'data', [])
|
2733
2755
|
results = []
|
2734
2756
|
for i in range(0, len(data)):
|
2735
2757
|
entry = data[i]
|
2736
|
-
|
2737
|
-
item = self.safe_value(entry, dataRequest, {})
|
2758
|
+
item = self.safe_dict(entry, 'data', {})
|
2738
2759
|
order = self.parse_order(item, market)
|
2739
2760
|
results.append(order)
|
2740
2761
|
return results
|