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/__init__.py
CHANGED
ccxt/ascendex.py
CHANGED
@@ -1359,7 +1359,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1359
1359
|
'cost': feeCost,
|
1360
1360
|
'currency': feeCurrencyCode,
|
1361
1361
|
}
|
1362
|
-
|
1362
|
+
triggerPrice = self.omit_zero(self.safe_string(order, 'stopPrice'))
|
1363
1363
|
reduceOnly = None
|
1364
1364
|
execInst = self.safe_string(order, 'execInst')
|
1365
1365
|
if execInst == 'reduceOnly':
|
@@ -1381,8 +1381,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1381
1381
|
'reduceOnly': reduceOnly,
|
1382
1382
|
'side': side,
|
1383
1383
|
'price': price,
|
1384
|
-
'stopPrice':
|
1385
|
-
'triggerPrice':
|
1384
|
+
'stopPrice': triggerPrice,
|
1385
|
+
'triggerPrice': triggerPrice,
|
1386
1386
|
'amount': amount,
|
1387
1387
|
'cost': None,
|
1388
1388
|
'average': average,
|
@@ -1453,7 +1453,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1453
1453
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1454
1454
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1455
1455
|
:param bool [params.postOnly]: True or False
|
1456
|
-
:param float [params.
|
1456
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1457
1457
|
:returns dict: request to be sent to the exchange
|
1458
1458
|
"""
|
1459
1459
|
market = self.market(symbol)
|
@@ -1484,7 +1484,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1484
1484
|
timeInForce = self.safe_string(params, 'timeInForce')
|
1485
1485
|
postOnly = self.is_post_only(isMarketOrder, False, params)
|
1486
1486
|
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
1487
|
-
|
1487
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
1488
1488
|
if isLimitOrder:
|
1489
1489
|
request['orderPrice'] = self.price_to_precision(symbol, price)
|
1490
1490
|
if timeInForce == 'IOC':
|
@@ -1493,8 +1493,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1493
1493
|
request['timeInForce'] = 'FOK'
|
1494
1494
|
if postOnly:
|
1495
1495
|
request['postOnly'] = True
|
1496
|
-
if
|
1497
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
1496
|
+
if triggerPrice is not None:
|
1497
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1498
1498
|
if isLimitOrder:
|
1499
1499
|
request['orderType'] = 'stop_limit'
|
1500
1500
|
elif isMarketOrder:
|
@@ -1528,7 +1528,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1528
1528
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1529
1529
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1530
1530
|
:param bool [params.postOnly]: True or False
|
1531
|
-
:param float [params.
|
1531
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1532
1532
|
:param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered(perpetual swap markets only)
|
1533
1533
|
:param float [params.takeProfit.triggerPrice]: *swap only* take profit trigger price
|
1534
1534
|
:param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered(perpetual swap markets only)
|
@@ -1622,7 +1622,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1622
1622
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1623
1623
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1624
1624
|
:param bool [params.postOnly]: True or False
|
1625
|
-
:param float [params.
|
1625
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1626
1626
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1627
1627
|
"""
|
1628
1628
|
self.load_markets()
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/ascendex.py
CHANGED
@@ -1360,7 +1360,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1360
1360
|
'cost': feeCost,
|
1361
1361
|
'currency': feeCurrencyCode,
|
1362
1362
|
}
|
1363
|
-
|
1363
|
+
triggerPrice = self.omit_zero(self.safe_string(order, 'stopPrice'))
|
1364
1364
|
reduceOnly = None
|
1365
1365
|
execInst = self.safe_string(order, 'execInst')
|
1366
1366
|
if execInst == 'reduceOnly':
|
@@ -1382,8 +1382,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1382
1382
|
'reduceOnly': reduceOnly,
|
1383
1383
|
'side': side,
|
1384
1384
|
'price': price,
|
1385
|
-
'stopPrice':
|
1386
|
-
'triggerPrice':
|
1385
|
+
'stopPrice': triggerPrice,
|
1386
|
+
'triggerPrice': triggerPrice,
|
1387
1387
|
'amount': amount,
|
1388
1388
|
'cost': None,
|
1389
1389
|
'average': average,
|
@@ -1454,7 +1454,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1454
1454
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1455
1455
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1456
1456
|
:param bool [params.postOnly]: True or False
|
1457
|
-
:param float [params.
|
1457
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1458
1458
|
:returns dict: request to be sent to the exchange
|
1459
1459
|
"""
|
1460
1460
|
market = self.market(symbol)
|
@@ -1485,7 +1485,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1485
1485
|
timeInForce = self.safe_string(params, 'timeInForce')
|
1486
1486
|
postOnly = self.is_post_only(isMarketOrder, False, params)
|
1487
1487
|
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
1488
|
-
|
1488
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
1489
1489
|
if isLimitOrder:
|
1490
1490
|
request['orderPrice'] = self.price_to_precision(symbol, price)
|
1491
1491
|
if timeInForce == 'IOC':
|
@@ -1494,8 +1494,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1494
1494
|
request['timeInForce'] = 'FOK'
|
1495
1495
|
if postOnly:
|
1496
1496
|
request['postOnly'] = True
|
1497
|
-
if
|
1498
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
1497
|
+
if triggerPrice is not None:
|
1498
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1499
1499
|
if isLimitOrder:
|
1500
1500
|
request['orderType'] = 'stop_limit'
|
1501
1501
|
elif isMarketOrder:
|
@@ -1529,7 +1529,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1529
1529
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1530
1530
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1531
1531
|
:param bool [params.postOnly]: True or False
|
1532
|
-
:param float [params.
|
1532
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1533
1533
|
:param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered(perpetual swap markets only)
|
1534
1534
|
:param float [params.takeProfit.triggerPrice]: *swap only* take profit trigger price
|
1535
1535
|
:param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered(perpetual swap markets only)
|
@@ -1623,7 +1623,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1623
1623
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1624
1624
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1625
1625
|
:param bool [params.postOnly]: True or False
|
1626
|
-
:param float [params.
|
1626
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1627
1627
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1628
1628
|
"""
|
1629
1629
|
await self.load_markets()
|
@@ -88,8 +88,8 @@ class AiohttpClient(Client):
|
|
88
88
|
# call aenter here to simulate async with otherwise we get the error "await not called with future"
|
89
89
|
# if connecting to a non-existent endpoint
|
90
90
|
if (self.proxy):
|
91
|
-
return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers'), proxy=self.proxy).__aenter__()
|
92
|
-
return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers')).__aenter__()
|
91
|
+
return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers'), proxy=self.proxy, max_msg_size=10485760).__aenter__()
|
92
|
+
return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers'), max_msg_size=10485760).__aenter__()
|
93
93
|
|
94
94
|
async def send(self, message):
|
95
95
|
if self.verbose:
|
ccxt/async_support/binance.py
CHANGED
@@ -6010,14 +6010,10 @@ class binance(Exchange, ImplicitAPI):
|
|
6010
6010
|
marginMode = None
|
6011
6011
|
marginMode, params = self.handle_margin_mode_and_params('createOrder', params)
|
6012
6012
|
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
6013
|
-
if
|
6014
|
-
|
6015
|
-
|
6016
|
-
|
6017
|
-
request['reduceOnly'] = reduceOnly
|
6018
|
-
else:
|
6019
|
-
if reduceOnly:
|
6020
|
-
request['sideEffectType'] = 'AUTO_REPAY'
|
6013
|
+
if reduceOnly:
|
6014
|
+
if marketType == 'margin' or (not market['contract'] and (marginMode is not None)):
|
6015
|
+
params = self.omit(params, 'reduceOnly')
|
6016
|
+
request['sideEffectType'] = 'AUTO_REPAY'
|
6021
6017
|
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
6022
6018
|
stopLossPrice = self.safe_string(params, 'stopLossPrice', triggerPrice) # fallback to stopLoss
|
6023
6019
|
takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
|
@@ -6374,7 +6370,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6374
6370
|
:param int [params.until]: the latest time in ms to fetch orders for
|
6375
6371
|
: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)
|
6376
6372
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6377
|
-
:param boolean [params.
|
6373
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6378
6374
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6379
6375
|
"""
|
6380
6376
|
if symbol is None:
|
@@ -6631,7 +6627,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6631
6627
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6632
6628
|
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
6633
6629
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch open orders in the portfolio margin account
|
6634
|
-
:param boolean [params.
|
6630
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account conditional orders
|
6635
6631
|
:param str [params.subType]: "linear" or "inverse"
|
6636
6632
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6637
6633
|
"""
|
@@ -6917,7 +6913,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6917
6913
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6918
6914
|
: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)
|
6919
6915
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6920
|
-
:param boolean [params.
|
6916
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6921
6917
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6922
6918
|
"""
|
6923
6919
|
if symbol is None:
|
@@ -6946,7 +6942,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6946
6942
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6947
6943
|
: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)
|
6948
6944
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6949
|
-
:param boolean [params.
|
6945
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6950
6946
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6951
6947
|
"""
|
6952
6948
|
if symbol is None:
|
@@ -6975,7 +6971,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6975
6971
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6976
6972
|
: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)
|
6977
6973
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6978
|
-
:param boolean [params.
|
6974
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6979
6975
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6980
6976
|
"""
|
6981
6977
|
if symbol is None:
|
@@ -7006,7 +7002,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7006
7002
|
:param str symbol: unified symbol of the market the order was made in
|
7007
7003
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7008
7004
|
:param boolean [params.portfolioMargin]: set to True if you would like to cancel an order in a portfolio margin account
|
7009
|
-
:param boolean [params.
|
7005
|
+
:param boolean [params.trigger]: set to True if you would like to cancel a portfolio margin account conditional order
|
7010
7006
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
7011
7007
|
"""
|
7012
7008
|
if symbol is None:
|
@@ -7086,7 +7082,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7086
7082
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7087
7083
|
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
7088
7084
|
:param boolean [params.portfolioMargin]: set to True if you would like to cancel orders in a portfolio margin account
|
7089
|
-
:param boolean [params.
|
7085
|
+
:param boolean [params.trigger]: set to True if you would like to cancel portfolio margin account conditional orders
|
7090
7086
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
7091
7087
|
"""
|
7092
7088
|
if symbol is None:
|
@@ -10840,7 +10836,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10840
10836
|
:param str id: the identification number of the ledger entry
|
10841
10837
|
:param str code: unified currency code
|
10842
10838
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10843
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
10839
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
10844
10840
|
"""
|
10845
10841
|
await self.load_markets()
|
10846
10842
|
type = None
|
@@ -10886,7 +10882,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10886
10882
|
: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)
|
10887
10883
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch the ledger for a portfolio margin account
|
10888
10884
|
:param str [params.subType]: "linear" or "inverse"
|
10889
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
10885
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
10890
10886
|
"""
|
10891
10887
|
await self.load_markets()
|
10892
10888
|
paginate = False
|
ccxt/async_support/bingx.py
CHANGED
@@ -3440,7 +3440,6 @@ class bingx(Exchange, ImplicitAPI):
|
|
3440
3440
|
'postOnly': None,
|
3441
3441
|
'side': self.parse_order_side(side),
|
3442
3442
|
'price': self.safe_string_2(order, 'price', 'p'),
|
3443
|
-
'stopPrice': triggerPrice,
|
3444
3443
|
'triggerPrice': triggerPrice,
|
3445
3444
|
'stopLossPrice': stopLossPrice,
|
3446
3445
|
'takeProfitPrice': takeProfitPrice,
|
@@ -5873,7 +5872,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
5873
5872
|
:param float amount: how much of the currency you want to trade in units of the base currency
|
5874
5873
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5875
5874
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5876
|
-
:param str [params.
|
5875
|
+
:param str [params.triggerPrice]: Trigger price used for TAKE_STOP_LIMIT, TAKE_STOP_MARKET, TRIGGER_LIMIT, TRIGGER_MARKET order types.
|
5877
5876
|
:param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
5878
5877
|
:param float [params.takeProfit.triggerPrice]: take profit trigger price
|
5879
5878
|
:param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
ccxt/async_support/bit2c.py
CHANGED
ccxt/async_support/bitbank.py
CHANGED
ccxt/async_support/bitbns.py
CHANGED
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:
|