ccxt 4.3.44__py2.py3-none-any.whl → 4.3.46__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.
Files changed (56) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/binance.py +2 -0
  3. ccxt/abstract/binancecoinm.py +2 -0
  4. ccxt/abstract/binanceus.py +2 -0
  5. ccxt/abstract/binanceusdm.py +2 -0
  6. ccxt/abstract/bitstamp.py +18 -2
  7. ccxt/abstract/kucoin.py +14 -0
  8. ccxt/abstract/kucoinfutures.py +14 -0
  9. ccxt/abstract/mexc.py +2 -0
  10. ccxt/abstract/oxfun.py +34 -0
  11. ccxt/async_support/__init__.py +3 -1
  12. ccxt/async_support/base/exchange.py +1 -1
  13. ccxt/async_support/binance.py +2 -0
  14. ccxt/async_support/bingx.py +26 -18
  15. ccxt/async_support/bitmart.py +4 -0
  16. ccxt/async_support/bitstamp.py +18 -2
  17. ccxt/async_support/bitteam.py +6 -8
  18. ccxt/async_support/coinmetro.py +9 -18
  19. ccxt/async_support/hyperliquid.py +31 -23
  20. ccxt/async_support/idex.py +1 -0
  21. ccxt/async_support/kucoin.py +27 -1
  22. ccxt/async_support/luno.py +9 -1
  23. ccxt/async_support/mexc.py +8 -6
  24. ccxt/async_support/okx.py +1 -0
  25. ccxt/async_support/oxfun.py +2773 -0
  26. ccxt/async_support/tokocrypto.py +9 -11
  27. ccxt/async_support/wavesexchange.py +119 -105
  28. ccxt/async_support/woofipro.py +1 -0
  29. ccxt/async_support/xt.py +1 -1
  30. ccxt/base/exchange.py +1 -1
  31. ccxt/binance.py +2 -0
  32. ccxt/bingx.py +26 -18
  33. ccxt/bitmart.py +4 -0
  34. ccxt/bitstamp.py +18 -2
  35. ccxt/bitteam.py +6 -8
  36. ccxt/coinmetro.py +9 -18
  37. ccxt/hyperliquid.py +31 -23
  38. ccxt/idex.py +1 -0
  39. ccxt/kucoin.py +27 -1
  40. ccxt/luno.py +9 -1
  41. ccxt/mexc.py +8 -6
  42. ccxt/okx.py +1 -0
  43. ccxt/oxfun.py +2772 -0
  44. ccxt/pro/__init__.py +3 -1
  45. ccxt/pro/binanceus.py +0 -8
  46. ccxt/pro/oxfun.py +950 -0
  47. ccxt/test/test_async.py +17 -1
  48. ccxt/test/test_sync.py +17 -1
  49. ccxt/tokocrypto.py +9 -11
  50. ccxt/wavesexchange.py +119 -105
  51. ccxt/woofipro.py +1 -0
  52. ccxt/xt.py +1 -1
  53. {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/METADATA +131 -131
  54. {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/RECORD +56 -52
  55. {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/WHEEL +0 -0
  56. {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.hyperliquid import ImplicitAPI
8
8
  import asyncio
9
- from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -32,6 +32,7 @@ class hyperliquid(Exchange, ImplicitAPI):
32
32
  'rateLimit': 50, # 1200 requests per minute, 20 request per second
33
33
  'certified': False,
34
34
  'pro': True,
35
+ 'dex': True,
35
36
  'has': {
36
37
  'CORS': None,
37
38
  'spot': True,
@@ -949,11 +950,12 @@ class hyperliquid(Exchange, ImplicitAPI):
949
950
  signature = self.sign_message(msg, self.privateKey)
950
951
  return signature
951
952
 
952
- def build_sig(self, chainId, messageTypes, message):
953
+ def sign_user_signed_action(self, messageTypes, message):
953
954
  zeroAddress = self.safe_string(self.options, 'zeroAddress')
955
+ chainId = 421614 # check self out
954
956
  domain: dict = {
955
957
  'chainId': chainId,
956
- 'name': 'Exchange',
958
+ 'name': 'HyperliquidSignTransaction',
957
959
  'verifyingContract': zeroAddress,
958
960
  'version': '1',
959
961
  }
@@ -962,28 +964,26 @@ class hyperliquid(Exchange, ImplicitAPI):
962
964
  return signature
963
965
 
964
966
  def build_transfer_sig(self, message):
965
- isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
966
- chainId = 421614 if (isSandboxMode) else 42161
967
967
  messageTypes: dict = {
968
- 'UsdTransferSignPayload': [
968
+ 'HyperliquidTransaction:UsdSend': [
969
+ {'name': 'hyperliquidChain', 'type': 'string'},
969
970
  {'name': 'destination', 'type': 'string'},
970
971
  {'name': 'amount', 'type': 'string'},
971
972
  {'name': 'time', 'type': 'uint64'},
972
973
  ],
973
974
  }
974
- return self.build_sig(chainId, messageTypes, message)
975
+ return self.sign_user_signed_action(messageTypes, message)
975
976
 
976
977
  def build_withdraw_sig(self, message):
977
- isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
978
- chainId = 421614 if (isSandboxMode) else 42161
979
978
  messageTypes: dict = {
980
- 'WithdrawFromBridge2SignPayload': [
979
+ 'HyperliquidTransaction:Withdraw': [
980
+ {'name': 'hyperliquidChain', 'type': 'string'},
981
981
  {'name': 'destination', 'type': 'string'},
982
- {'name': 'usd', 'type': 'string'},
982
+ {'name': 'amount', 'type': 'string'},
983
983
  {'name': 'time', 'type': 'uint64'},
984
984
  ],
985
985
  }
986
- return self.build_sig(chainId, messageTypes, message)
986
+ return self.sign_user_signed_action(messageTypes, message)
987
987
 
988
988
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
989
989
  """
@@ -2277,8 +2277,9 @@ class hyperliquid(Exchange, ImplicitAPI):
2277
2277
  if code is not None:
2278
2278
  code = code.upper()
2279
2279
  if code != 'USDC':
2280
- raise NotSupported(self.id + 'withdraw() only support USDC')
2280
+ raise NotSupported(self.id + 'transfer() only support USDC')
2281
2281
  payload: dict = {
2282
+ 'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
2282
2283
  'destination': toAccount,
2283
2284
  'amount': self.number_to_string(amount),
2284
2285
  'time': nonce,
@@ -2286,9 +2287,12 @@ class hyperliquid(Exchange, ImplicitAPI):
2286
2287
  sig = self.build_transfer_sig(payload)
2287
2288
  request: dict = {
2288
2289
  'action': {
2289
- 'chain': 'ArbitrumTestnet' if (isSandboxMode) else 'Arbitrum',
2290
- 'payload': payload,
2291
- 'type': 'usdTransfer',
2290
+ 'hyperliquidChain': payload['hyperliquidChain'],
2291
+ 'signatureChainId': '0x66eee', # check self out
2292
+ 'destination': toAccount,
2293
+ 'amount': str(amount),
2294
+ 'time': nonce,
2295
+ 'type': 'usdSend',
2292
2296
  },
2293
2297
  'nonce': nonce,
2294
2298
  'signature': sig,
@@ -2296,7 +2300,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2296
2300
  response = await self.privatePostExchange(self.extend(request, params))
2297
2301
  return response
2298
2302
 
2299
- async def withdraw(self, code: str, amount, address, tag=None, params={}):
2303
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2300
2304
  """
2301
2305
  make a withdrawal(only support USDC)
2302
2306
  :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
@@ -2314,25 +2318,29 @@ class hyperliquid(Exchange, ImplicitAPI):
2314
2318
  code = code.upper()
2315
2319
  if code != 'USDC':
2316
2320
  raise NotSupported(self.id + 'withdraw() only support USDC')
2317
- isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
2321
+ isSandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
2318
2322
  nonce = self.milliseconds()
2319
2323
  payload: dict = {
2324
+ 'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
2320
2325
  'destination': address,
2321
- 'usd': str(amount),
2326
+ 'amount': str(amount),
2322
2327
  'time': nonce,
2323
2328
  }
2324
2329
  sig = self.build_withdraw_sig(payload)
2325
2330
  request: dict = {
2326
2331
  'action': {
2327
- 'chain': 'ArbitrumTestnet' if (isSandboxMode) else 'Arbitrum',
2328
- 'payload': payload,
2329
- 'type': 'withdraw2',
2332
+ 'hyperliquidChain': payload['hyperliquidChain'],
2333
+ 'signatureChainId': '0x66eee', # check self out
2334
+ 'destination': address,
2335
+ 'amount': str(amount),
2336
+ 'time': nonce,
2337
+ 'type': 'withdraw3',
2330
2338
  },
2331
2339
  'nonce': nonce,
2332
2340
  'signature': sig,
2333
2341
  }
2334
2342
  response = await self.privatePostExchange(self.extend(request, params))
2335
- return response
2343
+ return self.parse_transaction(response)
2336
2344
 
2337
2345
  def format_vault_address(self, address: Str = None):
2338
2346
  if address is None:
@@ -35,6 +35,7 @@ class idex(Exchange, ImplicitAPI):
35
35
  'rateLimit': 1000,
36
36
  'version': 'v3',
37
37
  'pro': True,
38
+ 'dex': True,
38
39
  'certified': False,
39
40
  'requiresWeb3': True,
40
41
  'has': {
@@ -141,6 +141,7 @@ class kucoin(Exchange, ImplicitAPI):
141
141
  'futuresPublic': 'https://api-futures.kucoin.com',
142
142
  'webExchange': 'https://kucoin.com/_api',
143
143
  'broker': 'https://api-broker.kucoin.com',
144
+ 'earn': 'https://api.kucoin.com',
144
145
  },
145
146
  'www': 'https://www.kucoin.com',
146
147
  'doc': [
@@ -408,6 +409,9 @@ class kucoin(Exchange, ImplicitAPI):
408
409
  'broker/nd/account': 2,
409
410
  'broker/nd/account/apikey': 2,
410
411
  'broker/nd/rebase/download': 3,
412
+ 'broker/nd/transfer/detail': 1,
413
+ 'broker/nd/deposit/detail': 1,
414
+ 'broker/nd/withdraw/detail': 1,
411
415
  },
412
416
  'post': {
413
417
  'broker/nd/transfer': 1,
@@ -419,6 +423,25 @@ class kucoin(Exchange, ImplicitAPI):
419
423
  'broker/nd/account/apikey': 3,
420
424
  },
421
425
  },
426
+ 'earn': {
427
+ 'get': {
428
+ 'otc-loan/loan': 1,
429
+ 'otc-loan/accounts': 1,
430
+ 'earn/redeem-preview': 7.5, # 5EW
431
+ 'earn/saving/products': 7.5, # 5EW
432
+ 'earn/hold-assets': 7.5, # 5EW
433
+ 'earn/promotion/products': 7.5, # 5EW
434
+ 'earn/kcs-staking/products': 7.5, # 5EW
435
+ 'earn/staking/products': 7.5, # 5EW
436
+ 'earn/eth-staking/products': 7.5, # 5EW
437
+ },
438
+ 'post': {
439
+ 'earn/orders': 7.5, # 5EW
440
+ },
441
+ 'delete': {
442
+ 'earn/orders': 7.5, # 5EW
443
+ },
444
+ },
422
445
  },
423
446
  'timeframes': {
424
447
  '1m': '1min',
@@ -4507,6 +4530,8 @@ class kucoin(Exchange, ImplicitAPI):
4507
4530
  endpoint = '/api/' + version + '/' + self.implode_params(path, params)
4508
4531
  if api == 'webExchange':
4509
4532
  endpoint = '/' + self.implode_params(path, params)
4533
+ if api == 'earn':
4534
+ endpoint = '/api/v1/' + self.implode_params(path, params)
4510
4535
  query = self.omit(params, self.extract_params(path))
4511
4536
  endpart = ''
4512
4537
  headers = headers if (headers is not None) else {}
@@ -4522,7 +4547,8 @@ class kucoin(Exchange, ImplicitAPI):
4522
4547
  isFuturePrivate = (api == 'futuresPrivate')
4523
4548
  isPrivate = (api == 'private')
4524
4549
  isBroker = (api == 'broker')
4525
- if isPrivate or isFuturePrivate or isBroker:
4550
+ isEarn = (api == 'earn')
4551
+ if isPrivate or isFuturePrivate or isBroker or isEarn:
4526
4552
  self.check_required_credentials()
4527
4553
  timestamp = str(self.nonce())
4528
4554
  headers = self.extend({
@@ -897,7 +897,15 @@ class luno(Exchange, ImplicitAPI):
897
897
  request: dict = {
898
898
  'order_id': id,
899
899
  }
900
- return await self.privatePostStoporder(self.extend(request, params))
900
+ response = await self.privatePostStoporder(self.extend(request, params))
901
+ #
902
+ # {
903
+ # "success": True
904
+ # }
905
+ #
906
+ return self.safe_order({
907
+ 'info': response,
908
+ })
901
909
 
902
910
  async def fetch_ledger_by_entries(self, code: Str = None, entry=None, limit=None, params={}):
903
911
  # by default without entry number or limit number, return most recent entry
@@ -235,6 +235,7 @@ class mexc(Exchange, ImplicitAPI):
235
235
  'sub-account/margin': 1,
236
236
  'batchOrders': 10,
237
237
  'capital/withdraw/apply': 1,
238
+ 'capital/withdraw': 1,
238
239
  'capital/transfer': 1,
239
240
  'capital/transfer/internal': 1,
240
241
  'capital/deposit/address': 1,
@@ -253,6 +254,7 @@ class mexc(Exchange, ImplicitAPI):
253
254
  'margin/order': 1,
254
255
  'margin/openOrders': 1,
255
256
  'userDataStream': 1,
257
+ 'capital/withdraw': 1,
256
258
  },
257
259
  },
258
260
  },
@@ -1069,7 +1071,7 @@ class mexc(Exchange, ImplicitAPI):
1069
1071
  chains = self.safe_value(currency, 'networkList', [])
1070
1072
  for j in range(0, len(chains)):
1071
1073
  chain = chains[j]
1072
- networkId = self.safe_string(chain, 'network')
1074
+ networkId = self.safe_string_2(chain, 'network', 'netWork')
1073
1075
  network = self.network_id_to_code(networkId)
1074
1076
  isDepositEnabled = self.safe_bool(chain, 'depositEnable', False)
1075
1077
  isWithdrawEnabled = self.safe_bool(chain, 'withdrawEnable', False)
@@ -4894,7 +4896,7 @@ class mexc(Exchange, ImplicitAPI):
4894
4896
  async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
4895
4897
  """
4896
4898
  make a withdrawal
4897
- :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
4899
+ :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
4898
4900
  :param str code: unified currency code
4899
4901
  :param float amount: the amount to withdraw
4900
4902
  :param str address: the address to withdraw to
@@ -4904,7 +4906,7 @@ class mexc(Exchange, ImplicitAPI):
4904
4906
  """
4905
4907
  tag, params = self.handle_withdraw_tag_and_params(tag, params)
4906
4908
  networks = self.safe_value(self.options, 'networks', {})
4907
- network = self.safe_string_2(params, 'network', 'chain') # self line allows the user to specify either ERC20 or ETH
4909
+ network = self.safe_string_2(params, 'network', 'netWork') # self line allows the user to specify either ERC20 or ETH
4908
4910
  network = self.safe_string(networks, network, network) # handle ETH > ERC-20 alias
4909
4911
  self.check_address(address)
4910
4912
  await self.load_markets()
@@ -4917,9 +4919,9 @@ class mexc(Exchange, ImplicitAPI):
4917
4919
  if tag is not None:
4918
4920
  request['memo'] = tag
4919
4921
  if network is not None:
4920
- request['network'] = network
4921
- params = self.omit(params, ['network', 'chain'])
4922
- response = await self.spotPrivatePostCapitalWithdrawApply(self.extend(request, params))
4922
+ request['netWork'] = network
4923
+ params = self.omit(params, ['network', 'netWork'])
4924
+ response = await self.spotPrivatePostCapitalWithdraw(self.extend(request, params))
4923
4925
  #
4924
4926
  # {
4925
4927
  # "id":"7213fea8e94b4a5593d507237e5a555b"
ccxt/async_support/okx.py CHANGED
@@ -2386,6 +2386,7 @@ class okx(Exchange, ImplicitAPI):
2386
2386
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
2387
2387
  :see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
2388
2388
  :param dict [params]: extra parameters specific to the exchange API endpoint
2389
+ :param str [params.type]: wallet type, ['funding' or 'trading'] default is 'trading'
2389
2390
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
2390
2391
  """
2391
2392
  await self.load_markets()