ccxt 4.3.83__py2.py3-none-any.whl → 4.3.85__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 CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.83'
25
+ __version__ = '4.3.85'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -54,6 +54,7 @@ from ccxt.base.errors import OperationRejected # noqa: F4
54
54
  from ccxt.base.errors import NoChange # noqa: F401
55
55
  from ccxt.base.errors import MarginModeAlreadySet # noqa: F401
56
56
  from ccxt.base.errors import MarketClosed # noqa: F401
57
+ from ccxt.base.errors import ManualInteractionNeeded # noqa: F401
57
58
  from ccxt.base.errors import InsufficientFunds # noqa: F401
58
59
  from ccxt.base.errors import InvalidAddress # noqa: F401
59
60
  from ccxt.base.errors import AddressPending # noqa: F401
@@ -38,6 +38,8 @@ class ImplicitAPI:
38
38
  v1_private_post_private_get_accounts = v1PrivatePostPrivateGetAccounts = Entry('private/get-accounts', ['v1', 'private'], 'POST', {'cost': 3.3333333333333335})
39
39
  v1_private_post_private_get_withdrawal_history = v1PrivatePostPrivateGetWithdrawalHistory = Entry('private/get-withdrawal-history', ['v1', 'private'], 'POST', {'cost': 3.3333333333333335})
40
40
  v1_private_post_private_get_deposit_history = v1PrivatePostPrivateGetDepositHistory = Entry('private/get-deposit-history', ['v1', 'private'], 'POST', {'cost': 3.3333333333333335})
41
+ v1_private_post_private_get_fee_rate = v1PrivatePostPrivateGetFeeRate = Entry('private/get-fee-rate', ['v1', 'private'], 'POST', {'cost': 2})
42
+ v1_private_post_private_get_instrument_fee_rate = v1PrivatePostPrivateGetInstrumentFeeRate = Entry('private/get-instrument-fee-rate', ['v1', 'private'], 'POST', {'cost': 2})
41
43
  v1_private_post_private_staking_stake = v1PrivatePostPrivateStakingStake = Entry('private/staking/stake', ['v1', 'private'], 'POST', {'cost': 2})
42
44
  v1_private_post_private_staking_unstake = v1PrivatePostPrivateStakingUnstake = Entry('private/staking/unstake', ['v1', 'private'], 'POST', {'cost': 2})
43
45
  v1_private_post_private_staking_get_staking_position = v1PrivatePostPrivateStakingGetStakingPosition = Entry('private/staking/get-staking-position', ['v1', 'private'], 'POST', {'cost': 2})
@@ -162,6 +162,7 @@ class ImplicitAPI:
162
162
  futurespublic_get_status = futuresPublicGetStatus = Entry('status', 'futuresPublic', 'GET', {'cost': 1})
163
163
  futurespublic_get_level2_message_query = futuresPublicGetLevel2MessageQuery = Entry('level2/message/query', 'futuresPublic', 'GET', {'cost': 1})
164
164
  futurespublic_get_contracts_risk_limit_symbol = futuresPublicGetContractsRiskLimitSymbol = Entry('contracts/risk-limit/{symbol}', 'futuresPublic', 'GET', {'cost': 1})
165
+ futurespublic_get_alltickers = futuresPublicGetAllTickers = Entry('allTickers', 'futuresPublic', 'GET', {'cost': 1})
165
166
  futurespublic_get_level2_depth_limit = futuresPublicGetLevel2DepthLimit = Entry('level2/depth{limit}', 'futuresPublic', 'GET', {'cost': 1})
166
167
  futurespublic_get_level3_message_query = futuresPublicGetLevel3MessageQuery = Entry('level3/message/query', 'futuresPublic', 'GET', {'cost': 1})
167
168
  futurespublic_get_level3_snapshot = futuresPublicGetLevel3Snapshot = Entry('level3/snapshot', 'futuresPublic', 'GET', {'cost': 1})
@@ -191,6 +192,7 @@ class ImplicitAPI:
191
192
  futuresprivate_get_trade_statistics = futuresPrivateGetTradeStatistics = Entry('trade-statistics', 'futuresPrivate', 'GET', {'cost': 1})
192
193
  futuresprivate_get_trade_fees = futuresPrivateGetTradeFees = Entry('trade-fees', 'futuresPrivate', 'GET', {'cost': 1})
193
194
  futuresprivate_get_history_positions = futuresPrivateGetHistoryPositions = Entry('history-positions', 'futuresPrivate', 'GET', {'cost': 1})
195
+ futuresprivate_get_getmaxopensize = futuresPrivateGetGetMaxOpenSize = Entry('getMaxOpenSize', 'futuresPrivate', 'GET', {'cost': 1})
194
196
  futuresprivate_post_transfer_out = futuresPrivatePostTransferOut = Entry('transfer-out', 'futuresPrivate', 'POST', {'cost': 1})
195
197
  futuresprivate_post_transfer_in = futuresPrivatePostTransferIn = Entry('transfer-in', 'futuresPrivate', 'POST', {'cost': 1})
196
198
  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.83'
7
+ __version__ = '4.3.85'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -33,6 +33,7 @@ from ccxt.base.errors import OperationRejected # noqa: F4
33
33
  from ccxt.base.errors import NoChange # noqa: F401
34
34
  from ccxt.base.errors import MarginModeAlreadySet # noqa: F401
35
35
  from ccxt.base.errors import MarketClosed # noqa: F401
36
+ from ccxt.base.errors import ManualInteractionNeeded # noqa: F401
36
37
  from ccxt.base.errors import InsufficientFunds # noqa: F401
37
38
  from ccxt.base.errors import InvalidAddress # noqa: F401
38
39
  from ccxt.base.errors import AddressPending # noqa: F401
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.83'
5
+ __version__ = '4.3.85'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -10526,7 +10526,7 @@ class binance(Exchange, ImplicitAPI):
10526
10526
  extendedParams['recvWindow'] = recvWindow
10527
10527
  if (api == 'sapi') and (path == 'asset/dust'):
10528
10528
  query = self.urlencode_with_array_repeat(extendedParams)
10529
- elif (path == 'batchOrders') or (path.find('sub-account') >= 0) or (path == 'capital/withdraw/apply') or (path.find('staking') >= 0):
10529
+ elif (path == 'batchOrders') or (path.find('sub-account') >= 0) or (path == 'capital/withdraw/apply') or (path.find('staking') >= 0) or (path.find('simple-earn') >= 0):
10530
10530
  if (method == 'DELETE') and (path == 'batchOrders'):
10531
10531
  orderidlist = self.safe_list(extendedParams, 'orderidlist', [])
10532
10532
  origclientorderidlist = self.safe_list(extendedParams, 'origclientorderidlist', [])
@@ -354,9 +354,9 @@ class bitfinex2(Exchange, ImplicitAPI):
354
354
  # convert 'EXCHANGE LIMIT' to lowercase 'limit'
355
355
  # everything else remains uppercase
356
356
  'exchangeTypes': {
357
- # 'MARKET': None,
357
+ 'MARKET': 'market',
358
358
  'EXCHANGE MARKET': 'market',
359
- # 'LIMIT': None,
359
+ 'LIMIT': 'limit',
360
360
  'EXCHANGE LIMIT': 'limit',
361
361
  # 'STOP': None,
362
362
  'EXCHANGE STOP': 'market',
@@ -2307,6 +2307,8 @@ class bitmex(Exchange, ImplicitAPI):
2307
2307
  # 'otpToken': '123456', # requires if two-factor auth(OTP) is enabled
2308
2308
  # 'fee': 0.001, # bitcoin network fee
2309
2309
  }
2310
+ if self.twofa is not None:
2311
+ request['otpToken'] = self.totp(self.twofa)
2310
2312
  response = await self.privatePostUserRequestWithdrawal(self.extend(request, params))
2311
2313
  #
2312
2314
  # {
@@ -16,6 +16,7 @@ from ccxt.base.errors import ArgumentsRequired
16
16
  from ccxt.base.errors import BadRequest
17
17
  from ccxt.base.errors import NoChange
18
18
  from ccxt.base.errors import MarginModeAlreadySet
19
+ from ccxt.base.errors import ManualInteractionNeeded
19
20
  from ccxt.base.errors import InsufficientFunds
20
21
  from ccxt.base.errors import InvalidOrder
21
22
  from ccxt.base.errors import OrderNotFound
@@ -768,8 +769,11 @@ class bybit(Exchange, ImplicitAPI):
768
769
  '140069': PermissionDenied, # Do not allow OTC lending users to trade
769
770
  '140070': InvalidOrder, # ETP symbols are not allowed to be traded
770
771
  '170001': ExchangeError, # Internal error.
771
- '170007': RequestTimeout, # Timeout waiting for response from backend server.
772
772
  '170005': InvalidOrder, # Too many new orders; current limit is %s orders per %s.
773
+ '170007': RequestTimeout, # Timeout waiting for response from backend server.
774
+ '170010': InvalidOrder, # Purchase failed: Exceed the maximum position limit of leveraged tokens, the current available limit is %s USDT
775
+ '170011': InvalidOrder, # "Purchase failed: Exceed the maximum position limit of innovation tokens,
776
+ '170019': InvalidOrder, # the current available limit is replaceKey0 USDT"
773
777
  '170031': ExchangeError, # The feature has been suspended
774
778
  '170032': ExchangeError, # Network error. Please try again later
775
779
  '170033': InsufficientFunds, # margin Insufficient account balance
@@ -782,6 +786,7 @@ class bybit(Exchange, ImplicitAPI):
782
786
  '170116': InvalidOrder, # Invalid orderType.
783
787
  '170117': InvalidOrder, # Invalid side.
784
788
  '170121': InvalidOrder, # Invalid symbol.
789
+ '170124': InvalidOrder, # Order amount too large.
785
790
  '170130': BadRequest, # Data sent for paramter '%s' is not valid.
786
791
  '170131': InsufficientFunds, # Balance insufficient
787
792
  '170132': InvalidOrder, # Order price too high.
@@ -792,7 +797,6 @@ class bybit(Exchange, ImplicitAPI):
792
797
  '170137': InvalidOrder, # Order volume decimal too long
793
798
  '170139': InvalidOrder, # Order has been filled.
794
799
  '170140': InvalidOrder, # Transaction amount lower than the minimum.
795
- '170124': InvalidOrder, # Order amount too large.
796
800
  '170141': InvalidOrder, # Duplicate clientOrderId
797
801
  '170142': InvalidOrder, # Order has been canceled
798
802
  '170143': InvalidOrder, # Cannot be found on order book
@@ -817,6 +821,15 @@ class bybit(Exchange, ImplicitAPI):
817
821
  '170198': InvalidOrder, # Your order quantity to sell is too large. The filled price may deviate significantly from the market price. Please try again
818
822
  '170199': InvalidOrder, # Your order quantity to buy is too large. The filled price may deviate significantly from the nav. Please try again.
819
823
  '170200': InvalidOrder, # Your order quantity to sell is too large. The filled price may deviate significantly from the nav. Please try again.
824
+ '170201': PermissionDenied, # Your account has been restricted for trades. If you have any questions, please email us at support@bybit.com
825
+ '170202': InvalidOrder, # Invalid orderFilter parameter.
826
+ '170203': InvalidOrder, # Please enter the TP/SL price.
827
+ '170204': InvalidOrder, # trigger price cannot be higher than 110% price.
828
+ '170206': InvalidOrder, # trigger price cannot be lower than 90% of qty.
829
+ '170210': InvalidOrder, # New order rejected.
830
+ '170213': OrderNotFound, # Order does not exist.
831
+ '170217': InvalidOrder, # Only LIMIT-MAKER order is supported for the current pair.
832
+ '170218': InvalidOrder, # The LIMIT-MAKER order is rejected due to invalid price.
820
833
  '170221': BadRequest, # This coin does not exist.
821
834
  '170222': RateLimitExceeded, # Too many hasattr(self, requests) time frame.
822
835
  '170223': InsufficientFunds, # Your Spot Account with Institutional Lending triggers an alert or liquidation.
@@ -826,18 +839,7 @@ class bybit(Exchange, ImplicitAPI):
826
839
  '170228': InvalidOrder, # The purchase amount of each order exceeds the estimated maximum purchase amount.
827
840
  '170229': InvalidOrder, # The sell quantity per order exceeds the estimated maximum sell quantity.
828
841
  '170234': ExchangeError, # System Error
829
- '170210': InvalidOrder, # New order rejected.
830
- '170213': OrderNotFound, # Order does not exist.
831
- '170217': InvalidOrder, # Only LIMIT-MAKER order is supported for the current pair.
832
- '170218': InvalidOrder, # The LIMIT-MAKER order is rejected due to invalid price.
833
- '170010': InvalidOrder, # Purchase failed: Exceed the maximum position limit of leveraged tokens, the current available limit is %s USDT
834
- '170011': InvalidOrder, # "Purchase failed: Exceed the maximum position limit of innovation tokens,
835
- '170019': InvalidOrder, # the current available limit is replaceKey0 USDT"
836
- '170201': PermissionDenied, # Your account has been restricted for trades. If you have any questions, please email us at support@bybit.com
837
- '170202': InvalidOrder, # Invalid orderFilter parameter.
838
- '170203': InvalidOrder, # Please enter the TP/SL price.
839
- '170204': InvalidOrder, # trigger price cannot be higher than 110% price.
840
- '170206': InvalidOrder, # trigger price cannot be lower than 90% of qty.
842
+ '170241': ManualInteractionNeeded, # To proceed with trading, users must read through and confirm that they fully understand the project's risk disclosure document.
841
843
  '175000': InvalidOrder, # The serialNum is already in use.
842
844
  '175001': InvalidOrder, # Daily purchase limit has been exceeded. Please try again later.
843
845
  '175002': InvalidOrder, # There's a large number of purchase orders. Please try again later.
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.cryptocom import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -109,8 +109,8 @@ class cryptocom(Exchange, ImplicitAPI):
109
109
  'fetchTickers': True,
110
110
  'fetchTime': False,
111
111
  'fetchTrades': True,
112
- 'fetchTradingFee': False,
113
- 'fetchTradingFees': False,
112
+ 'fetchTradingFee': True,
113
+ 'fetchTradingFees': True,
114
114
  'fetchTransactionFees': False,
115
115
  'fetchTransactions': False,
116
116
  'fetchTransfers': False,
@@ -211,6 +211,8 @@ class cryptocom(Exchange, ImplicitAPI):
211
211
  'private/get-accounts': 10 / 3,
212
212
  'private/get-withdrawal-history': 10 / 3,
213
213
  'private/get-deposit-history': 10 / 3,
214
+ 'private/get-fee-rate': 2,
215
+ 'private/get-instrument-fee-rate': 2,
214
216
  'private/staking/stake': 2,
215
217
  'private/staking/unstake': 2,
216
218
  'private/staking/get-staking-position': 2,
@@ -2806,6 +2808,114 @@ class cryptocom(Exchange, ImplicitAPI):
2806
2808
  result = self.safe_dict(response, 'result')
2807
2809
  return self.parse_order(result, market)
2808
2810
 
2811
+ async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
2812
+ """
2813
+ fetch the trading fees for a market
2814
+ :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-instrument-fee-rate
2815
+ :param str symbol: unified market symbol
2816
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2817
+ :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
2818
+ """
2819
+ await self.load_markets()
2820
+ market = self.market(symbol)
2821
+ request: dict = {
2822
+ 'instrument_name': market['id'],
2823
+ }
2824
+ response = await self.v1PrivatePostPrivateGetInstrumentFeeRate(self.extend(request, params))
2825
+ #
2826
+ # {
2827
+ # "id": 1,
2828
+ # "code": 0,
2829
+ # "method": "private/staking/unstake",
2830
+ # "result": {
2831
+ # "staking_id": "1",
2832
+ # "instrument_name": "SOL.staked",
2833
+ # "status": "NEW",
2834
+ # "quantity": "1",
2835
+ # "underlying_inst_name": "SOL",
2836
+ # "reason": "NO_ERROR"
2837
+ # }
2838
+ # }
2839
+ #
2840
+ data = self.safe_dict(response, 'result', {})
2841
+ return self.parse_trading_fee(data, market)
2842
+
2843
+ async def fetch_trading_fees(self, params={}) -> TradingFees:
2844
+ """
2845
+ :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-fee-rate
2846
+ fetch the trading fees for multiple markets
2847
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2848
+ :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
2849
+ """
2850
+ await self.load_markets()
2851
+ response = await self.v1PrivatePostPrivateGetFeeRate(params)
2852
+ #
2853
+ # {
2854
+ # "id": 1,
2855
+ # "method": "/private/get-fee-rate",
2856
+ # "code": 0,
2857
+ # "result": {
2858
+ # "spot_tier": "3",
2859
+ # "deriv_tier": "3",
2860
+ # "effective_spot_maker_rate_bps": "6.5",
2861
+ # "effective_spot_taker_rate_bps": "6.9",
2862
+ # "effective_deriv_maker_rate_bps": "1.1",
2863
+ # "effective_deriv_taker_rate_bps": "3"
2864
+ # }
2865
+ # }
2866
+ #
2867
+ result = self.safe_dict(response, 'result', {})
2868
+ return self.parse_trading_fees(result)
2869
+
2870
+ def parse_trading_fees(self, response):
2871
+ #
2872
+ # {
2873
+ # "spot_tier": "3",
2874
+ # "deriv_tier": "3",
2875
+ # "effective_spot_maker_rate_bps": "6.5",
2876
+ # "effective_spot_taker_rate_bps": "6.9",
2877
+ # "effective_deriv_maker_rate_bps": "1.1",
2878
+ # "effective_deriv_taker_rate_bps": "3"
2879
+ # }
2880
+ #
2881
+ result: dict = {}
2882
+ result['info'] = response
2883
+ for i in range(0, len(self.symbols)):
2884
+ symbol = self.symbols[i]
2885
+ market = self.market(symbol)
2886
+ isSwap = market['swap']
2887
+ takerFeeKey = 'effective_deriv_taker_rate_bps' if isSwap else 'effective_spot_taker_rate_bps'
2888
+ makerFeeKey = 'effective_deriv_maker_rate_bps' if isSwap else 'effective_spot_maker_rate_bps'
2889
+ tradingFee = {
2890
+ 'info': response,
2891
+ 'symbol': symbol,
2892
+ 'maker': self.parse_number(Precise.string_div(self.safe_string(response, makerFeeKey), '10000')),
2893
+ 'taker': self.parse_number(Precise.string_div(self.safe_string(response, takerFeeKey), '10000')),
2894
+ 'percentage': None,
2895
+ 'tierBased': None,
2896
+ }
2897
+ result[symbol] = tradingFee
2898
+ return result
2899
+
2900
+ def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
2901
+ #
2902
+ # {
2903
+ # "instrument_name": "BTC_USD",
2904
+ # "effective_maker_rate_bps": "6.5",
2905
+ # "effective_taker_rate_bps": "6.9"
2906
+ # }
2907
+ #
2908
+ marketId = self.safe_string(fee, 'instrument_name')
2909
+ symbol = self.safe_symbol(marketId, market)
2910
+ return {
2911
+ 'info': fee,
2912
+ 'symbol': symbol,
2913
+ 'maker': self.parse_number(Precise.string_div(self.safe_string(fee, 'effective_maker_rate_bps'), '10000')),
2914
+ 'taker': self.parse_number(Precise.string_div(self.safe_string(fee, 'effective_taker_rate_bps'), '10000')),
2915
+ 'percentage': None,
2916
+ 'tierBased': None,
2917
+ }
2918
+
2809
2919
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
2810
2920
  type = self.safe_string(api, 0)
2811
2921
  access = self.safe_string(api, 1)
@@ -1181,6 +1181,26 @@ class kraken(Exchange, ImplicitAPI):
1181
1181
  # "misc": ''
1182
1182
  # }
1183
1183
  #
1184
+ # fetchMyTrades
1185
+ #
1186
+ # {
1187
+ # "ordertxid": "OSJVN7-A2AE-63WZV",
1188
+ # "postxid": "TBP7O6-PNXI-CONU",
1189
+ # "pair": "XXBTZUSD",
1190
+ # "time": 1710429248.3052235,
1191
+ # "type": "sell",
1192
+ # "ordertype": "liquidation market",
1193
+ # "price": "72026.50000",
1194
+ # "cost": "7.20265",
1195
+ # "fee": "0.01873",
1196
+ # "vol": "0.00010000",
1197
+ # "margin": "1.44053",
1198
+ # "leverage": "5",
1199
+ # "misc": "closing",
1200
+ # "trade_id": 68230622,
1201
+ # "maker": False
1202
+ # }
1203
+ #
1184
1204
  timestamp = None
1185
1205
  side = None
1186
1206
  type = None
@@ -1227,6 +1247,10 @@ class kraken(Exchange, ImplicitAPI):
1227
1247
  if market is not None:
1228
1248
  symbol = market['symbol']
1229
1249
  cost = self.safe_string(trade, 'cost')
1250
+ maker = self.safe_bool(trade, 'maker')
1251
+ takerOrMaker = None
1252
+ if maker is not None:
1253
+ takerOrMaker = 'maker' if maker else 'taker'
1230
1254
  return self.safe_trade({
1231
1255
  'id': id,
1232
1256
  'order': orderId,
@@ -1236,7 +1260,7 @@ class kraken(Exchange, ImplicitAPI):
1236
1260
  'symbol': symbol,
1237
1261
  'type': type,
1238
1262
  'side': side,
1239
- 'takerOrMaker': None,
1263
+ 'takerOrMaker': takerOrMaker,
1240
1264
  'price': price,
1241
1265
  'amount': amount,
1242
1266
  'cost': cost,
@@ -2001,7 +2025,10 @@ class kraken(Exchange, ImplicitAPI):
2001
2025
  # "fee": "0.000026",
2002
2026
  # "vol": "16.00000000",
2003
2027
  # "margin": "0.000000",
2028
+ # "leverage": "5",
2004
2029
  # "misc": ""
2030
+ # "trade_id": 68230622,
2031
+ # "maker": False
2005
2032
  # },
2006
2033
  # ...
2007
2034
  # },
@@ -2367,13 +2394,11 @@ class kraken(Exchange, ImplicitAPI):
2367
2394
  :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
2368
2395
  """
2369
2396
  # https://www.kraken.com/en-us/help/api#deposit-status
2370
- if code is None:
2371
- raise ArgumentsRequired(self.id + ' fetchDeposits() requires a currency code argument')
2372
2397
  await self.load_markets()
2373
- currency = self.currency(code)
2374
- request: dict = {
2375
- 'asset': currency['id'],
2376
- }
2398
+ request: dict = {}
2399
+ if code is not None:
2400
+ currency = self.currency(code)
2401
+ request['asset'] = currency['id']
2377
2402
  if since is not None:
2378
2403
  request['start'] = since
2379
2404
  response = await self.privatePostDepositStatus(self.extend(request, params))
@@ -137,6 +137,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
137
137
  'contracts/{symbol}': 1,
138
138
  'contracts/risk-limit/{symbol}': 1,
139
139
  'ticker': 1,
140
+ 'allTickers': 1,
140
141
  'level2/snapshot': 1.33,
141
142
  'level2/depth{limit}': 1,
142
143
  'level2/message/query': 1,
@@ -180,6 +181,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
180
181
  'trade-statistics': 1,
181
182
  'trade-fees': 1,
182
183
  'history-positions': 1,
184
+ 'getMaxOpenSize': 1,
183
185
  },
184
186
  'post': {
185
187
  'withdrawals': 1,
@@ -325,6 +327,9 @@ class kucoinfutures(kucoin, ImplicitAPI):
325
327
  # endpoint versions
326
328
  'versions': {
327
329
  'futuresPrivate': {
330
+ 'GET': {
331
+ 'getMaxOpenSize': 'v2',
332
+ },
328
333
  'POST': {
329
334
  'transfer-out': 'v2',
330
335
  },
@@ -1158,7 +1158,7 @@ class mexc(Exchange, ImplicitAPI):
1158
1158
  # "symbols": [
1159
1159
  # {
1160
1160
  # "symbol": "OGNUSDT",
1161
- # "status": "ENABLED",
1161
+ # "status": "1",
1162
1162
  # "baseAsset": "OGN",
1163
1163
  # "baseAssetPrecision": "2",
1164
1164
  # "quoteAsset": "USDT",
@@ -1203,7 +1203,7 @@ class mexc(Exchange, ImplicitAPI):
1203
1203
  status = self.safe_string(market, 'status')
1204
1204
  isSpotTradingAllowed = self.safe_value(market, 'isSpotTradingAllowed')
1205
1205
  active = False
1206
- if (status == 'ENABLED') and (isSpotTradingAllowed):
1206
+ if (status == '1') and (isSpotTradingAllowed):
1207
1207
  active = True
1208
1208
  isMarginTradingAllowed = self.safe_value(market, 'isMarginTradingAllowed')
1209
1209
  makerCommission = self.safe_number(market, 'makerCommission')
ccxt/base/errors.py CHANGED
@@ -16,6 +16,7 @@ error_hierarchy = {
16
16
  'MarginModeAlreadySet': {},
17
17
  },
18
18
  'MarketClosed': {},
19
+ 'ManualInteractionNeeded': {},
19
20
  },
20
21
  'InsufficientFunds': {},
21
22
  'InvalidAddress': {
@@ -106,6 +107,10 @@ class MarketClosed(OperationRejected):
106
107
  pass
107
108
 
108
109
 
110
+ class ManualInteractionNeeded(OperationRejected):
111
+ pass
112
+
113
+
109
114
  class InsufficientFunds(ExchangeError):
110
115
  pass
111
116
 
@@ -221,6 +226,7 @@ __all__ = [
221
226
  'NoChange',
222
227
  'MarginModeAlreadySet',
223
228
  'MarketClosed',
229
+ 'ManualInteractionNeeded',
224
230
  'InsufficientFunds',
225
231
  'InvalidAddress',
226
232
  'AddressPending',
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.83'
7
+ __version__ = '4.3.85'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/binance.py CHANGED
@@ -10525,7 +10525,7 @@ class binance(Exchange, ImplicitAPI):
10525
10525
  extendedParams['recvWindow'] = recvWindow
10526
10526
  if (api == 'sapi') and (path == 'asset/dust'):
10527
10527
  query = self.urlencode_with_array_repeat(extendedParams)
10528
- elif (path == 'batchOrders') or (path.find('sub-account') >= 0) or (path == 'capital/withdraw/apply') or (path.find('staking') >= 0):
10528
+ elif (path == 'batchOrders') or (path.find('sub-account') >= 0) or (path == 'capital/withdraw/apply') or (path.find('staking') >= 0) or (path.find('simple-earn') >= 0):
10529
10529
  if (method == 'DELETE') and (path == 'batchOrders'):
10530
10530
  orderidlist = self.safe_list(extendedParams, 'orderidlist', [])
10531
10531
  origclientorderidlist = self.safe_list(extendedParams, 'origclientorderidlist', [])
ccxt/bitfinex2.py CHANGED
@@ -354,9 +354,9 @@ class bitfinex2(Exchange, ImplicitAPI):
354
354
  # convert 'EXCHANGE LIMIT' to lowercase 'limit'
355
355
  # everything else remains uppercase
356
356
  'exchangeTypes': {
357
- # 'MARKET': None,
357
+ 'MARKET': 'market',
358
358
  'EXCHANGE MARKET': 'market',
359
- # 'LIMIT': None,
359
+ 'LIMIT': 'limit',
360
360
  'EXCHANGE LIMIT': 'limit',
361
361
  # 'STOP': None,
362
362
  'EXCHANGE STOP': 'market',
ccxt/bitmex.py CHANGED
@@ -2307,6 +2307,8 @@ class bitmex(Exchange, ImplicitAPI):
2307
2307
  # 'otpToken': '123456', # requires if two-factor auth(OTP) is enabled
2308
2308
  # 'fee': 0.001, # bitcoin network fee
2309
2309
  }
2310
+ if self.twofa is not None:
2311
+ request['otpToken'] = self.totp(self.twofa)
2310
2312
  response = self.privatePostUserRequestWithdrawal(self.extend(request, params))
2311
2313
  #
2312
2314
  # {
ccxt/bybit.py CHANGED
@@ -15,6 +15,7 @@ from ccxt.base.errors import ArgumentsRequired
15
15
  from ccxt.base.errors import BadRequest
16
16
  from ccxt.base.errors import NoChange
17
17
  from ccxt.base.errors import MarginModeAlreadySet
18
+ from ccxt.base.errors import ManualInteractionNeeded
18
19
  from ccxt.base.errors import InsufficientFunds
19
20
  from ccxt.base.errors import InvalidOrder
20
21
  from ccxt.base.errors import OrderNotFound
@@ -767,8 +768,11 @@ class bybit(Exchange, ImplicitAPI):
767
768
  '140069': PermissionDenied, # Do not allow OTC lending users to trade
768
769
  '140070': InvalidOrder, # ETP symbols are not allowed to be traded
769
770
  '170001': ExchangeError, # Internal error.
770
- '170007': RequestTimeout, # Timeout waiting for response from backend server.
771
771
  '170005': InvalidOrder, # Too many new orders; current limit is %s orders per %s.
772
+ '170007': RequestTimeout, # Timeout waiting for response from backend server.
773
+ '170010': InvalidOrder, # Purchase failed: Exceed the maximum position limit of leveraged tokens, the current available limit is %s USDT
774
+ '170011': InvalidOrder, # "Purchase failed: Exceed the maximum position limit of innovation tokens,
775
+ '170019': InvalidOrder, # the current available limit is replaceKey0 USDT"
772
776
  '170031': ExchangeError, # The feature has been suspended
773
777
  '170032': ExchangeError, # Network error. Please try again later
774
778
  '170033': InsufficientFunds, # margin Insufficient account balance
@@ -781,6 +785,7 @@ class bybit(Exchange, ImplicitAPI):
781
785
  '170116': InvalidOrder, # Invalid orderType.
782
786
  '170117': InvalidOrder, # Invalid side.
783
787
  '170121': InvalidOrder, # Invalid symbol.
788
+ '170124': InvalidOrder, # Order amount too large.
784
789
  '170130': BadRequest, # Data sent for paramter '%s' is not valid.
785
790
  '170131': InsufficientFunds, # Balance insufficient
786
791
  '170132': InvalidOrder, # Order price too high.
@@ -791,7 +796,6 @@ class bybit(Exchange, ImplicitAPI):
791
796
  '170137': InvalidOrder, # Order volume decimal too long
792
797
  '170139': InvalidOrder, # Order has been filled.
793
798
  '170140': InvalidOrder, # Transaction amount lower than the minimum.
794
- '170124': InvalidOrder, # Order amount too large.
795
799
  '170141': InvalidOrder, # Duplicate clientOrderId
796
800
  '170142': InvalidOrder, # Order has been canceled
797
801
  '170143': InvalidOrder, # Cannot be found on order book
@@ -816,6 +820,15 @@ class bybit(Exchange, ImplicitAPI):
816
820
  '170198': InvalidOrder, # Your order quantity to sell is too large. The filled price may deviate significantly from the market price. Please try again
817
821
  '170199': InvalidOrder, # Your order quantity to buy is too large. The filled price may deviate significantly from the nav. Please try again.
818
822
  '170200': InvalidOrder, # Your order quantity to sell is too large. The filled price may deviate significantly from the nav. Please try again.
823
+ '170201': PermissionDenied, # Your account has been restricted for trades. If you have any questions, please email us at support@bybit.com
824
+ '170202': InvalidOrder, # Invalid orderFilter parameter.
825
+ '170203': InvalidOrder, # Please enter the TP/SL price.
826
+ '170204': InvalidOrder, # trigger price cannot be higher than 110% price.
827
+ '170206': InvalidOrder, # trigger price cannot be lower than 90% of qty.
828
+ '170210': InvalidOrder, # New order rejected.
829
+ '170213': OrderNotFound, # Order does not exist.
830
+ '170217': InvalidOrder, # Only LIMIT-MAKER order is supported for the current pair.
831
+ '170218': InvalidOrder, # The LIMIT-MAKER order is rejected due to invalid price.
819
832
  '170221': BadRequest, # This coin does not exist.
820
833
  '170222': RateLimitExceeded, # Too many hasattr(self, requests) time frame.
821
834
  '170223': InsufficientFunds, # Your Spot Account with Institutional Lending triggers an alert or liquidation.
@@ -825,18 +838,7 @@ class bybit(Exchange, ImplicitAPI):
825
838
  '170228': InvalidOrder, # The purchase amount of each order exceeds the estimated maximum purchase amount.
826
839
  '170229': InvalidOrder, # The sell quantity per order exceeds the estimated maximum sell quantity.
827
840
  '170234': ExchangeError, # System Error
828
- '170210': InvalidOrder, # New order rejected.
829
- '170213': OrderNotFound, # Order does not exist.
830
- '170217': InvalidOrder, # Only LIMIT-MAKER order is supported for the current pair.
831
- '170218': InvalidOrder, # The LIMIT-MAKER order is rejected due to invalid price.
832
- '170010': InvalidOrder, # Purchase failed: Exceed the maximum position limit of leveraged tokens, the current available limit is %s USDT
833
- '170011': InvalidOrder, # "Purchase failed: Exceed the maximum position limit of innovation tokens,
834
- '170019': InvalidOrder, # the current available limit is replaceKey0 USDT"
835
- '170201': PermissionDenied, # Your account has been restricted for trades. If you have any questions, please email us at support@bybit.com
836
- '170202': InvalidOrder, # Invalid orderFilter parameter.
837
- '170203': InvalidOrder, # Please enter the TP/SL price.
838
- '170204': InvalidOrder, # trigger price cannot be higher than 110% price.
839
- '170206': InvalidOrder, # trigger price cannot be lower than 90% of qty.
841
+ '170241': ManualInteractionNeeded, # To proceed with trading, users must read through and confirm that they fully understand the project's risk disclosure document.
840
842
  '175000': InvalidOrder, # The serialNum is already in use.
841
843
  '175001': InvalidOrder, # Daily purchase limit has been exceeded. Please try again later.
842
844
  '175002': InvalidOrder, # There's a large number of purchase orders. Please try again later.