ccxt 4.3.8__py2.py3-none-any.whl → 4.3.10__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.8'
25
+ __version__ = '4.3.10'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/bingx.py CHANGED
@@ -86,13 +86,13 @@ class ImplicitAPI:
86
86
  wallets_v1_private_post_capital_deposit_createsubaddress = walletsV1PrivatePostCapitalDepositCreateSubAddress = Entry('capital/deposit/createSubAddress', ['wallets', 'v1', 'private'], 'POST', {'cost': 1})
87
87
  subaccount_v1_private_get_list = subAccountV1PrivateGetList = Entry('list', ['subAccount', 'v1', 'private'], 'GET', {'cost': 3})
88
88
  subaccount_v1_private_get_assets = subAccountV1PrivateGetAssets = Entry('assets', ['subAccount', 'v1', 'private'], 'GET', {'cost': 3})
89
- subaccount_v1_private_get_apikey_query = subAccountV1PrivateGetApiKeyQuery = Entry('apiKey/query', ['subAccount', 'v1', 'private'], 'GET', {'cost': 1})
90
89
  subaccount_v1_private_post_create = subAccountV1PrivatePostCreate = Entry('create', ['subAccount', 'v1', 'private'], 'POST', {'cost': 3})
91
90
  subaccount_v1_private_post_apikey_create = subAccountV1PrivatePostApiKeyCreate = Entry('apiKey/create', ['subAccount', 'v1', 'private'], 'POST', {'cost': 3})
92
91
  subaccount_v1_private_post_apikey_edit = subAccountV1PrivatePostApiKeyEdit = Entry('apiKey/edit', ['subAccount', 'v1', 'private'], 'POST', {'cost': 3})
93
92
  subaccount_v1_private_post_apikey_del = subAccountV1PrivatePostApiKeyDel = Entry('apiKey/del', ['subAccount', 'v1', 'private'], 'POST', {'cost': 3})
94
93
  subaccount_v1_private_post_updatestatus = subAccountV1PrivatePostUpdateStatus = Entry('updateStatus', ['subAccount', 'v1', 'private'], 'POST', {'cost': 3})
95
94
  account_v1_private_get_uid = accountV1PrivateGetUid = Entry('uid', ['account', 'v1', 'private'], 'GET', {'cost': 1})
95
+ account_v1_private_get_apikey_query = accountV1PrivateGetApiKeyQuery = Entry('apiKey/query', ['account', 'v1', 'private'], 'GET', {'cost': 1})
96
96
  account_v1_private_post_innertransfer_authorizesubaccount = accountV1PrivatePostInnerTransferAuthorizeSubAccount = Entry('innerTransfer/authorizeSubAccount', ['account', 'v1', 'private'], 'POST', {'cost': 3})
97
97
  user_auth_private_post_userdatastream = userAuthPrivatePostUserDataStream = Entry('userDataStream', ['user', 'auth', 'private'], 'POST', {'cost': 1})
98
98
  user_auth_private_put_userdatastream = userAuthPrivatePutUserDataStream = Entry('userDataStream', ['user', 'auth', 'private'], 'PUT', {'cost': 1})
@@ -11,6 +11,7 @@ class ImplicitAPI:
11
11
  public_get_exchange_book_pair = publicGetExchangeBookPair = Entry('exchange/book/{pair}', 'public', 'GET', {'cost': 3})
12
12
  public_get_exchange_bookupdates_pair_from = publicGetExchangeBookUpdatesPairFrom = Entry('exchange/bookUpdates/{pair}/{from}', 'public', 'GET', {'cost': 1})
13
13
  private_get_users_balances = privateGetUsersBalances = Entry('users/balances', 'private', 'GET', {'cost': 1})
14
+ private_get_users_wallets = privateGetUsersWallets = Entry('users/wallets', 'private', 'GET', {'cost': 1})
14
15
  private_get_users_wallets_history_since = privateGetUsersWalletsHistorySince = Entry('users/wallets/history/{since}', 'private', 'GET', {'cost': 1.67})
15
16
  private_get_exchange_orders_status_orderid = privateGetExchangeOrdersStatusOrderID = Entry('exchange/orders/status/{orderID}', 'private', 'GET', {'cost': 1})
16
17
  private_get_exchange_orders_active = privateGetExchangeOrdersActive = Entry('exchange/orders/active', 'private', 'GET', {'cost': 1})
@@ -184,6 +184,8 @@ class ImplicitAPI:
184
184
  futuresprivate_get_withdrawal_list = futuresPrivateGetWithdrawalList = Entry('withdrawal-list', 'futuresPrivate', 'GET', {'cost': 1})
185
185
  futuresprivate_get_sub_api_key = futuresPrivateGetSubApiKey = Entry('sub/api-key', 'futuresPrivate', 'GET', {'cost': 1})
186
186
  futuresprivate_get_trade_statistics = futuresPrivateGetTradeStatistics = Entry('trade-statistics', 'futuresPrivate', 'GET', {'cost': 1})
187
+ futuresprivate_get_trade_fees = futuresPrivateGetTradeFees = Entry('trade-fees', 'futuresPrivate', 'GET', {'cost': 1})
188
+ futuresprivate_get_history_positions = futuresPrivateGetHistoryPositions = Entry('history-positions', 'futuresPrivate', 'GET', {'cost': 1})
187
189
  futuresprivate_post_transfer_out = futuresPrivatePostTransferOut = Entry('transfer-out', 'futuresPrivate', 'POST', {'cost': 1})
188
190
  futuresprivate_post_transfer_in = futuresPrivatePostTransferIn = Entry('transfer-in', 'futuresPrivate', 'POST', {'cost': 1})
189
191
  futuresprivate_post_orders = futuresPrivatePostOrders = Entry('orders', 'futuresPrivate', 'POST', {'cost': 1.33})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.8'
7
+ __version__ = '4.3.10'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.8'
5
+ __version__ = '4.3.10'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -304,7 +304,6 @@ class bingx(Exchange, ImplicitAPI):
304
304
  'get': {
305
305
  'list': 3,
306
306
  'assets': 3,
307
- 'apiKey/query': 1,
308
307
  },
309
308
  'post': {
310
309
  'create': 3,
@@ -321,6 +320,7 @@ class bingx(Exchange, ImplicitAPI):
321
320
  'private': {
322
321
  'get': {
323
322
  'uid': 1,
323
+ 'apiKey/query': 1,
324
324
  },
325
325
  'post': {
326
326
  'innerTransfer/authorizeSubAccount': 3,
@@ -1756,6 +1756,12 @@ class bingx(Exchange, ImplicitAPI):
1756
1756
  }
1757
1757
  isMarketOrder = type == 'MARKET'
1758
1758
  isSpot = marketType == 'spot'
1759
+ stopLossPrice = self.safe_string(params, 'stopLossPrice')
1760
+ takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
1761
+ triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
1762
+ isTriggerOrder = triggerPrice is not None
1763
+ isStopLossPriceOrder = stopLossPrice is not None
1764
+ isTakeProfitPriceOrder = takeProfitPrice is not None
1759
1765
  exchangeClientOrderId = 'newClientOrderId' if isSpot else 'clientOrderID'
1760
1766
  clientOrderId = self.safe_string_2(params, exchangeClientOrderId, 'clientOrderId')
1761
1767
  if clientOrderId is not None:
@@ -1768,7 +1774,6 @@ class bingx(Exchange, ImplicitAPI):
1768
1774
  request['timeInForce'] = 'IOC'
1769
1775
  elif timeInForce == 'GTC':
1770
1776
  request['timeInForce'] = 'GTC'
1771
- triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
1772
1777
  if isSpot:
1773
1778
  cost = self.safe_number_2(params, 'cost', 'quoteOrderQty')
1774
1779
  params = self.omit(params, 'cost')
@@ -1791,17 +1796,19 @@ class bingx(Exchange, ImplicitAPI):
1791
1796
  request['type'] = 'TRIGGER_LIMIT'
1792
1797
  elif type == 'MARKET':
1793
1798
  request['type'] = 'TRIGGER_MARKET'
1799
+ elif (stopLossPrice is not None) or (takeProfitPrice is not None):
1800
+ stopTakePrice = stopLossPrice if (stopLossPrice is not None) else takeProfitPrice
1801
+ if type == 'LIMIT':
1802
+ request['type'] = 'TAKE_STOP_LIMIT'
1803
+ elif type == 'MARKET':
1804
+ request['type'] = 'TAKE_STOP_MARKET'
1805
+ request['stopPrice'] = self.parse_to_numeric(self.price_to_precision(symbol, stopTakePrice))
1794
1806
  else:
1795
1807
  if timeInForce == 'FOK':
1796
1808
  request['timeInForce'] = 'FOK'
1797
- stopLossPrice = self.safe_string(params, 'stopLossPrice')
1798
- takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
1799
1809
  trailingAmount = self.safe_string(params, 'trailingAmount')
1800
1810
  trailingPercent = self.safe_string_2(params, 'trailingPercent', 'priceRate')
1801
1811
  trailingType = self.safe_string(params, 'trailingType', 'TRAILING_STOP_MARKET')
1802
- isTriggerOrder = triggerPrice is not None
1803
- isStopLossPriceOrder = stopLossPrice is not None
1804
- isTakeProfitPriceOrder = takeProfitPrice is not None
1805
1812
  isTrailingAmountOrder = trailingAmount is not None
1806
1813
  isTrailingPercentOrder = trailingPercent is not None
1807
1814
  isTrailing = isTrailingAmountOrder or isTrailingPercentOrder
@@ -1879,7 +1886,7 @@ class bingx(Exchange, ImplicitAPI):
1879
1886
  positionSide = 'LONG' if (side == 'buy') else 'SHORT'
1880
1887
  request['positionSide'] = positionSide
1881
1888
  request['quantity'] = self.parse_to_numeric(self.amount_to_precision(symbol, amount))
1882
- params = self.omit(params, ['reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId'])
1889
+ params = self.omit(params, ['reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId'])
1883
1890
  return self.extend(request, params)
1884
1891
 
1885
1892
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -1897,9 +1904,9 @@ class bingx(Exchange, ImplicitAPI):
1897
1904
  :param bool [params.postOnly]: True to place a post only order
1898
1905
  :param str [params.timeInForce]: spot supports 'PO', 'GTC' and 'IOC', swap supports 'PO', 'GTC', 'IOC' and 'FOK'
1899
1906
  :param bool [params.reduceOnly]: *swap only* True or False whether the order is reduce only
1900
- :param float [params.triggerPrice]: *swap only* triggerPrice at which the attached take profit / stop loss order will be triggered
1901
- :param float [params.stopLossPrice]: *swap only* stop loss trigger price
1902
- :param float [params.takeProfitPrice]: *swap only* take profit trigger price
1907
+ :param float [params.triggerPrice]: triggerPrice at which the attached take profit / stop loss order will be triggered
1908
+ :param float [params.stopLossPrice]: stop loss trigger price
1909
+ :param float [params.takeProfitPrice]: take profit trigger price
1903
1910
  :param float [params.cost]: the quote quantity that can be used alternative for the amount
1904
1911
  :param float [params.trailingAmount]: *swap only* the quote amount to trail away from the current market price
1905
1912
  :param float [params.trailingPercent]: *swap only* the percent to trail away from the current market price
@@ -7864,7 +7864,7 @@ class bitget(Exchange, ImplicitAPI):
7864
7864
  """
7865
7865
  fetches historical positions
7866
7866
  :see: https://www.bitget.com/api-doc/contract/position/Get-History-Position
7867
- :param str [symbol]: unified contract symbols
7867
+ :param str[] [symbols]: unified contract symbols
7868
7868
  :param int [since]: timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months
7869
7869
  :param int [limit]: the maximum amount of records to fetch, default=20, max=100
7870
7870
  :param dict params: extra parameters specific to the exchange api endpoint