ccxt 4.4.39__py2.py3-none-any.whl → 4.4.41__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/bitmart.py +2 -0
- ccxt/abstract/okx.py +5 -0
- ccxt/ascendex.py +9 -9
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +9 -9
- ccxt/async_support/base/exchange.py +10 -3
- ccxt/async_support/base/ws/aiohttp_client.py +2 -2
- ccxt/async_support/binance.py +37 -41
- ccxt/async_support/bingx.py +4 -3
- ccxt/async_support/bit2c.py +0 -1
- ccxt/async_support/bitbank.py +0 -1
- ccxt/async_support/bitbns.py +0 -1
- ccxt/async_support/bitfinex.py +16 -17
- ccxt/async_support/bitfinex1.py +0 -1
- ccxt/async_support/bitflyer.py +0 -1
- ccxt/async_support/bitget.py +2 -2
- ccxt/async_support/bithumb.py +0 -1
- ccxt/async_support/bitmart.py +246 -6
- ccxt/async_support/bitmex.py +5 -6
- ccxt/async_support/bitopro.py +4 -5
- ccxt/async_support/bitrue.py +5 -7
- ccxt/async_support/bitso.py +1 -2
- ccxt/async_support/bitstamp.py +1 -2
- ccxt/async_support/bitteam.py +1 -3
- ccxt/async_support/bitvavo.py +2 -4
- ccxt/async_support/blockchaincom.py +5 -5
- ccxt/async_support/blofin.py +10 -10
- ccxt/async_support/btcalpha.py +0 -1
- ccxt/async_support/btcbox.py +0 -1
- ccxt/async_support/btcmarkets.py +1 -3
- ccxt/async_support/bybit.py +10 -11
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +77 -1
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +62 -0
- ccxt/async_support/coincatch.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/cryptocom.py +91 -2
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/defx.py +1 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +62 -6
- ccxt/async_support/gate.py +2 -2
- ccxt/async_support/hashkey.py +3 -5
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/hyperliquid.py +61 -2
- ccxt/async_support/kraken.py +124 -26
- ccxt/async_support/kucoin.py +29 -25
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/mexc.py +137 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +18 -18
- ccxt/async_support/okx.py +27 -22
- ccxt/async_support/phemex.py +12 -8
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/poloniexfutures.py +6 -6
- ccxt/async_support/vertex.py +11 -11
- ccxt/async_support/woo.py +33 -33
- ccxt/async_support/woofipro.py +24 -24
- ccxt/async_support/xt.py +29 -27
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +31 -19
- ccxt/base/types.py +10 -0
- ccxt/binance.py +37 -41
- ccxt/bingx.py +4 -3
- ccxt/bit2c.py +0 -1
- ccxt/bitbank.py +0 -1
- ccxt/bitbns.py +0 -1
- ccxt/bitfinex.py +16 -17
- ccxt/bitfinex1.py +0 -1
- ccxt/bitflyer.py +0 -1
- ccxt/bitget.py +2 -2
- ccxt/bithumb.py +0 -1
- ccxt/bitmart.py +246 -6
- ccxt/bitmex.py +5 -6
- ccxt/bitopro.py +4 -5
- ccxt/bitrue.py +5 -7
- ccxt/bitso.py +1 -2
- ccxt/bitstamp.py +1 -2
- ccxt/bitteam.py +1 -3
- ccxt/bitvavo.py +2 -4
- ccxt/blockchaincom.py +5 -5
- ccxt/blofin.py +10 -10
- ccxt/btcalpha.py +0 -1
- ccxt/btcbox.py +0 -1
- ccxt/btcmarkets.py +1 -3
- ccxt/bybit.py +10 -11
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +77 -1
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +62 -0
- ccxt/coincatch.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/cryptocom.py +91 -2
- ccxt/currencycom.py +1 -1
- ccxt/defx.py +1 -2
- ccxt/delta.py +1 -1
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +62 -6
- ccxt/gate.py +2 -2
- ccxt/hashkey.py +3 -5
- ccxt/htx.py +2 -2
- ccxt/hyperliquid.py +61 -2
- ccxt/kraken.py +124 -26
- ccxt/kucoin.py +29 -25
- ccxt/luno.py +1 -1
- ccxt/mexc.py +137 -1
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +18 -18
- ccxt/okx.py +27 -22
- ccxt/phemex.py +12 -8
- ccxt/poloniex.py +1 -1
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bybit.py +12 -1
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/gate.py +6 -6
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/okx.py +11 -11
- ccxt/pro/upbit.py +2 -2
- ccxt/vertex.py +11 -11
- ccxt/woo.py +33 -33
- ccxt/woofipro.py +24 -24
- ccxt/xt.py +29 -27
- ccxt/zonda.py +1 -1
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/METADATA +4 -4
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/RECORD +137 -137
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/WHEEL +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/top_level.txt +0 -0
ccxt/kucoin.py
CHANGED
@@ -659,6 +659,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
659
659
|
'version': 'v1',
|
660
660
|
'symbolSeparator': '-',
|
661
661
|
'fetchMyTradesMethod': 'private_get_fills',
|
662
|
+
'timeDifference': 0, # the difference between system clock and Binance clock
|
663
|
+
'adjustForTimeDifference': False, # controls the adjustment logic upon instantiation
|
662
664
|
'fetchCurrencies': {
|
663
665
|
'webApiEnable': True, # fetches from WEB
|
664
666
|
'webApiRetries': 1,
|
@@ -1075,7 +1077,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1075
1077
|
})
|
1076
1078
|
|
1077
1079
|
def nonce(self):
|
1078
|
-
return self.milliseconds()
|
1080
|
+
return self.milliseconds() - self.options['timeDifference']
|
1079
1081
|
|
1080
1082
|
def fetch_time(self, params={}):
|
1081
1083
|
"""
|
@@ -1312,6 +1314,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1312
1314
|
'created': None,
|
1313
1315
|
'info': market,
|
1314
1316
|
})
|
1317
|
+
if self.options['adjustForTimeDifference']:
|
1318
|
+
self.load_time_difference()
|
1315
1319
|
return result
|
1316
1320
|
|
1317
1321
|
def load_migration_status(self, force: bool = False):
|
@@ -2213,7 +2217,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2213
2217
|
market orders --------------------------------------------------
|
2214
2218
|
:param str [params.funds]: # Amount of quote currency to use
|
2215
2219
|
stop orders ----------------------------------------------------
|
2216
|
-
:param str [params.stop]: Either loss or entry, the default is loss. Requires
|
2220
|
+
:param str [params.stop]: Either loss or entry, the default is loss. Requires triggerPrice to be defined
|
2217
2221
|
margin orders --------------------------------------------------
|
2218
2222
|
:param float [params.leverage]: Leverage size of the order
|
2219
2223
|
:param str [params.stp]: '', # self trade prevention, CN, CO, CB or DC
|
@@ -2518,7 +2522,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2518
2522
|
:param str id: order id
|
2519
2523
|
:param str symbol: unified symbol of the market the order was made in
|
2520
2524
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2521
|
-
:param bool [params.
|
2525
|
+
:param bool [params.trigger]: True if cancelling a stop order
|
2522
2526
|
:param bool [params.hf]: False, # True for hf order
|
2523
2527
|
:param bool [params.sync]: False, # True to use the hf sync call
|
2524
2528
|
:returns: Response from the exchange
|
@@ -2526,7 +2530,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2526
2530
|
self.load_markets()
|
2527
2531
|
request: dict = {}
|
2528
2532
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
2529
|
-
|
2533
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
2530
2534
|
hf = None
|
2531
2535
|
hf, params = self.handle_hf_and_params(params)
|
2532
2536
|
useSync = False
|
@@ -2540,7 +2544,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2540
2544
|
params = self.omit(params, ['clientOid', 'clientOrderId', 'stop', 'trigger'])
|
2541
2545
|
if clientOrderId is not None:
|
2542
2546
|
request['clientOid'] = clientOrderId
|
2543
|
-
if
|
2547
|
+
if trigger:
|
2544
2548
|
response = self.privateDeleteStopOrderCancelOrderByClientOid(self.extend(request, params))
|
2545
2549
|
#
|
2546
2550
|
# {
|
@@ -2579,7 +2583,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2579
2583
|
return self.parse_order(response)
|
2580
2584
|
else:
|
2581
2585
|
request['orderId'] = id
|
2582
|
-
if
|
2586
|
+
if trigger:
|
2583
2587
|
response = self.privateDeleteStopOrderOrderId(self.extend(request, params))
|
2584
2588
|
#
|
2585
2589
|
# {
|
@@ -2627,7 +2631,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2627
2631
|
|
2628
2632
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
2629
2633
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2630
|
-
:param bool [params.
|
2634
|
+
:param bool [params.trigger]: *invalid for isolated margin* True if cancelling all stop orders
|
2631
2635
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
2632
2636
|
:param str [params.orderIds]: *stop orders only* Comma seperated order IDs
|
2633
2637
|
:param bool [params.hf]: False, # True for hf order
|
@@ -2635,7 +2639,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2635
2639
|
"""
|
2636
2640
|
self.load_markets()
|
2637
2641
|
request: dict = {}
|
2638
|
-
|
2642
|
+
trigger = self.safe_bool(params, 'stop', False)
|
2639
2643
|
hf = None
|
2640
2644
|
hf, params = self.handle_hf_and_params(params)
|
2641
2645
|
params = self.omit(params, 'stop')
|
@@ -2644,10 +2648,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2644
2648
|
request['symbol'] = self.market_id(symbol)
|
2645
2649
|
if marginMode is not None:
|
2646
2650
|
request['tradeType'] = self.options['marginModes'][marginMode]
|
2647
|
-
if marginMode == 'isolated' and
|
2651
|
+
if marginMode == 'isolated' and trigger:
|
2648
2652
|
raise BadRequest(self.id + ' cancelAllOrders does not support isolated margin for stop orders')
|
2649
2653
|
response = None
|
2650
|
-
if
|
2654
|
+
if trigger:
|
2651
2655
|
response = self.privateDeleteStopOrderCancel(self.extend(request, query))
|
2652
2656
|
elif hf:
|
2653
2657
|
if symbol is None:
|
@@ -2676,9 +2680,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2676
2680
|
:param str [params.side]: buy or sell
|
2677
2681
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2678
2682
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2679
|
-
:param int [params.currentPage]: *
|
2680
|
-
:param str [params.orderIds]: *
|
2681
|
-
:param bool [params.
|
2683
|
+
:param int [params.currentPage]: *trigger orders only* current page
|
2684
|
+
:param str [params.orderIds]: *trigger orders only* comma seperated order ID list
|
2685
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2682
2686
|
:param bool [params.hf]: False, # True for hf order
|
2683
2687
|
:returns: An `array of order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2684
2688
|
"""
|
@@ -2787,7 +2791,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2787
2791
|
:param str [params.side]: buy or sell
|
2788
2792
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2789
2793
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2790
|
-
:param bool [params.
|
2794
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2791
2795
|
:param bool [params.hf]: False, # True for hf order
|
2792
2796
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
2793
2797
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2813,12 +2817,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2813
2817
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
2814
2818
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2815
2819
|
:param int [params.until]: end time in ms
|
2816
|
-
:param bool [params.
|
2820
|
+
:param bool [params.trigger]: True if fetching trigger orders
|
2817
2821
|
:param str [params.side]: buy or sell
|
2818
2822
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2819
2823
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2820
|
-
:param int [params.currentPage]: *
|
2821
|
-
:param str [params.orderIds]: *
|
2824
|
+
:param int [params.currentPage]: *trigger orders only* current page
|
2825
|
+
:param str [params.orderIds]: *trigger orders only* comma seperated order ID list
|
2822
2826
|
:param bool [params.hf]: False, # True for hf order
|
2823
2827
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
2824
2828
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2842,9 +2846,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2842
2846
|
https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
|
2843
2847
|
|
2844
2848
|
:param str id: Order id
|
2845
|
-
:param str symbol: not sent to exchange except for
|
2849
|
+
:param str symbol: not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
|
2846
2850
|
:param dict [params]: exchange specific parameters
|
2847
|
-
:param bool [params.
|
2851
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2848
2852
|
:param bool [params.hf]: False, # True for hf order
|
2849
2853
|
:param bool [params.clientOid]: unique order id created by users to identify their orders
|
2850
2854
|
:returns: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2852,7 +2856,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2852
2856
|
self.load_markets()
|
2853
2857
|
request: dict = {}
|
2854
2858
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
2855
|
-
|
2859
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
2856
2860
|
hf = None
|
2857
2861
|
hf, params = self.handle_hf_and_params(params)
|
2858
2862
|
market = None
|
@@ -2866,7 +2870,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2866
2870
|
response = None
|
2867
2871
|
if clientOrderId is not None:
|
2868
2872
|
request['clientOid'] = clientOrderId
|
2869
|
-
if
|
2873
|
+
if trigger:
|
2870
2874
|
if symbol is not None:
|
2871
2875
|
request['symbol'] = market['id']
|
2872
2876
|
response = self.privateGetStopOrderQueryOrderByClientOid(self.extend(request, params))
|
@@ -2881,7 +2885,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2881
2885
|
if id is None:
|
2882
2886
|
raise InvalidOrder(self.id + ' fetchOrder() requires an order id')
|
2883
2887
|
request['orderId'] = id
|
2884
|
-
if
|
2888
|
+
if trigger:
|
2885
2889
|
response = self.privateGetStopOrderOrderId(self.extend(request, params))
|
2886
2890
|
elif hf:
|
2887
2891
|
response = self.privateGetHfOrdersOrderId(self.extend(request, params))
|
@@ -3019,7 +3023,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3019
3023
|
feeCurrencyId = self.safe_string(order, 'feeCurrency')
|
3020
3024
|
cancelExist = self.safe_bool(order, 'cancelExist', False)
|
3021
3025
|
responseStop = self.safe_string(order, 'stop')
|
3022
|
-
|
3026
|
+
trigger = responseStop is not None
|
3023
3027
|
stopTriggered = self.safe_bool(order, 'stopTriggered', False)
|
3024
3028
|
isActive = self.safe_bool_2(order, 'isActive', 'active')
|
3025
3029
|
responseStatus = self.safe_string(order, 'status')
|
@@ -3029,7 +3033,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3029
3033
|
status = 'open'
|
3030
3034
|
else:
|
3031
3035
|
status = 'closed'
|
3032
|
-
if
|
3036
|
+
if trigger:
|
3033
3037
|
if responseStatus == 'NEW':
|
3034
3038
|
status = 'open'
|
3035
3039
|
elif not isActive and not stopTriggered:
|
@@ -4182,7 +4186,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4182
4186
|
:param boolean [params.hf]: default False, when True will fetch ledger entries for the high frequency trading account
|
4183
4187
|
:param int [params.until]: the latest time in ms to fetch entries for
|
4184
4188
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
4185
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
4189
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
4186
4190
|
"""
|
4187
4191
|
self.load_markets()
|
4188
4192
|
self.load_accounts()
|
ccxt/luno.py
CHANGED
@@ -963,7 +963,7 @@ class luno(Exchange, ImplicitAPI):
|
|
963
963
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
964
964
|
:param int [limit]: max number of ledger entries to return, default is None
|
965
965
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
966
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
966
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
967
967
|
"""
|
968
968
|
self.load_markets()
|
969
969
|
self.load_accounts()
|
ccxt/mexc.py
CHANGED
@@ -688,6 +688,143 @@ class mexc(Exchange, ImplicitAPI):
|
|
688
688
|
'maxTimeTillEnd': 90 * 86400 * 1000 - 1, # 90 days
|
689
689
|
'broker': 'CCXT',
|
690
690
|
},
|
691
|
+
'features': {
|
692
|
+
'default': {
|
693
|
+
'sandbox': False,
|
694
|
+
'createOrder': {
|
695
|
+
'marginMode': True,
|
696
|
+
'triggerPrice': False,
|
697
|
+
'triggerDirection': False,
|
698
|
+
'triggerPriceType': {
|
699
|
+
'last': False,
|
700
|
+
'mark': False,
|
701
|
+
'index': False,
|
702
|
+
},
|
703
|
+
'stopLossPrice': False, # todo
|
704
|
+
'takeProfitPrice': False,
|
705
|
+
'attachedStopLossTakeProfit': None,
|
706
|
+
'timeInForce': {
|
707
|
+
'IOC': True,
|
708
|
+
'FOK': True,
|
709
|
+
'PO': True,
|
710
|
+
'GTD': False,
|
711
|
+
},
|
712
|
+
'hedged': False,
|
713
|
+
# exchange-supported features
|
714
|
+
'selfTradePrevention': False,
|
715
|
+
'trailing': False,
|
716
|
+
'iceberg': False,
|
717
|
+
},
|
718
|
+
'createOrders': {
|
719
|
+
'max': 20,
|
720
|
+
},
|
721
|
+
'fetchMyTrades': {
|
722
|
+
'marginMode': False,
|
723
|
+
'limit': 100,
|
724
|
+
'daysBack': 30,
|
725
|
+
'untilDays': None,
|
726
|
+
},
|
727
|
+
'fetchOrder': {
|
728
|
+
'marginMode': False,
|
729
|
+
'trigger': False,
|
730
|
+
'trailing': False,
|
731
|
+
},
|
732
|
+
'fetchOpenOrders': {
|
733
|
+
'marginMode': True,
|
734
|
+
'limit': None,
|
735
|
+
'trigger': False,
|
736
|
+
'trailing': False,
|
737
|
+
},
|
738
|
+
'fetchOrders': {
|
739
|
+
'marginMode': True,
|
740
|
+
'limit': 1000,
|
741
|
+
'daysBack': 7,
|
742
|
+
'untilDays': 7,
|
743
|
+
'trigger': False,
|
744
|
+
'trailing': False,
|
745
|
+
},
|
746
|
+
'fetchClosedOrders': {
|
747
|
+
'marginMode': True,
|
748
|
+
'limit': 1000,
|
749
|
+
'daysBackClosed': 7,
|
750
|
+
'daysBackCanceled': 7,
|
751
|
+
'untilDays': 7,
|
752
|
+
'trigger': False,
|
753
|
+
'trailing': False,
|
754
|
+
},
|
755
|
+
'fetchOHLCV': {
|
756
|
+
'limit': 1000,
|
757
|
+
},
|
758
|
+
},
|
759
|
+
'spot': {
|
760
|
+
'extends': 'default',
|
761
|
+
},
|
762
|
+
'forDerivs': {
|
763
|
+
'extends': 'default',
|
764
|
+
'createOrder': {
|
765
|
+
'triggerPrice': True,
|
766
|
+
'triggerPriceType': {
|
767
|
+
'last': True,
|
768
|
+
'mark': True,
|
769
|
+
'index': True,
|
770
|
+
},
|
771
|
+
'triggerDirection': True,
|
772
|
+
'stopLossPrice': False, # todo
|
773
|
+
'takeProfitPrice': False,
|
774
|
+
'hedged': True,
|
775
|
+
},
|
776
|
+
'createOrders': {
|
777
|
+
'max': 50,
|
778
|
+
},
|
779
|
+
'fetchMyTrades': {
|
780
|
+
'marginMode': False,
|
781
|
+
'limit': 100,
|
782
|
+
'daysBack': 90,
|
783
|
+
'untilDays': 90,
|
784
|
+
},
|
785
|
+
'fetchOrder': {
|
786
|
+
'marginMode': False,
|
787
|
+
},
|
788
|
+
'fetchOpenOrders': {
|
789
|
+
'marginMode': False,
|
790
|
+
'limit': 100,
|
791
|
+
'trigger': True,
|
792
|
+
'trailing': False,
|
793
|
+
},
|
794
|
+
'fetchOrders': {
|
795
|
+
'marginMode': False,
|
796
|
+
'limit': 100,
|
797
|
+
'daysBack': 90,
|
798
|
+
'untilDays': 90,
|
799
|
+
'trigger': True,
|
800
|
+
'trailing': False,
|
801
|
+
},
|
802
|
+
'fetchClosedOrders': {
|
803
|
+
'marginMode': False,
|
804
|
+
'limit': 100,
|
805
|
+
'daysBackClosed': 90,
|
806
|
+
'daysBackCanceled': None,
|
807
|
+
'untilDays': 90,
|
808
|
+
'trigger': True,
|
809
|
+
'trailing': False,
|
810
|
+
},
|
811
|
+
'fetchOHLCV': {
|
812
|
+
'limit': 2000,
|
813
|
+
},
|
814
|
+
},
|
815
|
+
'swap': {
|
816
|
+
'linear': {
|
817
|
+
'extends': 'forDerivs',
|
818
|
+
},
|
819
|
+
'inverse': {
|
820
|
+
'extends': 'forDerivs',
|
821
|
+
},
|
822
|
+
},
|
823
|
+
'future': {
|
824
|
+
'linear': None,
|
825
|
+
'inverse': None,
|
826
|
+
},
|
827
|
+
},
|
691
828
|
'commonCurrencies': {
|
692
829
|
'BEYONDPROTOCOL': 'BEYOND',
|
693
830
|
'BIFI': 'BIFIF',
|
@@ -2160,7 +2297,6 @@ class mexc(Exchange, ImplicitAPI):
|
|
2160
2297
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
2161
2298
|
:param str [marginMode]: only 'isolated' is supported for spot-margin trading
|
2162
2299
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2163
|
-
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
2164
2300
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2165
2301
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2166
2302
|
"""
|
ccxt/ndax.py
CHANGED
@@ -1194,7 +1194,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
1194
1194
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1195
1195
|
:param int [limit]: max number of ledger entries to return, default is None
|
1196
1196
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1197
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1197
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1198
1198
|
"""
|
1199
1199
|
omsId = self.safe_integer(self.options, 'omsId', 1)
|
1200
1200
|
self.load_markets()
|
ccxt/okcoin.py
CHANGED
@@ -1563,16 +1563,16 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1563
1563
|
:param str id: order id
|
1564
1564
|
:param str symbol: unified symbol of the market the order was made in
|
1565
1565
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1566
|
-
:param bool [params.
|
1566
|
+
:param bool [params.trigger]: True if cancel trigger or conditional orders
|
1567
1567
|
:param bool [params.advanced]: True if canceling advanced orders only
|
1568
1568
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1569
1569
|
"""
|
1570
1570
|
if symbol is None:
|
1571
1571
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1572
1572
|
self.load_markets()
|
1573
|
-
|
1573
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1574
1574
|
advanced = self.safe_value(params, 'advanced')
|
1575
|
-
if
|
1575
|
+
if trigger or advanced:
|
1576
1576
|
orderInner = self.cancel_orders([id], symbol, params)
|
1577
1577
|
return self.safe_value(orderInner, 0)
|
1578
1578
|
market = self.market(symbol)
|
@@ -1620,7 +1620,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1620
1620
|
if symbol is None:
|
1621
1621
|
raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
|
1622
1622
|
self.load_markets()
|
1623
|
-
|
1623
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1624
1624
|
advanced = self.safe_value(params, 'advanced')
|
1625
1625
|
params = self.omit(params, ['stop', 'trigger', 'advanced'])
|
1626
1626
|
market = self.market(symbol)
|
@@ -1636,7 +1636,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1636
1636
|
'instId': market['id'],
|
1637
1637
|
})
|
1638
1638
|
for i in range(0, len(ids)):
|
1639
|
-
if
|
1639
|
+
if trigger or advanced:
|
1640
1640
|
request.append({
|
1641
1641
|
'algoId': ids[i],
|
1642
1642
|
'instId': market['id'],
|
@@ -1653,7 +1653,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1653
1653
|
'clOrdId': clientOrderIds[i],
|
1654
1654
|
})
|
1655
1655
|
response = None
|
1656
|
-
if
|
1656
|
+
if trigger:
|
1657
1657
|
response = self.privatePostTradeCancelAlgos(request)
|
1658
1658
|
elif advanced:
|
1659
1659
|
response = self.privatePostTradeCancelAdvanceAlgos(request)
|
@@ -1901,8 +1901,8 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1901
1901
|
# 'ordId': id,
|
1902
1902
|
}
|
1903
1903
|
clientOrderId = self.safe_string_2(params, 'clOrdId', 'clientOrderId')
|
1904
|
-
|
1905
|
-
if
|
1904
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1905
|
+
if trigger:
|
1906
1906
|
if clientOrderId is not None:
|
1907
1907
|
request['algoClOrdId'] = clientOrderId
|
1908
1908
|
else:
|
@@ -1914,7 +1914,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1914
1914
|
request['ordId'] = id
|
1915
1915
|
query = self.omit(params, ['clientOrderId', 'stop', 'trigger'])
|
1916
1916
|
response = None
|
1917
|
-
if
|
1917
|
+
if trigger:
|
1918
1918
|
response = self.privateGetTradeOrderAlgo(self.extend(request, query))
|
1919
1919
|
else:
|
1920
1920
|
response = self.privateGetTradeOrder(self.extend(request, query))
|
@@ -1933,7 +1933,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1933
1933
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1934
1934
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1935
1935
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1936
|
-
:param bool [params.
|
1936
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
1937
1937
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
1938
1938
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1939
1939
|
"""
|
@@ -1953,12 +1953,12 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1953
1953
|
if limit is not None:
|
1954
1954
|
request['limit'] = limit # default 100, max 100
|
1955
1955
|
ordType = self.safe_string(params, 'ordType')
|
1956
|
-
|
1957
|
-
if
|
1956
|
+
trigger = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
|
1957
|
+
if trigger and (ordType is None):
|
1958
1958
|
request['ordType'] = 'trigger' # default to trigger
|
1959
1959
|
params = self.omit(params, ['stop'])
|
1960
1960
|
response = None
|
1961
|
-
if
|
1961
|
+
if trigger:
|
1962
1962
|
response = self.privateGetTradeOrdersAlgoPending(self.extend(request, params))
|
1963
1963
|
else:
|
1964
1964
|
response = self.privateGetTradeOrdersPending(self.extend(request, params))
|
@@ -1977,7 +1977,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1977
1977
|
:param int [since]: the earliest time in ms to fetch orders for
|
1978
1978
|
:param int [limit]: the maximum number of order structures to retrieve
|
1979
1979
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1980
|
-
:param bool [params.
|
1980
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
1981
1981
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
1982
1982
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1983
1983
|
"""
|
@@ -1990,12 +1990,12 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1990
1990
|
market = self.market(symbol)
|
1991
1991
|
request['instId'] = market['id']
|
1992
1992
|
ordType = self.safe_string(params, 'ordType')
|
1993
|
-
|
1994
|
-
if
|
1993
|
+
trigger = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
|
1994
|
+
if trigger and (ordType is None):
|
1995
1995
|
request['ordType'] = 'trigger' # default to trigger
|
1996
1996
|
params = self.omit(params, ['stop'])
|
1997
1997
|
response = None
|
1998
|
-
if
|
1998
|
+
if trigger:
|
1999
1999
|
response = self.privateGetTradeOrdersAlgoHistory(self.extend(request, params))
|
2000
2000
|
else:
|
2001
2001
|
method = None
|
@@ -2726,7 +2726,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2726
2726
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2727
2727
|
:param int [limit]: max number of ledger entries to return, default is None
|
2728
2728
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2729
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2729
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2730
2730
|
"""
|
2731
2731
|
self.load_markets()
|
2732
2732
|
method = None
|