ccxt 4.4.17__py2.py3-none-any.whl → 4.4.19__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.
@@ -46,12 +46,14 @@ class kucoinfutures(kucoin, ImplicitAPI):
46
46
  'addMargin': True,
47
47
  'cancelAllOrders': True,
48
48
  'cancelOrder': True,
49
+ 'cancelOrders': True,
49
50
  'closeAllPositions': False,
50
51
  'closePosition': True,
51
52
  'closePositions': False,
52
53
  'createDepositAddress': True,
53
54
  'createOrder': True,
54
55
  'createOrders': True,
56
+ 'createOrderWithTakeProfitAndStopLoss': True,
55
57
  'createReduceOnlyOrder': True,
56
58
  'createStopLimitOrder': True,
57
59
  'createStopLossOrder': True,
@@ -216,6 +218,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
216
218
  'stopOrders': 1,
217
219
  'sub/api-key': 1,
218
220
  'orders/client-order/{clientOid}': 1,
221
+ 'orders/multi-cancel': 20,
219
222
  },
220
223
  },
221
224
  'webExchange': {
@@ -255,6 +258,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
255
258
  '400100': BadRequest, # Parameter Error -- You tried to access the resource with invalid parameters
256
259
  '411100': AccountSuspended, # User is frozen -- Please contact us via support center
257
260
  '500000': ExchangeNotAvailable, # Internal Server Error -- We had a problem with our server. Try again later.
261
+ '300009': InvalidOrder, # {"msg":"No open positions to close.","code":"300009"}
258
262
  },
259
263
  'broad': {
260
264
  'Position does not exist': OrderNotFound, # {"code":"200000", "msg":"Position does not exist"}
@@ -1372,12 +1376,15 @@ class kucoinfutures(kucoin, ImplicitAPI):
1372
1376
  """
1373
1377
  Create an order on the exchange
1374
1378
  :see: https://docs.kucoin.com/futures/#place-an-order
1379
+ :see: https://www.kucoin.com/docs/rest/futures-trading/orders/place-take-profit-and-stop-loss-order#http-request
1375
1380
  :param str symbol: Unified CCXT market symbol
1376
1381
  :param str type: 'limit' or 'market'
1377
1382
  :param str side: 'buy' or 'sell'
1378
1383
  :param float amount: the amount of currency to trade
1379
1384
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1380
1385
  :param dict [params]: extra parameters specific to the exchange API endpoint
1386
+ :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
1387
+ :param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
1381
1388
  :param float [params.triggerPrice]: The price a trigger order is triggered at
1382
1389
  :param float [params.stopLossPrice]: price to trigger stop-loss orders
1383
1390
  :param float [params.takeProfitPrice]: price to trigger take-profit orders
@@ -1399,12 +1406,16 @@ class kucoinfutures(kucoin, ImplicitAPI):
1399
1406
  market = self.market(symbol)
1400
1407
  testOrder = self.safe_bool(params, 'test', False)
1401
1408
  params = self.omit(params, 'test')
1409
+ isTpAndSlOrder = (self.safe_value(params, 'stopLoss') is not None) or (self.safe_value(params, 'takeProfit') is not None)
1402
1410
  orderRequest = self.create_contract_order_request(symbol, type, side, amount, price, params)
1403
1411
  response = None
1404
1412
  if testOrder:
1405
1413
  response = await self.futuresPrivatePostOrdersTest(orderRequest)
1406
1414
  else:
1407
- response = await self.futuresPrivatePostOrders(orderRequest)
1415
+ if isTpAndSlOrder:
1416
+ response = await self.futuresPrivatePostStOrders(orderRequest)
1417
+ else:
1418
+ response = await self.futuresPrivatePostOrders(orderRequest)
1408
1419
  #
1409
1420
  # {
1410
1421
  # "code": "200000",
@@ -1479,6 +1490,9 @@ class kucoinfutures(kucoin, ImplicitAPI):
1479
1490
  'leverage': 1,
1480
1491
  }
1481
1492
  triggerPrice, stopLossPrice, takeProfitPrice = self.handle_trigger_prices(params)
1493
+ stopLoss = self.safe_dict(params, 'stopLoss')
1494
+ takeProfit = self.safe_dict(params, 'takeProfit')
1495
+ # isTpAndSl = stopLossPrice and takeProfitPrice
1482
1496
  triggerPriceTypes: dict = {
1483
1497
  'mark': 'MP',
1484
1498
  'last': 'TP',
@@ -1486,11 +1500,22 @@ class kucoinfutures(kucoin, ImplicitAPI):
1486
1500
  }
1487
1501
  triggerPriceType = self.safe_string(params, 'triggerPriceType', 'mark')
1488
1502
  triggerPriceTypeValue = self.safe_string(triggerPriceTypes, triggerPriceType, triggerPriceType)
1489
- params = self.omit(params, ['stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'stopPrice'])
1503
+ params = self.omit(params, ['stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'stopPrice', 'takeProfit', 'stopLoss'])
1490
1504
  if triggerPrice:
1491
1505
  request['stop'] = 'up' if (side == 'buy') else 'down'
1492
1506
  request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
1493
1507
  request['stopPriceType'] = triggerPriceTypeValue
1508
+ elif stopLoss is not None or takeProfit is not None:
1509
+ priceType = triggerPriceTypeValue
1510
+ if stopLoss is not None:
1511
+ slPrice = self.safe_string_2(stopLoss, 'triggerPrice', 'stopPrice')
1512
+ request['triggerStopDownPrice'] = self.price_to_precision(symbol, slPrice)
1513
+ priceType = self.safe_string(stopLoss, 'triggerPriceType', triggerPriceTypeValue)
1514
+ if takeProfit is not None:
1515
+ tpPrice = self.safe_string_2(takeProfit, 'triggerPrice', 'takeProfitPrice')
1516
+ request['triggerStopUpPrice'] = self.price_to_precision(symbol, tpPrice)
1517
+ priceType = self.safe_string(stopLoss, 'triggerPriceType', triggerPriceTypeValue)
1518
+ request['stopPriceType'] = priceType
1494
1519
  elif stopLossPrice or takeProfitPrice:
1495
1520
  if stopLossPrice:
1496
1521
  request['stop'] = 'up' if (side == 'buy') else 'down'
@@ -1561,6 +1586,61 @@ class kucoinfutures(kucoin, ImplicitAPI):
1561
1586
  #
1562
1587
  return self.safe_value(response, 'data')
1563
1588
 
1589
+ async def cancel_orders(self, ids, symbol: Str = None, params={}):
1590
+ """
1591
+ cancel multiple orders
1592
+ :see: https://www.kucoin.com/docs/rest/futures-trading/orders/batch-cancel-orders
1593
+ :param str[] ids: order ids
1594
+ :param str symbol: unified symbol of the market the order was made in
1595
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1596
+ :param str[] [params.clientOrderIds]: client order ids
1597
+ :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1598
+ """
1599
+ await self.load_markets()
1600
+ market = None
1601
+ if symbol is not None:
1602
+ market = self.market(symbol)
1603
+ ordersRequests = []
1604
+ clientOrderIds = self.safe_list_2(params, 'clientOrderIds', 'clientOids', [])
1605
+ params = self.omit(params, ['clientOrderIds', 'clientOids'])
1606
+ useClientorderId = False
1607
+ for i in range(0, len(clientOrderIds)):
1608
+ useClientorderId = True
1609
+ if symbol is None:
1610
+ raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument when cancelling by clientOrderIds')
1611
+ ordersRequests.append({
1612
+ 'symbol': market['id'],
1613
+ 'clientOid': self.safe_string(clientOrderIds, i),
1614
+ })
1615
+ for i in range(0, len(ids)):
1616
+ ordersRequests.append(ids[i])
1617
+ requestKey = 'clientOidsList' if useClientorderId else 'orderIdsList'
1618
+ request: dict = {}
1619
+ request[requestKey] = ordersRequests
1620
+ response = await self.futuresPrivateDeleteOrdersMultiCancel(self.extend(request, params))
1621
+ #
1622
+ # {
1623
+ # "code": "200000",
1624
+ # "data":
1625
+ # [
1626
+ # {
1627
+ # "orderId": "80465574458560512",
1628
+ # "clientOid": null,
1629
+ # "code": "200",
1630
+ # "msg": "success"
1631
+ # },
1632
+ # {
1633
+ # "orderId": "80465575289094144",
1634
+ # "clientOid": null,
1635
+ # "code": "200",
1636
+ # "msg": "success"
1637
+ # }
1638
+ # ]
1639
+ # }
1640
+ #
1641
+ orders = self.safe_list(response, 'data', [])
1642
+ return self.parse_orders(orders, market)
1643
+
1564
1644
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1565
1645
  """
1566
1646
  cancel all open orders
@@ -2163,8 +2163,10 @@ class mexc(Exchange, ImplicitAPI):
2163
2163
  order = self.parse_order(response, market)
2164
2164
  order['side'] = side
2165
2165
  order['type'] = type
2166
- order['price'] = price
2167
- order['amount'] = amount
2166
+ if self.safe_string(order, 'price') is None:
2167
+ order['price'] = price
2168
+ if self.safe_string(order, 'amount') is None:
2169
+ order['amount'] = amount
2168
2170
  return order
2169
2171
 
2170
2172
  async def create_swap_order(self, market, type, side, amount, price=None, marginMode=None, params={}):
ccxt/async_support/okx.py CHANGED
@@ -6828,6 +6828,7 @@ class okx(Exchange, ImplicitAPI):
6828
6828
  # "instType": "OPTION",
6829
6829
  # "oi": "300",
6830
6830
  # "oiCcy": "3",
6831
+ # "oiUsd": "3",
6831
6832
  # "ts": "1684551166251"
6832
6833
  # }
6833
6834
  #
@@ -6850,7 +6851,7 @@ class okx(Exchange, ImplicitAPI):
6850
6851
  else:
6851
6852
  baseVolume = self.safe_number(interest, 'oiCcy')
6852
6853
  openInterestAmount = self.safe_number(interest, 'oi')
6853
- openInterestValue = self.safe_number(interest, 'oiCcy')
6854
+ openInterestValue = self.safe_number(interest, 'oiUsd')
6854
6855
  return self.safe_open_interest({
6855
6856
  'symbol': self.safe_symbol(id),
6856
6857
  'baseVolume': baseVolume, # deprecated
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.17'
7
+ __version__ = '4.4.19'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/base/types.py CHANGED
@@ -360,6 +360,17 @@ class MarketMarginModes(TypedDict):
360
360
  cross: bool
361
361
  isolated: bool
362
362
 
363
+ class MinMax(TypedDict):
364
+ min: Num
365
+ max: Num
366
+
367
+ class MarketLimits(TypedDict):
368
+ amount: Optional[MinMax]
369
+ cost: Optional[MinMax]
370
+ leverage: Optional[MinMax]
371
+ price: Optional[MinMax]
372
+ market: Optional[MinMax]
373
+
363
374
  class MarketInterface(TypedDict):
364
375
  info: Dict[str, Any]
365
376
  id: Str
@@ -393,7 +404,7 @@ class MarketInterface(TypedDict):
393
404
  tierBased: bool
394
405
  feeSide: Str
395
406
  precision: Any
396
- limits: Any
407
+ limits: MarketLimits
397
408
  created: Int
398
409
 
399
410
  class Limit(TypedDict):
ccxt/binance.py CHANGED
@@ -827,6 +827,7 @@ class binance(Exchange, ImplicitAPI):
827
827
  'constituents': 2,
828
828
  'apiTradingStatus': {'cost': 1, 'noSymbol': 10},
829
829
  'lvtKlines': 1,
830
+ 'convert/exchangeInfo': 4,
830
831
  },
831
832
  },
832
833
  'fapiData': {
@@ -880,6 +881,7 @@ class binance(Exchange, ImplicitAPI):
880
881
  'feeBurn': 1,
881
882
  'symbolConfig': 5,
882
883
  'accountConfig': 5,
884
+ 'convert/orderStatus': 5,
883
885
  },
884
886
  'post': {
885
887
  'batchOrders': 5,
@@ -895,6 +897,8 @@ class binance(Exchange, ImplicitAPI):
895
897
  'apiReferral/customization': 1,
896
898
  'apiReferral/userCustomization': 1,
897
899
  'feeBurn': 1,
900
+ 'convert/getQuote': 200, # 360 requests per hour
901
+ 'convert/acceptQuote': 20,
898
902
  },
899
903
  'put': {
900
904
  'listenKey': 1,
@@ -3161,14 +3165,15 @@ class binance(Exchange, ImplicitAPI):
3161
3165
  fees = self.fees
3162
3166
  linear = None
3163
3167
  inverse = None
3164
- strike = self.safe_string(market, 'strikePrice')
3165
3168
  symbol = base + '/' + quote
3169
+ strike = None
3166
3170
  if contract:
3167
3171
  if swap:
3168
3172
  symbol = symbol + ':' + settle
3169
3173
  elif future:
3170
3174
  symbol = symbol + ':' + settle + '-' + self.yymmdd(expiry)
3171
3175
  elif option:
3176
+ strike = self.number_to_string(self.parse_to_numeric(self.safe_string(market, 'strikePrice')))
3172
3177
  symbol = symbol + ':' + settle + '-' + self.yymmdd(expiry) + '-' + strike + '-' + self.safe_string(optionParts, 3)
3173
3178
  contractSize = self.safe_number_2(market, 'contractSize', 'unit', self.parse_number('1'))
3174
3179
  linear = settle == quote
@@ -5946,11 +5951,21 @@ class binance(Exchange, ImplicitAPI):
5946
5951
  if isPortfolioMargin:
5947
5952
  request['quantity'] = self.parse_to_numeric(amount)
5948
5953
  else:
5949
- request['quantity'] = self.amount_to_precision(symbol, amount)
5954
+ marketAmountPrecision = self.safe_string(market['precision'], 'amount')
5955
+ isPrecisionAvailable = (marketAmountPrecision is not None)
5956
+ if isPrecisionAvailable:
5957
+ request['quantity'] = self.amount_to_precision(symbol, amount)
5958
+ else:
5959
+ request['quantity'] = self.parse_to_numeric(amount) # some options don't have the precision available
5950
5960
  if priceIsRequired and not isPriceMatch:
5951
5961
  if price is None:
5952
5962
  raise InvalidOrder(self.id + ' createOrder() requires a price argument for a ' + type + ' order')
5953
- request['price'] = self.price_to_precision(symbol, price)
5963
+ pricePrecision = self.safe_string(market['precision'], 'price')
5964
+ isPricePrecisionAvailable = (pricePrecision is not None)
5965
+ if isPricePrecisionAvailable:
5966
+ request['price'] = self.price_to_precision(symbol, price)
5967
+ else:
5968
+ request['price'] = self.parse_to_numeric(price) # some options don't have the precision available
5954
5969
  if stopPriceIsRequired:
5955
5970
  if market['contract']:
5956
5971
  if stopPrice is None:
ccxt/bingx.py CHANGED
@@ -508,6 +508,7 @@ class bingx(Exchange, ImplicitAPI):
508
508
  },
509
509
  'networks': {
510
510
  'ARB': 'ARBITRUM',
511
+ 'MATIC': 'POLYGON',
511
512
  },
512
513
  },
513
514
  })
@@ -613,9 +614,10 @@ class bingx(Exchange, ImplicitAPI):
613
614
  'max': self.safe_number(rawNetwork, 'withdrawMax'),
614
615
  },
615
616
  }
617
+ fee = self.safe_number(rawNetwork, 'withdrawFee')
616
618
  if isDefault:
617
- fee = self.safe_number(rawNetwork, 'withdrawFee')
618
619
  defaultLimits = limits
620
+ precision = self.safe_number(rawNetwork, 'withdrawPrecision')
619
621
  networkActive = networkDepositEnabled or networkWithdrawEnabled
620
622
  networks[networkCode] = {
621
623
  'info': rawNetwork,
@@ -625,7 +627,7 @@ class bingx(Exchange, ImplicitAPI):
625
627
  'active': networkActive,
626
628
  'deposit': networkDepositEnabled,
627
629
  'withdraw': networkWithdrawEnabled,
628
- 'precision': None,
630
+ 'precision': precision,
629
631
  'limits': limits,
630
632
  }
631
633
  active = depositEnabled or withdrawEnabled
@@ -770,7 +772,7 @@ class bingx(Exchange, ImplicitAPI):
770
772
  isActive = False
771
773
  if (self.safe_string(market, 'apiStateOpen') == 'true') and (self.safe_string(market, 'apiStateClose') == 'true'):
772
774
  isActive = True # swap active
773
- elif self.safe_bool(market, 'apiStateSell') and self.safe_bool(market, 'apiStateBuy') and (self.safe_number(market, 'status') == 1):
775
+ elif self.safe_bool(market, 'apiStateSell') and self.safe_bool(market, 'apiStateBuy') and (self.safe_string(market, 'status') == '1'):
774
776
  isActive = True # spot active
775
777
  isInverse = None if (spot) else checkIsInverse
776
778
  isLinear = None if (spot) else checkIsLinear
ccxt/bitget.py CHANGED
@@ -1444,7 +1444,7 @@ class bitget(Exchange, ImplicitAPI):
1444
1444
  'ARB': 'ArbitrumOne',
1445
1445
  'ZKSYNC': 'zkSyncEra',
1446
1446
  'STARKNET': 'Starknet',
1447
- 'APT': 'APTOS',
1447
+ 'APT': 'Aptos',
1448
1448
  'MATIC': 'Polygon',
1449
1449
  'VIC': 'VICTION',
1450
1450
  'AVAXC': 'C-Chain',
ccxt/bitmart.py CHANGED
@@ -1287,7 +1287,7 @@ class bitmart(Exchange, ImplicitAPI):
1287
1287
  'close': last,
1288
1288
  'last': last,
1289
1289
  'previousClose': None,
1290
- 'change': change,
1290
+ 'change': None,
1291
1291
  'percentage': percentage,
1292
1292
  'average': average,
1293
1293
  'baseVolume': baseVolume,
ccxt/bitso.py CHANGED
@@ -124,6 +124,12 @@ class bitso(Exchange, ImplicitAPI):
124
124
  'TUSD': 0.01,
125
125
  },
126
126
  'defaultPrecision': 0.00000001,
127
+ 'networks': {
128
+ 'TRC20': 'trx',
129
+ 'ERC20': 'erc20',
130
+ 'BEP20': 'bsc',
131
+ 'BEP2': 'bep2',
132
+ },
127
133
  },
128
134
  'timeframes': {
129
135
  '1m': '60',
@@ -1548,18 +1554,6 @@ class bitso(Exchange, ImplicitAPI):
1548
1554
  first = self.safe_dict(payload, 0)
1549
1555
  return self.parse_transaction(first, currency)
1550
1556
 
1551
- def safe_network(self, networkId):
1552
- if networkId is None:
1553
- return None
1554
- networkId = networkId.upper()
1555
- networksById: dict = {
1556
- 'trx': 'TRC20',
1557
- 'erc20': 'ERC20',
1558
- 'bsc': 'BEP20',
1559
- 'bep2': 'BEP2',
1560
- }
1561
- return self.safe_string(networksById, networkId, networkId)
1562
-
1563
1557
  def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
1564
1558
  #
1565
1559
  # deposit
@@ -1606,12 +1600,14 @@ class bitso(Exchange, ImplicitAPI):
1606
1600
  networkId = self.safe_string_2(transaction, 'network', 'method')
1607
1601
  status = self.safe_string(transaction, 'status')
1608
1602
  withdrawId = self.safe_string(transaction, 'wid')
1603
+ networkCode = self.network_id_to_code(networkId)
1604
+ networkCodeUpper = networkCode.upper() if (networkCode is not None) else None
1609
1605
  return {
1610
1606
  'id': self.safe_string_2(transaction, 'wid', 'fid'),
1611
1607
  'txid': self.safe_string(details, 'tx_hash'),
1612
1608
  'timestamp': self.parse8601(datetime),
1613
1609
  'datetime': datetime,
1614
- 'network': self.safe_network(networkId),
1610
+ 'network': networkCodeUpper,
1615
1611
  'addressFrom': receivingAddress,
1616
1612
  'address': withdrawalAddress if (withdrawalAddress is not None) else receivingAddress,
1617
1613
  'addressTo': withdrawalAddress,
ccxt/gate.py CHANGED
@@ -3490,32 +3490,61 @@ class gate(Exchange, ImplicitAPI):
3490
3490
 
3491
3491
  def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
3492
3492
  #
3493
- # deposits
3493
+ # fetchDeposits
3494
3494
  #
3495
- # {
3496
- # "id": "d33361395",
3497
- # "currency": "USDT_TRX",
3498
- # "address": "TErdnxenuLtXfnMafLbfappYdHtnXQ5U4z",
3499
- # "amount": "100",
3500
- # "txid": "ae9374de34e558562fe18cbb1bf9ab4d9eb8aa7669d65541c9fa2a532c1474a0",
3501
- # "timestamp": "1626345819",
3502
- # "status": "DONE",
3503
- # "memo": ""
3504
- # }
3495
+ # {
3496
+ # "id": "d33361395",
3497
+ # "currency": "USDT_TRX",
3498
+ # "address": "TErdnxenuLtXfnMafLbfappYdHtnXQ5U4z",
3499
+ # "amount": "100",
3500
+ # "txid": "ae9374de34e558562fe18cbb1bf9ab4d9eb8aa7669d65541c9fa2a532c1474a0",
3501
+ # "timestamp": "1626345819",
3502
+ # "status": "DONE",
3503
+ # "memo": ""
3504
+ # }
3505
3505
  #
3506
3506
  # withdraw
3507
3507
  #
3508
- # {
3509
- # "id": "w13389675",
3510
- # "currency": "USDT",
3511
- # "amount": "50",
3512
- # "address": "TUu2rLFrmzUodiWfYki7QCNtv1akL682p1",
3513
- # "memo": null
3514
- # }
3508
+ # {
3509
+ # "id":"w64413318",
3510
+ # "currency":"usdt",
3511
+ # "amount":"10150",
3512
+ # "address":"0x0ab891497116f7f5532a4c2f4f7b1784488628e1",
3513
+ # "memo":null,
3514
+ # "status":"REQUEST",
3515
+ # "chain":"eth",
3516
+ # "withdraw_order_id":"",
3517
+ # "fee_amount":"4.15000000"
3518
+ # }
3519
+ #
3520
+ # fetchWithdrawals
3521
+ #
3522
+ # {
3523
+ # "id": "210496",
3524
+ # "timestamp": "1542000000",
3525
+ # "withdraw_order_id": "order_123456",
3526
+ # "currency": "USDT",
3527
+ # "address": "1HkxtBAMrA3tP5ENnYY2CZortjZvFDH5Cs",
3528
+ # "txid": "128988928203223323290",
3529
+ # "block_number": "41575382",
3530
+ # "amount": "222.61",
3531
+ # "fee": "0.01",
3532
+ # "memo": "",
3533
+ # "status": "DONE",
3534
+ # "chain": "TRX"
3535
+ # }
3536
+ #
3537
+ # {
3538
+ # "id": "w13389675",
3539
+ # "currency": "USDT",
3540
+ # "amount": "50",
3541
+ # "address": "TUu2rLFrmzUodiWfYki7QCNtv1akL682p1",
3542
+ # "memo": null
3543
+ # }
3515
3544
  #
3516
3545
  # {
3517
3546
  # "currency":"usdt",
3518
- # "address":"0x01b0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806",
3547
+ # "address":"0x01c0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806",
3519
3548
  # "amount":"1880",
3520
3549
  # "chain":"eth"
3521
3550
  # }
@@ -3530,7 +3559,7 @@ class gate(Exchange, ImplicitAPI):
3530
3559
  amountString = Precise.string_abs(amountString)
3531
3560
  else:
3532
3561
  type = self.parse_transaction_type(id[0])
3533
- feeCostString = self.safe_string(transaction, 'fee')
3562
+ feeCostString = self.safe_string_2(transaction, 'fee', 'fee_amount')
3534
3563
  if type == 'withdrawal':
3535
3564
  amountString = Precise.string_sub(amountString, feeCostString)
3536
3565
  networkId = self.safe_string_upper(transaction, 'chain')
ccxt/htx.py CHANGED
@@ -1253,6 +1253,16 @@ class htx(Exchange, ImplicitAPI):
1253
1253
  })
1254
1254
 
1255
1255
  def fetch_status(self, params={}):
1256
+ """
1257
+ the latest known information on the availability of the exchange API
1258
+ :see: https://huobiapi.github.io/docs/spot/v1/en/#get-system-status
1259
+ :see: https://huobiapi.github.io/docs/dm/v1/en/#get-system-status
1260
+ :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-system-status
1261
+ :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#get-system-status
1262
+ :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#query-whether-the-system-is-available # contractPublicGetHeartbeat
1263
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1264
+ :returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
1265
+ """
1256
1266
  self.load_markets()
1257
1267
  marketType = None
1258
1268
  marketType, params = self.handle_market_type_and_params('fetchStatus', None, params)
@@ -1464,6 +1474,8 @@ class htx(Exchange, ImplicitAPI):
1464
1474
  def fetch_time(self, params={}):
1465
1475
  """
1466
1476
  fetches the current integer timestamp in milliseconds from the exchange server
1477
+ :see: https://huobiapi.github.io/docs/spot/v1/en/#get-current-timestamp
1478
+ :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-current-system-timestamp
1467
1479
  :param dict [params]: extra parameters specific to the exchange API endpoint
1468
1480
  :returns int: the current integer timestamp in milliseconds from the exchange server
1469
1481
  """
@@ -1510,6 +1522,7 @@ class htx(Exchange, ImplicitAPI):
1510
1522
  def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
1511
1523
  """
1512
1524
  fetch the trading fees for a market
1525
+ :see: https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1513
1526
  :param str symbol: unified market symbol
1514
1527
  :param dict [params]: extra parameters specific to the exchange API endpoint
1515
1528
  :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
@@ -1553,6 +1566,13 @@ class htx(Exchange, ImplicitAPI):
1553
1566
  return result
1554
1567
 
1555
1568
  def fetch_trading_limits_by_id(self, id: str, params={}):
1569
+ """
1570
+ * @ignore
1571
+ :see: https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
1572
+ :param str id: market id
1573
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1574
+ :returns dict: the limits object of a market structure
1575
+ """
1556
1576
  request: dict = {
1557
1577
  'symbol': id,
1558
1578
  }
@@ -5913,6 +5933,7 @@ class htx(Exchange, ImplicitAPI):
5913
5933
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5914
5934
  """
5915
5935
  fetch all withdrawals made from an account
5936
+ :see: https://huobiapi.github.io/docs/spot/v1/en/#search-for-existed-withdraws-and-deposits
5916
5937
  :param str code: unified currency code
5917
5938
  :param int [since]: the earliest time in ms to fetch withdrawals for
5918
5939
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -6238,6 +6259,7 @@ class htx(Exchange, ImplicitAPI):
6238
6259
  def fetch_isolated_borrow_rates(self, params={}) -> IsolatedBorrowRates:
6239
6260
  """
6240
6261
  fetch the borrow interest rates of all currencies
6262
+ :see: https://huobiapi.github.io/docs/spot/v1/en/#get-loan-interest-rate-and-quota-isolated
6241
6263
  :param dict [params]: extra parameters specific to the exchange API endpoint
6242
6264
  :returns dict: a list of `isolated borrow rate structures <https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure>`
6243
6265
  """
@@ -6448,6 +6470,8 @@ class htx(Exchange, ImplicitAPI):
6448
6470
  def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
6449
6471
  """
6450
6472
  fetch the current funding rate
6473
+ :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-funding-rate
6474
+ :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-funding-rate
6451
6475
  :param str symbol: unified market symbol
6452
6476
  :param dict [params]: extra parameters specific to the exchange API endpoint
6453
6477
  :returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
@@ -6485,6 +6509,8 @@ class htx(Exchange, ImplicitAPI):
6485
6509
  def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
6486
6510
  """
6487
6511
  fetch the funding rate for multiple markets
6512
+ :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-funding-rate
6513
+ :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-funding-rate
6488
6514
  :param str[]|None symbols: list of unified market symbols
6489
6515
  :param dict [params]: extra parameters specific to the exchange API endpoint
6490
6516
  :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
ccxt/hyperliquid.py CHANGED
@@ -1879,6 +1879,10 @@ class hyperliquid(Exchange, ImplicitAPI):
1879
1879
  statuses: dict = {
1880
1880
  'triggered': 'open',
1881
1881
  'filled': 'closed',
1882
+ 'open': 'open',
1883
+ 'canceled': 'canceled',
1884
+ 'rejected': 'rejected',
1885
+ 'marginCanceled': 'canceled',
1882
1886
  }
1883
1887
  return self.safe_string(statuses, status, status)
1884
1888
 
ccxt/kucoin.py CHANGED
@@ -4724,7 +4724,7 @@ class kucoin(Exchange, ImplicitAPI):
4724
4724
  headers = headers if (headers is not None) else {}
4725
4725
  url = self.urls['api'][api]
4726
4726
  if not self.is_empty(query):
4727
- if (method == 'GET') or (method == 'DELETE'):
4727
+ if ((method == 'GET') or (method == 'DELETE')) and (path != 'orders/multi-cancel'):
4728
4728
  endpoint += '?' + self.rawencode(query)
4729
4729
  else:
4730
4730
  body = self.json(query)