ccxt 4.3.77__py2.py3-none-any.whl → 4.3.79__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/binance.py CHANGED
@@ -3472,7 +3472,7 @@ class binance(Exchange, ImplicitAPI):
3472
3472
  #
3473
3473
  # futures(fapi)
3474
3474
  #
3475
- # fapiPrivateV2GetAccount
3475
+ # fapiPrivateV3GetAccount
3476
3476
  #
3477
3477
  # {
3478
3478
  # "feeTier":0,
@@ -8377,6 +8377,7 @@ class binance(Exchange, ImplicitAPI):
8377
8377
  :see: https://developers.binance.com/docs/wallet/asset/trade-fee
8378
8378
  :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
8379
8379
  :see: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
8380
+ :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
8380
8381
  :param dict [params]: extra parameters specific to the exchange API endpoint
8381
8382
  :param str [params.subType]: "linear" or "inverse"
8382
8383
  :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
@@ -8393,7 +8394,7 @@ class binance(Exchange, ImplicitAPI):
8393
8394
  if isSpotOrMargin:
8394
8395
  response = self.sapiGetAssetTradeFee(params)
8395
8396
  elif isLinear:
8396
- response = self.fapiPrivateV2GetAccount(params)
8397
+ response = self.fapiPrivateGetAccountConfig(params)
8397
8398
  elif isInverse:
8398
8399
  response = self.dapiPrivateGetAccount(params)
8399
8400
  #
@@ -9575,6 +9576,7 @@ class binance(Exchange, ImplicitAPI):
9575
9576
  :see: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
9576
9577
  :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
9577
9578
  :see: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
9579
+ :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3
9578
9580
  :param str[] [symbols]: list of unified market symbols
9579
9581
  :param dict [params]: extra parameters specific to the exchange API endpoint
9580
9582
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch positions in a portfolio margin account
@@ -9693,6 +9695,7 @@ class binance(Exchange, ImplicitAPI):
9693
9695
  :see: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
9694
9696
  :see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information
9695
9697
  :see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information
9698
+ :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3
9696
9699
  :param str[]|None symbols: list of unified market symbols
9697
9700
  :param dict [params]: extra parameters specific to the exchange API endpoint
9698
9701
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch positions for a portfolio margin account
@@ -10048,6 +10051,7 @@ class binance(Exchange, ImplicitAPI):
10048
10051
  :see: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
10049
10052
  :see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
10050
10053
  :see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
10054
+ :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
10051
10055
  :param str[] [symbols]: a list of unified market symbols
10052
10056
  :param dict [params]: extra parameters specific to the exchange API endpoint
10053
10057
  :param str [params.subType]: "linear" or "inverse"
@@ -10066,7 +10070,7 @@ class binance(Exchange, ImplicitAPI):
10066
10070
  if isPortfolioMargin:
10067
10071
  response = self.papiGetUmAccount(params)
10068
10072
  else:
10069
- response = self.fapiPrivateV2GetAccount(params)
10073
+ response = self.fapiPrivateGetSymbolConfig(params)
10070
10074
  elif self.is_inverse(type, subType):
10071
10075
  if isPortfolioMargin:
10072
10076
  response = self.papiGetCmAccount(params)
@@ -10075,6 +10079,8 @@ class binance(Exchange, ImplicitAPI):
10075
10079
  else:
10076
10080
  raise NotSupported(self.id + ' fetchLeverages() supports linear and inverse contracts only')
10077
10081
  leverages = self.safe_list(response, 'positions', [])
10082
+ if isinstance(response, list):
10083
+ leverages = response
10078
10084
  return self.parse_leverages(leverages, symbols, 'symbol')
10079
10085
 
10080
10086
  def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
@@ -10083,6 +10089,9 @@ class binance(Exchange, ImplicitAPI):
10083
10089
  marginMode = None
10084
10090
  if marginModeRaw is not None:
10085
10091
  marginMode = 'isolated' if marginModeRaw else 'cross'
10092
+ marginTypeRaw = self.safe_string_lower(leverage, 'marginType')
10093
+ if marginTypeRaw is not None:
10094
+ marginMode = 'cross' if (marginTypeRaw == 'crossed') else 'isolated'
10086
10095
  side = self.safe_string_lower(leverage, 'positionSide')
10087
10096
  longLeverage = None
10088
10097
  shortLeverage = None
@@ -11762,6 +11771,7 @@ class binance(Exchange, ImplicitAPI):
11762
11771
  fetches margin modes("isolated" or "cross") that the market for the symbol in in, with symbol=None all markets for a subType(linear/inverse) are returned
11763
11772
  :see: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
11764
11773
  :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
11774
+ :see: https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
11765
11775
  :param str symbol: unified symbol of the market the order was made in
11766
11776
  :param dict [params]: extra parameters specific to the exchange API endpoint
11767
11777
  :param str [params.subType]: "linear" or "inverse"
@@ -11776,70 +11786,17 @@ class binance(Exchange, ImplicitAPI):
11776
11786
  subType, params = self.handle_sub_type_and_params('fetchMarginMode', market, params)
11777
11787
  response = None
11778
11788
  if subType == 'linear':
11779
- response = self.fapiPrivateV2GetAccount(params)
11789
+ response = self.fapiPrivateGetSymbolConfig(params)
11780
11790
  #
11781
- # {
11782
- # feeTier: '0',
11783
- # canTrade: True,
11784
- # canDeposit: True,
11785
- # canWithdraw: True,
11786
- # tradeGroupId: '-1',
11787
- # updateTime: '0',
11788
- # multiAssetsMargin: True,
11789
- # totalInitialMargin: '438.31134352',
11790
- # totalMaintMargin: '5.90847101',
11791
- # totalWalletBalance: '4345.15626338',
11792
- # totalUnrealizedProfit: '376.45220224',
11793
- # totalMarginBalance: '4721.60846562',
11794
- # totalPositionInitialMargin: '425.45252687',
11795
- # totalOpenOrderInitialMargin: '12.85881664',
11796
- # totalCrossWalletBalance: '4345.15626338',
11797
- # totalCrossUnPnl: '376.45220224',
11798
- # availableBalance: '4281.84764041',
11799
- # maxWithdrawAmount: '4281.84764041',
11800
- # assets: [
11801
- # {
11802
- # asset: 'ETH',
11803
- # walletBalance: '0.00000000',
11804
- # unrealizedProfit: '0.00000000',
11805
- # marginBalance: '0.00000000',
11806
- # maintMargin: '0.00000000',
11807
- # initialMargin: '0.00000000',
11808
- # positionInitialMargin: '0.00000000',
11809
- # openOrderInitialMargin: '0.00000000',
11810
- # maxWithdrawAmount: '0.00000000',
11811
- # crossWalletBalance: '0.00000000',
11812
- # crossUnPnl: '0.00000000',
11813
- # availableBalance: '1.26075574',
11814
- # marginAvailable: True,
11815
- # updateTime: '0'
11816
- # },
11817
- # ...
11818
- # ],
11819
- # positions: [
11820
- # {
11821
- # symbol: 'SNTUSDT',
11822
- # initialMargin: '0',
11823
- # maintMargin: '0',
11824
- # unrealizedProfit: '0.00000000',
11825
- # positionInitialMargin: '0',
11826
- # openOrderInitialMargin: '0',
11827
- # leverage: '20',
11828
- # isolated: False,
11829
- # entryPrice: '0.0',
11830
- # breakEvenPrice: '0.0',
11831
- # maxNotional: '25000',
11832
- # positionSide: 'BOTH',
11833
- # positionAmt: '0',
11834
- # notional: '0',
11835
- # isolatedWallet: '0',
11836
- # updateTime: '0',
11837
- # bidNotional: '0',
11838
- # askNotional: '0'
11839
- # },
11840
- # ...
11841
- # ]
11842
- # }
11791
+ # [
11792
+ # {
11793
+ # "symbol": "BTCUSDT",
11794
+ # "marginType": "CROSSED",
11795
+ # "isAutoAddMargin": "false",
11796
+ # "leverage": 21,
11797
+ # "maxNotionalValue": "1000000",
11798
+ # }
11799
+ # ]
11843
11800
  #
11844
11801
  elif subType == 'inverse':
11845
11802
  response = self.dapiPrivateGetAccount(params)
@@ -11894,16 +11851,24 @@ class binance(Exchange, ImplicitAPI):
11894
11851
  else:
11895
11852
  raise BadRequest(self.id + ' fetchMarginModes() supports linear and inverse subTypes only')
11896
11853
  assets = self.safe_list(response, 'positions', [])
11854
+ if isinstance(response, list):
11855
+ assets = response
11897
11856
  return self.parse_margin_modes(assets, symbols, 'symbol', 'swap')
11898
11857
 
11899
11858
  def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
11900
11859
  marketId = self.safe_string(marginMode, 'symbol')
11901
11860
  market = self.safe_market(marketId, market)
11902
- isIsolated = self.safe_bool(marginMode, 'isolated')
11861
+ marginModeRaw = self.safe_bool(marginMode, 'isolated')
11862
+ reMarginMode = None
11863
+ if marginModeRaw is not None:
11864
+ reMarginMode = 'isolated' if marginModeRaw else 'cross'
11865
+ marginTypeRaw = self.safe_string_lower(marginMode, 'marginType')
11866
+ if marginTypeRaw is not None:
11867
+ reMarginMode = 'cross' if (marginTypeRaw == 'crossed') else 'isolated'
11903
11868
  return {
11904
11869
  'info': marginMode,
11905
11870
  'symbol': market['symbol'],
11906
- 'marginMode': 'isolated' if isIsolated else 'cross',
11871
+ 'marginMode': reMarginMode,
11907
11872
  }
11908
11873
 
11909
11874
  def fetch_option(self, symbol: str, params={}) -> Option:
ccxt/bingx.py CHANGED
@@ -1179,7 +1179,6 @@ class bingx(Exchange, ImplicitAPI):
1179
1179
  'fee': {
1180
1180
  'cost': self.parse_number(Precise.string_abs(self.safe_string_2(trade, 'commission', 'n'))),
1181
1181
  'currency': currencyCode,
1182
- 'rate': None,
1183
1182
  },
1184
1183
  }, market)
1185
1184
 
ccxt/bitget.py CHANGED
@@ -1330,6 +1330,7 @@ class bitget(Exchange, ImplicitAPI):
1330
1330
  'JADE': 'Jade Protocol',
1331
1331
  'DEGEN': 'DegenReborn',
1332
1332
  'TONCOIN': 'TON',
1333
+ 'OMNI': 'omni', # conflict with Omni Network
1333
1334
  },
1334
1335
  'options': {
1335
1336
  'timeframes': {
ccxt/bitteam.py CHANGED
@@ -1886,7 +1886,6 @@ class bitteam(Exchange, ImplicitAPI):
1886
1886
  fee = {
1887
1887
  'currency': self.safe_currency_code(feeCurrencyId),
1888
1888
  'cost': feeCost,
1889
- 'rate': None,
1890
1889
  }
1891
1890
  intTs = self.parse_to_int(timestamp)
1892
1891
  return self.safe_trade({
ccxt/gate.py CHANGED
@@ -3293,8 +3293,8 @@ class gate(Exchange, ImplicitAPI):
3293
3293
  side = self.safe_string_2(trade, 'side', 'type', contractSide)
3294
3294
  orderId = self.safe_string(trade, 'order_id')
3295
3295
  feeAmount = self.safe_string(trade, 'fee')
3296
- gtFee = self.safe_string(trade, 'gt_fee')
3297
- pointFee = self.safe_string(trade, 'point_fee')
3296
+ gtFee = self.omit_zero(self.safe_string(trade, 'gt_fee'))
3297
+ pointFee = self.omit_zero(self.safe_string(trade, 'point_fee'))
3298
3298
  fees = []
3299
3299
  if feeAmount is not None:
3300
3300
  feeCurrencyId = self.safe_string(trade, 'fee_currency')
ccxt/kraken.py CHANGED
@@ -1336,7 +1336,7 @@ class kraken(Exchange, ImplicitAPI):
1336
1336
  def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
1337
1337
  """
1338
1338
  create a market order by providing the symbol, side and cost
1339
- :see: https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
1339
+ :see: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder
1340
1340
  :param str symbol: unified symbol of the market to create an order in(only USD markets are supported)
1341
1341
  :param str side: 'buy' or 'sell'
1342
1342
  :param float cost: how much you want to trade in units of the quote currency
@@ -1351,7 +1351,7 @@ class kraken(Exchange, ImplicitAPI):
1351
1351
  def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
1352
1352
  """
1353
1353
  create a market buy order by providing the symbol, side and cost
1354
- :see: https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
1354
+ :see: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder
1355
1355
  :param str symbol: unified symbol of the market to create an order in
1356
1356
  :param float cost: how much you want to trade in units of the quote currency
1357
1357
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1362,7 +1362,7 @@ class kraken(Exchange, ImplicitAPI):
1362
1362
 
1363
1363
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1364
1364
  """
1365
- :see: https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
1365
+ :see: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder
1366
1366
  create a trade order
1367
1367
  :param str symbol: unified symbol of the market to create an order in
1368
1368
  :param str type: 'market' or 'limit'
@@ -1495,6 +1495,8 @@ class kraken(Exchange, ImplicitAPI):
1495
1495
  # "status": "ok",
1496
1496
  # "txid": "OAW2BO-7RWEK-PZY5UO",
1497
1497
  # "originaltxid": "OXL6SS-UPNMC-26WBE7",
1498
+ # "newuserref": 1234,
1499
+ # "olduserref": 123,
1498
1500
  # "volume": "0.00075000",
1499
1501
  # "price": "13500.0",
1500
1502
  # "orders_cancelled": 1,
@@ -1623,7 +1625,7 @@ class kraken(Exchange, ImplicitAPI):
1623
1625
  if (id is None) or (id.startswith('[')):
1624
1626
  txid = self.safe_list(order, 'txid')
1625
1627
  id = self.safe_string(txid, 0)
1626
- clientOrderId = self.safe_string(order, 'userref')
1628
+ clientOrderId = self.safe_string_2(order, 'userref', 'newuserref')
1627
1629
  rawTrades = self.safe_value(order, 'trades', [])
1628
1630
  trades = []
1629
1631
  for i in range(0, len(rawTrades)):
@@ -1750,7 +1752,7 @@ class kraken(Exchange, ImplicitAPI):
1750
1752
  if postOnly:
1751
1753
  extendedPostFlags = flags + ',post' if (flags is not None) else 'post'
1752
1754
  request['oflags'] = extendedPostFlags
1753
- if (flags is not None) and (request['oflags'] is None):
1755
+ if (flags is not None) and not ('oflags' in request):
1754
1756
  request['oflags'] = flags
1755
1757
  params = self.omit(params, ['timeInForce', 'reduceOnly', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingLimitAmount', 'offset'])
1756
1758
  return [request, params]
@@ -1758,7 +1760,7 @@ class kraken(Exchange, ImplicitAPI):
1758
1760
  def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
1759
1761
  """
1760
1762
  edit a trade order
1761
- :see: https://docs.kraken.com/rest/#tag/Trading/operation/editOrder
1763
+ :see: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/editOrder
1762
1764
  :param str id: order id
1763
1765
  :param str symbol: unified symbol of the market to create an order in
1764
1766
  :param str type: 'market' or 'limit'
@@ -1817,15 +1819,13 @@ class kraken(Exchange, ImplicitAPI):
1817
1819
  clientOrderId = self.safe_value_2(params, 'userref', 'clientOrderId')
1818
1820
  request: dict = {
1819
1821
  'trades': True, # whether or not to include trades in output(optional, default False)
1820
- # 'txid': id, # do not comma separate a list of ids - use fetchOrdersByIds instead
1822
+ 'txid': id, # do not comma separate a list of ids - use fetchOrdersByIds instead
1821
1823
  # 'userref': 'optional', # restrict results to given user reference id(optional)
1822
1824
  }
1823
1825
  query = params
1824
1826
  if clientOrderId is not None:
1825
1827
  request['userref'] = clientOrderId
1826
1828
  query = self.omit(params, ['userref', 'clientOrderId'])
1827
- else:
1828
- request['txid'] = id
1829
1829
  response = self.privatePostQueryOrders(self.extend(request, query))
1830
1830
  #
1831
1831
  # {
ccxt/kuna.py CHANGED
@@ -870,7 +870,6 @@ class kuna(Exchange, ImplicitAPI):
870
870
  'fee': {
871
871
  'cost': self.safe_string(trade, 'fee'),
872
872
  'currency': self.safe_currency_code(self.safe_string(trade, 'feeCurrency')),
873
- 'rate': None,
874
873
  },
875
874
  }, market)
876
875
 
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.77'
7
+ __version__ = '4.3.79'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/binance.py CHANGED
@@ -204,7 +204,7 @@ class binance(ccxt.async_support.binance):
204
204
  :param dict [params]: exchange specific parameters for the bitmex api endpoint
205
205
  :returns dict: an array of `liquidation structures <https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure>`
206
206
  """
207
- return self.watch_liquidations_for_symbols([symbol], since, limit, params)
207
+ return await self.watch_liquidations_for_symbols([symbol], since, limit, params)
208
208
 
209
209
  async def watch_liquidations_for_symbols(self, symbols: List[str] = None, since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
210
210
  """
@@ -1888,7 +1888,7 @@ class binance(ccxt.async_support.binance):
1888
1888
  :param str|None [params.type]: 'future', 'delivery', 'savings', 'funding', or 'spot'
1889
1889
  :param str|None [params.marginMode]: 'cross' or 'isolated', for margin trading, uses self.options.defaultMarginMode if not passed, defaults to None/None/None
1890
1890
  :param str[]|None [params.symbols]: unified market symbols, only used in isolated margin mode
1891
- :param str|None [params.method]: method to use. Can be account.balance or account.status
1891
+ :param str|None [params.method]: method to use. Can be account.balance, account.status, v2/account.balance or v2/account.status
1892
1892
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
1893
1893
  """
1894
1894
  await self.load_markets()
@@ -1919,8 +1919,14 @@ class binance(ccxt.async_support.binance):
1919
1919
  #
1920
1920
  #
1921
1921
  messageHash = self.safe_string(message, 'id')
1922
- result = self.safe_dict(message, 'result', {})
1923
- rawBalance = self.safe_list(result, 0, [])
1922
+ rawBalance = None
1923
+ if isinstance(message['result'], list):
1924
+ # account.balance
1925
+ rawBalance = self.safe_list(message, 'result', [])
1926
+ else:
1927
+ # account.status
1928
+ result = self.safe_dict(message, 'result', {})
1929
+ rawBalance = self.safe_list(result, 'assets', [])
1924
1930
  parsedBalances = self.parseBalanceCustom(rawBalance)
1925
1931
  client.resolve(parsedBalances, messageHash)
1926
1932
 
@@ -1993,6 +1999,7 @@ class binance(ccxt.async_support.binance):
1993
1999
  :param str[] [symbols]: list of unified market symbols
1994
2000
  :param dict [params]: extra parameters specific to the exchange API endpoint
1995
2001
  :param boolean [params.returnRateLimits]: set to True to return rate limit informations, defaults to False.
2002
+ :param str|None [params.method]: method to use. Can be account.position or v2/account.position
1996
2003
  :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
1997
2004
  """
1998
2005
  await self.load_markets()
@@ -2008,9 +2015,11 @@ class binance(ccxt.async_support.binance):
2008
2015
  returnRateLimits = False
2009
2016
  returnRateLimits, params = self.handle_option_and_params(params, 'fetchPositionsWs', 'returnRateLimits', False)
2010
2017
  payload['returnRateLimits'] = returnRateLimits
2018
+ method = None
2019
+ method, params = self.handle_option_and_params(params, 'fetchPositionsWs', 'method', 'account.position')
2011
2020
  message: dict = {
2012
2021
  'id': messageHash,
2013
- 'method': 'account.position',
2022
+ 'method': method,
2014
2023
  'params': self.sign_params(self.extend(payload, params)),
2015
2024
  }
2016
2025
  subscription: dict = {
@@ -3029,7 +3038,7 @@ class binance(ccxt.async_support.binance):
3029
3038
  self.set_balance_cache(client, type, isPortfolioMargin)
3030
3039
  self.set_positions_cache(client, type, symbols, isPortfolioMargin)
3031
3040
  fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', True)
3032
- awaitPositionsSnapshot = self.safe_bool('watchPositions', 'awaitPositionsSnapshot', True)
3041
+ awaitPositionsSnapshot = self.handle_option('watchPositions', 'awaitPositionsSnapshot', True)
3033
3042
  cache = self.safe_value(self.positions, type)
3034
3043
  if fetchPositionsSnapshot and awaitPositionsSnapshot and cache is None:
3035
3044
  snapshot = await client.future(type + ':fetchPositionsSnapshot')
ccxt/pro/bybit.py CHANGED
@@ -1061,7 +1061,7 @@ class bybit(ccxt.async_support.bybit):
1061
1061
  self.set_positions_cache(client, symbols)
1062
1062
  cache = self.positions
1063
1063
  fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', True)
1064
- awaitPositionsSnapshot = self.safe_bool('watchPositions', 'awaitPositionsSnapshot', True)
1064
+ awaitPositionsSnapshot = self.handle_option('watchPositions', 'awaitPositionsSnapshot', True)
1065
1065
  if fetchPositionsSnapshot and awaitPositionsSnapshot and cache is None:
1066
1066
  snapshot = await client.future('fetchPositionsSnapshot')
1067
1067
  return self.filter_by_symbols_since_limit(snapshot, symbols, since, limit, True)
ccxt/pro/cryptocom.py CHANGED
@@ -524,7 +524,7 @@ class cryptocom(ccxt.async_support.cryptocom):
524
524
  client = self.client(url)
525
525
  self.set_positions_cache(client, symbols)
526
526
  fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', True)
527
- awaitPositionsSnapshot = self.safe_bool('watchPositions', 'awaitPositionsSnapshot', True)
527
+ awaitPositionsSnapshot = self.handle_option('watchPositions', 'awaitPositionsSnapshot', True)
528
528
  if fetchPositionsSnapshot and awaitPositionsSnapshot and self.positions is None:
529
529
  snapshot = await client.future('fetchPositionsSnapshot')
530
530
  return self.filter_by_symbols_since_limit(snapshot, symbols, since, limit, True)
ccxt/pro/gate.py CHANGED
@@ -1013,7 +1013,7 @@ class gate(ccxt.async_support.gate):
1013
1013
  client = self.client(url)
1014
1014
  self.set_positions_cache(client, type, symbols)
1015
1015
  fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', True)
1016
- awaitPositionsSnapshot = self.safe_bool('watchPositions', 'awaitPositionsSnapshot', True)
1016
+ awaitPositionsSnapshot = self.handle_option('watchPositions', 'awaitPositionsSnapshot', True)
1017
1017
  cache = self.safe_value(self.positions, type)
1018
1018
  if fetchPositionsSnapshot and awaitPositionsSnapshot and cache is None:
1019
1019
  return await client.future(type + ':fetchPositionsSnapshot')
ccxt/pro/kucoinfutures.py CHANGED
@@ -338,7 +338,7 @@ class kucoinfutures(ccxt.async_support.kucoinfutures):
338
338
  client = self.client(url)
339
339
  self.set_position_cache(client, symbol)
340
340
  fetchPositionSnapshot = self.handle_option('watchPosition', 'fetchPositionSnapshot', True)
341
- awaitPositionSnapshot = self.safe_bool('watchPosition', 'awaitPositionSnapshot', True)
341
+ awaitPositionSnapshot = self.handle_option('watchPosition', 'awaitPositionSnapshot', True)
342
342
  currentPosition = self.get_current_position(symbol)
343
343
  if fetchPositionSnapshot and awaitPositionSnapshot and currentPosition is None:
344
344
  snapshot = await client.future('fetchPositionSnapshot:' + symbol)
ccxt/pro/paradex.py CHANGED
@@ -112,6 +112,7 @@ class paradex(ccxt.async_support.paradex):
112
112
  :param dict [params]: extra parameters specific to the exchange API endpoint
113
113
  :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
114
114
  """
115
+ await self.load_markets()
115
116
  market = self.market(symbol)
116
117
  messageHash = 'order_book.' + market['id'] + '.snapshot@15@100ms'
117
118
  url = self.urls['api']['ws']
@@ -213,6 +214,7 @@ class paradex(ccxt.async_support.paradex):
213
214
  :param dict [params]: extra parameters specific to the exchange API endpoint
214
215
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
215
216
  """
217
+ await self.load_markets()
216
218
  symbols = self.market_symbols(symbols)
217
219
  channel = 'markets_summary'
218
220
  url = self.urls['api']['ws']
ccxt/pro/vertex.py CHANGED
@@ -545,7 +545,7 @@ class vertex(ccxt.async_support.vertex):
545
545
  client = self.client(url)
546
546
  self.set_positions_cache(client, symbols, params)
547
547
  fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', True)
548
- awaitPositionsSnapshot = self.safe_bool('watchPositions', 'awaitPositionsSnapshot', True)
548
+ awaitPositionsSnapshot = self.handle_option('watchPositions', 'awaitPositionsSnapshot', True)
549
549
  if fetchPositionsSnapshot and awaitPositionsSnapshot and self.positions is None:
550
550
  snapshot = await client.future('fetchPositionsSnapshot')
551
551
  return self.filter_by_symbols_since_limit(snapshot, symbols, since, limit, True)
ccxt/pro/woo.py CHANGED
@@ -909,7 +909,7 @@ class woo(ccxt.async_support.woo):
909
909
  client = self.client(url)
910
910
  self.set_positions_cache(client, symbols)
911
911
  fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', True)
912
- awaitPositionsSnapshot = self.safe_bool('watchPositions', 'awaitPositionsSnapshot', True)
912
+ awaitPositionsSnapshot = self.handle_option('watchPositions', 'awaitPositionsSnapshot', True)
913
913
  if fetchPositionsSnapshot and awaitPositionsSnapshot and self.positions is None:
914
914
  snapshot = await client.future('fetchPositionsSnapshot')
915
915
  return self.filter_by_symbols_since_limit(snapshot, symbols, since, limit, True)
ccxt/pro/woofipro.py CHANGED
@@ -866,7 +866,7 @@ class woofipro(ccxt.async_support.woofipro):
866
866
  client = self.client(url)
867
867
  self.set_positions_cache(client, symbols)
868
868
  fetchPositionsSnapshot = self.handle_option('watchPositions', 'fetchPositionsSnapshot', True)
869
- awaitPositionsSnapshot = self.safe_bool('watchPositions', 'awaitPositionsSnapshot', True)
869
+ awaitPositionsSnapshot = self.handle_option('watchPositions', 'awaitPositionsSnapshot', True)
870
870
  if fetchPositionsSnapshot and awaitPositionsSnapshot and self.positions is None:
871
871
  snapshot = await client.future('fetchPositionsSnapshot')
872
872
  return self.filter_by_symbols_since_limit(snapshot, symbols, since, limit, True)
ccxt/vertex.py CHANGED
@@ -658,6 +658,12 @@ class vertex(Exchange, ImplicitAPI):
658
658
  amount = None
659
659
  side = None
660
660
  fee = None
661
+ feeCost = self.convert_from_x18(self.safe_string(trade, 'fee'))
662
+ if feeCost is not None:
663
+ fee = {
664
+ 'cost': feeCost,
665
+ 'currency': None,
666
+ }
661
667
  id = self.safe_string_2(trade, 'trade_id', 'submission_idx')
662
668
  order = self.safe_string(trade, 'digest')
663
669
  timestamp = self.safe_timestamp(trade, 'timestamp')
@@ -673,10 +679,6 @@ class vertex(Exchange, ImplicitAPI):
673
679
  subOrder = self.safe_dict(trade, 'order', {})
674
680
  price = self.convert_from_x18(self.safe_string(subOrder, 'priceX18'))
675
681
  amount = self.convert_from_x18(self.safe_string(trade, 'base_filled'))
676
- fee = {
677
- 'cost': self.convert_from_x18(self.safe_string(trade, 'fee')),
678
- 'currency': None,
679
- }
680
682
  if Precise.string_lt(amount, '0'):
681
683
  side = 'sell'
682
684
  else:
ccxt/woo.py CHANGED
@@ -603,6 +603,9 @@ class woo(Exchange, ImplicitAPI):
603
603
  amount = self.safe_string(trade, 'executed_quantity')
604
604
  order_id = self.safe_string(trade, 'order_id')
605
605
  fee = self.parse_token_and_fee_temp(trade, 'fee_asset', 'fee')
606
+ feeCost = self.safe_string(fee, 'cost')
607
+ if feeCost is not None:
608
+ fee['cost'] = feeCost
606
609
  cost = Precise.string_mul(price, amount)
607
610
  side = self.safe_string_lower(trade, 'side')
608
611
  id = self.safe_string(trade, 'id')
ccxt/woofipro.py CHANGED
@@ -673,6 +673,9 @@ class woofipro(Exchange, ImplicitAPI):
673
673
  amount = self.safe_string(trade, 'executed_quantity')
674
674
  order_id = self.safe_string(trade, 'order_id')
675
675
  fee = self.parse_token_and_fee_temp(trade, 'fee_asset', 'fee')
676
+ feeCost = self.safe_string(fee, 'cost')
677
+ if feeCost is not None:
678
+ fee['cost'] = feeCost
676
679
  cost = Precise.string_mul(price, amount)
677
680
  side = self.safe_string_lower(trade, 'side')
678
681
  id = self.safe_string(trade, 'id')
ccxt/xt.py CHANGED
@@ -2034,7 +2034,6 @@ class xt(Exchange, ImplicitAPI):
2034
2034
  'fee': {
2035
2035
  'currency': self.safe_currency_code(self.safe_string_2(trade, 'feeCurrency', 'feeCoin')),
2036
2036
  'cost': self.safe_string(trade, 'fee'),
2037
- 'rate': None,
2038
2037
  },
2039
2038
  }, market)
2040
2039
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ccxt
3
- Version: 4.3.77
3
+ Version: 4.3.79
4
4
  Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
5
5
  Home-page: https://ccxt.com
6
6
  Author: Igor Kroitor
@@ -270,13 +270,13 @@ console.log(version, Object.keys(exchanges));
270
270
 
271
271
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
272
272
 
273
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.77/dist/ccxt.browser.min.js
274
- * unpkg: https://unpkg.com/ccxt@4.3.77/dist/ccxt.browser.min.js
273
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.79/dist/ccxt.browser.min.js
274
+ * unpkg: https://unpkg.com/ccxt@4.3.79/dist/ccxt.browser.min.js
275
275
 
276
276
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
277
277
 
278
278
  ```HTML
279
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.77/dist/ccxt.browser.min.js"></script>
279
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.79/dist/ccxt.browser.min.js"></script>
280
280
  ```
281
281
 
282
282
  Creates a global `ccxt` object: