ccxt 4.3.45__py2.py3-none-any.whl → 4.3.47__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.
@@ -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,
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.45'
7
+ __version__ = '4.3.47'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1518,8 +1518,8 @@ class Exchange(object):
1518
1518
 
1519
1519
  def precision_from_string(self, str):
1520
1520
  # support string formats like '1e-4'
1521
- if 'e' in str:
1522
- numStr = re.sub(r'\de', '', str)
1521
+ if 'e' in str or 'E' in str:
1522
+ numStr = re.sub(r'\d\.?\d*[eE]', '', str)
1523
1523
  return int(numStr) * -1
1524
1524
  # support integer formats (without dot) like '1', '10' etc [Note: bug in decimalToPrecision, so this should not be used atm]
1525
1525
  # if not ('.' in str):
ccxt/binance.py CHANGED
@@ -1010,6 +1010,8 @@ class binance(Exchange, ImplicitAPI):
1010
1010
  'post': {
1011
1011
  'order/oco': 0.2,
1012
1012
  'orderList/oco': 0.2,
1013
+ 'orderList/oto': 0.2,
1014
+ 'orderList/otoco': 0.2,
1013
1015
  'sor/order': 0.2,
1014
1016
  'sor/order/test': 0.2,
1015
1017
  'order': 0.2,
ccxt/bingx.py CHANGED
@@ -21,7 +21,7 @@ from ccxt.base.errors import OrderNotFound
21
21
  from ccxt.base.errors import NotSupported
22
22
  from ccxt.base.errors import OperationFailed
23
23
  from ccxt.base.errors import DDoSProtection
24
- from ccxt.base.decimal_to_precision import DECIMAL_PLACES
24
+ from ccxt.base.decimal_to_precision import TICK_SIZE
25
25
  from ccxt.base.precise import Precise
26
26
 
27
27
 
@@ -399,7 +399,7 @@ class bingx(Exchange, ImplicitAPI):
399
399
  '1w': '1w',
400
400
  '1M': '1M',
401
401
  },
402
- 'precisionMode': DECIMAL_PLACES,
402
+ 'precisionMode': TICK_SIZE,
403
403
  'exceptions': {
404
404
  'exact': {
405
405
  '400': BadRequest,
@@ -615,18 +615,26 @@ class bingx(Exchange, ImplicitAPI):
615
615
  # "msg": "",
616
616
  # "data": [
617
617
  # {
618
- # "contractId": "100",
619
- # "symbol": "BTC-USDT",
620
- # "size": "0.0001",
621
- # "quantityPrecision": 4,
622
- # "pricePrecision": 1,
623
- # "feeRate": 0.0005,
624
- # "tradeMinLimit": 1,
625
- # "maxLongLeverage": 150,
626
- # "maxShortLeverage": 150,
627
- # "currency": "USDT",
628
- # "asset": "BTC",
629
- # "status": 1
618
+ # "contractId": "100",
619
+ # "symbol": "BTC-USDT",
620
+ # "size": "0.0001",
621
+ # "quantityPrecision": "4",
622
+ # "pricePrecision": "1",
623
+ # "feeRate": "0.0005",
624
+ # "makerFeeRate": "0.0002",
625
+ # "takerFeeRate": "0.0005",
626
+ # "tradeMinLimit": "0",
627
+ # "tradeMinQuantity": "0.0001",
628
+ # "tradeMinUSDT": "2",
629
+ # "maxLongLeverage": "125",
630
+ # "maxShortLeverage": "125",
631
+ # "currency": "USDT",
632
+ # "asset": "BTC",
633
+ # "status": "1",
634
+ # "apiStateOpen": "true",
635
+ # "apiStateClose": "true",
636
+ # "ensureTrigger": True,
637
+ # "triggerFeeRate": "0.00020000"
630
638
  # },
631
639
  # ...
632
640
  # ]
@@ -644,12 +652,12 @@ class bingx(Exchange, ImplicitAPI):
644
652
  quote = self.safe_currency_code(quoteId)
645
653
  currency = self.safe_string(market, 'currency')
646
654
  settle = self.safe_currency_code(currency)
647
- pricePrecision = self.safe_integer(market, 'pricePrecision')
655
+ pricePrecision = self.safe_number(market, 'tickSize')
648
656
  if pricePrecision is None:
649
- pricePrecision = self.precision_from_string(self.safe_string(market, 'tickSize'))
650
- quantityPrecision = self.safe_integer(market, 'quantityPrecision')
657
+ pricePrecision = self.parse_number(self.parse_precision(self.safe_string(market, 'pricePrecision')))
658
+ quantityPrecision = self.safe_number(market, 'stepSize')
651
659
  if quantityPrecision is None:
652
- quantityPrecision = self.precision_from_string(self.safe_string(market, 'stepSize'))
660
+ quantityPrecision = self.parse_number(self.parse_precision(self.safe_string(market, 'quantityPrecision')))
653
661
  type = 'swap' if (settle is not None) else 'spot'
654
662
  spot = type == 'spot'
655
663
  swap = type == 'swap'
ccxt/bitget.py CHANGED
@@ -4189,7 +4189,7 @@ class bitget(Exchange, ImplicitAPI):
4189
4189
  request['clientOid'] = clientOrderId
4190
4190
  if marginMode is not None:
4191
4191
  request['loanType'] = 'normal'
4192
- if createMarketBuyOrderRequiresPrice and isMarketOrder and (side == 'buy'):
4192
+ if isMarketOrder and (side == 'buy'):
4193
4193
  request['quoteSize'] = quantity
4194
4194
  else:
4195
4195
  request['baseSize'] = quantity
ccxt/bitmart.py CHANGED
@@ -2238,7 +2238,7 @@ class bitmart(Exchange, ImplicitAPI):
2238
2238
  trailingActivationPrice = self.safe_number(order, 'activation_price')
2239
2239
  return self.safe_order({
2240
2240
  'id': id,
2241
- 'clientOrderId': self.safe_string(order, 'client_order_id'),
2241
+ 'clientOrderId': self.safe_string_2(order, 'client_order_id', 'clientOrderId'),
2242
2242
  'info': order,
2243
2243
  'timestamp': timestamp,
2244
2244
  'datetime': self.iso8601(timestamp),
@@ -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
  def cancel_order(self, id: str, symbol: Str = None, params={}):
ccxt/bitteam.py CHANGED
@@ -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)
ccxt/coinmetro.py CHANGED
@@ -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
ccxt/hyperliquid.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.hyperliquid import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
8
+ from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, Transaction, TransferEntry
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import ArgumentsRequired
@@ -31,6 +31,7 @@ class hyperliquid(Exchange, ImplicitAPI):
31
31
  'rateLimit': 50, # 1200 requests per minute, 20 request per second
32
32
  'certified': False,
33
33
  'pro': True,
34
+ 'dex': True,
34
35
  'has': {
35
36
  'CORS': None,
36
37
  'spot': True,
@@ -948,11 +949,12 @@ class hyperliquid(Exchange, ImplicitAPI):
948
949
  signature = self.sign_message(msg, self.privateKey)
949
950
  return signature
950
951
 
951
- def build_sig(self, chainId, messageTypes, message):
952
+ def sign_user_signed_action(self, messageTypes, message):
952
953
  zeroAddress = self.safe_string(self.options, 'zeroAddress')
954
+ chainId = 421614 # check self out
953
955
  domain: dict = {
954
956
  'chainId': chainId,
955
- 'name': 'Exchange',
957
+ 'name': 'HyperliquidSignTransaction',
956
958
  'verifyingContract': zeroAddress,
957
959
  'version': '1',
958
960
  }
@@ -961,28 +963,26 @@ class hyperliquid(Exchange, ImplicitAPI):
961
963
  return signature
962
964
 
963
965
  def build_transfer_sig(self, message):
964
- isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
965
- chainId = 421614 if (isSandboxMode) else 42161
966
966
  messageTypes: dict = {
967
- 'UsdTransferSignPayload': [
967
+ 'HyperliquidTransaction:UsdSend': [
968
+ {'name': 'hyperliquidChain', 'type': 'string'},
968
969
  {'name': 'destination', 'type': 'string'},
969
970
  {'name': 'amount', 'type': 'string'},
970
971
  {'name': 'time', 'type': 'uint64'},
971
972
  ],
972
973
  }
973
- return self.build_sig(chainId, messageTypes, message)
974
+ return self.sign_user_signed_action(messageTypes, message)
974
975
 
975
976
  def build_withdraw_sig(self, message):
976
- isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
977
- chainId = 421614 if (isSandboxMode) else 42161
978
977
  messageTypes: dict = {
979
- 'WithdrawFromBridge2SignPayload': [
978
+ 'HyperliquidTransaction:Withdraw': [
979
+ {'name': 'hyperliquidChain', 'type': 'string'},
980
980
  {'name': 'destination', 'type': 'string'},
981
- {'name': 'usd', 'type': 'string'},
981
+ {'name': 'amount', 'type': 'string'},
982
982
  {'name': 'time', 'type': 'uint64'},
983
983
  ],
984
984
  }
985
- return self.build_sig(chainId, messageTypes, message)
985
+ return self.sign_user_signed_action(messageTypes, message)
986
986
 
987
987
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
988
988
  """
@@ -2276,8 +2276,9 @@ class hyperliquid(Exchange, ImplicitAPI):
2276
2276
  if code is not None:
2277
2277
  code = code.upper()
2278
2278
  if code != 'USDC':
2279
- raise NotSupported(self.id + 'withdraw() only support USDC')
2279
+ raise NotSupported(self.id + 'transfer() only support USDC')
2280
2280
  payload: dict = {
2281
+ 'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
2281
2282
  'destination': toAccount,
2282
2283
  'amount': self.number_to_string(amount),
2283
2284
  'time': nonce,
@@ -2285,9 +2286,12 @@ class hyperliquid(Exchange, ImplicitAPI):
2285
2286
  sig = self.build_transfer_sig(payload)
2286
2287
  request: dict = {
2287
2288
  'action': {
2288
- 'chain': 'ArbitrumTestnet' if (isSandboxMode) else 'Arbitrum',
2289
- 'payload': payload,
2290
- 'type': 'usdTransfer',
2289
+ 'hyperliquidChain': payload['hyperliquidChain'],
2290
+ 'signatureChainId': '0x66eee', # check self out
2291
+ 'destination': toAccount,
2292
+ 'amount': str(amount),
2293
+ 'time': nonce,
2294
+ 'type': 'usdSend',
2291
2295
  },
2292
2296
  'nonce': nonce,
2293
2297
  'signature': sig,
@@ -2295,7 +2299,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2295
2299
  response = self.privatePostExchange(self.extend(request, params))
2296
2300
  return response
2297
2301
 
2298
- def withdraw(self, code: str, amount, address, tag=None, params={}):
2302
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2299
2303
  """
2300
2304
  make a withdrawal(only support USDC)
2301
2305
  :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
@@ -2313,25 +2317,56 @@ class hyperliquid(Exchange, ImplicitAPI):
2313
2317
  code = code.upper()
2314
2318
  if code != 'USDC':
2315
2319
  raise NotSupported(self.id + 'withdraw() only support USDC')
2316
- isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
2320
+ isSandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
2317
2321
  nonce = self.milliseconds()
2318
2322
  payload: dict = {
2323
+ 'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
2319
2324
  'destination': address,
2320
- 'usd': str(amount),
2325
+ 'amount': str(amount),
2321
2326
  'time': nonce,
2322
2327
  }
2323
2328
  sig = self.build_withdraw_sig(payload)
2324
2329
  request: dict = {
2325
2330
  'action': {
2326
- 'chain': 'ArbitrumTestnet' if (isSandboxMode) else 'Arbitrum',
2327
- 'payload': payload,
2328
- 'type': 'withdraw2',
2331
+ 'hyperliquidChain': payload['hyperliquidChain'],
2332
+ 'signatureChainId': '0x66eee', # check self out
2333
+ 'destination': address,
2334
+ 'amount': str(amount),
2335
+ 'time': nonce,
2336
+ 'type': 'withdraw3',
2329
2337
  },
2330
2338
  'nonce': nonce,
2331
2339
  'signature': sig,
2332
2340
  }
2333
2341
  response = self.privatePostExchange(self.extend(request, params))
2334
- return response
2342
+ return self.parse_transaction(response)
2343
+
2344
+ def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
2345
+ #
2346
+ # {status: 'ok', response: {type: 'default'}}
2347
+ #
2348
+ return {
2349
+ 'info': transaction,
2350
+ 'id': None,
2351
+ 'txid': None,
2352
+ 'timestamp': None,
2353
+ 'datetime': None,
2354
+ 'network': None,
2355
+ 'address': None,
2356
+ 'addressTo': None,
2357
+ 'addressFrom': None,
2358
+ 'tag': None,
2359
+ 'tagTo': None,
2360
+ 'tagFrom': None,
2361
+ 'type': None,
2362
+ 'amount': None,
2363
+ 'currency': None,
2364
+ 'status': self.safe_string(transaction, 'status'),
2365
+ 'updated': None,
2366
+ 'comment': None,
2367
+ 'internal': None,
2368
+ 'fee': None,
2369
+ }
2335
2370
 
2336
2371
  def format_vault_address(self, address: Str = None):
2337
2372
  if address is None:
ccxt/idex.py CHANGED
@@ -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': {
ccxt/mexc.py CHANGED
@@ -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
  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
  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 = self.spotPrivatePostCapitalWithdrawApply(self.extend(request, params))
4922
+ request['netWork'] = network
4923
+ params = self.omit(params, ['network', 'netWork'])
4924
+ response = self.spotPrivatePostCapitalWithdraw(self.extend(request, params))
4923
4925
  #
4924
4926
  # {
4925
4927
  # "id":"7213fea8e94b4a5593d507237e5a555b"
ccxt/okx.py CHANGED
@@ -2385,6 +2385,7 @@ class okx(Exchange, ImplicitAPI):
2385
2385
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
2386
2386
  :see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
2387
2387
  :param dict [params]: extra parameters specific to the exchange API endpoint
2388
+ :param str [params.type]: wallet type, ['funding' or 'trading'] default is 'trading'
2388
2389
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
2389
2390
  """
2390
2391
  self.load_markets()
ccxt/oxfun.py CHANGED
@@ -32,7 +32,7 @@ class oxfun(Exchange, ImplicitAPI):
32
32
  def describe(self):
33
33
  return self.deep_extend(super(oxfun, self).describe(), {
34
34
  'id': 'oxfun',
35
- 'name': 'Oxfun',
35
+ 'name': 'OXFUN',
36
36
  'countries': ['PA'], # Panama todo check
37
37
  'version': 'v3',
38
38
  'rateLimit': 120, # 100 requests per second and 25000 per 5 minutes
@@ -152,7 +152,7 @@ class oxfun(Exchange, ImplicitAPI):
152
152
  '1d': '86400s',
153
153
  },
154
154
  'urls': {
155
- 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/9c7114b3-ec32-4cf7-a716-f807d7d071cd',
155
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/6a196124-c1ee-4fae-8573-962071b61a85',
156
156
  'referral': 'https://ox.fun/register?shareAccountId=5ZUD4a7G',
157
157
  'api': {
158
158
  'public': 'https://api.ox.fun',
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.45'
7
+ __version__ = '4.3.47'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/binanceus.py CHANGED
@@ -45,12 +45,4 @@ class binanceus(binance):
45
45
  'defaultType': 'spot',
46
46
  'fetchMarkets': ['spot'],
47
47
  },
48
- 'fees': {
49
- 'trading': {
50
- 'tierBased': False,
51
- 'percentage': True,
52
- 'taker': 0.0, # 0.1% trading fee, zero fees for all trading pairs before November 1
53
- 'maker': 0.0, # 0.1% trading fee, zero fees for all trading pairs before November 1
54
- },
55
- },
56
48
  })