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

@@ -1111,17 +1111,51 @@ class bitfinex(Exchange, ImplicitAPI):
1111
1111
  request: dict = {
1112
1112
  'order_id': int(id),
1113
1113
  }
1114
- return await self.privatePostOrderCancel(self.extend(request, params))
1114
+ response = await self.privatePostOrderCancel(self.extend(request, params))
1115
+ #
1116
+ # {
1117
+ # id: '161236928925',
1118
+ # cid: '1720172026812',
1119
+ # cid_date: '2024-07-05',
1120
+ # gid: null,
1121
+ # symbol: 'adaust',
1122
+ # exchange: 'bitfinex',
1123
+ # price: '0.33',
1124
+ # avg_execution_price: '0.0',
1125
+ # side: 'buy',
1126
+ # type: 'exchange limit',
1127
+ # timestamp: '1720172026.813',
1128
+ # is_live: True,
1129
+ # is_cancelled: False,
1130
+ # is_hidden: False,
1131
+ # oco_order: null,
1132
+ # was_forced: False,
1133
+ # original_amount: '10.0',
1134
+ # remaining_amount: '10.0',
1135
+ # executed_amount: '0.0',
1136
+ # src: 'api',
1137
+ # meta: {}
1138
+ # }
1139
+ #
1140
+ return self.parse_order(response)
1115
1141
 
1116
1142
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1117
1143
  """
1118
1144
  cancel all open orders
1119
1145
  :see: https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
1120
- :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
1146
+ :param str symbol: not used by bitfinex cancelAllOrders
1121
1147
  :param dict [params]: extra parameters specific to the exchange API endpoint
1122
1148
  :returns dict: response from exchange
1123
1149
  """
1124
- return await self.privatePostOrderCancelAll(params)
1150
+ response = await self.privatePostOrderCancelAll(params)
1151
+ #
1152
+ # {result: 'Submitting 1 order cancellations.'}
1153
+ #
1154
+ return [
1155
+ self.safe_order({
1156
+ 'info': response,
1157
+ }),
1158
+ ]
1125
1159
 
1126
1160
  def parse_order(self, order: dict, market: Market = None) -> Order:
1127
1161
  #
@@ -1560,7 +1594,7 @@ class bitfinex(Exchange, ImplicitAPI):
1560
1594
  return response
1561
1595
 
1562
1596
  def nonce(self):
1563
- return self.milliseconds()
1597
+ return self.microseconds()
1564
1598
 
1565
1599
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
1566
1600
  request = '/' + self.implode_params(path, params)
@@ -105,7 +105,10 @@ class bitso(Exchange, ImplicitAPI):
105
105
  'urls': {
106
106
  'logo': 'https://user-images.githubusercontent.com/51840849/87295554-11f98280-c50e-11ea-80d6-15b3bafa8cbf.jpg',
107
107
  'api': {
108
- 'rest': 'https://api.bitso.com',
108
+ 'rest': 'https://bitso.com/api',
109
+ },
110
+ 'test': {
111
+ 'rest': 'https://stage.bitso.com/api',
109
112
  },
110
113
  'www': 'https://bitso.com',
111
114
  'doc': 'https://bitso.com/api_info',
@@ -4148,10 +4148,8 @@ class bybit(Exchange, ImplicitAPI):
4148
4148
  """
4149
4149
  cancel multiple orders for multiple symbols
4150
4150
  :see: https://bybit-exchange.github.io/docs/v5/order/batch-cancel
4151
- :param str[] ids: order ids
4152
- :param str symbol: unified symbol of the market the order was made in
4151
+ :param CancellationRequest[] orders: list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
4153
4152
  :param dict [params]: extra parameters specific to the exchange API endpoint
4154
- :param str[] [params.clientOrderIds]: client order ids
4155
4153
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
4156
4154
  """
4157
4155
  await self.load_markets()
@@ -798,13 +798,19 @@ class cryptocom(Exchange, ImplicitAPI):
798
798
  'instrument_name': market['id'],
799
799
  'timeframe': self.safe_string(self.timeframes, timeframe, timeframe),
800
800
  }
801
- if since is not None:
802
- request['start_ts'] = since
803
801
  if limit is not None:
804
802
  request['count'] = limit
805
- until = self.safe_integer(params, 'until')
803
+ now = self.microseconds()
804
+ duration = self.parse_timeframe(timeframe)
805
+ until = self.safe_integer(params, 'until', now)
806
806
  params = self.omit(params, ['until'])
807
- if until is not None:
807
+ if since is not None:
808
+ request['start_ts'] = since
809
+ if limit is not None:
810
+ request['end_ts'] = self.sum(since, duration * (limit + 1) * 1000) - 1
811
+ else:
812
+ request['end_ts'] = until
813
+ else:
808
814
  request['end_ts'] = until
809
815
  response = await self.v1PublicGetPublicGetCandlestick(self.extend(request, params))
810
816
  #
@@ -1362,7 +1368,7 @@ class cryptocom(Exchange, ImplicitAPI):
1362
1368
  """
1363
1369
  cancel multiple orders for multiple symbols
1364
1370
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order-list-list
1365
- :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol
1371
+ :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
1366
1372
  :param dict [params]: extra parameters specific to the exchange API endpoint
1367
1373
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1368
1374
  """
@@ -4780,8 +4780,7 @@ class gate(Exchange, ImplicitAPI):
4780
4780
  """
4781
4781
  cancel multiple orders for multiple symbols
4782
4782
  :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
4783
- :param str[] ids: order ids
4784
- :param str symbol: unified symbol of the market the order was made in
4783
+ :param CancellationRequest[] orders: list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
4785
4784
  :param dict [params]: extra parameters specific to the exchange API endpoint
4786
4785
  :param str[] [params.clientOrderIds]: client order ids
4787
4786
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -1261,7 +1261,7 @@ class hyperliquid(Exchange, ImplicitAPI):
1261
1261
  cancel multiple orders for multiple symbols
1262
1262
  :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1263
1263
  :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1264
- :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol
1264
+ :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
1265
1265
  :param dict [params]: extra parameters specific to the exchange API endpoint
1266
1266
  :param str [params.vaultAddress]: the vault address
1267
1267
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -1030,7 +1030,7 @@ class kraken(Exchange, ImplicitAPI):
1030
1030
  amount = Precise.string_abs(amount)
1031
1031
  else:
1032
1032
  direction = 'in'
1033
- timestamp = self.safe_timestamp(item, 'time')
1033
+ timestamp = self.safe_integer_product(item, 'time', 1000)
1034
1034
  return {
1035
1035
  'info': item,
1036
1036
  'id': id,
ccxt/async_support/okx.py CHANGED
@@ -950,6 +950,15 @@ class okx(Exchange, ImplicitAPI):
950
950
  '70010': BadRequest, # Timestamp parameters need to be in Unix timestamp format in milliseconds.
951
951
  '70013': BadRequest, # endTs needs to be bigger than or equal to beginTs.
952
952
  '70016': BadRequest, # Please specify your instrument settings for at least one instType.
953
+ '1009': BadRequest, # Request message exceeds the maximum frame length
954
+ '4001': AuthenticationError, # Login Failed
955
+ '4002': BadRequest, # Invalid Request
956
+ '4003': RateLimitExceeded, # APIKey subscription amount exceeds the limit 100
957
+ '4004': NetworkError, # No data received in 30s
958
+ '4005': ExchangeNotAvailable, # Buffer is full, cannot write data
959
+ '4006': BadRequest, # Abnormal disconnection
960
+ '4007': AuthenticationError, # API key has been updated or deleted. Please reconnect.
961
+ '4008': RateLimitExceeded, # The number of subscribed channels exceeds the maximum limit.
953
962
  },
954
963
  'broad': {
955
964
  'Internal Server Error': ExchangeNotAvailable, # {"code":500,"data":{},"detailMsg":"","error_code":"500","error_message":"Internal Server Error","msg":"Internal Server Error"}
@@ -3144,7 +3153,7 @@ class okx(Exchange, ImplicitAPI):
3144
3153
  cancel multiple orders for multiple symbols
3145
3154
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
3146
3155
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
3147
- :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol
3156
+ :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
3148
3157
  :param dict [params]: extra parameters specific to the exchange API endpoint
3149
3158
  :param boolean [params.trigger]: whether the order is a stop/trigger order
3150
3159
  :param boolean [params.trailing]: set to True if you want to cancel trailing orders
@@ -843,7 +843,8 @@ class timex(Exchange, ImplicitAPI):
843
843
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
844
844
  """
845
845
  await self.load_markets()
846
- return await self.cancel_orders([id], symbol, params)
846
+ orders = await self.cancel_orders([id], symbol, params)
847
+ return self.safe_dict(orders, 0)
847
848
 
848
849
  async def cancel_orders(self, ids, symbol: Str = None, params={}):
849
850
  """
@@ -883,7 +884,20 @@ class timex(Exchange, ImplicitAPI):
883
884
  # ],
884
885
  # "unchangedOrders": ["string"],
885
886
  # }
886
- return response
887
+ #
888
+ changedOrders = self.safe_list(response, 'changedOrders', [])
889
+ unchangedOrders = self.safe_list(response, 'unchangedOrders', [])
890
+ orders = []
891
+ for i in range(0, len(changedOrders)):
892
+ newOrder = self.safe_dict(changedOrders[i], 'newOrder')
893
+ orders.append(self.parse_order(newOrder))
894
+ for i in range(0, len(unchangedOrders)):
895
+ orders.append(self.safe_order({
896
+ 'info': unchangedOrders[i],
897
+ 'id': unchangedOrders[i],
898
+ 'status': 'unchanged',
899
+ }))
900
+ return orders
887
901
 
888
902
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
889
903
  """
ccxt/async_support/xt.py CHANGED
@@ -836,7 +836,7 @@ class xt(Exchange, ImplicitAPI):
836
836
  'name': self.safe_string(entry, 'fullName'),
837
837
  'active': active,
838
838
  'fee': self.parse_number(minWithdrawFeeString),
839
- 'precision': None,
839
+ 'precision': minPrecision,
840
840
  'deposit': deposit,
841
841
  'withdraw': withdraw,
842
842
  'networks': networks,
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.59'
7
+ __version__ = '4.3.60'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/binance.py CHANGED
@@ -6647,22 +6647,64 @@ class binance(Exchange, ImplicitAPI):
6647
6647
  response = None
6648
6648
  if market['option']:
6649
6649
  response = self.eapiPrivateDeleteAllOpenOrders(self.extend(request, params))
6650
+ #
6651
+ # {
6652
+ # "code": 0,
6653
+ # "msg": "success"
6654
+ # }
6655
+ #
6650
6656
  elif market['linear']:
6651
6657
  if isPortfolioMargin:
6652
6658
  if isConditional:
6653
6659
  response = self.papiDeleteUmConditionalAllOpenOrders(self.extend(request, params))
6660
+ #
6661
+ # {
6662
+ # "code": "200",
6663
+ # "msg": "The operation of cancel all conditional open order is done."
6664
+ # }
6665
+ #
6654
6666
  else:
6655
6667
  response = self.papiDeleteUmAllOpenOrders(self.extend(request, params))
6668
+ #
6669
+ # {
6670
+ # "code": 200,
6671
+ # "msg": "The operation of cancel all open order is done."
6672
+ # }
6673
+ #
6656
6674
  else:
6657
6675
  response = self.fapiPrivateDeleteAllOpenOrders(self.extend(request, params))
6676
+ #
6677
+ # {
6678
+ # "code": 200,
6679
+ # "msg": "The operation of cancel all open order is done."
6680
+ # }
6681
+ #
6658
6682
  elif market['inverse']:
6659
6683
  if isPortfolioMargin:
6660
6684
  if isConditional:
6661
6685
  response = self.papiDeleteCmConditionalAllOpenOrders(self.extend(request, params))
6686
+ #
6687
+ # {
6688
+ # "code": "200",
6689
+ # "msg": "The operation of cancel all conditional open order is done."
6690
+ # }
6691
+ #
6662
6692
  else:
6663
6693
  response = self.papiDeleteCmAllOpenOrders(self.extend(request, params))
6694
+ #
6695
+ # {
6696
+ # "code": 200,
6697
+ # "msg": "The operation of cancel all open order is done."
6698
+ # }
6699
+ #
6664
6700
  else:
6665
6701
  response = self.dapiPrivateDeleteAllOpenOrders(self.extend(request, params))
6702
+ #
6703
+ # {
6704
+ # "code": 200,
6705
+ # "msg": "The operation of cancel all open order is done."
6706
+ # }
6707
+ #
6666
6708
  elif (type == 'margin') or (marginMode is not None) or isPortfolioMargin:
6667
6709
  if isPortfolioMargin:
6668
6710
  response = self.papiDeleteMarginAllOpenOrders(self.extend(request, params))
@@ -6670,12 +6712,59 @@ class binance(Exchange, ImplicitAPI):
6670
6712
  if marginMode == 'isolated':
6671
6713
  request['isIsolated'] = True
6672
6714
  response = self.sapiDeleteMarginOpenOrders(self.extend(request, params))
6715
+ #
6716
+ # [
6717
+ # {
6718
+ # "symbol": "BTCUSDT",
6719
+ # "isIsolated": True, # if isolated margin
6720
+ # "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
6721
+ # "orderId": 11,
6722
+ # "orderListId": -1,
6723
+ # "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
6724
+ # "price": "0.089853",
6725
+ # "origQty": "0.178622",
6726
+ # "executedQty": "0.000000",
6727
+ # "cummulativeQuoteQty": "0.000000",
6728
+ # "status": "CANCELED",
6729
+ # "timeInForce": "GTC",
6730
+ # "type": "LIMIT",
6731
+ # "side": "BUY",
6732
+ # "selfTradePreventionMode": "NONE"
6733
+ # },
6734
+ # ...
6735
+ # ]
6736
+ #
6673
6737
  else:
6674
6738
  response = self.privateDeleteOpenOrders(self.extend(request, params))
6739
+ #
6740
+ # [
6741
+ # {
6742
+ # "symbol": "ADAUSDT",
6743
+ # "origClientOrderId": "x-R4BD3S82662cde7a90114475b86e21",
6744
+ # "orderId": 3935107,
6745
+ # "orderListId": -1,
6746
+ # "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
6747
+ # "transactTime": 1720589016657,
6748
+ # "price": "0.35000000",
6749
+ # "origQty": "30.00000000",
6750
+ # "executedQty": "0.00000000",
6751
+ # "cummulativeQuoteQty": "0.00000000",
6752
+ # "status": "CANCELED",
6753
+ # "timeInForce": "GTC",
6754
+ # "type": "LIMIT",
6755
+ # "side": "BUY",
6756
+ # "selfTradePreventionMode": "EXPIRE_MAKER"
6757
+ # }
6758
+ # ]
6759
+ #
6675
6760
  if isinstance(response, list):
6676
6761
  return self.parse_orders(response, market)
6677
6762
  else:
6678
- return response
6763
+ return [
6764
+ self.safe_order({
6765
+ 'info': response,
6766
+ }),
6767
+ ]
6679
6768
 
6680
6769
  def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
6681
6770
  """