ccxt 4.4.72__py2.py3-none-any.whl → 4.4.73__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.
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bybit import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LeverageTiers, LongShortRatio, Market, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
10
+ from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LeverageTiers, Liquidation, LongShortRatio, Market, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -2476,7 +2476,7 @@ class bybit(Exchange, ImplicitAPI):
2476
2476
  tickerList = self.safe_list(result, 'list', [])
2477
2477
  return self.parse_tickers(tickerList, parsedSymbols)
2478
2478
 
2479
- async def fetch_bids_asks(self, symbols: Strings = None, params={}):
2479
+ async def fetch_bids_asks(self, symbols: Strings = None, params={}) -> Tickers:
2480
2480
  """
2481
2481
  fetches the bid and ask price and volume for multiple markets
2482
2482
 
@@ -3690,7 +3690,7 @@ class bybit(Exchange, ImplicitAPI):
3690
3690
  'trades': None,
3691
3691
  }, market)
3692
3692
 
3693
- async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
3693
+ async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
3694
3694
  """
3695
3695
  create a market buy order by providing the symbol and cost
3696
3696
 
@@ -3707,7 +3707,7 @@ class bybit(Exchange, ImplicitAPI):
3707
3707
  raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
3708
3708
  return await self.create_order(symbol, 'market', 'buy', cost, 1, params)
3709
3709
 
3710
- async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
3710
+ async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
3711
3711
  """
3712
3712
  create a market sell order by providing the symbol and cost
3713
3713
 
@@ -3728,7 +3728,7 @@ class bybit(Exchange, ImplicitAPI):
3728
3728
  raise NotSupported(self.id + ' createMarketSellOrderWithCost() supports spot orders only')
3729
3729
  return await self.create_order(symbol, 'market', 'sell', cost, 1, params)
3730
3730
 
3731
- async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
3731
+ async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
3732
3732
  """
3733
3733
  create a trade order
3734
3734
 
@@ -3987,7 +3987,7 @@ class bybit(Exchange, ImplicitAPI):
3987
3987
  params = self.omit(params, ['stopPrice', 'timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'clientOrderId', 'triggerPrice', 'stopLoss', 'takeProfit', 'trailingAmount', 'trailingTriggerPrice', 'hedged'])
3988
3988
  return self.extend(request, params)
3989
3989
 
3990
- async def create_orders(self, orders: List[OrderRequest], params={}):
3990
+ async def create_orders(self, orders: List[OrderRequest], params={}) -> List[Order]:
3991
3991
  """
3992
3992
  create a list of trade orders
3993
3993
 
@@ -4137,7 +4137,7 @@ class bybit(Exchange, ImplicitAPI):
4137
4137
  params = self.omit(params, ['stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'clientOrderId', 'stopLoss', 'takeProfit'])
4138
4138
  return request
4139
4139
 
4140
- async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
4140
+ async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}) -> Order:
4141
4141
  """
4142
4142
  edit a trade order
4143
4143
 
@@ -4187,7 +4187,7 @@ class bybit(Exchange, ImplicitAPI):
4187
4187
  'id': self.safe_string(result, 'orderId'),
4188
4188
  })
4189
4189
 
4190
- async def edit_orders(self, orders: List[OrderRequest], params={}):
4190
+ async def edit_orders(self, orders: List[OrderRequest], params={}) -> List[Order]:
4191
4191
  """
4192
4192
  edit a list of trade orders
4193
4193
 
@@ -4298,7 +4298,7 @@ class bybit(Exchange, ImplicitAPI):
4298
4298
  request['category'] = 'option'
4299
4299
  return self.extend(request, params)
4300
4300
 
4301
- async def cancel_order(self, id: str, symbol: Str = None, params={}):
4301
+ async def cancel_order(self, id: str, symbol: Str = None, params={}) -> Order:
4302
4302
  """
4303
4303
  cancels an open order
4304
4304
 
@@ -4333,7 +4333,7 @@ class bybit(Exchange, ImplicitAPI):
4333
4333
  result = self.safe_dict(response, 'result', {})
4334
4334
  return self.parse_order(result, market)
4335
4335
 
4336
- async def cancel_orders(self, ids, symbol: Str = None, params={}):
4336
+ async def cancel_orders(self, ids, symbol: Str = None, params={}) -> List[Order]:
4337
4337
  """
4338
4338
  cancel multiple orders
4339
4339
 
@@ -4602,7 +4602,7 @@ class bybit(Exchange, ImplicitAPI):
4602
4602
  return response
4603
4603
  return self.parse_orders(orders, market)
4604
4604
 
4605
- async def fetch_order_classic(self, id: str, symbol: Str = None, params={}):
4605
+ async def fetch_order_classic(self, id: str, symbol: Str = None, params={}) -> Order:
4606
4606
  """
4607
4607
  fetches information on an order made by the user *classic accounts only*
4608
4608
 
@@ -4847,7 +4847,7 @@ classic accounts only/ spot not supported* fetches information on an order made
4847
4847
  data = self.add_pagination_cursor_to_result(response)
4848
4848
  return self.parse_orders(data, market, since, limit)
4849
4849
 
4850
- async def fetch_closed_order(self, id: str, symbol: Str = None, params={}):
4850
+ async def fetch_closed_order(self, id: str, symbol: Str = None, params={}) -> Order:
4851
4851
  """
4852
4852
  fetches information on a closed order made by the user
4853
4853
 
@@ -4877,7 +4877,7 @@ classic accounts only/ spot not supported* fetches information on an order made
4877
4877
  raise InvalidOrder(self.id + ' returned more than one order')
4878
4878
  return self.safe_value(result, 0)
4879
4879
 
4880
- async def fetch_open_order(self, id: str, symbol: Str = None, params={}):
4880
+ async def fetch_open_order(self, id: str, symbol: Str = None, params={}) -> Order:
4881
4881
  """
4882
4882
  fetches information on an open order made by the user
4883
4883
 
@@ -5033,7 +5033,7 @@ classic accounts only/ spot not supported* fetches information on an order made
5033
5033
  }
5034
5034
  return await self.fetch_canceled_and_closed_orders(symbol, since, limit, self.extend(request, params))
5035
5035
 
5036
- async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5036
+ async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
5037
5037
  """
5038
5038
  fetches information on multiple canceled orders made by the user
5039
5039
 
@@ -5156,7 +5156,7 @@ classic accounts only/ spot not supported* fetches information on an order made
5156
5156
  data = self.add_pagination_cursor_to_result(response)
5157
5157
  return self.parse_orders(data, market, since, limit)
5158
5158
 
5159
- async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5159
+ async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
5160
5160
  """
5161
5161
  fetch all the trades made from a single order
5162
5162
 
@@ -5178,7 +5178,7 @@ classic accounts only/ spot not supported* fetches information on an order made
5178
5178
  params = self.omit(params, ['clientOrderId', 'orderLinkId'])
5179
5179
  return await self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
5180
5180
 
5181
- async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5181
+ async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
5182
5182
  """
5183
5183
  fetch all trades made by the user
5184
5184
 
@@ -5901,7 +5901,7 @@ classic accounts only/ spot not supported* fetches information on an order made
5901
5901
  result = self.safe_dict(response, 'result', {})
5902
5902
  return self.parse_transaction(result, currency)
5903
5903
 
5904
- async def fetch_position(self, symbol: str, params={}):
5904
+ async def fetch_position(self, symbol: str, params={}) -> Position:
5905
5905
  """
5906
5906
  fetch data on a single open contract trade position
5907
5907
 
@@ -5972,7 +5972,7 @@ classic accounts only/ spot not supported* fetches information on an order made
5972
5972
  position['datetime'] = self.iso8601(timestamp)
5973
5973
  return position
5974
5974
 
5975
- async def fetch_positions(self, symbols: Strings = None, params={}):
5975
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
5976
5976
  """
5977
5977
  fetch all open positions
5978
5978
 
@@ -5984,9 +5984,14 @@ classic accounts only/ spot not supported* fetches information on an order made
5984
5984
  :param str [params.subType]: market subType, ['linear', 'inverse']
5985
5985
  :param str [params.baseCoin]: Base coin. Supports linear, inverse & option
5986
5986
  :param str [params.settleCoin]: Settle coin. Supports linear, inverse & option
5987
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times
5987
5988
  :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
5988
5989
  """
5989
5990
  await self.load_markets()
5991
+ paginate = False
5992
+ paginate, params = self.handle_option_and_params(params, 'fetchPositions', 'paginate')
5993
+ if paginate:
5994
+ return await self.fetch_paginated_call_cursor('fetchPositions', symbols, None, None, params, 'nextPageCursor', 'cursor', None, 200)
5990
5995
  symbol = None
5991
5996
  if (symbols is not None) and isinstance(symbols, list):
5992
5997
  symbolsLength = len(symbols)
@@ -6017,6 +6022,8 @@ classic accounts only/ spot not supported* fetches information on an order made
6017
6022
  # inverse
6018
6023
  if symbol is None and baseCoin is None:
6019
6024
  request['category'] = 'inverse'
6025
+ if self.safe_integer(params, 'limit') is None:
6026
+ request['limit'] = 200 # max limit
6020
6027
  params = self.omit(params, ['type'])
6021
6028
  request['category'] = type
6022
6029
  response = await self.privateGetV5PositionList(self.extend(request, params))
@@ -6065,7 +6072,7 @@ classic accounts only/ spot not supported* fetches information on an order made
6065
6072
  results.append(self.parse_position(rawPosition))
6066
6073
  return self.filter_by_array_positions(results, 'symbol', symbols, False)
6067
6074
 
6068
- def parse_position(self, position: dict, market: Market = None):
6075
+ def parse_position(self, position: dict, market: Market = None) -> Position:
6069
6076
  #
6070
6077
  # linear swap
6071
6078
  #
@@ -7016,7 +7023,7 @@ classic accounts only/ spot not supported* fetches information on an order made
7016
7023
  'amount': amount,
7017
7024
  })
7018
7025
 
7019
- def parse_margin_loan(self, info, currency: Currency = None):
7026
+ def parse_margin_loan(self, info, currency: Currency = None) -> dict:
7020
7027
  #
7021
7028
  # borrowCrossMargin
7022
7029
  #
@@ -7254,7 +7261,7 @@ classic accounts only/ spot not supported* fetches information on an order made
7254
7261
  result[symbol] = fee
7255
7262
  return result
7256
7263
 
7257
- def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
7264
+ def parse_deposit_withdraw_fee(self, fee, currency: Currency = None) -> Any:
7258
7265
  #
7259
7266
  # {
7260
7267
  # "name": "BTC",
@@ -7702,7 +7709,7 @@ classic accounts only/ spot not supported* fetches information on an order made
7702
7709
  'info': greeks,
7703
7710
  }
7704
7711
 
7705
- async def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
7712
+ async def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
7706
7713
  """
7707
7714
  retrieves the users liquidated positions
7708
7715
 
@@ -7781,7 +7788,7 @@ classic accounts only/ spot not supported* fetches information on an order made
7781
7788
  liquidations = self.add_pagination_cursor_to_result(response)
7782
7789
  return self.parse_liquidations(liquidations, market, since, limit)
7783
7790
 
7784
- def parse_liquidation(self, liquidation, market: Market = None):
7791
+ def parse_liquidation(self, liquidation, market: Market = None) -> Liquidation:
7785
7792
  #
7786
7793
  # {
7787
7794
  # "symbol": "ETHPERP",
@@ -7944,7 +7951,7 @@ classic accounts only/ spot not supported* fetches information on an order made
7944
7951
  })
7945
7952
  return tiers
7946
7953
 
7947
- async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
7954
+ async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[FundingHistory]:
7948
7955
  """
7949
7956
  fetch the history of funding payments paid and received on self account
7950
7957
 
@@ -7985,7 +7992,7 @@ classic accounts only/ spot not supported* fetches information on an order made
7985
7992
  fundings = self.add_pagination_cursor_to_result(response)
7986
7993
  return self.parse_incomes(fundings, market, since, limit)
7987
7994
 
7988
- def parse_income(self, income, market: Market = None):
7995
+ def parse_income(self, income, market: Market = None) -> object:
7989
7996
  #
7990
7997
  # {
7991
7998
  # "symbol": "XMRUSDT",
@@ -614,7 +614,7 @@ class defx(Exchange, ImplicitAPI):
614
614
  'active': self.safe_string(market, 'status', '') == 'active',
615
615
  'contract': True,
616
616
  'linear': True,
617
- 'inverse': None,
617
+ 'inverse': False,
618
618
  'taker': self.safe_number(fees, 'taker'),
619
619
  'maker': self.safe_number(fees, 'maker'),
620
620
  'contractSize': self.parse_number('1'),
@@ -641,6 +641,8 @@ class derive(Exchange, ImplicitAPI):
641
641
  optionType = 'put'
642
642
  else:
643
643
  optionType = 'call'
644
+ linear = True
645
+ inverse = False
644
646
  return self.safe_market_structure({
645
647
  'id': marketId,
646
648
  'symbol': symbol,
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.72'
7
+ __version__ = '4.4.73'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -6471,19 +6471,13 @@ class Exchange(object):
6471
6471
  return self.sort_by(result, 'id', True)
6472
6472
  return result
6473
6473
 
6474
- def remove_repeated_elements_from_array(self, input):
6474
+ def remove_repeated_elements_from_array(self, input, fallbackToTimestamp: bool = True):
6475
6475
  uniqueResult = {}
6476
6476
  for i in range(0, len(input)):
6477
6477
  entry = input[i]
6478
- id = self.safe_string(entry, 'id')
6479
- if id is not None:
6480
- if self.safe_string(uniqueResult, id) is None:
6481
- uniqueResult[id] = entry
6482
- else:
6483
- timestamp = self.safe_integer_2(entry, 'timestamp', 0)
6484
- if timestamp is not None:
6485
- if self.safe_string(uniqueResult, timestamp) is None:
6486
- uniqueResult[timestamp] = entry
6478
+ uniqValue = self.safe_string_n(entry, ['id', 'timestamp', 0]) if fallbackToTimestamp else self.safe_string(entry, 'id')
6479
+ if uniqValue is not None and not (uniqValue in uniqueResult):
6480
+ uniqueResult[uniqValue] = entry
6487
6481
  values = list(uniqueResult.values())
6488
6482
  valuesLength = len(values)
6489
6483
  if valuesLength > 0:
ccxt/binance.py CHANGED
@@ -1317,12 +1317,13 @@ class binance(Exchange, ImplicitAPI):
1317
1317
  },
1318
1318
  'quoteOrderQty': True, # whether market orders support amounts in quote currency
1319
1319
  'broker': {
1320
- 'spot': 'x-R4BD3S82',
1321
- 'margin': 'x-R4BD3S82',
1322
- 'future': 'x-xcKtGhcu',
1320
+ 'spot': 'x-TKT5PX2F',
1321
+ 'margin': 'x-TKT5PX2F',
1322
+ 'future': 'x-cvBPrNm9',
1323
1323
  'delivery': 'x-xcKtGhcu',
1324
- 'swap': 'x-xcKtGhcu',
1324
+ 'swap': 'x-cvBPrNm9',
1325
1325
  'option': 'x-xcKtGhcu',
1326
+ 'inverse': 'x-xcKtGhcu',
1326
1327
  },
1327
1328
  'accountsByType': {
1328
1329
  'main': 'MAIN',
@@ -5161,7 +5162,7 @@ class binance(Exchange, ImplicitAPI):
5161
5162
  # "symbol": "BTCUSDT",
5162
5163
  # "orderId": 16383176297,
5163
5164
  # "orderListId": -1,
5164
- # "clientOrderId": "x-R4BD3S8222ecb58eb9074fb1be018c",
5165
+ # "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
5165
5166
  # "transactTime": 1670891847932,
5166
5167
  # "price": "13500.00000000",
5167
5168
  # "origQty": "0.00085000",
@@ -5517,7 +5518,7 @@ class binance(Exchange, ImplicitAPI):
5517
5518
  # "symbol": "BTCUSDT",
5518
5519
  # "orderId": 16383176297,
5519
5520
  # "orderListId": -1,
5520
- # "clientOrderId": "x-R4BD3S8222ecb58eb9074fb1be018c",
5521
+ # "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
5521
5522
  # "transactTime": 1670891847932,
5522
5523
  # "price": "13500.00000000",
5523
5524
  # "origQty": "0.00085000",
@@ -5580,7 +5581,7 @@ class binance(Exchange, ImplicitAPI):
5580
5581
  # "symbol": "BTCUSDT",
5581
5582
  # "orderId": 5403233939,
5582
5583
  # "orderListId": -1,
5583
- # "clientOrderId": "x-R4BD3S825e669e75b6c14f69a2c43e",
5584
+ # "clientOrderId": "x-TKT5PX2F5e669e75b6c14f69a2c43e",
5584
5585
  # "transactTime": 1617151923742,
5585
5586
  # "price": "0.00000000",
5586
5587
  # "origQty": "0.00050000",
@@ -5755,7 +5756,7 @@ class binance(Exchange, ImplicitAPI):
5755
5756
  # createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin
5756
5757
  #
5757
5758
  # {
5758
- # "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
5759
+ # "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
5759
5760
  # "cummulativeQuoteQty": "0.00000000",
5760
5761
  # "executedQty": "0.00000000",
5761
5762
  # "fills": [],
@@ -5776,7 +5777,7 @@ class binance(Exchange, ImplicitAPI):
5776
5777
  # {
5777
5778
  # "symbol": "BTCUSDT",
5778
5779
  # "orderId": 24700763749,
5779
- # "clientOrderId": "x-R4BD3S826f724c2a4af6425f98c7b6",
5780
+ # "clientOrderId": "x-TKT5PX2F6f724c2a4af6425f98c7b6",
5780
5781
  # "price": "35000.00000000",
5781
5782
  # "origQty": "0.00100000",
5782
5783
  # "executedQty": "0.00000000",
@@ -6315,8 +6316,11 @@ class binance(Exchange, ImplicitAPI):
6315
6316
  clientOrderIdRequest = 'newClientStrategyId' if isPortfolioMarginConditional else 'newClientOrderId'
6316
6317
  if clientOrderId is None:
6317
6318
  broker = self.safe_dict(self.options, 'broker', {})
6318
- defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-R4BD3S82'
6319
- brokerId = self.safe_string(broker, marketType, defaultId)
6319
+ defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-TKT5PX2F'
6320
+ idMarketType = 'spot'
6321
+ if market['contract']:
6322
+ idMarketType = 'swap' if (market['swap'] and market['linear']) else 'inverse'
6323
+ brokerId = self.safe_string(broker, idMarketType, defaultId)
6320
6324
  request[clientOrderIdRequest] = brokerId + self.uuid22()
6321
6325
  else:
6322
6326
  request[clientOrderIdRequest] = clientOrderId
@@ -6835,7 +6839,7 @@ class binance(Exchange, ImplicitAPI):
6835
6839
  # {
6836
6840
  # "symbol": "BTCUSDT",
6837
6841
  # "orderId": 24684460474,
6838
- # "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
6842
+ # "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
6839
6843
  # "price": "35000.00000000",
6840
6844
  # "origQty": "0.00100000",
6841
6845
  # "executedQty": "0.00000000",
@@ -7448,7 +7452,7 @@ class binance(Exchange, ImplicitAPI):
7448
7452
  # [
7449
7453
  # {
7450
7454
  # "symbol": "ADAUSDT",
7451
- # "origClientOrderId": "x-R4BD3S82662cde7a90114475b86e21",
7455
+ # "origClientOrderId": "x-TKT5PX2F662cde7a90114475b86e21",
7452
7456
  # "orderId": 3935107,
7453
7457
  # "orderListId": -1,
7454
7458
  # "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
@@ -11323,7 +11327,7 @@ class binance(Exchange, ImplicitAPI):
11323
11327
  if newClientOrderId is None:
11324
11328
  isSpotOrMargin = (api.find('sapi') > -1 or api == 'private')
11325
11329
  marketType = 'spot' if isSpotOrMargin else 'future'
11326
- defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-R4BD3S82'
11330
+ defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-TKT5PX2F'
11327
11331
  broker = self.safe_dict(self.options, 'broker', {})
11328
11332
  brokerId = self.safe_string(broker, marketType, defaultId)
11329
11333
  params['newClientOrderId'] = brokerId + self.uuid22()
ccxt/bit2c.py CHANGED
@@ -62,23 +62,34 @@ class bit2c(Exchange, ImplicitAPI):
62
62
  'fetchMarginMode': False,
63
63
  'fetchMarkOHLCV': False,
64
64
  'fetchMyTrades': True,
65
+ 'fetchOpenInterest': False,
65
66
  'fetchOpenInterestHistory': False,
67
+ 'fetchOpenInterests': False,
66
68
  'fetchOpenOrders': True,
67
69
  'fetchOrder': True,
68
70
  'fetchOrderBook': True,
69
71
  'fetchPosition': False,
72
+ 'fetchPositionHistory': False,
70
73
  'fetchPositionMode': False,
71
74
  'fetchPositions': False,
75
+ 'fetchPositionsForSymbol': False,
76
+ 'fetchPositionsHistory': False,
72
77
  'fetchPositionsRisk': False,
73
78
  'fetchPremiumIndexOHLCV': False,
79
+ 'fetchSettlementHistory': False,
74
80
  'fetchTicker': True,
75
81
  'fetchTrades': True,
76
82
  'fetchTradingFee': False,
77
83
  'fetchTradingFees': True,
78
84
  'fetchTransfer': False,
79
85
  'fetchTransfers': False,
86
+ 'fetchUnderlyingAssets': False,
80
87
  'reduceMargin': False,
88
+ 'repayCrossMargin': False,
89
+ 'repayIsolatedMargin': False,
90
+ 'repayMargin': False,
81
91
  'setLeverage': False,
92
+ 'setMargin': False,
82
93
  'setMarginMode': False,
83
94
  'setPositionMode': False,
84
95
  'transfer': False,
ccxt/bitget.py CHANGED
@@ -1917,7 +1917,7 @@ class bitget(Exchange, ImplicitAPI):
1917
1917
  priceDecimals = self.safe_integer(market, 'pricePlace')
1918
1918
  amountDecimals = self.safe_integer(market, 'volumePlace')
1919
1919
  priceStep = self.safe_string(market, 'priceEndStep')
1920
- amountStep = self.safe_string(market, 'minTradeNum')
1920
+ amountStep = self.safe_string(market, 'sizeMultiplier')
1921
1921
  precise = Precise(priceStep)
1922
1922
  precise.decimals = max(precise.decimals, priceDecimals)
1923
1923
  precise.reduce()
@@ -2416,16 +2416,17 @@ class bitget(Exchange, ImplicitAPI):
2416
2416
  paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
2417
2417
  if paginate:
2418
2418
  return self.fetch_paginated_call_cursor('fetchWithdrawals', None, since, limit, params, 'idLessThan', 'idLessThan', None, 100)
2419
- if code is None:
2420
- raise ArgumentsRequired(self.id + ' fetchWithdrawals() requires a `code` argument')
2421
- currency = self.currency(code)
2419
+ currency = None
2420
+ if code is not None:
2421
+ currency = self.currency(code)
2422
2422
  if since is None:
2423
2423
  since = self.milliseconds() - 7776000000 # 90 days
2424
2424
  request: dict = {
2425
- 'coin': currency['id'],
2426
2425
  'startTime': since,
2427
2426
  'endTime': self.milliseconds(),
2428
2427
  }
2428
+ if currency is not None:
2429
+ request['coin'] = currency['id']
2429
2430
  request, params = self.handle_until_option('endTime', request, params)
2430
2431
  if limit is not None:
2431
2432
  request['limit'] = limit
ccxt/bitrue.py CHANGED
@@ -1229,7 +1229,7 @@ class bitrue(Exchange, ImplicitAPI):
1229
1229
  # "time": 1699338305000
1230
1230
  # }
1231
1231
  #
1232
- timestamp = self.safe_integer(response, 'time')
1232
+ timestamp = self.safe_integer_2(response, 'time', 'lastUpdateId')
1233
1233
  orderbook = self.parse_order_book(response, symbol, timestamp)
1234
1234
  orderbook['nonce'] = self.safe_integer(response, 'lastUpdateId')
1235
1235
  return orderbook