ccxt 4.4.38__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/abstract/digifinex.py +1 -0
- ccxt/abstract/mexc.py +1 -0
- ccxt/abstract/woo.py +2 -2
- ccxt/alpaca.py +74 -3
- ccxt/ascendex.py +9 -9
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/alpaca.py +74 -3
- 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 +58 -19
- 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 +155 -33
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/kucoin.py +25 -24
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/mexc.py +173 -26
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +18 -18
- ccxt/async_support/okx.py +22 -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 +39 -39
- 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 +32 -25
- 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 +58 -19
- ccxt/exmo.py +2 -2
- ccxt/gate.py +1 -1
- ccxt/hashkey.py +3 -5
- ccxt/htx.py +155 -33
- ccxt/hyperliquid.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/kucoin.py +25 -24
- ccxt/luno.py +1 -1
- ccxt/mexc.py +173 -26
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +18 -18
- ccxt/okx.py +22 -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/pro/woo.py +1 -1
- ccxt/vertex.py +11 -11
- ccxt/woo.py +39 -39
- ccxt/woofipro.py +24 -24
- ccxt/xt.py +26 -26
- ccxt/zonda.py +1 -1
- {ccxt-4.4.38.dist-info → ccxt-4.4.40.dist-info}/METADATA +4 -4
- {ccxt-4.4.38.dist-info → ccxt-4.4.40.dist-info}/RECORD +140 -140
- {ccxt-4.4.38.dist-info → ccxt-4.4.40.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.38.dist-info → ccxt-4.4.40.dist-info}/WHEEL +0 -0
- {ccxt-4.4.38.dist-info → ccxt-4.4.40.dist-info}/top_level.txt +0 -0
ccxt/async_support/bitfinex.py
CHANGED
@@ -1484,10 +1484,10 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1484
1484
|
if flags[i] == 'postOnly':
|
1485
1485
|
postOnly = True
|
1486
1486
|
price = self.safe_string(orderList, 16)
|
1487
|
-
|
1487
|
+
triggerPrice = None
|
1488
1488
|
if (orderType == 'EXCHANGE STOP') or (orderType == 'EXCHANGE STOP LIMIT'):
|
1489
1489
|
price = None
|
1490
|
-
|
1490
|
+
triggerPrice = self.safe_string(orderList, 16)
|
1491
1491
|
if orderType == 'EXCHANGE STOP LIMIT':
|
1492
1492
|
price = self.safe_string(orderList, 19)
|
1493
1493
|
status = None
|
@@ -1510,8 +1510,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1510
1510
|
'postOnly': postOnly,
|
1511
1511
|
'side': side,
|
1512
1512
|
'price': price,
|
1513
|
-
'
|
1514
|
-
'triggerPrice': stopPrice,
|
1513
|
+
'triggerPrice': triggerPrice,
|
1515
1514
|
'amount': amount,
|
1516
1515
|
'cost': None,
|
1517
1516
|
'average': average,
|
@@ -1532,7 +1531,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1532
1531
|
:param float amount: how much you want to trade in units of the base currency
|
1533
1532
|
:param float [price]: the price of the order, in units of the quote currency, ignored in market orders
|
1534
1533
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1535
|
-
:param float [params.
|
1534
|
+
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
1536
1535
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1537
1536
|
:param bool [params.postOnly]:
|
1538
1537
|
:param bool [params.reduceOnly]: Ensures that the executed order does not flip the opened position.
|
@@ -1550,7 +1549,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1550
1549
|
'symbol': market['id'],
|
1551
1550
|
'amount': amountString,
|
1552
1551
|
}
|
1553
|
-
|
1552
|
+
triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
|
1554
1553
|
trailingAmount = self.safe_string(params, 'trailingAmount')
|
1555
1554
|
timeInForce = self.safe_string(params, 'timeInForce')
|
1556
1555
|
postOnlyParam = self.safe_bool(params, 'postOnly', False)
|
@@ -1560,9 +1559,9 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1560
1559
|
if trailingAmount is not None:
|
1561
1560
|
orderType = 'TRAILING STOP'
|
1562
1561
|
request['price_trailing'] = trailingAmount
|
1563
|
-
elif
|
1562
|
+
elif triggerPrice is not None:
|
1564
1563
|
# request['price'] is taken for stop orders
|
1565
|
-
request['price'] = self.price_to_precision(symbol,
|
1564
|
+
request['price'] = self.price_to_precision(symbol, triggerPrice)
|
1566
1565
|
if type == 'limit':
|
1567
1566
|
orderType = 'STOP LIMIT'
|
1568
1567
|
request['price_aux_limit'] = self.price_to_precision(symbol, price)
|
@@ -1575,7 +1574,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1575
1574
|
raise InvalidOrder(self.id + ' createOrder() requires a price argument with IOC and FOK orders')
|
1576
1575
|
if (ioc or fok) and (type == 'market'):
|
1577
1576
|
raise InvalidOrder(self.id + ' createOrder() does not allow market IOC and FOK orders')
|
1578
|
-
if (type != 'market') and (
|
1577
|
+
if (type != 'market') and (triggerPrice is None):
|
1579
1578
|
request['price'] = self.price_to_precision(symbol, price)
|
1580
1579
|
if ioc:
|
1581
1580
|
orderType = 'IOC'
|
@@ -1612,7 +1611,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1612
1611
|
:param float amount: the amount of currency to trade
|
1613
1612
|
:param float [price]: price of the order
|
1614
1613
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1615
|
-
:param float [params.
|
1614
|
+
:param float [params.triggerPrice]: the price that triggers a trigger order
|
1616
1615
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1617
1616
|
:param boolean [params.postOnly]: set to True if you want to make a post only order
|
1618
1617
|
:param boolean [params.reduceOnly]: indicates that the order is to reduce the size of a position
|
@@ -2850,7 +2849,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
2850
2849
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2851
2850
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
2852
2851
|
: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)
|
2853
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2852
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2854
2853
|
"""
|
2855
2854
|
await self.load_markets()
|
2856
2855
|
paginate = False
|
@@ -3521,7 +3520,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
3521
3520
|
:param float amount: how much you want to trade in units of the base currency
|
3522
3521
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
3523
3522
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3524
|
-
:param float [params.
|
3523
|
+
:param float [params.triggerPrice]: the price that triggers a trigger order
|
3525
3524
|
:param boolean [params.postOnly]: set to True if you want to make a post only order
|
3526
3525
|
:param boolean [params.reduceOnly]: indicates that the order is to reduce the size of a position
|
3527
3526
|
:param int [params.flags]: additional order parameters: 4096(Post Only), 1024(Reduce Only), 16384(OCO), 64(Hidden), 512(Close), 524288(No Var Rates)
|
@@ -3539,7 +3538,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
3539
3538
|
amountString = self.amount_to_precision(symbol, amount)
|
3540
3539
|
amountString = amountString if (side == 'buy') else Precise.string_neg(amountString)
|
3541
3540
|
request['amount'] = amountString
|
3542
|
-
|
3541
|
+
triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
|
3543
3542
|
trailingAmount = self.safe_string(params, 'trailingAmount')
|
3544
3543
|
timeInForce = self.safe_string(params, 'timeInForce')
|
3545
3544
|
postOnlyParam = self.safe_bool(params, 'postOnly', False)
|
@@ -3547,13 +3546,13 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
3547
3546
|
clientOrderId = self.safe_integer_2(params, 'cid', 'clientOrderId')
|
3548
3547
|
if trailingAmount is not None:
|
3549
3548
|
request['price_trailing'] = trailingAmount
|
3550
|
-
elif
|
3549
|
+
elif triggerPrice is not None:
|
3551
3550
|
# request['price'] is taken for stop orders
|
3552
|
-
request['price'] = self.price_to_precision(symbol,
|
3551
|
+
request['price'] = self.price_to_precision(symbol, triggerPrice)
|
3553
3552
|
if type == 'limit':
|
3554
3553
|
request['price_aux_limit'] = self.price_to_precision(symbol, price)
|
3555
3554
|
postOnly = (postOnlyParam or (timeInForce == 'PO'))
|
3556
|
-
if (type != 'market') and (
|
3555
|
+
if (type != 'market') and (triggerPrice is None):
|
3557
3556
|
request['price'] = self.price_to_precision(symbol, price)
|
3558
3557
|
# flag values may be summed to combine flags
|
3559
3558
|
flags = 0
|
ccxt/async_support/bitfinex1.py
CHANGED
@@ -1248,7 +1248,6 @@ class bitfinex1(Exchange, ImplicitAPI):
|
|
1248
1248
|
'postOnly': None,
|
1249
1249
|
'side': side,
|
1250
1250
|
'price': self.safe_string(order, 'price'),
|
1251
|
-
'stopPrice': None,
|
1252
1251
|
'triggerPrice': None,
|
1253
1252
|
'average': self.safe_string(order, 'avg_execution_price'),
|
1254
1253
|
'amount': self.safe_string(order, 'original_amount'),
|
ccxt/async_support/bitflyer.py
CHANGED
ccxt/async_support/bitget.py
CHANGED
@@ -4103,7 +4103,6 @@ class bitget(Exchange, ImplicitAPI):
|
|
4103
4103
|
'timeInForce': timeInForce,
|
4104
4104
|
'postOnly': postOnly,
|
4105
4105
|
'reduceOnly': reduceOnly,
|
4106
|
-
'stopPrice': self.safe_number(order, 'triggerPrice'),
|
4107
4106
|
'triggerPrice': self.safe_number(order, 'triggerPrice'),
|
4108
4107
|
'takeProfitPrice': self.safe_number_2(order, 'presetStopSurplusPrice', 'stopSurplusTriggerPrice'),
|
4109
4108
|
'stopLossPrice': self.safe_number_2(order, 'presetStopLossPrice', 'stopLossTriggerPrice'),
|
@@ -5713,7 +5712,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5713
5712
|
:param str [params.symbol]: *contract only* unified market symbol
|
5714
5713
|
:param str [params.productType]: *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
5715
5714
|
: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)
|
5716
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
5715
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
5717
5716
|
"""
|
5718
5717
|
await self.load_markets()
|
5719
5718
|
symbol = self.safe_string(params, 'symbol')
|
ccxt/async_support/bithumb.py
CHANGED
ccxt/async_support/bitmart.py
CHANGED
@@ -2482,7 +2482,6 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2482
2482
|
'postOnly': postOnly,
|
2483
2483
|
'side': self.parse_order_side(self.safe_string(order, 'side')),
|
2484
2484
|
'price': self.omit_zero(priceString),
|
2485
|
-
'stopPrice': trailingActivationPrice,
|
2486
2485
|
'triggerPrice': trailingActivationPrice,
|
2487
2486
|
'amount': self.omit_zero(self.safe_string(order, 'size')),
|
2488
2487
|
'cost': self.safe_string_2(order, 'filled_notional', 'filledNotional'),
|
@@ -2890,7 +2889,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2890
2889
|
:param str symbol: unified symbol of the market the order was made in
|
2891
2890
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2892
2891
|
:param str [params.clientOrderId]: *spot only* the client order id of the order to cancel
|
2893
|
-
:param boolean [params.
|
2892
|
+
:param boolean [params.trigger]: *swap only* whether the order is a trigger order
|
2894
2893
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2895
2894
|
"""
|
2896
2895
|
if symbol is None:
|
@@ -2910,9 +2909,9 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2910
2909
|
if market['spot']:
|
2911
2910
|
response = await self.privatePostSpotV3CancelOrder(self.extend(request, params))
|
2912
2911
|
else:
|
2913
|
-
|
2912
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
2914
2913
|
params = self.omit(params, ['stop', 'trigger'])
|
2915
|
-
if not
|
2914
|
+
if not trigger:
|
2916
2915
|
response = await self.privatePostContractPrivateCancelOrder(self.extend(request, params))
|
2917
2916
|
else:
|
2918
2917
|
response = await self.privatePostContractPrivateCancelPlanOrder(self.extend(request, params))
|
ccxt/async_support/bitmex.py
CHANGED
@@ -1277,7 +1277,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1277
1277
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1278
1278
|
:param int [limit]: max number of ledger entries to return, default is None
|
1279
1279
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1280
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1280
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1281
1281
|
"""
|
1282
1282
|
await self.load_markets()
|
1283
1283
|
request: dict = {
|
@@ -1807,7 +1807,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1807
1807
|
if execInst is not None:
|
1808
1808
|
postOnly = (execInst == 'ParticipateDoNotInitiate')
|
1809
1809
|
timestamp = self.parse8601(self.safe_string(order, 'timestamp'))
|
1810
|
-
|
1810
|
+
triggerPrice = self.safe_number(order, 'stopPx')
|
1811
1811
|
remaining = self.safe_string(order, 'leavesQty')
|
1812
1812
|
return self.safe_order({
|
1813
1813
|
'info': order,
|
@@ -1822,8 +1822,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1822
1822
|
'postOnly': postOnly,
|
1823
1823
|
'side': self.safe_string_lower(order, 'side'),
|
1824
1824
|
'price': self.safe_string(order, 'price'),
|
1825
|
-
'
|
1826
|
-
'triggerPrice': stopPrice,
|
1825
|
+
'triggerPrice': triggerPrice,
|
1827
1826
|
'amount': amount,
|
1828
1827
|
'cost': cost,
|
1829
1828
|
'average': average,
|
@@ -1961,7 +1960,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1961
1960
|
else:
|
1962
1961
|
if triggerPrice is None:
|
1963
1962
|
# if exchange specific trigger types were provided
|
1964
|
-
raise ArgumentsRequired(self.id + ' createOrder() requires a triggerPrice
|
1963
|
+
raise ArgumentsRequired(self.id + ' createOrder() requires a triggerPrice parameter for the ' + orderType + ' order type')
|
1965
1964
|
request['stopPx'] = self.parse_to_numeric(self.price_to_precision(symbol, triggerPrice))
|
1966
1965
|
request['ordType'] = orderType
|
1967
1966
|
params = self.omit(params, ['triggerPrice', 'stopPrice', 'stopPx', 'triggerDirection', 'trailingAmount'])
|
@@ -2523,7 +2522,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2523
2522
|
'timestamp': self.parse8601(datetime),
|
2524
2523
|
'datetime': datetime,
|
2525
2524
|
'fundingRate': self.safe_number(contract, 'fundingRate'),
|
2526
|
-
'fundingTimestamp': self.
|
2525
|
+
'fundingTimestamp': self.parse8601(fundingDatetime),
|
2527
2526
|
'fundingDatetime': fundingDatetime,
|
2528
2527
|
'nextFundingRate': self.safe_number(contract, 'indicativeFundingRate'),
|
2529
2528
|
'nextFundingTimestamp': None,
|
ccxt/async_support/bitopro.py
CHANGED
@@ -964,7 +964,6 @@ class bitopro(Exchange, ImplicitAPI):
|
|
964
964
|
'postOnly': postOnly,
|
965
965
|
'side': side,
|
966
966
|
'price': price,
|
967
|
-
'stopPrice': None,
|
968
967
|
'triggerPrice': None,
|
969
968
|
'amount': amount,
|
970
969
|
'cost': None,
|
@@ -1006,12 +1005,12 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1006
1005
|
request['price'] = self.price_to_precision(symbol, price)
|
1007
1006
|
if orderType == 'STOP_LIMIT':
|
1008
1007
|
request['price'] = self.price_to_precision(symbol, price)
|
1009
|
-
|
1008
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
1010
1009
|
params = self.omit(params, ['triggerPrice', 'stopPrice'])
|
1011
|
-
if
|
1012
|
-
raise InvalidOrder(self.id + ' createOrder() requires a
|
1010
|
+
if triggerPrice is None:
|
1011
|
+
raise InvalidOrder(self.id + ' createOrder() requires a triggerPrice parameter for ' + orderType + ' orders')
|
1013
1012
|
else:
|
1014
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
1013
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1015
1014
|
condition = self.safe_string(params, 'condition')
|
1016
1015
|
if condition is None:
|
1017
1016
|
raise InvalidOrder(self.id + ' createOrder() requires a condition parameter for ' + orderType + ' orders')
|
ccxt/async_support/bitrue.py
CHANGED
@@ -1778,8 +1778,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1778
1778
|
postOnly = (type == 'limit_maker') or (timeInForce == 'GTX') or (type == 'post_only')
|
1779
1779
|
if type == 'limit_maker':
|
1780
1780
|
type = 'limit'
|
1781
|
-
|
1782
|
-
stopPrice = self.parse_number(self.omit_zero(stopPriceString))
|
1781
|
+
triggerPrice = self.parse_number(self.omit_zero(self.safe_string(order, 'stopPrice')))
|
1783
1782
|
return self.safe_order({
|
1784
1783
|
'info': order,
|
1785
1784
|
'id': id,
|
@@ -1793,8 +1792,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1793
1792
|
'postOnly': postOnly,
|
1794
1793
|
'side': side,
|
1795
1794
|
'price': price,
|
1796
|
-
'
|
1797
|
-
'triggerPrice': stopPrice,
|
1795
|
+
'triggerPrice': triggerPrice,
|
1798
1796
|
'amount': amount,
|
1799
1797
|
'cost': cost,
|
1800
1798
|
'average': average,
|
@@ -1917,10 +1915,10 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1917
1915
|
if clientOrderId is not None:
|
1918
1916
|
params = self.omit(params, ['newClientOrderId', 'clientOrderId'])
|
1919
1917
|
request['newClientOrderId'] = clientOrderId
|
1920
|
-
|
1921
|
-
if
|
1918
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
1919
|
+
if triggerPrice is not None:
|
1922
1920
|
params = self.omit(params, ['triggerPrice', 'stopPrice'])
|
1923
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
1921
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1924
1922
|
response = await self.spotV1PrivatePostOrder(self.extend(request, params))
|
1925
1923
|
data = response
|
1926
1924
|
else:
|
ccxt/async_support/bitso.py
CHANGED
@@ -209,7 +209,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
209
209
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
210
210
|
:param int [limit]: max number of ledger entries to return, default is None
|
211
211
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
212
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
212
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
213
213
|
"""
|
214
214
|
request: dict = {}
|
215
215
|
if limit is not None:
|
@@ -1108,7 +1108,6 @@ class bitso(Exchange, ImplicitAPI):
|
|
1108
1108
|
'postOnly': None,
|
1109
1109
|
'side': side,
|
1110
1110
|
'price': price,
|
1111
|
-
'stopPrice': None,
|
1112
1111
|
'triggerPrice': None,
|
1113
1112
|
'amount': amount,
|
1114
1113
|
'cost': None,
|
ccxt/async_support/bitstamp.py
CHANGED
@@ -1850,7 +1850,6 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1850
1850
|
'postOnly': None,
|
1851
1851
|
'side': side,
|
1852
1852
|
'price': price,
|
1853
|
-
'stopPrice': None,
|
1854
1853
|
'triggerPrice': None,
|
1855
1854
|
'cost': None,
|
1856
1855
|
'amount': amount,
|
@@ -1968,7 +1967,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1968
1967
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1969
1968
|
:param int [limit]: max number of ledger entries to return, default is None
|
1970
1969
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1971
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1970
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1972
1971
|
"""
|
1973
1972
|
await self.load_markets()
|
1974
1973
|
request: dict = {}
|
ccxt/async_support/bitteam.py
CHANGED
@@ -1185,7 +1185,6 @@ class bitteam(Exchange, ImplicitAPI):
|
|
1185
1185
|
side = self.safe_string(order, 'side')
|
1186
1186
|
feeRaw = self.safe_value(order, 'fee')
|
1187
1187
|
price = self.safe_string(order, 'price')
|
1188
|
-
stopPrice = self.safe_string(order, 'stopPrice')
|
1189
1188
|
amount = self.safe_string(order, 'quantity')
|
1190
1189
|
filled = self.safe_string(order, 'executed')
|
1191
1190
|
fee = None
|
@@ -1210,8 +1209,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
1210
1209
|
'timeInForce': 'GTC',
|
1211
1210
|
'side': side,
|
1212
1211
|
'price': price,
|
1213
|
-
'
|
1214
|
-
'triggerPrice': stopPrice,
|
1212
|
+
'triggerPrice': self.safe_string(order, 'stopPrice'),
|
1215
1213
|
'average': None,
|
1216
1214
|
'amount': amount,
|
1217
1215
|
'cost': None,
|
ccxt/async_support/bitvavo.py
CHANGED
@@ -1112,7 +1112,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1112
1112
|
:param float price: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1113
1113
|
:param dict [params]: extra parameters specific to the bitvavo api endpoint
|
1114
1114
|
:param str [params.timeInForce]: "GTC", "IOC", or "PO"
|
1115
|
-
:param float [params.stopPrice]:
|
1115
|
+
:param float [params.stopPrice]: Alias for triggerPrice
|
1116
1116
|
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
1117
1117
|
:param bool [params.postOnly]: If True, the order will only be posted to the order book and not executed immediately
|
1118
1118
|
:param float [params.stopLossPrice]: The price at which a stop loss order is triggered at
|
@@ -1564,7 +1564,6 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1564
1564
|
timeInForce = self.safe_string(order, 'timeInForce')
|
1565
1565
|
postOnly = self.safe_value(order, 'postOnly')
|
1566
1566
|
# https://github.com/ccxt/ccxt/issues/8489
|
1567
|
-
stopPrice = self.safe_number(order, 'triggerPrice')
|
1568
1567
|
return self.safe_order({
|
1569
1568
|
'info': order,
|
1570
1569
|
'id': id,
|
@@ -1578,8 +1577,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1578
1577
|
'postOnly': postOnly,
|
1579
1578
|
'side': side,
|
1580
1579
|
'price': price,
|
1581
|
-
'
|
1582
|
-
'triggerPrice': stopPrice,
|
1580
|
+
'triggerPrice': self.safe_number(order, 'triggerPrice'),
|
1583
1581
|
'amount': amount,
|
1584
1582
|
'cost': cost,
|
1585
1583
|
'average': None,
|
@@ -567,12 +567,12 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
567
567
|
'orderQty': self.amount_to_precision(symbol, amount),
|
568
568
|
'clOrdId': clientOrderId,
|
569
569
|
}
|
570
|
-
|
570
|
+
triggerPrice = self.safe_value_2(params, 'stopPx', 'stopPrice')
|
571
571
|
params = self.omit(params, ['stopPx', 'stopPrice'])
|
572
572
|
if uppercaseOrderType == 'STOP' or uppercaseOrderType == 'STOPLIMIT':
|
573
|
-
if
|
574
|
-
raise ArgumentsRequired(self.id + ' createOrder() requires a stopPx or
|
575
|
-
if
|
573
|
+
if triggerPrice is None:
|
574
|
+
raise ArgumentsRequired(self.id + ' createOrder() requires a stopPx or triggerPrice param for a ' + uppercaseOrderType + ' order')
|
575
|
+
if triggerPrice is not None:
|
576
576
|
if uppercaseOrderType == 'MARKET':
|
577
577
|
request['ordType'] = 'STOP'
|
578
578
|
elif uppercaseOrderType == 'LIMIT':
|
@@ -586,7 +586,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
586
586
|
if priceRequired:
|
587
587
|
request['price'] = self.price_to_precision(symbol, price)
|
588
588
|
if stopPriceRequired:
|
589
|
-
request['stopPx'] = self.price_to_precision(symbol,
|
589
|
+
request['stopPx'] = self.price_to_precision(symbol, triggerPrice)
|
590
590
|
response = await self.privatePostOrders(self.extend(request, params))
|
591
591
|
return self.parse_order(response, market)
|
592
592
|
|
ccxt/async_support/blofin.py
CHANGED
@@ -1331,7 +1331,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1331
1331
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1332
1332
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1333
1333
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1334
|
-
:param bool [params.
|
1334
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
1335
1335
|
: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)
|
1336
1336
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1337
1337
|
"""
|
@@ -1348,12 +1348,12 @@ class blofin(Exchange, ImplicitAPI):
|
|
1348
1348
|
request['instId'] = market['id']
|
1349
1349
|
if limit is not None:
|
1350
1350
|
request['limit'] = limit # default 100, max 100
|
1351
|
-
|
1351
|
+
isTrigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl', 'TPSL'], False)
|
1352
1352
|
method: Str = None
|
1353
1353
|
method, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersPending')
|
1354
1354
|
query = self.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL'])
|
1355
1355
|
response = None
|
1356
|
-
if
|
1356
|
+
if isTrigger or (method == 'privateGetTradeOrdersTpslPending'):
|
1357
1357
|
response = await self.privateGetTradeOrdersTpslPending(self.extend(request, query))
|
1358
1358
|
else:
|
1359
1359
|
response = await self.privateGetTradeOrdersPending(self.extend(request, query))
|
@@ -1473,7 +1473,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1473
1473
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
1474
1474
|
:param int [params.until]: the latest time in ms to fetch entries for
|
1475
1475
|
: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)
|
1476
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1476
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1477
1477
|
"""
|
1478
1478
|
await self.load_markets()
|
1479
1479
|
paginate = False
|
@@ -1660,8 +1660,8 @@ class blofin(Exchange, ImplicitAPI):
|
|
1660
1660
|
method = self.safe_string(params, 'method', defaultMethod)
|
1661
1661
|
clientOrderIds = self.parse_ids(self.safe_value(params, 'clientOrderId'))
|
1662
1662
|
tpslIds = self.parse_ids(self.safe_value(params, 'tpslId'))
|
1663
|
-
|
1664
|
-
if
|
1663
|
+
trigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl'])
|
1664
|
+
if trigger:
|
1665
1665
|
method = 'privatePostTradeCancelTpsl'
|
1666
1666
|
if clientOrderIds is None:
|
1667
1667
|
ids = self.parse_ids(ids)
|
@@ -1672,7 +1672,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1672
1672
|
'instId': market['id'],
|
1673
1673
|
})
|
1674
1674
|
for i in range(0, len(ids)):
|
1675
|
-
if
|
1675
|
+
if trigger:
|
1676
1676
|
request.append({
|
1677
1677
|
'tpslId': ids[i],
|
1678
1678
|
'instId': market['id'],
|
@@ -2060,7 +2060,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
2060
2060
|
:param int [since]: the earliest time in ms to fetch orders for
|
2061
2061
|
:param int [limit]: the maximum number of orde structures to retrieve
|
2062
2062
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2063
|
-
:param bool [params.
|
2063
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
2064
2064
|
: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)
|
2065
2065
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2066
2066
|
"""
|
@@ -2079,12 +2079,12 @@ class blofin(Exchange, ImplicitAPI):
|
|
2079
2079
|
request['limit'] = limit # default 100, max 100
|
2080
2080
|
if since is not None:
|
2081
2081
|
request['begin'] = since
|
2082
|
-
|
2082
|
+
isTrigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl', 'TPSL'], False)
|
2083
2083
|
method: Str = None
|
2084
2084
|
method, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersHistory')
|
2085
2085
|
query = self.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL'])
|
2086
2086
|
response = None
|
2087
|
-
if (
|
2087
|
+
if (isTrigger) or (method == 'privateGetTradeOrdersTpslHistory'):
|
2088
2088
|
response = await self.privateGetTradeOrdersTpslHistory(self.extend(request, query))
|
2089
2089
|
else:
|
2090
2090
|
response = await self.privateGetTradeOrdersHistory(self.extend(request, query))
|
ccxt/async_support/btcalpha.py
CHANGED
ccxt/async_support/btcbox.py
CHANGED
ccxt/async_support/btcmarkets.py
CHANGED
@@ -1015,7 +1015,6 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1015
1015
|
id = self.safe_string(order, 'orderId')
|
1016
1016
|
clientOrderId = self.safe_string(order, 'clientOrderId')
|
1017
1017
|
timeInForce = self.safe_string(order, 'timeInForce')
|
1018
|
-
stopPrice = self.safe_number(order, 'triggerPrice')
|
1019
1018
|
postOnly = self.safe_bool(order, 'postOnly')
|
1020
1019
|
return self.safe_order({
|
1021
1020
|
'info': order,
|
@@ -1030,8 +1029,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1030
1029
|
'postOnly': postOnly,
|
1031
1030
|
'side': side,
|
1032
1031
|
'price': price,
|
1033
|
-
'
|
1034
|
-
'triggerPrice': stopPrice,
|
1032
|
+
'triggerPrice': self.safe_number(order, 'triggerPrice'),
|
1035
1033
|
'cost': None,
|
1036
1034
|
'amount': amount,
|
1037
1035
|
'filled': None,
|
ccxt/async_support/bybit.py
CHANGED
@@ -3569,7 +3569,6 @@ class bybit(Exchange, ImplicitAPI):
|
|
3569
3569
|
'reduceOnly': self.safe_bool(order, 'reduceOnly'),
|
3570
3570
|
'side': side,
|
3571
3571
|
'price': price,
|
3572
|
-
'stopPrice': stopPrice,
|
3573
3572
|
'triggerPrice': stopPrice,
|
3574
3573
|
'takeProfitPrice': takeProfitPrice,
|
3575
3574
|
'stopLossPrice': stopLossPrice,
|
@@ -5429,7 +5428,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5429
5428
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5430
5429
|
: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)
|
5431
5430
|
:param str [params.subType]: if inverse will use v5/account/contract-transaction-log
|
5432
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
5431
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
5433
5432
|
"""
|
5434
5433
|
await self.load_markets()
|
5435
5434
|
paginate = False
|
@@ -7705,7 +7704,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
7705
7704
|
if market['spot']:
|
7706
7705
|
raise NotSupported(self.id + ' fetchLeverageTiers() is not supported for spot market')
|
7707
7706
|
symbol = market['symbol']
|
7708
|
-
data = await self.get_leverage_tiers_paginated(symbol, self.extend({'paginate': True, 'paginationCalls':
|
7707
|
+
data = await self.get_leverage_tiers_paginated(symbol, self.extend({'paginate': True, 'paginationCalls': 40}, params))
|
7709
7708
|
symbols = self.market_symbols(symbols)
|
7710
7709
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
7711
7710
|
|
ccxt/async_support/cex.py
CHANGED
@@ -1238,7 +1238,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1238
1238
|
:param int [limit]: max number of ledger entries to return
|
1239
1239
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1240
1240
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
1241
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1241
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1242
1242
|
"""
|
1243
1243
|
await self.load_markets()
|
1244
1244
|
currency = None
|