ccxt 4.3.45__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.
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.45'
25
+ __version__ = '4.3.46'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/binance.py CHANGED
@@ -616,6 +616,8 @@ class ImplicitAPI:
616
616
  private_get_account_commission = privateGetAccountCommission = Entry('account/commission', 'private', 'GET', {'cost': 4})
617
617
  private_post_order_oco = privatePostOrderOco = Entry('order/oco', 'private', 'POST', {'cost': 0.2})
618
618
  private_post_orderlist_oco = privatePostOrderListOco = Entry('orderList/oco', 'private', 'POST', {'cost': 0.2})
619
+ private_post_orderlist_oto = privatePostOrderListOto = Entry('orderList/oto', 'private', 'POST', {'cost': 0.2})
620
+ private_post_orderlist_otoco = privatePostOrderListOtoco = Entry('orderList/otoco', 'private', 'POST', {'cost': 0.2})
619
621
  private_post_sor_order = privatePostSorOrder = Entry('sor/order', 'private', 'POST', {'cost': 0.2})
620
622
  private_post_sor_order_test = privatePostSorOrderTest = Entry('sor/order/test', 'private', 'POST', {'cost': 0.2})
621
623
  private_post_order = privatePostOrder = Entry('order', 'private', 'POST', {'cost': 0.2})
@@ -616,6 +616,8 @@ class ImplicitAPI:
616
616
  private_get_account_commission = privateGetAccountCommission = Entry('account/commission', 'private', 'GET', {'cost': 4})
617
617
  private_post_order_oco = privatePostOrderOco = Entry('order/oco', 'private', 'POST', {'cost': 0.2})
618
618
  private_post_orderlist_oco = privatePostOrderListOco = Entry('orderList/oco', 'private', 'POST', {'cost': 0.2})
619
+ private_post_orderlist_oto = privatePostOrderListOto = Entry('orderList/oto', 'private', 'POST', {'cost': 0.2})
620
+ private_post_orderlist_otoco = privatePostOrderListOtoco = Entry('orderList/otoco', 'private', 'POST', {'cost': 0.2})
619
621
  private_post_sor_order = privatePostSorOrder = Entry('sor/order', 'private', 'POST', {'cost': 0.2})
620
622
  private_post_sor_order_test = privatePostSorOrderTest = Entry('sor/order/test', 'private', 'POST', {'cost': 0.2})
621
623
  private_post_order = privatePostOrder = Entry('order', 'private', 'POST', {'cost': 0.2})
@@ -668,6 +668,8 @@ class ImplicitAPI:
668
668
  private_get_account_commission = privateGetAccountCommission = Entry('account/commission', 'private', 'GET', {'cost': 4})
669
669
  private_post_order_oco = privatePostOrderOco = Entry('order/oco', 'private', 'POST', {'cost': 0.2})
670
670
  private_post_orderlist_oco = privatePostOrderListOco = Entry('orderList/oco', 'private', 'POST', {'cost': 0.2})
671
+ private_post_orderlist_oto = privatePostOrderListOto = Entry('orderList/oto', 'private', 'POST', {'cost': 0.2})
672
+ private_post_orderlist_otoco = privatePostOrderListOtoco = Entry('orderList/otoco', 'private', 'POST', {'cost': 0.2})
671
673
  private_post_sor_order = privatePostSorOrder = Entry('sor/order', 'private', 'POST', {'cost': 0.2})
672
674
  private_post_sor_order_test = privatePostSorOrderTest = Entry('sor/order/test', 'private', 'POST', {'cost': 0.2})
673
675
  private_post_order = privatePostOrder = Entry('order', 'private', 'POST', {'cost': 0.2})
@@ -616,6 +616,8 @@ class ImplicitAPI:
616
616
  private_get_account_commission = privateGetAccountCommission = Entry('account/commission', 'private', 'GET', {'cost': 4})
617
617
  private_post_order_oco = privatePostOrderOco = Entry('order/oco', 'private', 'POST', {'cost': 0.2})
618
618
  private_post_orderlist_oco = privatePostOrderListOco = Entry('orderList/oco', 'private', 'POST', {'cost': 0.2})
619
+ private_post_orderlist_oto = privatePostOrderListOto = Entry('orderList/oto', 'private', 'POST', {'cost': 0.2})
620
+ private_post_orderlist_otoco = privatePostOrderListOtoco = Entry('orderList/otoco', 'private', 'POST', {'cost': 0.2})
619
621
  private_post_sor_order = privatePostSorOrder = Entry('sor/order', 'private', 'POST', {'cost': 0.2})
620
622
  private_post_sor_order_test = privatePostSorOrderTest = Entry('sor/order/test', 'private', 'POST', {'cost': 0.2})
621
623
  private_post_order = privatePostOrder = Entry('order', 'private', 'POST', {'cost': 0.2})
ccxt/abstract/mexc.py CHANGED
@@ -64,6 +64,7 @@ class ImplicitAPI:
64
64
  spot_private_post_sub_account_margin = spotPrivatePostSubAccountMargin = Entry('sub-account/margin', ['spot', 'private'], 'POST', {'cost': 1})
65
65
  spot_private_post_batchorders = spotPrivatePostBatchOrders = Entry('batchOrders', ['spot', 'private'], 'POST', {'cost': 10})
66
66
  spot_private_post_capital_withdraw_apply = spotPrivatePostCapitalWithdrawApply = Entry('capital/withdraw/apply', ['spot', 'private'], 'POST', {'cost': 1})
67
+ spot_private_post_capital_withdraw = spotPrivatePostCapitalWithdraw = Entry('capital/withdraw', ['spot', 'private'], 'POST', {'cost': 1})
67
68
  spot_private_post_capital_transfer = spotPrivatePostCapitalTransfer = Entry('capital/transfer', ['spot', 'private'], 'POST', {'cost': 1})
68
69
  spot_private_post_capital_transfer_internal = spotPrivatePostCapitalTransferInternal = Entry('capital/transfer/internal', ['spot', 'private'], 'POST', {'cost': 1})
69
70
  spot_private_post_capital_deposit_address = spotPrivatePostCapitalDepositAddress = Entry('capital/deposit/address', ['spot', 'private'], 'POST', {'cost': 1})
@@ -78,6 +79,7 @@ class ImplicitAPI:
78
79
  spot_private_delete_margin_order = spotPrivateDeleteMarginOrder = Entry('margin/order', ['spot', 'private'], 'DELETE', {'cost': 1})
79
80
  spot_private_delete_margin_openorders = spotPrivateDeleteMarginOpenOrders = Entry('margin/openOrders', ['spot', 'private'], 'DELETE', {'cost': 1})
80
81
  spot_private_delete_userdatastream = spotPrivateDeleteUserDataStream = Entry('userDataStream', ['spot', 'private'], 'DELETE', {'cost': 1})
82
+ spot_private_delete_capital_withdraw = spotPrivateDeleteCapitalWithdraw = Entry('capital/withdraw', ['spot', 'private'], 'DELETE', {'cost': 1})
81
83
  contract_public_get_ping = contractPublicGetPing = Entry('ping', ['contract', 'public'], 'GET', {'cost': 2})
82
84
  contract_public_get_detail = contractPublicGetDetail = Entry('detail', ['contract', 'public'], 'GET', {'cost': 100})
83
85
  contract_public_get_support_currencies = contractPublicGetSupportCurrencies = Entry('support_currencies', ['contract', 'public'], 'GET', {'cost': 2})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.45'
7
+ __version__ = '4.3.46'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.45'
5
+ __version__ = '4.3.46'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -1011,6 +1011,8 @@ class binance(Exchange, ImplicitAPI):
1011
1011
  'post': {
1012
1012
  'order/oco': 0.2,
1013
1013
  'orderList/oco': 0.2,
1014
+ 'orderList/oto': 0.2,
1015
+ 'orderList/otoco': 0.2,
1014
1016
  'sor/order': 0.2,
1015
1017
  'sor/order/test': 0.2,
1016
1018
  'order': 0.2,
@@ -22,7 +22,7 @@ from ccxt.base.errors import OrderNotFound
22
22
  from ccxt.base.errors import NotSupported
23
23
  from ccxt.base.errors import OperationFailed
24
24
  from ccxt.base.errors import DDoSProtection
25
- from ccxt.base.decimal_to_precision import DECIMAL_PLACES
25
+ from ccxt.base.decimal_to_precision import TICK_SIZE
26
26
  from ccxt.base.precise import Precise
27
27
 
28
28
 
@@ -400,7 +400,7 @@ class bingx(Exchange, ImplicitAPI):
400
400
  '1w': '1w',
401
401
  '1M': '1M',
402
402
  },
403
- 'precisionMode': DECIMAL_PLACES,
403
+ 'precisionMode': TICK_SIZE,
404
404
  'exceptions': {
405
405
  'exact': {
406
406
  '400': BadRequest,
@@ -616,18 +616,26 @@ class bingx(Exchange, ImplicitAPI):
616
616
  # "msg": "",
617
617
  # "data": [
618
618
  # {
619
- # "contractId": "100",
620
- # "symbol": "BTC-USDT",
621
- # "size": "0.0001",
622
- # "quantityPrecision": 4,
623
- # "pricePrecision": 1,
624
- # "feeRate": 0.0005,
625
- # "tradeMinLimit": 1,
626
- # "maxLongLeverage": 150,
627
- # "maxShortLeverage": 150,
628
- # "currency": "USDT",
629
- # "asset": "BTC",
630
- # "status": 1
619
+ # "contractId": "100",
620
+ # "symbol": "BTC-USDT",
621
+ # "size": "0.0001",
622
+ # "quantityPrecision": "4",
623
+ # "pricePrecision": "1",
624
+ # "feeRate": "0.0005",
625
+ # "makerFeeRate": "0.0002",
626
+ # "takerFeeRate": "0.0005",
627
+ # "tradeMinLimit": "0",
628
+ # "tradeMinQuantity": "0.0001",
629
+ # "tradeMinUSDT": "2",
630
+ # "maxLongLeverage": "125",
631
+ # "maxShortLeverage": "125",
632
+ # "currency": "USDT",
633
+ # "asset": "BTC",
634
+ # "status": "1",
635
+ # "apiStateOpen": "true",
636
+ # "apiStateClose": "true",
637
+ # "ensureTrigger": True,
638
+ # "triggerFeeRate": "0.00020000"
631
639
  # },
632
640
  # ...
633
641
  # ]
@@ -645,12 +653,12 @@ class bingx(Exchange, ImplicitAPI):
645
653
  quote = self.safe_currency_code(quoteId)
646
654
  currency = self.safe_string(market, 'currency')
647
655
  settle = self.safe_currency_code(currency)
648
- pricePrecision = self.safe_integer(market, 'pricePrecision')
656
+ pricePrecision = self.safe_number(market, 'tickSize')
649
657
  if pricePrecision is None:
650
- pricePrecision = self.precision_from_string(self.safe_string(market, 'tickSize'))
651
- quantityPrecision = self.safe_integer(market, 'quantityPrecision')
658
+ pricePrecision = self.parse_number(self.parse_precision(self.safe_string(market, 'pricePrecision')))
659
+ quantityPrecision = self.safe_number(market, 'stepSize')
652
660
  if quantityPrecision is None:
653
- quantityPrecision = self.precision_from_string(self.safe_string(market, 'stepSize'))
661
+ quantityPrecision = self.parse_number(self.parse_precision(self.safe_string(market, 'quantityPrecision')))
654
662
  type = 'swap' if (settle is not None) else 'spot'
655
663
  spot = type == 'spot'
656
664
  swap = type == 'swap'
@@ -2594,6 +2594,10 @@ class bitmart(Exchange, ImplicitAPI):
2594
2594
  request['type'] = 'limit_maker'
2595
2595
  if ioc:
2596
2596
  request['type'] = 'ioc'
2597
+ clientOrderId = self.safe_string(params, 'clientOrderId')
2598
+ if clientOrderId is not None:
2599
+ params = self.omit(params, 'clientOrderId')
2600
+ request['client_order_id'] = clientOrderId
2597
2601
  return self.extend(request, params)
2598
2602
 
2599
2603
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -15,7 +15,7 @@ from ccxt.base.errors import BadSymbol
15
15
  from ccxt.base.errors import InsufficientFunds
16
16
  from ccxt.base.errors import OrderNotFound
17
17
  from ccxt.base.errors import ExchangeNotAvailable
18
- from ccxt.base.decimal_to_precision import DECIMAL_PLACES
18
+ from ccxt.base.decimal_to_precision import TICK_SIZE
19
19
  from ccxt.base.precise import Precise
20
20
 
21
21
 
@@ -199,7 +199,7 @@ class bitteam(Exchange, ImplicitAPI):
199
199
  'maker': self.parse_number('0.002'),
200
200
  },
201
201
  },
202
- 'precisionMode': DECIMAL_PLACES,
202
+ 'precisionMode': TICK_SIZE,
203
203
  # exchange-specific options
204
204
  'options': {
205
205
  'networksById': {
@@ -358,8 +358,6 @@ class bitteam(Exchange, ImplicitAPI):
358
358
  base = self.safe_currency_code(baseId)
359
359
  quote = self.safe_currency_code(quoteId)
360
360
  active = self.safe_value(market, 'active')
361
- amountPrecision = self.safe_integer(market, 'baseStep')
362
- pricePrecision = self.safe_integer(market, 'quoteStep')
363
361
  timeStart = self.safe_string(market, 'timeStart')
364
362
  created = self.parse8601(timeStart)
365
363
  minCost = None
@@ -394,8 +392,8 @@ class bitteam(Exchange, ImplicitAPI):
394
392
  'strike': None,
395
393
  'optionType': None,
396
394
  'precision': {
397
- 'amount': amountPrecision,
398
- 'price': pricePrecision,
395
+ 'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'baseStep'))),
396
+ 'price': self.parse_number(self.parse_precision(self.safe_string(market, 'quoteStep'))),
399
397
  },
400
398
  'limits': {
401
399
  'leverage': {
@@ -549,7 +547,7 @@ class bitteam(Exchange, ImplicitAPI):
549
547
  numericId = self.safe_integer(currency, 'id')
550
548
  code = self.safe_currency_code(id)
551
549
  active = self.safe_bool(currency, 'active', False)
552
- precision = self.safe_integer(currency, 'precision')
550
+ precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'precision')))
553
551
  txLimits = self.safe_value(currency, 'txLimits', {})
554
552
  minWithdraw = self.safe_string(txLimits, 'minWithdraw')
555
553
  maxWithdraw = self.safe_string(txLimits, 'maxWithdraw')
@@ -569,7 +567,7 @@ class bitteam(Exchange, ImplicitAPI):
569
567
  withdraw = self.safe_value(statuses, 'withdrawStatus')
570
568
  networkIds = list(feesByNetworkId.keys())
571
569
  networks: dict = {}
572
- networkPrecision = self.safe_integer(currency, 'decimals')
570
+ networkPrecision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
573
571
  for j in range(0, len(networkIds)):
574
572
  networkId = networkIds[j]
575
573
  networkCode = self.network_id_to_code(networkId, code)
@@ -16,7 +16,7 @@ from ccxt.base.errors import InsufficientFunds
16
16
  from ccxt.base.errors import InvalidOrder
17
17
  from ccxt.base.errors import OrderNotFound
18
18
  from ccxt.base.errors import RateLimitExceeded
19
- from ccxt.base.decimal_to_precision import DECIMAL_PLACES
19
+ from ccxt.base.decimal_to_precision import TICK_SIZE
20
20
  from ccxt.base.precise import Precise
21
21
 
22
22
 
@@ -215,7 +215,7 @@ class coinmetro(Exchange, ImplicitAPI):
215
215
  'maker': self.parse_number('0'),
216
216
  },
217
217
  },
218
- 'precisionMode': DECIMAL_PLACES,
218
+ 'precisionMode': TICK_SIZE,
219
219
  # exchange-specific options
220
220
  'options': {
221
221
  'currenciesByIdForParseMarket': None,
@@ -317,7 +317,6 @@ class coinmetro(Exchange, ImplicitAPI):
317
317
  deposit = self.safe_value(currency, 'canDeposit')
318
318
  canTrade = self.safe_value(currency, 'canTrade')
319
319
  active = withdraw if canTrade else True
320
- precision = self.safe_integer(currency, 'digits')
321
320
  minAmount = self.safe_number(currency, 'minQty')
322
321
  result[code] = self.safe_currency_structure({
323
322
  'id': id,
@@ -328,7 +327,7 @@ class coinmetro(Exchange, ImplicitAPI):
328
327
  'deposit': deposit,
329
328
  'withdraw': withdraw,
330
329
  'fee': None,
331
- 'precision': precision,
330
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(currency, 'digits'))),
332
331
  'limits': {
333
332
  'amount': {'min': minAmount, 'max': None},
334
333
  'withdraw': {'min': None, 'max': None},
@@ -354,19 +353,14 @@ class coinmetro(Exchange, ImplicitAPI):
354
353
  #
355
354
  # [
356
355
  # {
357
- # "pair": "PERPEUR",
358
- # "precision": 5,
359
- # "margin": False
360
- # },
361
- # {
362
- # "pair": "PERPUSD",
356
+ # "pair": "YFIEUR",
363
357
  # "precision": 5,
364
358
  # "margin": False
365
359
  # },
366
360
  # {
367
- # "pair": "YFIEUR",
368
- # "precision": 5,
369
- # "margin": False
361
+ # "pair": "BTCEUR",
362
+ # "precision": 2,
363
+ # "margin": True
370
364
  # },
371
365
  # ...
372
366
  # ]
@@ -412,9 +406,7 @@ class coinmetro(Exchange, ImplicitAPI):
412
406
  'optionType': None,
413
407
  'precision': {
414
408
  'amount': basePrecisionAndLimits['precision'],
415
- 'price': quotePrecisionAndLimits['precision'],
416
- 'base': basePrecisionAndLimits['precision'],
417
- 'quote': quotePrecisionAndLimits['precision'],
409
+ 'price': self.parse_number(self.parse_precision(self.safe_string(market, 'precision'))),
418
410
  },
419
411
  'limits': {
420
412
  'leverage': {
@@ -464,12 +456,11 @@ class coinmetro(Exchange, ImplicitAPI):
464
456
  def parse_market_precision_and_limits(self, currencyId):
465
457
  currencies = self.safe_value(self.options, 'currenciesByIdForParseMarket', {})
466
458
  currency = self.safe_value(currencies, currencyId, {})
467
- precision = self.safe_integer(currency, 'precision')
468
459
  limits = self.safe_value(currency, 'limits', {})
469
460
  amountLimits = self.safe_value(limits, 'amount', {})
470
461
  minLimit = self.safe_number(amountLimits, 'min')
471
462
  result: dict = {
472
- 'precision': precision,
463
+ 'precision': self.safe_number(currency, 'precision'),
473
464
  'minLimit': minLimit,
474
465
  }
475
466
  return result
@@ -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': {
@@ -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()
@@ -33,7 +33,7 @@ class oxfun(Exchange, ImplicitAPI):
33
33
  def describe(self):
34
34
  return self.deep_extend(super(oxfun, self).describe(), {
35
35
  'id': 'oxfun',
36
- 'name': 'Oxfun',
36
+ 'name': 'OXFUN',
37
37
  'countries': ['PA'], # Panama todo check
38
38
  'version': 'v3',
39
39
  'rateLimit': 120, # 100 requests per second and 25000 per 5 minutes
@@ -153,7 +153,7 @@ class oxfun(Exchange, ImplicitAPI):
153
153
  '1d': '86400s',
154
154
  },
155
155
  'urls': {
156
- 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/9c7114b3-ec32-4cf7-a716-f807d7d071cd',
156
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/6a196124-c1ee-4fae-8573-962071b61a85',
157
157
  'referral': 'https://ox.fun/register?shareAccountId=5ZUD4a7G',
158
158
  'api': {
159
159
  'public': 'https://api.ox.fun',
@@ -31,7 +31,7 @@ from ccxt.base.errors import OnMaintenance
31
31
  from ccxt.base.errors import InvalidNonce
32
32
  from ccxt.base.errors import RequestTimeout
33
33
  from ccxt.base.decimal_to_precision import TRUNCATE
34
- from ccxt.base.decimal_to_precision import DECIMAL_PLACES
34
+ from ccxt.base.decimal_to_precision import TICK_SIZE
35
35
  from ccxt.base.precise import Precise
36
36
 
37
37
 
@@ -234,7 +234,7 @@ class tokocrypto(Exchange, ImplicitAPI):
234
234
  'maker': self.parse_number('0.0075'), # 0.1% trading fee, zero fees for all trading pairs before November 1
235
235
  },
236
236
  },
237
- 'precisionMode': DECIMAL_PLACES,
237
+ 'precisionMode': TICK_SIZE,
238
238
  'options': {
239
239
  # 'fetchTradesMethod': 'binanceGetTrades', # binanceGetTrades, binanceGetAggTrades
240
240
  'createMarketBuyOrderRequiresPrice': True,
@@ -734,10 +734,10 @@ class tokocrypto(Exchange, ImplicitAPI):
734
734
  'strike': None,
735
735
  'optionType': None,
736
736
  'precision': {
737
- 'amount': self.safe_integer(market, 'quantityPrecision'),
738
- 'price': self.safe_integer(market, 'pricePrecision'),
739
- 'base': self.safe_integer(market, 'baseAssetPrecision'),
740
- 'quote': self.safe_integer(market, 'quotePrecision'),
737
+ 'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'quantityPrecision'))),
738
+ 'price': self.parse_number(self.parse_precision(self.safe_string(market, 'pricePrecision'))),
739
+ 'base': self.parse_number(self.parse_precision(self.safe_string(market, 'baseAssetPrecision'))),
740
+ 'quote': self.parse_number(self.parse_precision(self.safe_string(market, 'quotePrecision'))),
741
741
  },
742
742
  'limits': {
743
743
  'leverage': {
@@ -762,8 +762,7 @@ class tokocrypto(Exchange, ImplicitAPI):
762
762
  }
763
763
  if 'PRICE_FILTER' in filtersByType:
764
764
  filter = self.safe_value(filtersByType, 'PRICE_FILTER', {})
765
- tickSize = self.safe_string(filter, 'tickSize')
766
- entry['precision']['price'] = self.precision_from_string(tickSize)
765
+ entry['precision']['price'] = self.safe_number(filter, 'tickSize')
767
766
  # PRICE_FILTER reports zero values for maxPrice
768
767
  # since they updated filter types in November 2018
769
768
  # https://github.com/ccxt/ccxt/issues/4286
@@ -772,11 +771,10 @@ class tokocrypto(Exchange, ImplicitAPI):
772
771
  'min': self.safe_number(filter, 'minPrice'),
773
772
  'max': self.safe_number(filter, 'maxPrice'),
774
773
  }
775
- entry['precision']['price'] = self.precision_from_string(filter['tickSize'])
774
+ entry['precision']['price'] = filter['tickSize']
776
775
  if 'LOT_SIZE' in filtersByType:
777
776
  filter = self.safe_value(filtersByType, 'LOT_SIZE', {})
778
- stepSize = self.safe_string(filter, 'stepSize')
779
- entry['precision']['amount'] = self.precision_from_string(stepSize)
777
+ entry['precision']['amount'] = self.safe_number(filter, 'stepSize')
780
778
  entry['limits']['amount'] = {
781
779
  'min': self.safe_number(filter, 'minQty'),
782
780
  'max': self.safe_number(filter, 'maxQty'),
@@ -34,6 +34,7 @@ class wavesexchange(Exchange, ImplicitAPI):
34
34
  'countries': ['CH'], # Switzerland
35
35
  'certified': False,
36
36
  'pro': False,
37
+ 'dex': True,
37
38
  'has': {
38
39
  'CORS': None,
39
40
  'spot': True,
@@ -32,6 +32,7 @@ class woofipro(Exchange, ImplicitAPI):
32
32
  'version': 'v1',
33
33
  'certified': True,
34
34
  'pro': True,
35
+ 'dex': True,
35
36
  'hostname': 'dex.woo.org',
36
37
  'has': {
37
38
  'CORS': None,