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
ccxt/async_support/okx.py
CHANGED
@@ -3255,9 +3255,9 @@ class okx(Exchange, ImplicitAPI):
|
|
3255
3255
|
"""
|
3256
3256
|
if symbol is None:
|
3257
3257
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
3258
|
-
|
3258
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3259
3259
|
trailing = self.safe_bool(params, 'trailing', False)
|
3260
|
-
if
|
3260
|
+
if trigger or trailing:
|
3261
3261
|
orderInner = await self.cancel_orders([id], symbol, params)
|
3262
3262
|
return self.safe_value(orderInner, 0)
|
3263
3263
|
await self.load_markets()
|
@@ -3315,9 +3315,9 @@ class okx(Exchange, ImplicitAPI):
|
|
3315
3315
|
method = self.safe_string(params, 'method', defaultMethod)
|
3316
3316
|
clientOrderIds = self.parse_ids(self.safe_value_2(params, 'clOrdId', 'clientOrderId'))
|
3317
3317
|
algoIds = self.parse_ids(self.safe_value(params, 'algoId'))
|
3318
|
-
|
3318
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3319
3319
|
trailing = self.safe_bool(params, 'trailing', False)
|
3320
|
-
if
|
3320
|
+
if trigger or trailing:
|
3321
3321
|
method = 'privatePostTradeCancelAlgos'
|
3322
3322
|
if clientOrderIds is None:
|
3323
3323
|
ids = self.parse_ids(ids)
|
@@ -3328,7 +3328,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3328
3328
|
'instId': market['id'],
|
3329
3329
|
})
|
3330
3330
|
for i in range(0, len(ids)):
|
3331
|
-
if trailing or
|
3331
|
+
if trailing or trigger:
|
3332
3332
|
request.append({
|
3333
3333
|
'algoId': ids[i],
|
3334
3334
|
'instId': market['id'],
|
@@ -3399,9 +3399,9 @@ class okx(Exchange, ImplicitAPI):
|
|
3399
3399
|
options = self.safe_dict(self.options, 'cancelOrders', {})
|
3400
3400
|
defaultMethod = self.safe_string(options, 'method', 'privatePostTradeCancelBatchOrders')
|
3401
3401
|
method = self.safe_string(params, 'method', defaultMethod)
|
3402
|
-
|
3402
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
3403
3403
|
trailing = self.safe_bool(params, 'trailing', False)
|
3404
|
-
isStopOrTrailing =
|
3404
|
+
isStopOrTrailing = trigger or trailing
|
3405
3405
|
if isStopOrTrailing:
|
3406
3406
|
method = 'privatePostTradeCancelAlgos'
|
3407
3407
|
for i in range(0, len(orders)):
|
@@ -3724,8 +3724,8 @@ class okx(Exchange, ImplicitAPI):
|
|
3724
3724
|
options = self.safe_value(self.options, 'fetchOrder', {})
|
3725
3725
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrder')
|
3726
3726
|
method = self.safe_string(params, 'method', defaultMethod)
|
3727
|
-
|
3728
|
-
if
|
3727
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3728
|
+
if trigger:
|
3729
3729
|
method = 'privateGetTradeOrderAlgo'
|
3730
3730
|
if clientOrderId is not None:
|
3731
3731
|
request['algoClOrdId'] = clientOrderId
|
@@ -3853,7 +3853,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3853
3853
|
:param int [since]: the earliest time in ms to fetch open orders for
|
3854
3854
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
3855
3855
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3856
|
-
:param bool [params.
|
3856
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
3857
3857
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
3858
3858
|
:param str [params.algoId]: Algo ID "'433845797218942976'"
|
3859
3859
|
: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)
|
@@ -3886,13 +3886,13 @@ class okx(Exchange, ImplicitAPI):
|
|
3886
3886
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersPending')
|
3887
3887
|
method = self.safe_string(params, 'method', defaultMethod)
|
3888
3888
|
ordType = self.safe_string(params, 'ordType')
|
3889
|
-
|
3889
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3890
3890
|
trailing = self.safe_bool(params, 'trailing', False)
|
3891
|
-
if trailing or
|
3891
|
+
if trailing or trigger or (ordType in algoOrderTypes):
|
3892
3892
|
method = 'privateGetTradeOrdersAlgoPending'
|
3893
3893
|
if trailing:
|
3894
3894
|
request['ordType'] = 'move_order_stop'
|
3895
|
-
elif
|
3895
|
+
elif trigger and (ordType is None):
|
3896
3896
|
request['ordType'] = 'trigger'
|
3897
3897
|
query = self.omit(params, ['method', 'stop', 'trigger', 'trailing'])
|
3898
3898
|
response = None
|
@@ -4009,7 +4009,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4009
4009
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
4010
4010
|
:param int [limit]: max number of orders to return, default is None
|
4011
4011
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4012
|
-
:param bool [params.
|
4012
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
4013
4013
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
4014
4014
|
:param str [params.algoId]: Algo ID "'433845797218942976'"
|
4015
4015
|
:param int [params.until]: timestamp in ms to fetch orders for
|
@@ -4044,18 +4044,18 @@ class okx(Exchange, ImplicitAPI):
|
|
4044
4044
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersHistory')
|
4045
4045
|
method = self.safe_string(params, 'method', defaultMethod)
|
4046
4046
|
ordType = self.safe_string(params, 'ordType')
|
4047
|
-
|
4047
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
4048
4048
|
trailing = self.safe_bool(params, 'trailing', False)
|
4049
4049
|
if trailing:
|
4050
4050
|
method = 'privateGetTradeOrdersAlgoHistory'
|
4051
4051
|
request['ordType'] = 'move_order_stop'
|
4052
|
-
elif
|
4052
|
+
elif trigger or (ordType in algoOrderTypes):
|
4053
4053
|
method = 'privateGetTradeOrdersAlgoHistory'
|
4054
4054
|
algoId = self.safe_string(params, 'algoId')
|
4055
4055
|
if algoId is not None:
|
4056
4056
|
request['algoId'] = algoId
|
4057
4057
|
params = self.omit(params, 'algoId')
|
4058
|
-
if
|
4058
|
+
if trigger:
|
4059
4059
|
if ordType is None:
|
4060
4060
|
raise ArgumentsRequired(self.id + ' fetchCanceledOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"')
|
4061
4061
|
else:
|
@@ -4225,14 +4225,14 @@ class okx(Exchange, ImplicitAPI):
|
|
4225
4225
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersHistory')
|
4226
4226
|
method = self.safe_string(params, 'method', defaultMethod)
|
4227
4227
|
ordType = self.safe_string(params, 'ordType')
|
4228
|
-
|
4228
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
4229
4229
|
trailing = self.safe_bool(params, 'trailing', False)
|
4230
|
-
if trailing or
|
4230
|
+
if trailing or trigger or (ordType in algoOrderTypes):
|
4231
4231
|
method = 'privateGetTradeOrdersAlgoHistory'
|
4232
4232
|
request['state'] = 'effective'
|
4233
4233
|
if trailing:
|
4234
4234
|
request['ordType'] = 'move_order_stop'
|
4235
|
-
elif
|
4235
|
+
elif trigger:
|
4236
4236
|
if ordType is None:
|
4237
4237
|
request['ordType'] = 'trigger'
|
4238
4238
|
else:
|
@@ -4454,7 +4454,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4454
4454
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
4455
4455
|
:param int [params.until]: the latest time in ms to fetch entries for
|
4456
4456
|
: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)
|
4457
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
4457
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
4458
4458
|
"""
|
4459
4459
|
await self.load_markets()
|
4460
4460
|
paginate = False
|
ccxt/async_support/phemex.py
CHANGED
@@ -2804,15 +2804,15 @@ class phemex(Exchange, ImplicitAPI):
|
|
2804
2804
|
raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
|
2805
2805
|
await self.load_markets()
|
2806
2806
|
market = self.market(symbol)
|
2807
|
-
|
2808
|
-
params = self.omit(params, 'stop', 'trigger')
|
2807
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger', False)
|
2808
|
+
params = self.omit(params, ['stop', 'trigger'])
|
2809
2809
|
request: dict = {
|
2810
2810
|
'symbol': market['id'],
|
2811
2811
|
# 'untriggerred': False, # False to cancel non-conditional orders, True to cancel conditional orders
|
2812
2812
|
# 'text': 'up to 40 characters max',
|
2813
2813
|
}
|
2814
|
-
if
|
2815
|
-
request['untriggerred'] =
|
2814
|
+
if trigger:
|
2815
|
+
request['untriggerred'] = trigger
|
2816
2816
|
response = None
|
2817
2817
|
if market['settle'] == 'USDT':
|
2818
2818
|
response = await self.privateDeleteGOrdersAll(self.extend(request, params))
|
@@ -3894,19 +3894,23 @@ class phemex(Exchange, ImplicitAPI):
|
|
3894
3894
|
marketId = self.safe_string(contract, 'symbol')
|
3895
3895
|
symbol = self.safe_symbol(marketId, market)
|
3896
3896
|
timestamp = self.safe_integer_product(contract, 'timestamp', 0.000001)
|
3897
|
+
markEp = self.from_ep(self.safe_string(contract, 'markEp'), market)
|
3898
|
+
indexEp = self.from_ep(self.safe_string(contract, 'indexEp'), market)
|
3899
|
+
fundingRateEr = self.from_er(self.safe_string(contract, 'fundingRateEr'), market)
|
3900
|
+
nextFundingRateEr = self.from_er(self.safe_string(contract, 'predFundingRateEr'), market)
|
3897
3901
|
return {
|
3898
3902
|
'info': contract,
|
3899
3903
|
'symbol': symbol,
|
3900
|
-
'markPrice': self.
|
3901
|
-
'indexPrice': self.
|
3904
|
+
'markPrice': self.safe_number(contract, 'markPriceRp', markEp),
|
3905
|
+
'indexPrice': self.safe_number(contract, 'indexPriceRp', indexEp),
|
3902
3906
|
'interestRate': None,
|
3903
3907
|
'estimatedSettlePrice': None,
|
3904
3908
|
'timestamp': timestamp,
|
3905
3909
|
'datetime': self.iso8601(timestamp),
|
3906
|
-
'fundingRate': self.
|
3910
|
+
'fundingRate': self.safe_number(contract, 'fundingRateRr', fundingRateEr),
|
3907
3911
|
'fundingTimestamp': None,
|
3908
3912
|
'fundingDatetime': None,
|
3909
|
-
'nextFundingRate': self.
|
3913
|
+
'nextFundingRate': self.safe_number(contract, 'predFundingRateRr', nextFundingRateEr),
|
3910
3914
|
'nextFundingTimestamp': None,
|
3911
3915
|
'nextFundingDatetime': None,
|
3912
3916
|
'previousFundingRate': None,
|
ccxt/async_support/poloniex.py
CHANGED
@@ -1201,7 +1201,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1201
1201
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1202
1202
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1203
1203
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1204
|
-
:param boolean [params.
|
1204
|
+
:param boolean [params.trigger]: set True to fetch trigger orders instead of regular orders
|
1205
1205
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1206
1206
|
"""
|
1207
1207
|
await self.load_markets()
|
@@ -1180,17 +1180,17 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1180
1180
|
cancel all open orders
|
1181
1181
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
1182
1182
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1183
|
-
:param dict [params.
|
1183
|
+
:param dict [params.trigger]: When True, all the trigger orders will be cancelled
|
1184
1184
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1185
1185
|
"""
|
1186
1186
|
await self.load_markets()
|
1187
1187
|
request: dict = {}
|
1188
1188
|
if symbol is not None:
|
1189
1189
|
request['symbol'] = self.market_id(symbol)
|
1190
|
-
|
1190
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1191
1191
|
params = self.omit(params, ['stop', 'trigger'])
|
1192
1192
|
response = None
|
1193
|
-
if
|
1193
|
+
if trigger:
|
1194
1194
|
response = await self.privateDeleteStopOrders(self.extend(request, params))
|
1195
1195
|
else:
|
1196
1196
|
response = await self.privateDeleteOrders(self.extend(request, params))
|
@@ -1254,13 +1254,13 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1254
1254
|
:returns: An `array of order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1255
1255
|
"""
|
1256
1256
|
await self.load_markets()
|
1257
|
-
|
1257
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1258
1258
|
until = self.safe_integer(params, 'until')
|
1259
1259
|
params = self.omit(params, ['trigger', 'stop', 'until'])
|
1260
1260
|
if status == 'closed':
|
1261
1261
|
status = 'done'
|
1262
1262
|
request: dict = {}
|
1263
|
-
if not
|
1263
|
+
if not trigger:
|
1264
1264
|
request['status'] = 'active' if (status == 'open') else 'done'
|
1265
1265
|
elif status != 'open':
|
1266
1266
|
raise BadRequest(self.id + ' fetchOrdersByStatus() can only fetch untriggered stop orders')
|
@@ -1273,7 +1273,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1273
1273
|
if until is not None:
|
1274
1274
|
request['endAt'] = until
|
1275
1275
|
response = None
|
1276
|
-
if
|
1276
|
+
if trigger:
|
1277
1277
|
response = await self.privateGetStopOrders(self.extend(request, params))
|
1278
1278
|
else:
|
1279
1279
|
response = await self.privateGetOrders(self.extend(request, params))
|
ccxt/async_support/vertex.py
CHANGED
@@ -1964,7 +1964,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
1964
1964
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1965
1965
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1966
1966
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1967
|
-
:param boolean [params.
|
1967
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
1968
1968
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
1969
1969
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1970
1970
|
"""
|
@@ -1974,13 +1974,13 @@ class vertex(Exchange, ImplicitAPI):
|
|
1974
1974
|
userAddress, params = self.handle_public_address('fetchOpenOrders', params)
|
1975
1975
|
request = {}
|
1976
1976
|
market: Market = None
|
1977
|
-
|
1977
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
1978
1978
|
params = self.omit(params, ['stop', 'trigger'])
|
1979
1979
|
if symbol is not None:
|
1980
1980
|
market = self.market(symbol)
|
1981
1981
|
request['product_id'] = self.parse_to_numeric(market['id'])
|
1982
1982
|
response = None
|
1983
|
-
if
|
1983
|
+
if trigger:
|
1984
1984
|
contracts = await self.query_contracts()
|
1985
1985
|
chainId = self.safe_string(contracts, 'chain_id')
|
1986
1986
|
verifyingContractAddress = self.safe_string(contracts, 'endpoint_addr')
|
@@ -2076,14 +2076,14 @@ class vertex(Exchange, ImplicitAPI):
|
|
2076
2076
|
:param int [since]: the earliest time in ms to fetch open orders for
|
2077
2077
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
2078
2078
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2079
|
-
:param boolean [params.
|
2079
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
2080
2080
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
2081
2081
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2082
2082
|
"""
|
2083
2083
|
self.check_required_credentials()
|
2084
|
-
|
2084
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
2085
2085
|
params = self.omit(params, ['stop', 'trigger'])
|
2086
|
-
if not
|
2086
|
+
if not trigger:
|
2087
2087
|
raise NotSupported(self.id + ' fetchOrders only support trigger orders')
|
2088
2088
|
userAddress = None
|
2089
2089
|
userAddress, params = self.handle_public_address('fetchOrders', params)
|
@@ -2158,7 +2158,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
2158
2158
|
cancel all open orders in a market
|
2159
2159
|
:param str symbol: unified market symbol
|
2160
2160
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2161
|
-
:param boolean [params.
|
2161
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
2162
2162
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2163
2163
|
"""
|
2164
2164
|
self.check_required_credentials()
|
@@ -2189,10 +2189,10 @@ class vertex(Exchange, ImplicitAPI):
|
|
2189
2189
|
'signature': self.build_cancel_all_orders_sig(cancels, chainId, verifyingContractAddress),
|
2190
2190
|
},
|
2191
2191
|
}
|
2192
|
-
|
2192
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
2193
2193
|
params = self.omit(params, ['stop', 'trigger'])
|
2194
2194
|
response = None
|
2195
|
-
if
|
2195
|
+
if trigger:
|
2196
2196
|
response = await self.v1TriggerPostExecute(self.extend(request, params))
|
2197
2197
|
#
|
2198
2198
|
# {
|
@@ -2286,10 +2286,10 @@ class vertex(Exchange, ImplicitAPI):
|
|
2286
2286
|
'signature': self.build_cancel_orders_sig(cancels, chainId, verifyingContractAddress),
|
2287
2287
|
},
|
2288
2288
|
}
|
2289
|
-
|
2289
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
2290
2290
|
params = self.omit(params, ['stop', 'trigger'])
|
2291
2291
|
response = None
|
2292
|
-
if
|
2292
|
+
if trigger:
|
2293
2293
|
response = await self.v1TriggerPostExecute(self.extend(request, params))
|
2294
2294
|
#
|
2295
2295
|
# {
|
ccxt/async_support/woo.py
CHANGED
@@ -975,17 +975,17 @@ class woo(Exchange, ImplicitAPI):
|
|
975
975
|
isTrailingAmountOrder = trailingAmount is not None
|
976
976
|
isTrailingPercentOrder = trailingPercent is not None
|
977
977
|
isTrailing = isTrailingAmountOrder or isTrailingPercentOrder
|
978
|
-
|
978
|
+
isConditional = isTrailing or stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
979
979
|
isMarket = orderType == 'MARKET'
|
980
980
|
timeInForce = self.safe_string_lower(params, 'timeInForce')
|
981
981
|
postOnly = self.is_post_only(isMarket, None, params)
|
982
|
-
reduceOnlyKey = 'reduceOnly' if
|
983
|
-
clientOrderIdKey = 'clientOrderId' if
|
984
|
-
orderQtyKey = 'quantity' if
|
985
|
-
priceKey = 'price' if
|
986
|
-
typeKey = 'type' if
|
982
|
+
reduceOnlyKey = 'reduceOnly' if isConditional else 'reduce_only'
|
983
|
+
clientOrderIdKey = 'clientOrderId' if isConditional else 'client_order_id'
|
984
|
+
orderQtyKey = 'quantity' if isConditional else 'order_quantity'
|
985
|
+
priceKey = 'price' if isConditional else 'order_price'
|
986
|
+
typeKey = 'type' if isConditional else 'order_type'
|
987
987
|
request[typeKey] = orderType # LIMIT/MARKET/IOC/FOK/POST_ONLY/ASK/BID
|
988
|
-
if not
|
988
|
+
if not isConditional:
|
989
989
|
if postOnly:
|
990
990
|
request['order_type'] = 'POST_ONLY'
|
991
991
|
elif timeInForce == 'fok':
|
@@ -996,7 +996,7 @@ class woo(Exchange, ImplicitAPI):
|
|
996
996
|
request[reduceOnlyKey] = reduceOnly
|
997
997
|
if not isMarket and price is not None:
|
998
998
|
request[priceKey] = self.price_to_precision(symbol, price)
|
999
|
-
if isMarket and not
|
999
|
+
if isMarket and not isConditional:
|
1000
1000
|
# for market buy it requires the amount of quote currency to spend
|
1001
1001
|
cost = self.safe_string_2(params, 'cost', 'order_amount')
|
1002
1002
|
params = self.omit(params, ['cost', 'order_amount'])
|
@@ -1064,7 +1064,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1064
1064
|
request['childOrders'] = [outterOrder]
|
1065
1065
|
params = self.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'postOnly', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLoss', 'takeProfit', 'trailingPercent', 'trailingAmount', 'trailingTriggerPrice'])
|
1066
1066
|
response = None
|
1067
|
-
if
|
1067
|
+
if isConditional:
|
1068
1068
|
response = await self.v3PrivatePostAlgoOrder(self.extend(request, params))
|
1069
1069
|
else:
|
1070
1070
|
response = await self.v1PrivatePostOrder(self.extend(request, params))
|
@@ -1163,17 +1163,17 @@ class woo(Exchange, ImplicitAPI):
|
|
1163
1163
|
convertedTrailingPercent = Precise.string_div(trailingPercent, '100')
|
1164
1164
|
request['callbackRate'] = convertedTrailingPercent
|
1165
1165
|
params = self.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent'])
|
1166
|
-
|
1166
|
+
isConditional = isTrailing or (stopPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
|
1167
1167
|
response = None
|
1168
1168
|
if isByClientOrder:
|
1169
1169
|
request['client_order_id'] = clientOrderIdExchangeSpecific
|
1170
|
-
if
|
1170
|
+
if isConditional:
|
1171
1171
|
response = await self.v3PrivatePutAlgoOrderClientClientOrderId(self.extend(request, params))
|
1172
1172
|
else:
|
1173
1173
|
response = await self.v3PrivatePutOrderClientClientOrderId(self.extend(request, params))
|
1174
1174
|
else:
|
1175
1175
|
request['oid'] = id
|
1176
|
-
if
|
1176
|
+
if isConditional:
|
1177
1177
|
response = await self.v3PrivatePutAlgoOrderOid(self.extend(request, params))
|
1178
1178
|
else:
|
1179
1179
|
response = await self.v3PrivatePutOrderOid(self.extend(request, params))
|
@@ -1203,12 +1203,12 @@ class woo(Exchange, ImplicitAPI):
|
|
1203
1203
|
:param str id: order id
|
1204
1204
|
:param str symbol: unified symbol of the market the order was made in
|
1205
1205
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1206
|
-
:param boolean [params.
|
1206
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
1207
1207
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1208
1208
|
"""
|
1209
|
-
|
1210
|
-
params = self.omit(params, 'stop')
|
1211
|
-
if not
|
1209
|
+
isTrigger = self.safe_bool_2(params, 'trigger', 'stop', False)
|
1210
|
+
params = self.omit(params, ['trigger', 'stop'])
|
1211
|
+
if not isTrigger and (symbol is None):
|
1212
1212
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1213
1213
|
await self.load_markets()
|
1214
1214
|
market: Market = None
|
@@ -1219,7 +1219,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1219
1219
|
clientOrderIdExchangeSpecific = self.safe_string(params, 'client_order_id', clientOrderIdUnified)
|
1220
1220
|
isByClientOrder = clientOrderIdExchangeSpecific is not None
|
1221
1221
|
response = None
|
1222
|
-
if
|
1222
|
+
if isTrigger:
|
1223
1223
|
request['order_id'] = id
|
1224
1224
|
response = await self.v3PrivateDeleteAlgoOrderOrderId(self.extend(request, params))
|
1225
1225
|
else:
|
@@ -1251,13 +1251,13 @@ class woo(Exchange, ImplicitAPI):
|
|
1251
1251
|
cancel all open orders in a market
|
1252
1252
|
:param str symbol: unified market symbol
|
1253
1253
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1254
|
-
:param boolean [params.
|
1254
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
1255
1255
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1256
1256
|
"""
|
1257
1257
|
await self.load_markets()
|
1258
|
-
|
1258
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
1259
1259
|
params = self.omit(params, ['stop', 'trigger'])
|
1260
|
-
if
|
1260
|
+
if trigger:
|
1261
1261
|
return await self.v3PrivateDeleteAlgoOrdersPending(params)
|
1262
1262
|
if symbol is None:
|
1263
1263
|
raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
|
@@ -1314,17 +1314,17 @@ class woo(Exchange, ImplicitAPI):
|
|
1314
1314
|
:param str id: the order id
|
1315
1315
|
:param str symbol: unified symbol of the market the order was made in
|
1316
1316
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1317
|
-
:param boolean [params.
|
1317
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
1318
1318
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1319
1319
|
"""
|
1320
1320
|
await self.load_markets()
|
1321
1321
|
market = self.market(symbol) if (symbol is not None) else None
|
1322
|
-
|
1322
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
1323
1323
|
params = self.omit(params, ['stop', 'trigger'])
|
1324
1324
|
request: dict = {}
|
1325
1325
|
clientOrderId = self.safe_string_2(params, 'clOrdID', 'clientOrderId')
|
1326
1326
|
response = None
|
1327
|
-
if
|
1327
|
+
if trigger:
|
1328
1328
|
request['oid'] = id
|
1329
1329
|
response = await self.v3PrivateGetAlgoOrderOid(self.extend(request, params))
|
1330
1330
|
elif clientOrderId:
|
@@ -1382,7 +1382,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1382
1382
|
:param int [since]: the earliest time in ms to fetch orders for
|
1383
1383
|
:param int [limit]: the maximum number of order structures to retrieve
|
1384
1384
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1385
|
-
:param boolean [params.
|
1385
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
1386
1386
|
:param boolean [params.isTriggered]: whether the order has been triggered(False by default)
|
1387
1387
|
:param str [params.side]: 'buy' or 'sell'
|
1388
1388
|
:param boolean [params.trailing]: set to True if you want to fetch trailing orders
|
@@ -1396,14 +1396,14 @@ class woo(Exchange, ImplicitAPI):
|
|
1396
1396
|
return await self.fetch_paginated_call_incremental('fetchOrders', symbol, since, limit, params, 'page', 500)
|
1397
1397
|
request: dict = {}
|
1398
1398
|
market: Market = None
|
1399
|
-
|
1399
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
1400
1400
|
trailing = self.safe_bool(params, 'trailing', False)
|
1401
1401
|
params = self.omit(params, ['stop', 'trailing', 'trigger'])
|
1402
1402
|
if symbol is not None:
|
1403
1403
|
market = self.market(symbol)
|
1404
1404
|
request['symbol'] = market['id']
|
1405
1405
|
if since is not None:
|
1406
|
-
if
|
1406
|
+
if trigger or trailing:
|
1407
1407
|
request['createdTimeStart'] = since
|
1408
1408
|
else:
|
1409
1409
|
request['start_t'] = since
|
@@ -1411,12 +1411,12 @@ class woo(Exchange, ImplicitAPI):
|
|
1411
1411
|
request['size'] = limit
|
1412
1412
|
else:
|
1413
1413
|
request['size'] = 500
|
1414
|
-
if
|
1414
|
+
if trigger:
|
1415
1415
|
request['algoType'] = 'stop'
|
1416
1416
|
elif trailing:
|
1417
1417
|
request['algoType'] = 'TRAILING_STOP'
|
1418
1418
|
response = None
|
1419
|
-
if
|
1419
|
+
if trigger or trailing:
|
1420
1420
|
response = await self.v3PrivateGetAlgoOrders(self.extend(request, params))
|
1421
1421
|
else:
|
1422
1422
|
response = await self.v1PrivateGetOrders(self.extend(request, params))
|
@@ -1466,7 +1466,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1466
1466
|
:param int [since]: the earliest time in ms to fetch orders for
|
1467
1467
|
:param int [limit]: the maximum number of order structures to retrieve
|
1468
1468
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1469
|
-
:param boolean [params.
|
1469
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
1470
1470
|
:param boolean [params.isTriggered]: whether the order has been triggered(False by default)
|
1471
1471
|
:param str [params.side]: 'buy' or 'sell'
|
1472
1472
|
:param boolean [params.trailing]: set to True if you want to fetch trailing orders
|
@@ -1488,7 +1488,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1488
1488
|
:param int [since]: the earliest time in ms to fetch orders for
|
1489
1489
|
:param int [limit]: the maximum number of order structures to retrieve
|
1490
1490
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1491
|
-
:param boolean [params.
|
1491
|
+
:param boolean [params.trigger]: whether the order is a trigger/algo order
|
1492
1492
|
:param boolean [params.isTriggered]: whether the order has been triggered(False by default)
|
1493
1493
|
:param str [params.side]: 'buy' or 'sell'
|
1494
1494
|
:param boolean [params.trailing]: set to True if you want to fetch trailing orders
|
@@ -2056,7 +2056,7 @@ class woo(Exchange, ImplicitAPI):
|
|
2056
2056
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2057
2057
|
:param int [limit]: max number of ledger entries to return, default is None
|
2058
2058
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2059
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2059
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2060
2060
|
"""
|
2061
2061
|
currency, rows = await self.get_asset_history_rows(code, since, limit, params)
|
2062
2062
|
return self.parse_ledger(rows, currency, since, limit, params)
|
@@ -2473,8 +2473,8 @@ class woo(Exchange, ImplicitAPI):
|
|
2473
2473
|
if not isSandboxMode:
|
2474
2474
|
applicationId = 'bc830de7-50f3-460b-9ee0-f430f83f9dad'
|
2475
2475
|
brokerId = self.safe_string(self.options, 'brokerId', applicationId)
|
2476
|
-
|
2477
|
-
if
|
2476
|
+
isTrigger = path.find('algo') > -1
|
2477
|
+
if isTrigger:
|
2478
2478
|
params['brokerId'] = brokerId
|
2479
2479
|
else:
|
2480
2480
|
params['broker_id'] = brokerId
|