ccxt 4.2.30__py2.py3-none-any.whl → 4.2.31__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/async_support/htx.py CHANGED
@@ -4692,7 +4692,7 @@ class htx(Exchange, ImplicitAPI):
4692
4692
  marketId = self.safe_string_2(order, 'contract_code', 'symbol')
4693
4693
  market = self.safe_market(marketId, market)
4694
4694
  timestamp = self.safe_integer_n(order, ['created_at', 'created-at', 'create_date'])
4695
- clientOrderId = self.safe_string_2(order, 'client_order_id', 'client-order-id')
4695
+ clientOrderId = self.safe_string_2(order, 'client_order_id', 'client-or' + 'der-id') # transpiler regex trick for php issue
4696
4696
  cost = None
4697
4697
  amount = None
4698
4698
  if (type is not None) and (type.find('market') >= 0):
@@ -958,7 +958,9 @@ class kraken(Exchange, ImplicitAPI):
958
958
  else:
959
959
  request['interval'] = timeframe
960
960
  if since is not None:
961
- request['since'] = self.parse_to_int((since - 1) / 1000)
961
+ # contrary to kraken's api documentation, the since parameter must be passed in nanoseconds
962
+ # the adding of '000000' is copied from the fetchTrades function
963
+ request['since'] = self.number_to_string(since) + '000000' # expected to be in nanoseconds
962
964
  response = await self.publicGetOHLC(self.extend(request, params))
963
965
  #
964
966
  # {
@@ -57,6 +57,9 @@ class krakenfutures(Exchange, ImplicitAPI):
57
57
  'fetchClosedOrders': None, # https://support.kraken.com/hc/en-us/articles/360058243651-Historical-orders
58
58
  'fetchCrossBorrowRate': False,
59
59
  'fetchCrossBorrowRates': False,
60
+ 'fetchDepositAddress': False,
61
+ 'fetchDepositAddresses': False,
62
+ 'fetchDepositAddressesByNetwork': False,
60
63
  'fetchFundingHistory': None,
61
64
  'fetchFundingRate': 'emulated',
62
65
  'fetchFundingRateHistory': True,
@@ -62,6 +62,7 @@ class lbank(Exchange, ImplicitAPI):
62
62
  'fetchClosedOrders': False,
63
63
  'fetchCrossBorrowRate': False,
64
64
  'fetchCrossBorrowRates': False,
65
+ 'fetchDepositAddress': True,
65
66
  'fetchDepositWithdrawFee': 'emulated',
66
67
  'fetchDepositWithdrawFees': True,
67
68
  'fetchFundingHistory': False,
@@ -346,7 +347,7 @@ class lbank(Exchange, ImplicitAPI):
346
347
 
347
348
  async def fetch_markets(self, params={}):
348
349
  """
349
- retrieves data on all markets for lbank2
350
+ retrieves data on all markets for lbank
350
351
  :see: https://www.lbank.com/en-US/docs/index.html#trading-pairs
351
352
  :see: https://www.lbank.com/en-US/docs/contract.html#query-contract-information-list
352
353
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -2167,7 +2168,7 @@ class lbank(Exchange, ImplicitAPI):
2167
2168
  """
2168
2169
  * @deprecated
2169
2170
  please use fetchDepositWithdrawFees instead
2170
- :param str[]|None codes: not used by lbank2 fetchTransactionFees()
2171
+ :param str[]|None codes: not used by lbank fetchTransactionFees()
2171
2172
  :param dict [params]: extra parameters specific to the exchange API endpoint
2172
2173
  :returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
2173
2174
  """
ccxt/async_support/okx.py CHANGED
@@ -364,9 +364,11 @@ class okx(Exchange, ImplicitAPI):
364
364
  'tradingBot/grid/sub-orders': 1,
365
365
  'tradingBot/grid/positions': 1,
366
366
  'tradingBot/grid/ai-param': 1,
367
- 'tradingBot/public/rsi-back-testing': 1,
367
+ 'tradingBot/signal/signals': 1,
368
368
  'tradingBot/signal/orders-algo-details': 1,
369
+ 'tradingBot/signal/orders-algo-history': 1,
369
370
  'tradingBot/signal/positions': 1,
371
+ 'tradingBot/signal/positions-history': 1,
370
372
  'tradingBot/signal/sub-orders': 1,
371
373
  'tradingBot/signal/event-history': 1,
372
374
  'tradingBot/recurring/orders-algo-pending': 1,
@@ -486,6 +488,15 @@ class okx(Exchange, ImplicitAPI):
486
488
  'tradingBot/grid/compute-margin-balance': 1,
487
489
  'tradingBot/grid/margin-balance': 1,
488
490
  'tradingBot/grid/min-investment': 1,
491
+ 'tradingBot/signal/create-signal': 1,
492
+ 'tradingBot/signal/order-algo': 1,
493
+ 'tradingBot/signal/stop-order-algo': 1,
494
+ 'tradingBot/signal/margin-balance': 1,
495
+ 'tradingBot/signal/amendTPSL': 1,
496
+ 'tradingBot/signal/set-instruments': 1,
497
+ 'tradingBot/signal/close-position': 1,
498
+ 'tradingBot/signal/sub-order': 1,
499
+ 'tradingBot/signal/cancel-sub-order': 1,
489
500
  'tradingBot/recurring/order-algo': 1,
490
501
  'tradingBot/recurring/amend-order-algo': 1,
491
502
  'tradingBot/recurring/stop-order-algo': 1,
@@ -3937,10 +3948,12 @@ class okx(Exchange, ImplicitAPI):
3937
3948
  if symbol is not None:
3938
3949
  market = self.market(symbol)
3939
3950
  request['instId'] = market['id']
3951
+ if since is not None:
3952
+ request['begin'] = since
3940
3953
  request, params = self.handle_until_option('end', request, params)
3941
3954
  type, query = self.handle_market_type_and_params('fetchMyTrades', market, params)
3942
3955
  request['instType'] = self.convert_to_instrument_type(type)
3943
- if limit is not None:
3956
+ if (limit is not None) and (since is None): # limit = n, okx will return the n most recent results, instead of the n results after limit, so limit should only be sent when since is None
3944
3957
  request['limit'] = limit # default 100, max 100
3945
3958
  response = await self.privateGetTradeFillsHistory(self.extend(request, query))
3946
3959
  #
@@ -45,6 +45,9 @@ class poloniexfutures(Exchange, ImplicitAPI):
45
45
  'fetchBalance': True,
46
46
  'fetchClosedOrders': True,
47
47
  'fetchCurrencies': False,
48
+ 'fetchDepositAddress': False,
49
+ 'fetchDepositAddresses': False,
50
+ 'fetchDepositAddressesByNetwork': False,
48
51
  'fetchFundingRate': True,
49
52
  'fetchFundingRateHistory': False,
50
53
  'fetchL3OrderBook': True,
@@ -109,7 +109,7 @@ class timex(Exchange, ImplicitAPI):
109
109
  'rest': 'https://plasma-relay-backend.timex.io',
110
110
  },
111
111
  'www': 'https://timex.io',
112
- 'doc': 'https://docs.timex.io',
112
+ 'doc': 'https://plasma-relay-backend.timex.io/swagger-ui/index.html',
113
113
  'referral': 'https://timex.io/?refcode=1x27vNkTbP1uwkCck',
114
114
  },
115
115
  'api': {
@@ -32,7 +32,7 @@ class whitebit(Exchange, ImplicitAPI):
32
32
  'name': 'WhiteBit',
33
33
  'version': 'v4',
34
34
  'countries': ['EE'],
35
- 'rateLimit': 500,
35
+ 'rateLimit': 50,
36
36
  'pro': True,
37
37
  'has': {
38
38
  'CORS': None,
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.2.30'
7
+ __version__ = '4.2.31'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1969,7 +1969,7 @@ class Exchange(object):
1969
1969
  result.append(messageHash)
1970
1970
  return result
1971
1971
 
1972
- def filter_by_limit(self, array: List[object], limit: Int = None, key: IndexType = 'timestamp'):
1972
+ def filter_by_limit(self, array: List[object], limit: Int = None, key: IndexType = 'timestamp', fromStart: bool = False):
1973
1973
  if self.valueIsDefined(limit):
1974
1974
  arrayLength = len(array)
1975
1975
  if arrayLength > 0:
@@ -1979,7 +1979,10 @@ class Exchange(object):
1979
1979
  last = array[arrayLength - 1][key]
1980
1980
  if first is not None and last is not None:
1981
1981
  ascending = first <= last # True if array is sorted in ascending order based on 'timestamp'
1982
- array = self.arraySlice(array, -limit) if ascending else self.arraySlice(array, 0, limit)
1982
+ if fromStart:
1983
+ array = self.arraySlice(array, 0, limit) if ascending else self.arraySlice(array, -limit)
1984
+ else:
1985
+ array = self.arraySlice(array, -limit) if ascending else self.arraySlice(array, 0, limit)
1983
1986
  return array
1984
1987
 
1985
1988
  def filter_by_since_limit(self, array: List[object], since: Int = None, limit: Int = None, key: IndexType = 'timestamp', tail=False):
@@ -1995,7 +1998,10 @@ class Exchange(object):
1995
1998
  result.append(entry)
1996
1999
  if tail and limit is not None:
1997
2000
  return self.arraySlice(result, -limit)
1998
- return self.filter_by_limit(result, limit, key)
2001
+ # if the user provided a 'since' argument
2002
+ # we want to limit the result starting from the 'since'
2003
+ shouldFilterFromStart = not tail and sinceIsDefined
2004
+ return self.filter_by_limit(result, limit, key, shouldFilterFromStart)
1999
2005
 
2000
2006
  def filter_by_value_since_limit(self, array: List[object], field: IndexType, value=None, since: Int = None, limit: Int = None, key='timestamp', tail=False):
2001
2007
  valueIsDefined = self.valueIsDefined(value)
@@ -2016,7 +2022,7 @@ class Exchange(object):
2016
2022
  result.append(entry)
2017
2023
  if tail and limit is not None:
2018
2024
  return self.arraySlice(result, -limit)
2019
- return self.filter_by_limit(result, limit, key)
2025
+ return self.filter_by_limit(result, limit, key, sinceIsDefined)
2020
2026
 
2021
2027
  def set_sandbox_mode(self, enabled):
2022
2028
  if enabled:
ccxt/binance.py CHANGED
@@ -5514,7 +5514,7 @@ class binance(Exchange, ImplicitAPI):
5514
5514
  params = self.omit(params, 'type')
5515
5515
  orders = self.fetch_orders(symbol, since, None, params)
5516
5516
  filteredOrders = self.filter_by(orders, 'status', 'canceled')
5517
- return self.filter_by_limit(filteredOrders, limit)
5517
+ return self.filter_by_since_limit(filteredOrders, since, limit)
5518
5518
 
5519
5519
  def cancel_order(self, id: str, symbol: Str = None, params={}):
5520
5520
  """