ccxt 4.3.95__py2.py3-none-any.whl → 4.3.96__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.95'
25
+ __version__ = '4.3.96'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -95,7 +95,6 @@ from ccxt.binanceusdm import binanceusdm # noqa: F4
95
95
  from ccxt.bingx import bingx # noqa: F401
96
96
  from ccxt.bit2c import bit2c # noqa: F401
97
97
  from ccxt.bitbank import bitbank # noqa: F401
98
- from ccxt.bitbay import bitbay # noqa: F401
99
98
  from ccxt.bitbns import bitbns # noqa: F401
100
99
  from ccxt.bitcoincom import bitcoincom # noqa: F401
101
100
  from ccxt.bitfinex import bitfinex # noqa: F401
@@ -145,7 +144,6 @@ from ccxt.gateio import gateio # noqa: F4
145
144
  from ccxt.gemini import gemini # noqa: F401
146
145
  from ccxt.hashkey import hashkey # noqa: F401
147
146
  from ccxt.hitbtc import hitbtc # noqa: F401
148
- from ccxt.hitbtc3 import hitbtc3 # noqa: F401
149
147
  from ccxt.hollaex import hollaex # noqa: F401
150
148
  from ccxt.htx import htx # noqa: F401
151
149
  from ccxt.huobi import huobi # noqa: F401
@@ -207,7 +205,6 @@ exchanges = [
207
205
  'bingx',
208
206
  'bit2c',
209
207
  'bitbank',
210
- 'bitbay',
211
208
  'bitbns',
212
209
  'bitcoincom',
213
210
  'bitfinex',
@@ -257,7 +254,6 @@ exchanges = [
257
254
  'gemini',
258
255
  'hashkey',
259
256
  'hitbtc',
260
- 'hitbtc3',
261
257
  'hollaex',
262
258
  'htx',
263
259
  'huobi',
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.95'
7
+ __version__ = '4.3.96'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -75,7 +75,6 @@ from ccxt.async_support.binanceusdm import binanceusdm
75
75
  from ccxt.async_support.bingx import bingx # noqa: F401
76
76
  from ccxt.async_support.bit2c import bit2c # noqa: F401
77
77
  from ccxt.async_support.bitbank import bitbank # noqa: F401
78
- from ccxt.async_support.bitbay import bitbay # noqa: F401
79
78
  from ccxt.async_support.bitbns import bitbns # noqa: F401
80
79
  from ccxt.async_support.bitcoincom import bitcoincom # noqa: F401
81
80
  from ccxt.async_support.bitfinex import bitfinex # noqa: F401
@@ -125,7 +124,6 @@ from ccxt.async_support.gateio import gateio
125
124
  from ccxt.async_support.gemini import gemini # noqa: F401
126
125
  from ccxt.async_support.hashkey import hashkey # noqa: F401
127
126
  from ccxt.async_support.hitbtc import hitbtc # noqa: F401
128
- from ccxt.async_support.hitbtc3 import hitbtc3 # noqa: F401
129
127
  from ccxt.async_support.hollaex import hollaex # noqa: F401
130
128
  from ccxt.async_support.htx import htx # noqa: F401
131
129
  from ccxt.async_support.huobi import huobi # noqa: F401
@@ -187,7 +185,6 @@ exchanges = [
187
185
  'bingx',
188
186
  'bit2c',
189
187
  'bitbank',
190
- 'bitbay',
191
188
  'bitbns',
192
189
  'bitcoincom',
193
190
  'bitfinex',
@@ -237,7 +234,6 @@ exchanges = [
237
234
  'gemini',
238
235
  'hashkey',
239
236
  'hitbtc',
240
- 'hitbtc3',
241
237
  'hollaex',
242
238
  'htx',
243
239
  'huobi',
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.95'
5
+ __version__ = '4.3.96'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -875,9 +875,6 @@ class Exchange(BaseExchange):
875
875
  await self.cancel_order_ws(id, symbol)
876
876
  return await self.create_order_ws(symbol, type, side, amount, price, params)
877
877
 
878
- async def fetch_permissions(self, params={}):
879
- raise NotSupported(self.id + ' fetchPermissions() is not supported yet')
880
-
881
878
  async def fetch_position(self, symbol: str, params={}):
882
879
  raise NotSupported(self.id + ' fetchPosition() is not supported yet')
883
880
 
@@ -480,6 +480,7 @@ class bingx(Exchange, ImplicitAPI):
480
480
  },
481
481
  'commonCurrencies': {
482
482
  'SNOW': 'Snowman', # Snowman vs SnowSwap conflict
483
+ 'OMNI': 'OmniCat',
483
484
  },
484
485
  'options': {
485
486
  'defaultType': 'spot',
@@ -109,7 +109,6 @@ class blofin(Exchange, ImplicitAPI):
109
109
  'fetchOrderBooks': False,
110
110
  'fetchOrders': False,
111
111
  'fetchOrderTrades': True,
112
- 'fetchPermissions': None,
113
112
  'fetchPosition': True,
114
113
  'fetchPositions': True,
115
114
  'fetchPositionsForSymbol': False,
@@ -5503,11 +5503,16 @@ class bybit(Exchange, ImplicitAPI):
5503
5503
  :param str code: unified currency code, default is None
5504
5504
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
5505
5505
  :param int [limit]: max number of ledger entrys to return, default is None
5506
- :param dict [params]: extra parameters specific to the exchange API endpoint
5506
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
5507
5507
  :param str [params.subType]: if inverse will use v5/account/contract-transaction-log
5508
+ :param dict [params]: extra parameters specific to the exchange API endpoint
5508
5509
  :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
5509
5510
  """
5510
5511
  await self.load_markets()
5512
+ paginate = False
5513
+ paginate, params = self.handle_option_and_params(params, 'fetchLedger', 'paginate')
5514
+ if paginate:
5515
+ return await self.fetch_paginated_call_cursor('fetchLedger', code, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
5511
5516
  request: dict = {
5512
5517
  # 'coin': currency['id'],
5513
5518
  # 'currency': currency['id'], # alias
@@ -5551,7 +5556,7 @@ class bybit(Exchange, ImplicitAPI):
5551
5556
  else:
5552
5557
  response = await self.privateGetV5AccountTransactionLog(self.extend(request, params))
5553
5558
  else:
5554
- response = await self.privateGetV2PrivateWalletFundRecords(self.extend(request, params))
5559
+ response = await self.privateGetV5AccountContractTransactionLog(self.extend(request, params))
5555
5560
  #
5556
5561
  # {
5557
5562
  # "ret_code": 0,
@@ -70,7 +70,7 @@ class hyperliquid(Exchange, ImplicitAPI):
70
70
  'fetchCurrencies': True,
71
71
  'fetchDepositAddress': False,
72
72
  'fetchDepositAddresses': False,
73
- 'fetchDeposits': False,
73
+ 'fetchDeposits': True,
74
74
  'fetchDepositWithdrawFee': 'emulated',
75
75
  'fetchDepositWithdrawFees': False,
76
76
  'fetchFundingHistory': False,
@@ -80,7 +80,7 @@ class hyperliquid(Exchange, ImplicitAPI):
80
80
  'fetchIndexOHLCV': False,
81
81
  'fetchIsolatedBorrowRate': False,
82
82
  'fetchIsolatedBorrowRates': False,
83
- 'fetchLedger': False,
83
+ 'fetchLedger': True,
84
84
  'fetchLeverage': False,
85
85
  'fetchLeverageTiers': False,
86
86
  'fetchLiquidations': False,
@@ -112,7 +112,7 @@ class hyperliquid(Exchange, ImplicitAPI):
112
112
  'fetchTransfer': False,
113
113
  'fetchTransfers': False,
114
114
  'fetchWithdrawal': False,
115
- 'fetchWithdrawals': False,
115
+ 'fetchWithdrawals': True,
116
116
  'reduceMargin': True,
117
117
  'repayCrossMargin': False,
118
118
  'repayIsolatedMargin': False,
@@ -1883,10 +1883,7 @@ class hyperliquid(Exchange, ImplicitAPI):
1883
1883
  coin = self.safe_string(entry, 'coin')
1884
1884
  marketId = None
1885
1885
  if coin is not None:
1886
- if coin.find('/') > -1:
1887
- marketId = coin
1888
- else:
1889
- marketId = coin + '/USDC:USDC'
1886
+ marketId = self.coin_to_market_id(coin)
1890
1887
  if self.safe_string(entry, 'id') is None:
1891
1888
  market = self.safe_market(marketId, None)
1892
1889
  else:
@@ -2014,7 +2011,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2014
2011
  price = self.safe_string(trade, 'px')
2015
2012
  amount = self.safe_string(trade, 'sz')
2016
2013
  coin = self.safe_string(trade, 'coin')
2017
- marketId = coin + '/USDC:USDC'
2014
+ marketId = self.coin_to_market_id(coin)
2018
2015
  market = self.safe_market(marketId, None)
2019
2016
  symbol = market['symbol']
2020
2017
  id = self.safe_string(trade, 'tid')
@@ -2148,7 +2145,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2148
2145
  #
2149
2146
  entry = self.safe_dict(position, 'position', {})
2150
2147
  coin = self.safe_string(entry, 'coin')
2151
- marketId = coin + '/USDC:USDC'
2148
+ marketId = self.coin_to_market_id(coin)
2152
2149
  market = self.safe_market(marketId, None)
2153
2150
  symbol = market['symbol']
2154
2151
  leverage = self.safe_dict(entry, 'leverage', {})
@@ -2434,11 +2431,13 @@ class hyperliquid(Exchange, ImplicitAPI):
2434
2431
  """
2435
2432
  make a withdrawal(only support USDC)
2436
2433
  :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
2434
+ :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
2437
2435
  :param str code: unified currency code
2438
2436
  :param float amount: the amount to withdraw
2439
2437
  :param str address: the address to withdraw to
2440
2438
  :param str tag:
2441
2439
  :param dict [params]: extra parameters specific to the exchange API endpoint
2440
+ :param str [params.vaultAddress]: vault address withdraw from
2442
2441
  :returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
2443
2442
  """
2444
2443
  self.check_required_credentials()
@@ -2448,24 +2447,38 @@ class hyperliquid(Exchange, ImplicitAPI):
2448
2447
  code = code.upper()
2449
2448
  if code != 'USDC':
2450
2449
  raise NotSupported(self.id + 'withdraw() only support USDC')
2451
- isSandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
2450
+ vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
2451
+ params = self.omit(params, 'vaultAddress')
2452
2452
  nonce = self.milliseconds()
2453
- payload: dict = {
2454
- 'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
2455
- 'destination': address,
2456
- 'amount': str(amount),
2457
- 'time': nonce,
2458
- }
2459
- sig = self.build_withdraw_sig(payload)
2460
- request: dict = {
2461
- 'action': {
2453
+ action: dict = {}
2454
+ sig = None
2455
+ if vaultAddress is not None:
2456
+ action = {
2457
+ 'type': 'vaultTransfer',
2458
+ 'vaultAddress': '0x' + vaultAddress,
2459
+ 'isDeposit': False,
2460
+ 'usd': amount,
2461
+ }
2462
+ sig = self.sign_l1_action(action, nonce)
2463
+ else:
2464
+ isSandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
2465
+ payload: dict = {
2466
+ 'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
2467
+ 'destination': address,
2468
+ 'amount': str(amount),
2469
+ 'time': nonce,
2470
+ }
2471
+ sig = self.build_withdraw_sig(payload)
2472
+ action = {
2462
2473
  'hyperliquidChain': payload['hyperliquidChain'],
2463
2474
  'signatureChainId': '0x66eee', # check self out
2464
2475
  'destination': address,
2465
2476
  'amount': str(amount),
2466
2477
  'time': nonce,
2467
2478
  'type': 'withdraw3',
2468
- },
2479
+ }
2480
+ request: dict = {
2481
+ 'action': action,
2469
2482
  'nonce': nonce,
2470
2483
  'signature': sig,
2471
2484
  }
@@ -2476,27 +2489,51 @@ class hyperliquid(Exchange, ImplicitAPI):
2476
2489
  #
2477
2490
  # {status: 'ok', response: {type: 'default'}}
2478
2491
  #
2492
+ # fetchDeposits / fetchWithdrawals
2493
+ # {
2494
+ # "time":1724762307531,
2495
+ # "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
2496
+ # "delta":{
2497
+ # "type":"accountClassTransfer",
2498
+ # "usdc":"50.0",
2499
+ # "toPerp":false
2500
+ # }
2501
+ # }
2502
+ #
2503
+ timestamp = self.safe_integer(transaction, 'time')
2504
+ delta = self.safe_dict(transaction, 'delta', {})
2505
+ fee = None
2506
+ feeCost = self.safe_integer(delta, 'fee')
2507
+ if feeCost is not None:
2508
+ fee = {
2509
+ 'currency': 'USDC',
2510
+ 'cost': feeCost,
2511
+ }
2512
+ internal = None
2513
+ type = self.safe_string(delta, 'type')
2514
+ if type is not None:
2515
+ internal = (type == 'internalTransfer')
2479
2516
  return {
2480
2517
  'info': transaction,
2481
2518
  'id': None,
2482
- 'txid': None,
2483
- 'timestamp': None,
2484
- 'datetime': None,
2519
+ 'txid': self.safe_string(transaction, 'hash'),
2520
+ 'timestamp': timestamp,
2521
+ 'datetime': self.iso8601(timestamp),
2485
2522
  'network': None,
2486
2523
  'address': None,
2487
- 'addressTo': None,
2488
- 'addressFrom': None,
2524
+ 'addressTo': self.safe_string(delta, 'destination'),
2525
+ 'addressFrom': self.safe_string(delta, 'user'),
2489
2526
  'tag': None,
2490
2527
  'tagTo': None,
2491
2528
  'tagFrom': None,
2492
2529
  'type': None,
2493
- 'amount': None,
2530
+ 'amount': self.safe_integer(delta, 'usdc'),
2494
2531
  'currency': None,
2495
2532
  'status': self.safe_string(transaction, 'status'),
2496
2533
  'updated': None,
2497
2534
  'comment': None,
2498
- 'internal': None,
2499
- 'fee': None,
2535
+ 'internal': internal,
2536
+ 'fee': fee,
2500
2537
  }
2501
2538
 
2502
2539
  async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
@@ -2603,6 +2640,183 @@ class hyperliquid(Exchange, ImplicitAPI):
2603
2640
  'tierBased': None,
2604
2641
  }
2605
2642
 
2643
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
2644
+ """
2645
+ fetch the history of changes, actions done by the user or operations that altered the balance of the user
2646
+ :param str code: unified currency code
2647
+ :param int [since]: timestamp in ms of the earliest ledger entry
2648
+ :param int [limit]: max number of ledger entrys to return
2649
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2650
+ :param int [params.until]: timestamp in ms of the latest ledger entry
2651
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
2652
+ """
2653
+ await self.load_markets()
2654
+ userAddress = None
2655
+ userAddress, params = self.handle_public_address('fetchLedger', params)
2656
+ request: dict = {
2657
+ 'type': 'userNonFundingLedgerUpdates',
2658
+ 'user': userAddress,
2659
+ }
2660
+ if since is not None:
2661
+ request['startTime'] = since
2662
+ until = self.safe_integer(params, 'until')
2663
+ if until is not None:
2664
+ request['endTime'] = until
2665
+ params = self.omit(params, ['until'])
2666
+ response = await self.publicPostInfo(self.extend(request, params))
2667
+ #
2668
+ # [
2669
+ # {
2670
+ # "time":1724762307531,
2671
+ # "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
2672
+ # "delta":{
2673
+ # "type":"accountClassTransfer",
2674
+ # "usdc":"50.0",
2675
+ # "toPerp":false
2676
+ # }
2677
+ # }
2678
+ # ]
2679
+ #
2680
+ return self.parse_ledger(response, None, since, limit)
2681
+
2682
+ def parse_ledger_entry(self, item: dict, currency: Currency = None):
2683
+ #
2684
+ # {
2685
+ # "time":1724762307531,
2686
+ # "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
2687
+ # "delta":{
2688
+ # "type":"accountClassTransfer",
2689
+ # "usdc":"50.0",
2690
+ # "toPerp":false
2691
+ # }
2692
+ # }
2693
+ #
2694
+ timestamp = self.safe_integer(item, 'time')
2695
+ delta = self.safe_dict(item, 'delta', {})
2696
+ fee = None
2697
+ feeCost = self.safe_integer(delta, 'fee')
2698
+ if feeCost is not None:
2699
+ fee = {
2700
+ 'currency': 'USDC',
2701
+ 'cost': feeCost,
2702
+ }
2703
+ type = self.safe_string(delta, 'type')
2704
+ amount = self.safe_string(delta, 'usdc')
2705
+ return {
2706
+ 'id': self.safe_string(item, 'hash'),
2707
+ 'direction': None,
2708
+ 'account': None,
2709
+ 'referenceAccount': self.safe_string(delta, 'user'),
2710
+ 'referenceId': self.safe_string(item, 'hash'),
2711
+ 'type': self.parse_ledger_entry_type(type),
2712
+ 'currency': None,
2713
+ 'amount': self.parse_number(amount),
2714
+ 'timestamp': timestamp,
2715
+ 'datetime': self.iso8601(timestamp),
2716
+ 'before': None,
2717
+ 'after': None,
2718
+ 'status': None,
2719
+ 'fee': fee,
2720
+ 'info': item,
2721
+ }
2722
+
2723
+ def parse_ledger_entry_type(self, type):
2724
+ ledgerType: dict = {
2725
+ 'internalTransfer': 'transfer',
2726
+ 'accountClassTransfer': 'transfer',
2727
+ }
2728
+ return self.safe_string(ledgerType, type, type)
2729
+
2730
+ async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
2731
+ """
2732
+ fetch all deposits made to an account
2733
+ :param str code: unified currency code
2734
+ :param int [since]: the earliest time in ms to fetch deposits for
2735
+ :param int [limit]: the maximum number of deposits structures to retrieve
2736
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2737
+ :param int [params.until]: the latest time in ms to fetch withdrawals for
2738
+ :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
2739
+ """
2740
+ await self.load_markets()
2741
+ userAddress = None
2742
+ userAddress, params = self.handle_public_address('fetchDepositsWithdrawals', params)
2743
+ request: dict = {
2744
+ 'type': 'userNonFundingLedgerUpdates',
2745
+ 'user': userAddress,
2746
+ }
2747
+ if since is not None:
2748
+ request['startTime'] = since
2749
+ until = self.safe_integer(params, 'until')
2750
+ if until is not None:
2751
+ request['endTime'] = until
2752
+ params = self.omit(params, ['until'])
2753
+ response = await self.publicPostInfo(self.extend(request, params))
2754
+ #
2755
+ # [
2756
+ # {
2757
+ # "time":1724762307531,
2758
+ # "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
2759
+ # "delta":{
2760
+ # "type":"accountClassTransfer",
2761
+ # "usdc":"50.0",
2762
+ # "toPerp":false
2763
+ # }
2764
+ # }
2765
+ # ]
2766
+ #
2767
+ records = self.extract_type_from_delta(response)
2768
+ deposits = self.filter_by_array(records, 'type', ['deposit'], False)
2769
+ return self.parse_transactions(deposits, None, since, limit)
2770
+
2771
+ async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
2772
+ """
2773
+ fetch all withdrawals made from an account
2774
+ :param str code: unified currency code
2775
+ :param int [since]: the earliest time in ms to fetch withdrawals for
2776
+ :param int [limit]: the maximum number of withdrawals structures to retrieve
2777
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2778
+ :param int [params.until]: the latest time in ms to fetch withdrawals for
2779
+ :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
2780
+ """
2781
+ await self.load_markets()
2782
+ userAddress = None
2783
+ userAddress, params = self.handle_public_address('fetchDepositsWithdrawals', params)
2784
+ request: dict = {
2785
+ 'type': 'userNonFundingLedgerUpdates',
2786
+ 'user': userAddress,
2787
+ }
2788
+ if since is not None:
2789
+ request['startTime'] = since
2790
+ until = self.safe_integer(params, 'until')
2791
+ if until is not None:
2792
+ request['endTime'] = until
2793
+ params = self.omit(params, ['until'])
2794
+ response = await self.publicPostInfo(self.extend(request, params))
2795
+ #
2796
+ # [
2797
+ # {
2798
+ # "time":1724762307531,
2799
+ # "hash":"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781",
2800
+ # "delta":{
2801
+ # "type":"accountClassTransfer",
2802
+ # "usdc":"50.0",
2803
+ # "toPerp":false
2804
+ # }
2805
+ # }
2806
+ # ]
2807
+ #
2808
+ records = self.extract_type_from_delta(response)
2809
+ withdrawals = self.filter_by_array(records, 'type', ['withdraw'], False)
2810
+ return self.parse_transactions(withdrawals, None, since, limit)
2811
+
2812
+ def extract_type_from_delta(self, data=[]):
2813
+ records = []
2814
+ for i in range(0, len(data)):
2815
+ record = data[i]
2816
+ record['type'] = record['delta']['type']
2817
+ records.append(record)
2818
+ return records
2819
+
2606
2820
  def format_vault_address(self, address: Str = None):
2607
2821
  if address is None:
2608
2822
  return None
@@ -2622,7 +2836,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2622
2836
  raise ArgumentsRequired(self.id + ' ' + methodName + '() requires a user parameter inside \'params\' or the wallet address set')
2623
2837
 
2624
2838
  def coin_to_market_id(self, coin: Str):
2625
- if coin.find('/') > -1:
2839
+ if coin.find('/') > -1 or coin.find('@') > -1:
2626
2840
  return coin # spot
2627
2841
  return coin + '/USDC:USDC'
2628
2842
 
@@ -645,6 +645,7 @@ class kucoin(Exchange, ImplicitAPI):
645
645
  'KALT': 'ALT', # ALTLAYER
646
646
  },
647
647
  'options': {
648
+ 'hf': False,
648
649
  'version': 'v1',
649
650
  'symbolSeparator': '-',
650
651
  'fetchMyTradesMethod': 'private_get_fills',
@@ -1228,9 +1229,8 @@ class kucoin(Exchange, ImplicitAPI):
1228
1229
  status: Int = self.safe_integer(data, 'status')
1229
1230
  self.options['hfMigrated'] = (status == 2)
1230
1231
 
1231
- async def handle_hf_and_params(self, params={}):
1232
- await self.load_migration_status()
1233
- migrated: Bool = self.safe_bool(self.options, 'hfMigrated')
1232
+ def handle_hf_and_params(self, params={}):
1233
+ migrated: Bool = self.safe_bool_2(self.options, 'hfMigrated', 'hf', False)
1234
1234
  loadedHf: Bool = None
1235
1235
  if migrated is not None:
1236
1236
  if migrated:
@@ -2068,7 +2068,7 @@ class kucoin(Exchange, ImplicitAPI):
2068
2068
  testOrder = self.safe_bool(params, 'test', False)
2069
2069
  params = self.omit(params, 'test')
2070
2070
  hf = None
2071
- hf, params = await self.handle_hf_and_params(params)
2071
+ hf, params = self.handle_hf_and_params(params)
2072
2072
  useSync = False
2073
2073
  useSync, params = self.handle_option_and_params(params, 'createOrder', 'sync', False)
2074
2074
  triggerPrice, stopLossPrice, takeProfitPrice = self.handle_trigger_prices(params)
@@ -2184,7 +2184,7 @@ class kucoin(Exchange, ImplicitAPI):
2184
2184
  'orderList': ordersRequests,
2185
2185
  }
2186
2186
  hf = None
2187
- hf, params = await self.handle_hf_and_params(params)
2187
+ hf, params = self.handle_hf_and_params(params)
2188
2188
  useSync = False
2189
2189
  useSync, params = self.handle_option_and_params(params, 'createOrders', 'sync', False)
2190
2190
  response = None
@@ -2356,7 +2356,7 @@ class kucoin(Exchange, ImplicitAPI):
2356
2356
  clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
2357
2357
  stop = self.safe_bool_2(params, 'stop', 'trigger', False)
2358
2358
  hf = None
2359
- hf, params = await self.handle_hf_and_params(params)
2359
+ hf, params = self.handle_hf_and_params(params)
2360
2360
  useSync = False
2361
2361
  useSync, params = self.handle_option_and_params(params, 'cancelOrder', 'sync', False)
2362
2362
  if hf or useSync:
@@ -2464,7 +2464,7 @@ class kucoin(Exchange, ImplicitAPI):
2464
2464
  request: dict = {}
2465
2465
  stop = self.safe_bool(params, 'stop', False)
2466
2466
  hf = None
2467
- hf, params = await self.handle_hf_and_params(params)
2467
+ hf, params = self.handle_hf_and_params(params)
2468
2468
  params = self.omit(params, 'stop')
2469
2469
  marginMode, query = self.handle_margin_mode_and_params('cancelAllOrders', params)
2470
2470
  if symbol is not None:
@@ -2513,7 +2513,7 @@ class kucoin(Exchange, ImplicitAPI):
2513
2513
  until = self.safe_integer(params, 'until')
2514
2514
  stop = self.safe_bool_2(params, 'stop', 'trigger', False)
2515
2515
  hf = None
2516
- hf, params = await self.handle_hf_and_params(params)
2516
+ hf, params = self.handle_hf_and_params(params)
2517
2517
  if hf and (symbol is None):
2518
2518
  raise ArgumentsRequired(self.id + ' fetchOrdersByStatus() requires a symbol parameter for hf orders')
2519
2519
  params = self.omit(params, ['stop', 'trigger', 'till', 'until'])
@@ -2675,7 +2675,7 @@ class kucoin(Exchange, ImplicitAPI):
2675
2675
  clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
2676
2676
  stop = self.safe_bool_2(params, 'stop', 'trigger', False)
2677
2677
  hf = None
2678
- hf, params = await self.handle_hf_and_params(params)
2678
+ hf, params = self.handle_hf_and_params(params)
2679
2679
  market = None
2680
2680
  if symbol is not None:
2681
2681
  market = self.market(symbol)
@@ -2926,7 +2926,7 @@ class kucoin(Exchange, ImplicitAPI):
2926
2926
  return await self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params)
2927
2927
  request: dict = {}
2928
2928
  hf = None
2929
- hf, params = await self.handle_hf_and_params(params)
2929
+ hf, params = self.handle_hf_and_params(params)
2930
2930
  if hf and symbol is None:
2931
2931
  raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol parameter for hf orders')
2932
2932
  market = None
@@ -3601,7 +3601,7 @@ class kucoin(Exchange, ImplicitAPI):
3601
3601
  type = self.safe_string(accountsByType, requestedType, requestedType)
3602
3602
  params = self.omit(params, 'type')
3603
3603
  hf = None
3604
- hf, params = await self.handle_hf_and_params(params)
3604
+ hf, params = self.handle_hf_and_params(params)
3605
3605
  if hf:
3606
3606
  type = 'trade_hf'
3607
3607
  marginMode, query = self.handle_margin_mode_and_params('fetchBalance', params)
@@ -4030,7 +4030,7 @@ class kucoin(Exchange, ImplicitAPI):
4030
4030
  paginate = False
4031
4031
  paginate, params = self.handle_option_and_params(params, 'fetchLedger', 'paginate')
4032
4032
  hf = None
4033
- hf, params = await self.handle_hf_and_params(params)
4033
+ hf, params = self.handle_hf_and_params(params)
4034
4034
  if paginate:
4035
4035
  return await self.fetch_paginated_call_dynamic('fetchLedger', code, since, limit, params)
4036
4036
  request: dict = {
@@ -809,6 +809,8 @@ class mexc(Exchange, ImplicitAPI):
809
809
  async def fetch_status(self, params={}):
810
810
  """
811
811
  the latest known information on the availability of the exchange API
812
+ :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity
813
+ :see: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
812
814
  :param dict [params]: extra parameters specific to the exchange API endpoint
813
815
  :returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
814
816
  """
@@ -842,6 +844,8 @@ class mexc(Exchange, ImplicitAPI):
842
844
  async def fetch_time(self, params={}):
843
845
  """
844
846
  fetches the current integer timestamp in milliseconds from the exchange server
847
+ :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#check-server-time
848
+ :see: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
845
849
  :param dict [params]: extra parameters specific to the exchange API endpoint
846
850
  :returns int: the current integer timestamp in milliseconds from the exchange server
847
851
  """
@@ -998,6 +1002,8 @@ class mexc(Exchange, ImplicitAPI):
998
1002
  async def fetch_markets(self, params={}) -> List[Market]:
999
1003
  """
1000
1004
  retrieves data on all markets for mexc
1005
+ :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
1006
+ :see: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
1001
1007
  :param dict [params]: extra parameters specific to the exchange API endpoint
1002
1008
  :returns dict[]: an array of objects representing market data
1003
1009
  """
ccxt/async_support/okx.py CHANGED
@@ -134,7 +134,6 @@ class okx(Exchange, ImplicitAPI):
134
134
  'fetchOrderBooks': False,
135
135
  'fetchOrders': False,
136
136
  'fetchOrderTrades': True,
137
- 'fetchPermissions': None,
138
137
  'fetchPosition': True,
139
138
  'fetchPositionHistory': 'emulated',
140
139
  'fetchPositions': True,
ccxt/async_support/p2b.py CHANGED
@@ -83,7 +83,6 @@ class p2b(Exchange, ImplicitAPI):
83
83
  'fetchOrderBooks': False,
84
84
  'fetchOrders': True,
85
85
  'fetchOrderTrades': True,
86
- 'fetchPermissions': False,
87
86
  'fetchPosition': False,
88
87
  'fetchPositionHistory': False,
89
88
  'fetchPositionMode': False,