ccxt 4.4.39__py2.py3-none-any.whl → 4.4.40__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/ascendex.py +9 -9
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +9 -9
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/aiohttp_client.py +2 -2
- ccxt/async_support/binance.py +13 -17
- ccxt/async_support/bingx.py +1 -2
- 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 +15 -16
- ccxt/async_support/bitfinex1.py +0 -1
- ccxt/async_support/bitflyer.py +0 -1
- ccxt/async_support/bitget.py +1 -2
- ccxt/async_support/bithumb.py +0 -1
- ccxt/async_support/bitmart.py +3 -4
- 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 +2 -3
- 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 +2 -2
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hashkey.py +3 -5
- ccxt/async_support/htx.py +1 -1
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/kucoin.py +24 -24
- 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 +21 -21
- 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 +26 -26
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +13 -16
- ccxt/binance.py +13 -17
- ccxt/bingx.py +1 -2
- ccxt/bit2c.py +0 -1
- ccxt/bitbank.py +0 -1
- ccxt/bitbns.py +0 -1
- ccxt/bitfinex.py +15 -16
- ccxt/bitfinex1.py +0 -1
- ccxt/bitflyer.py +0 -1
- ccxt/bitget.py +1 -2
- ccxt/bithumb.py +0 -1
- ccxt/bitmart.py +3 -4
- 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 +2 -3
- 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 +2 -2
- ccxt/gate.py +1 -1
- ccxt/hashkey.py +3 -5
- ccxt/htx.py +1 -1
- ccxt/hyperliquid.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/kucoin.py +24 -24
- ccxt/luno.py +1 -1
- ccxt/mexc.py +137 -1
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +18 -18
- ccxt/okx.py +21 -21
- 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 +26 -26
- ccxt/zonda.py +1 -1
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/METADATA +4 -4
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/RECORD +134 -134
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/WHEEL +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/top_level.txt +0 -0
@@ -1668,7 +1668,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1668
1668
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1669
1669
|
:param int [limit]: max number of ledger entries to return, default is None
|
1670
1670
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1671
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1671
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1672
1672
|
"""
|
1673
1673
|
await self.load_markets()
|
1674
1674
|
request: dict = {}
|
ccxt/async_support/defx.py
CHANGED
@@ -1317,7 +1317,6 @@ class defx(Exchange, ImplicitAPI):
|
|
1317
1317
|
:param str id: order id
|
1318
1318
|
:param str symbol: unified symbol of the market the order was made in
|
1319
1319
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1320
|
-
:param boolean [params.stop]: whether the order is a stop/algo order
|
1321
1320
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1322
1321
|
"""
|
1323
1322
|
await self.load_markets()
|
@@ -1734,7 +1733,7 @@ class defx(Exchange, ImplicitAPI):
|
|
1734
1733
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1735
1734
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
1736
1735
|
: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)
|
1737
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1736
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1738
1737
|
"""
|
1739
1738
|
await self.load_markets()
|
1740
1739
|
paginate = False
|
ccxt/async_support/delta.py
CHANGED
@@ -2152,7 +2152,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2152
2152
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2153
2153
|
:param int [limit]: max number of ledger entries to return, default is None
|
2154
2154
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2155
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2155
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2156
2156
|
"""
|
2157
2157
|
await self.load_markets()
|
2158
2158
|
request: dict = {
|
ccxt/async_support/digifinex.py
CHANGED
@@ -2478,7 +2478,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2478
2478
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2479
2479
|
:param int [limit]: max number of ledger entries to return, default is None
|
2480
2480
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2481
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2481
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2482
2482
|
"""
|
2483
2483
|
await self.load_markets()
|
2484
2484
|
request: dict = {}
|
ccxt/async_support/exmo.py
CHANGED
@@ -1463,7 +1463,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
1463
1463
|
"""
|
1464
1464
|
await self.load_markets()
|
1465
1465
|
request: dict = {}
|
1466
|
-
|
1466
|
+
trigger = self.safe_value_2(params, 'trigger', 'stop')
|
1467
1467
|
params = self.omit(params, ['trigger', 'stop'])
|
1468
1468
|
marginMode = None
|
1469
1469
|
marginMode, params = self.handle_margin_mode_and_params('cancelOrder', params)
|
@@ -1477,7 +1477,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
1477
1477
|
# {}
|
1478
1478
|
#
|
1479
1479
|
else:
|
1480
|
-
if
|
1480
|
+
if trigger:
|
1481
1481
|
request['parent_order_id'] = id
|
1482
1482
|
response = await self.privatePostStopMarketOrderCancel(self.extend(request, params))
|
1483
1483
|
#
|
ccxt/async_support/gate.py
CHANGED
@@ -6706,7 +6706,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6706
6706
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6707
6707
|
:param int [params.until]: end time in ms
|
6708
6708
|
: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)
|
6709
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
6709
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
6710
6710
|
"""
|
6711
6711
|
await self.load_markets()
|
6712
6712
|
paginate = False
|
ccxt/async_support/hashkey.py
CHANGED
@@ -2199,7 +2199,7 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2199
2199
|
:param int [params.until]: the latest time in ms to fetch entries for
|
2200
2200
|
:param int [params.flowType]: trade, fee, transfer, deposit, withdrawal
|
2201
2201
|
:param int [params.accountType]: spot, swap, custody
|
2202
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2202
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2203
2203
|
"""
|
2204
2204
|
methodName = 'fetchLedger'
|
2205
2205
|
if since is None:
|
@@ -3337,10 +3337,8 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3337
3337
|
raise BadRequest(self.id + ' ' + methodName + '() type parameter can not be "' + paramsType + '". It should define the type of the market("spot" or "swap"). To define the type of an order use the trigger parameter(True for trigger orders)')
|
3338
3338
|
|
3339
3339
|
def handle_trigger_option_and_params(self, params: object, methodName: str, defaultValue=None):
|
3340
|
-
|
3341
|
-
|
3342
|
-
isTrigger = isStop
|
3343
|
-
isTrigger, params = self.handle_option_and_params(params, methodName, 'trigger', isTrigger)
|
3340
|
+
isTrigger = defaultValue
|
3341
|
+
isTrigger, params = self.handle_option_and_params_2(params, methodName, 'stop', 'trigger', isTrigger)
|
3344
3342
|
return [isTrigger, params]
|
3345
3343
|
|
3346
3344
|
def parse_order(self, order: dict, market: Market = None) -> Order:
|
ccxt/async_support/htx.py
CHANGED
@@ -7764,7 +7764,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7764
7764
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7765
7765
|
:param int [params.until]: the latest time in ms to fetch entries for
|
7766
7766
|
: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)
|
7767
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
7767
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
7768
7768
|
"""
|
7769
7769
|
await self.load_markets()
|
7770
7770
|
paginate = False
|
@@ -2971,7 +2971,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2971
2971
|
:param int [limit]: max number of ledger entries to return
|
2972
2972
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2973
2973
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
2974
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2974
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2975
2975
|
"""
|
2976
2976
|
await self.load_markets()
|
2977
2977
|
userAddress = None
|
ccxt/async_support/kraken.py
CHANGED
@@ -1129,7 +1129,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1129
1129
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1130
1130
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
1131
1131
|
:param int [params.end]: timestamp in seconds of the latest ledger entry
|
1132
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1132
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1133
1133
|
"""
|
1134
1134
|
# https://www.kraken.com/features/api#get-ledgers-info
|
1135
1135
|
await self.load_markets()
|
ccxt/async_support/kucoin.py
CHANGED
@@ -2214,7 +2214,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2214
2214
|
market orders --------------------------------------------------
|
2215
2215
|
:param str [params.funds]: # Amount of quote currency to use
|
2216
2216
|
stop orders ----------------------------------------------------
|
2217
|
-
:param str [params.stop]: Either loss or entry, the default is loss. Requires
|
2217
|
+
:param str [params.stop]: Either loss or entry, the default is loss. Requires triggerPrice to be defined
|
2218
2218
|
margin orders --------------------------------------------------
|
2219
2219
|
:param float [params.leverage]: Leverage size of the order
|
2220
2220
|
:param str [params.stp]: '', # self trade prevention, CN, CO, CB or DC
|
@@ -2519,7 +2519,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2519
2519
|
:param str id: order id
|
2520
2520
|
:param str symbol: unified symbol of the market the order was made in
|
2521
2521
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2522
|
-
:param bool [params.
|
2522
|
+
:param bool [params.trigger]: True if cancelling a stop order
|
2523
2523
|
:param bool [params.hf]: False, # True for hf order
|
2524
2524
|
:param bool [params.sync]: False, # True to use the hf sync call
|
2525
2525
|
:returns: Response from the exchange
|
@@ -2527,7 +2527,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2527
2527
|
await self.load_markets()
|
2528
2528
|
request: dict = {}
|
2529
2529
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
2530
|
-
|
2530
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
2531
2531
|
hf = None
|
2532
2532
|
hf, params = self.handle_hf_and_params(params)
|
2533
2533
|
useSync = False
|
@@ -2541,7 +2541,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2541
2541
|
params = self.omit(params, ['clientOid', 'clientOrderId', 'stop', 'trigger'])
|
2542
2542
|
if clientOrderId is not None:
|
2543
2543
|
request['clientOid'] = clientOrderId
|
2544
|
-
if
|
2544
|
+
if trigger:
|
2545
2545
|
response = await self.privateDeleteStopOrderCancelOrderByClientOid(self.extend(request, params))
|
2546
2546
|
#
|
2547
2547
|
# {
|
@@ -2580,7 +2580,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2580
2580
|
return self.parse_order(response)
|
2581
2581
|
else:
|
2582
2582
|
request['orderId'] = id
|
2583
|
-
if
|
2583
|
+
if trigger:
|
2584
2584
|
response = await self.privateDeleteStopOrderOrderId(self.extend(request, params))
|
2585
2585
|
#
|
2586
2586
|
# {
|
@@ -2628,7 +2628,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2628
2628
|
|
2629
2629
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
2630
2630
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2631
|
-
:param bool [params.
|
2631
|
+
:param bool [params.trigger]: *invalid for isolated margin* True if cancelling all stop orders
|
2632
2632
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
2633
2633
|
:param str [params.orderIds]: *stop orders only* Comma seperated order IDs
|
2634
2634
|
:param bool [params.hf]: False, # True for hf order
|
@@ -2636,7 +2636,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2636
2636
|
"""
|
2637
2637
|
await self.load_markets()
|
2638
2638
|
request: dict = {}
|
2639
|
-
|
2639
|
+
trigger = self.safe_bool(params, 'stop', False)
|
2640
2640
|
hf = None
|
2641
2641
|
hf, params = self.handle_hf_and_params(params)
|
2642
2642
|
params = self.omit(params, 'stop')
|
@@ -2645,10 +2645,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2645
2645
|
request['symbol'] = self.market_id(symbol)
|
2646
2646
|
if marginMode is not None:
|
2647
2647
|
request['tradeType'] = self.options['marginModes'][marginMode]
|
2648
|
-
if marginMode == 'isolated' and
|
2648
|
+
if marginMode == 'isolated' and trigger:
|
2649
2649
|
raise BadRequest(self.id + ' cancelAllOrders does not support isolated margin for stop orders')
|
2650
2650
|
response = None
|
2651
|
-
if
|
2651
|
+
if trigger:
|
2652
2652
|
response = await self.privateDeleteStopOrderCancel(self.extend(request, query))
|
2653
2653
|
elif hf:
|
2654
2654
|
if symbol is None:
|
@@ -2677,9 +2677,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2677
2677
|
:param str [params.side]: buy or sell
|
2678
2678
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2679
2679
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2680
|
-
:param int [params.currentPage]: *
|
2681
|
-
:param str [params.orderIds]: *
|
2682
|
-
:param bool [params.
|
2680
|
+
:param int [params.currentPage]: *trigger orders only* current page
|
2681
|
+
:param str [params.orderIds]: *trigger orders only* comma seperated order ID list
|
2682
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2683
2683
|
:param bool [params.hf]: False, # True for hf order
|
2684
2684
|
:returns: An `array of order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2685
2685
|
"""
|
@@ -2788,7 +2788,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2788
2788
|
:param str [params.side]: buy or sell
|
2789
2789
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2790
2790
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2791
|
-
:param bool [params.
|
2791
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2792
2792
|
:param bool [params.hf]: False, # True for hf order
|
2793
2793
|
: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)
|
2794
2794
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2814,12 +2814,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2814
2814
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
2815
2815
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2816
2816
|
:param int [params.until]: end time in ms
|
2817
|
-
:param bool [params.
|
2817
|
+
:param bool [params.trigger]: True if fetching trigger orders
|
2818
2818
|
:param str [params.side]: buy or sell
|
2819
2819
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2820
2820
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2821
|
-
:param int [params.currentPage]: *
|
2822
|
-
:param str [params.orderIds]: *
|
2821
|
+
:param int [params.currentPage]: *trigger orders only* current page
|
2822
|
+
:param str [params.orderIds]: *trigger orders only* comma seperated order ID list
|
2823
2823
|
:param bool [params.hf]: False, # True for hf order
|
2824
2824
|
: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)
|
2825
2825
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2843,9 +2843,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2843
2843
|
https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
|
2844
2844
|
|
2845
2845
|
:param str id: Order id
|
2846
|
-
:param str symbol: not sent to exchange except for
|
2846
|
+
:param str symbol: not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
|
2847
2847
|
:param dict [params]: exchange specific parameters
|
2848
|
-
:param bool [params.
|
2848
|
+
:param bool [params.trigger]: True if fetching a trigger order
|
2849
2849
|
:param bool [params.hf]: False, # True for hf order
|
2850
2850
|
:param bool [params.clientOid]: unique order id created by users to identify their orders
|
2851
2851
|
:returns: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2853,7 +2853,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2853
2853
|
await self.load_markets()
|
2854
2854
|
request: dict = {}
|
2855
2855
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
2856
|
-
|
2856
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
2857
2857
|
hf = None
|
2858
2858
|
hf, params = self.handle_hf_and_params(params)
|
2859
2859
|
market = None
|
@@ -2867,7 +2867,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2867
2867
|
response = None
|
2868
2868
|
if clientOrderId is not None:
|
2869
2869
|
request['clientOid'] = clientOrderId
|
2870
|
-
if
|
2870
|
+
if trigger:
|
2871
2871
|
if symbol is not None:
|
2872
2872
|
request['symbol'] = market['id']
|
2873
2873
|
response = await self.privateGetStopOrderQueryOrderByClientOid(self.extend(request, params))
|
@@ -2882,7 +2882,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2882
2882
|
if id is None:
|
2883
2883
|
raise InvalidOrder(self.id + ' fetchOrder() requires an order id')
|
2884
2884
|
request['orderId'] = id
|
2885
|
-
if
|
2885
|
+
if trigger:
|
2886
2886
|
response = await self.privateGetStopOrderOrderId(self.extend(request, params))
|
2887
2887
|
elif hf:
|
2888
2888
|
response = await self.privateGetHfOrdersOrderId(self.extend(request, params))
|
@@ -3020,7 +3020,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3020
3020
|
feeCurrencyId = self.safe_string(order, 'feeCurrency')
|
3021
3021
|
cancelExist = self.safe_bool(order, 'cancelExist', False)
|
3022
3022
|
responseStop = self.safe_string(order, 'stop')
|
3023
|
-
|
3023
|
+
trigger = responseStop is not None
|
3024
3024
|
stopTriggered = self.safe_bool(order, 'stopTriggered', False)
|
3025
3025
|
isActive = self.safe_bool_2(order, 'isActive', 'active')
|
3026
3026
|
responseStatus = self.safe_string(order, 'status')
|
@@ -3030,7 +3030,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3030
3030
|
status = 'open'
|
3031
3031
|
else:
|
3032
3032
|
status = 'closed'
|
3033
|
-
if
|
3033
|
+
if trigger:
|
3034
3034
|
if responseStatus == 'NEW':
|
3035
3035
|
status = 'open'
|
3036
3036
|
elif not isActive and not stopTriggered:
|
@@ -4183,7 +4183,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4183
4183
|
:param boolean [params.hf]: default False, when True will fetch ledger entries for the high frequency trading account
|
4184
4184
|
:param int [params.until]: the latest time in ms to fetch entries for
|
4185
4185
|
: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)
|
4186
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
4186
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
4187
4187
|
"""
|
4188
4188
|
await self.load_markets()
|
4189
4189
|
await self.load_accounts()
|
ccxt/async_support/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
|
await self.load_markets()
|
969
969
|
await self.load_accounts()
|
ccxt/async_support/mexc.py
CHANGED
@@ -689,6 +689,143 @@ class mexc(Exchange, ImplicitAPI):
|
|
689
689
|
'maxTimeTillEnd': 90 * 86400 * 1000 - 1, # 90 days
|
690
690
|
'broker': 'CCXT',
|
691
691
|
},
|
692
|
+
'features': {
|
693
|
+
'def': {
|
694
|
+
'sandbox': False,
|
695
|
+
'createOrder': {
|
696
|
+
'marginMode': True,
|
697
|
+
'triggerPrice': False,
|
698
|
+
'triggerDirection': False,
|
699
|
+
'triggerPriceType': {
|
700
|
+
'last': False,
|
701
|
+
'mark': False,
|
702
|
+
'index': False,
|
703
|
+
},
|
704
|
+
'stopLossPrice': False, # todo
|
705
|
+
'takeProfitPrice': False,
|
706
|
+
'attachedStopLossTakeProfit': None,
|
707
|
+
'timeInForce': {
|
708
|
+
'IOC': True,
|
709
|
+
'FOK': True,
|
710
|
+
'PO': True,
|
711
|
+
'GTD': False,
|
712
|
+
},
|
713
|
+
'hedged': False,
|
714
|
+
# exchange-supported features
|
715
|
+
'selfTradePrevention': False,
|
716
|
+
'trailing': False,
|
717
|
+
'iceberg': False,
|
718
|
+
},
|
719
|
+
'createOrders': {
|
720
|
+
'max': 20,
|
721
|
+
},
|
722
|
+
'fetchMyTrades': {
|
723
|
+
'marginMode': False,
|
724
|
+
'limit': 100,
|
725
|
+
'daysBack': 30,
|
726
|
+
'untilDays': None,
|
727
|
+
},
|
728
|
+
'fetchOrder': {
|
729
|
+
'marginMode': False,
|
730
|
+
'trigger': False,
|
731
|
+
'trailing': False,
|
732
|
+
},
|
733
|
+
'fetchOpenOrders': {
|
734
|
+
'marginMode': True,
|
735
|
+
'limit': None,
|
736
|
+
'trigger': False,
|
737
|
+
'trailing': False,
|
738
|
+
},
|
739
|
+
'fetchOrders': {
|
740
|
+
'marginMode': True,
|
741
|
+
'limit': 1000,
|
742
|
+
'daysBack': 7,
|
743
|
+
'untilDays': 7,
|
744
|
+
'trigger': False,
|
745
|
+
'trailing': False,
|
746
|
+
},
|
747
|
+
'fetchClosedOrders': {
|
748
|
+
'marginMode': True,
|
749
|
+
'limit': 1000,
|
750
|
+
'daysBackClosed': 7,
|
751
|
+
'daysBackCanceled': 7,
|
752
|
+
'untilDays': 7,
|
753
|
+
'trigger': False,
|
754
|
+
'trailing': False,
|
755
|
+
},
|
756
|
+
'fetchOHLCV': {
|
757
|
+
'limit': 1000,
|
758
|
+
},
|
759
|
+
},
|
760
|
+
'spot': {
|
761
|
+
'extends': 'def',
|
762
|
+
},
|
763
|
+
'forDerivs': {
|
764
|
+
'extends': 'def',
|
765
|
+
'createOrder': {
|
766
|
+
'triggerPrice': True,
|
767
|
+
'triggerPriceType': {
|
768
|
+
'last': True,
|
769
|
+
'mark': True,
|
770
|
+
'index': True,
|
771
|
+
},
|
772
|
+
'triggerDirection': True,
|
773
|
+
'stopLossPrice': False, # todo
|
774
|
+
'takeProfitPrice': False,
|
775
|
+
'hedged': True,
|
776
|
+
},
|
777
|
+
'createOrders': {
|
778
|
+
'max': 50,
|
779
|
+
},
|
780
|
+
'fetchMyTrades': {
|
781
|
+
'marginMode': False,
|
782
|
+
'limit': 100,
|
783
|
+
'daysBack': 90,
|
784
|
+
'untilDays': 90,
|
785
|
+
},
|
786
|
+
'fetchOrder': {
|
787
|
+
'marginMode': False,
|
788
|
+
},
|
789
|
+
'fetchOpenOrders': {
|
790
|
+
'marginMode': False,
|
791
|
+
'limit': 100,
|
792
|
+
'trigger': True,
|
793
|
+
'trailing': False,
|
794
|
+
},
|
795
|
+
'fetchOrders': {
|
796
|
+
'marginMode': False,
|
797
|
+
'limit': 100,
|
798
|
+
'daysBack': 90,
|
799
|
+
'untilDays': 90,
|
800
|
+
'trigger': True,
|
801
|
+
'trailing': False,
|
802
|
+
},
|
803
|
+
'fetchClosedOrders': {
|
804
|
+
'marginMode': False,
|
805
|
+
'limit': 100,
|
806
|
+
'daysBackClosed': 90,
|
807
|
+
'daysBackCanceled': None,
|
808
|
+
'untilDays': 90,
|
809
|
+
'trigger': True,
|
810
|
+
'trailing': False,
|
811
|
+
},
|
812
|
+
'fetchOHLCV': {
|
813
|
+
'limit': 2000,
|
814
|
+
},
|
815
|
+
},
|
816
|
+
'swap': {
|
817
|
+
'linear': {
|
818
|
+
'extends': 'forDerivs',
|
819
|
+
},
|
820
|
+
'inverse': {
|
821
|
+
'extends': 'forDerivs',
|
822
|
+
},
|
823
|
+
},
|
824
|
+
'future': {
|
825
|
+
'linear': None,
|
826
|
+
'inverse': None,
|
827
|
+
},
|
828
|
+
},
|
692
829
|
'commonCurrencies': {
|
693
830
|
'BEYONDPROTOCOL': 'BEYOND',
|
694
831
|
'BIFI': 'BIFIF',
|
@@ -2161,7 +2298,6 @@ class mexc(Exchange, ImplicitAPI):
|
|
2161
2298
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
2162
2299
|
:param str [marginMode]: only 'isolated' is supported for spot-margin trading
|
2163
2300
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2164
|
-
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
2165
2301
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2166
2302
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2167
2303
|
"""
|
ccxt/async_support/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
|
await self.load_markets()
|
ccxt/async_support/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
|
await 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 = await 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
|
await 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 = await self.privatePostTradeCancelAlgos(request)
|
1658
1658
|
elif advanced:
|
1659
1659
|
response = await 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 = await self.privateGetTradeOrderAlgo(self.extend(request, query))
|
1919
1919
|
else:
|
1920
1920
|
response = await 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 = await self.privateGetTradeOrdersAlgoPending(self.extend(request, params))
|
1963
1963
|
else:
|
1964
1964
|
response = await 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 = await 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
|
await self.load_markets()
|
2732
2732
|
method = None
|