ccxt 4.4.45__py2.py3-none-any.whl → 4.4.47__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/bybit.py +1 -0
  7. ccxt/ace.py +58 -0
  8. ccxt/alpaca.py +80 -0
  9. ccxt/ascendex.py +110 -3
  10. ccxt/async_support/__init__.py +1 -1
  11. ccxt/async_support/ace.py +58 -0
  12. ccxt/async_support/alpaca.py +80 -0
  13. ccxt/async_support/ascendex.py +110 -3
  14. ccxt/async_support/base/exchange.py +1 -1
  15. ccxt/async_support/bigone.py +113 -4
  16. ccxt/async_support/binance.py +4 -5
  17. ccxt/async_support/binanceus.py +10 -0
  18. ccxt/async_support/bingx.py +1 -2
  19. ccxt/async_support/bit2c.py +56 -0
  20. ccxt/async_support/bitbank.py +58 -0
  21. ccxt/async_support/bitbns.py +60 -0
  22. ccxt/async_support/bitfinex.py +2 -3
  23. ccxt/async_support/bitfinex1.py +8 -0
  24. ccxt/async_support/bitflyer.py +71 -0
  25. ccxt/async_support/bitget.py +103 -40
  26. ccxt/async_support/bithumb.py +54 -0
  27. ccxt/async_support/bitmex.py +1 -2
  28. ccxt/async_support/bitopro.py +74 -0
  29. ccxt/async_support/bitrue.py +97 -17
  30. ccxt/async_support/bitso.py +59 -0
  31. ccxt/async_support/bitteam.py +73 -0
  32. ccxt/async_support/bitvavo.py +70 -2
  33. ccxt/async_support/bl3p.py +42 -0
  34. ccxt/async_support/blockchaincom.py +66 -2
  35. ccxt/async_support/blofin.py +87 -1
  36. ccxt/async_support/btcalpha.py +73 -0
  37. ccxt/async_support/btcbox.py +58 -0
  38. ccxt/async_support/btcmarkets.py +73 -0
  39. ccxt/async_support/btcturk.py +61 -0
  40. ccxt/async_support/bybit.py +87 -39
  41. ccxt/async_support/cex.py +57 -0
  42. ccxt/async_support/coinbase.py +1 -1
  43. ccxt/async_support/coinbaseexchange.py +76 -0
  44. ccxt/async_support/coinex.py +1 -2
  45. ccxt/async_support/delta.py +10 -6
  46. ccxt/async_support/gate.py +3 -4
  47. ccxt/async_support/hashkey.py +1 -2
  48. ccxt/async_support/hollaex.py +1 -1
  49. ccxt/async_support/htx.py +2 -4
  50. ccxt/async_support/hyperliquid.py +6 -7
  51. ccxt/async_support/krakenfutures.py +2 -0
  52. ccxt/async_support/lbank.py +1 -2
  53. ccxt/async_support/mexc.py +1 -0
  54. ccxt/async_support/okx.py +13 -9
  55. ccxt/async_support/onetrading.py +18 -3
  56. ccxt/async_support/oxfun.py +1 -2
  57. ccxt/async_support/whitebit.py +2 -2
  58. ccxt/async_support/woo.py +1 -2
  59. ccxt/async_support/woofipro.py +1 -2
  60. ccxt/base/errors.py +6 -0
  61. ccxt/base/exchange.py +16 -14
  62. ccxt/bigone.py +113 -4
  63. ccxt/binance.py +4 -5
  64. ccxt/binanceus.py +10 -0
  65. ccxt/bingx.py +1 -2
  66. ccxt/bit2c.py +56 -0
  67. ccxt/bitbank.py +58 -0
  68. ccxt/bitbns.py +60 -0
  69. ccxt/bitfinex.py +2 -3
  70. ccxt/bitfinex1.py +8 -0
  71. ccxt/bitflyer.py +71 -0
  72. ccxt/bitget.py +103 -40
  73. ccxt/bithumb.py +54 -0
  74. ccxt/bitmex.py +1 -2
  75. ccxt/bitopro.py +74 -0
  76. ccxt/bitrue.py +97 -17
  77. ccxt/bitso.py +59 -0
  78. ccxt/bitteam.py +73 -0
  79. ccxt/bitvavo.py +70 -2
  80. ccxt/bl3p.py +42 -0
  81. ccxt/blockchaincom.py +66 -2
  82. ccxt/blofin.py +87 -1
  83. ccxt/btcalpha.py +73 -0
  84. ccxt/btcbox.py +58 -0
  85. ccxt/btcmarkets.py +73 -0
  86. ccxt/btcturk.py +61 -0
  87. ccxt/bybit.py +87 -39
  88. ccxt/cex.py +57 -0
  89. ccxt/coinbase.py +1 -1
  90. ccxt/coinbaseexchange.py +76 -0
  91. ccxt/coinex.py +1 -2
  92. ccxt/delta.py +10 -6
  93. ccxt/gate.py +3 -4
  94. ccxt/hashkey.py +1 -2
  95. ccxt/hollaex.py +1 -1
  96. ccxt/htx.py +2 -4
  97. ccxt/hyperliquid.py +6 -7
  98. ccxt/krakenfutures.py +2 -0
  99. ccxt/lbank.py +1 -2
  100. ccxt/mexc.py +1 -0
  101. ccxt/okx.py +13 -9
  102. ccxt/onetrading.py +18 -3
  103. ccxt/oxfun.py +1 -2
  104. ccxt/pro/__init__.py +1 -1
  105. ccxt/pro/bingx.py +3 -5
  106. ccxt/pro/bitget.py +2 -4
  107. ccxt/pro/coinex.py +1 -1
  108. ccxt/pro/xt.py +1 -1
  109. ccxt/test/tests_async.py +2 -0
  110. ccxt/test/tests_sync.py +2 -0
  111. ccxt/whitebit.py +2 -2
  112. ccxt/woo.py +1 -2
  113. ccxt/woofipro.py +1 -2
  114. {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/METADATA +4 -5
  115. {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/RECORD +118 -118
  116. {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/LICENSE.txt +0 -0
  117. {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/WHEEL +0 -0
  118. {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/top_level.txt +0 -0
@@ -289,6 +289,7 @@ class onetrading(Exchange, ImplicitAPI):
289
289
  'INTERNAL_SERVER_ERROR': ExchangeError,
290
290
  },
291
291
  'broad': {
292
+ 'Order not found.': OrderNotFound,
292
293
  },
293
294
  },
294
295
  'commonCurrencies': {
@@ -1000,6 +1001,7 @@ class onetrading(Exchange, ImplicitAPI):
1000
1001
  'CLOSED': 'canceled',
1001
1002
  'FAILED': 'failed',
1002
1003
  'STOP_TRIGGERED': 'triggered',
1004
+ 'DONE': 'closed',
1003
1005
  }
1004
1006
  return self.safe_string(statuses, status, status)
1005
1007
 
@@ -1094,7 +1096,7 @@ class onetrading(Exchange, ImplicitAPI):
1094
1096
  'datetime': self.iso8601(timestamp),
1095
1097
  'lastTradeTimestamp': None,
1096
1098
  'symbol': symbol,
1097
- 'type': type,
1099
+ 'type': self.parse_order_type(type),
1098
1100
  'timeInForce': timeInForce,
1099
1101
  'postOnly': postOnly,
1100
1102
  'side': side,
@@ -1110,6 +1112,12 @@ class onetrading(Exchange, ImplicitAPI):
1110
1112
  'trades': rawTrades,
1111
1113
  }, market)
1112
1114
 
1115
+ def parse_order_type(self, type: Str):
1116
+ types: dict = {
1117
+ 'booked': 'limit',
1118
+ }
1119
+ return self.safe_string(types, type, type)
1120
+
1113
1121
  def parse_time_in_force(self, timeInForce: Str):
1114
1122
  timeInForces: dict = {
1115
1123
  'GOOD_TILL_CANCELLED': 'GTC',
@@ -1167,6 +1175,9 @@ class onetrading(Exchange, ImplicitAPI):
1167
1175
  if clientOrderId is not None:
1168
1176
  request['client_id'] = clientOrderId
1169
1177
  params = self.omit(params, ['clientOrderId', 'client_id'])
1178
+ timeInForce = self.safe_string_2(params, 'timeInForce', 'time_in_force', 'GOOD_TILL_CANCELLED')
1179
+ params = self.omit(params, 'timeInForce')
1180
+ request['time_in_force'] = timeInForce
1170
1181
  response = await self.privatePostAccountOrders(self.extend(request, params))
1171
1182
  #
1172
1183
  # {
@@ -1206,11 +1217,15 @@ class onetrading(Exchange, ImplicitAPI):
1206
1217
  request['client_id'] = clientOrderId
1207
1218
  else:
1208
1219
  request['order_id'] = id
1209
- response = await getattr(self, method)(self.extend(request, params))
1220
+ response = None
1221
+ if method == 'privateDeleteAccountOrdersOrderId':
1222
+ response = await self.privateDeleteAccountOrdersOrderId(self.extend(request, params))
1223
+ else:
1224
+ response = await self.privateDeleteAccountOrdersClientClientId(self.extend(request, params))
1210
1225
  #
1211
1226
  # responds with an empty body
1212
1227
  #
1213
- return response
1228
+ return self.parse_order(response)
1214
1229
 
1215
1230
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1216
1231
  """
@@ -1033,8 +1033,7 @@ class oxfun(Exchange, ImplicitAPI):
1033
1033
  # }
1034
1034
  #
1035
1035
  data = self.safe_list(response, 'data', [])
1036
- result = self.parse_funding_rates(data)
1037
- return self.filter_by_array(result, 'symbol', symbols)
1036
+ return self.parse_funding_rates(data, symbols)
1038
1037
 
1039
1038
  def parse_funding_rate(self, fundingRate, market: Market = None) -> FundingRate:
1040
1039
  #
@@ -310,6 +310,7 @@ class whitebit(Exchange, ImplicitAPI):
310
310
  'broad': {
311
311
  'This action is unauthorized': PermissionDenied, # {"code":2,"message":"This action is unauthorized. Enable your key in API settings"}
312
312
  'Given amount is less than min amount': InvalidOrder, # {"code":0,"message":"Validation failed","errors":{"amount":["Given amount is less than min amount 200000"],"total":["Total is less than 5.05"]}}
313
+ 'Min amount step': InvalidOrder, # {"code":32,"errors":{"amount":["Min amount step = 0.01"]},"message":"Validation failed"}
313
314
  'Total is less than': InvalidOrder, # {"code":0,"message":"Validation failed","errors":{"amount":["Given amount is less than min amount 200000"],"total":["Total is less than 5.05"]}}
314
315
  'fee must be no less than': InvalidOrder, # {"code":0,"message":"Validation failed","errors":{"amount":["Total amount + fee must be no less than 5.05505"]}}
315
316
  'Enable your key in API settings': PermissionDenied, # {"code":2,"message":"This action is unauthorized. Enable your key in API settings"}
@@ -2376,8 +2377,7 @@ class whitebit(Exchange, ImplicitAPI):
2376
2377
  # ]
2377
2378
  #
2378
2379
  data = self.safe_list(response, 'result', [])
2379
- result = self.parse_funding_rates(data)
2380
- return self.filter_by_array(result, 'symbol', symbols)
2380
+ return self.parse_funding_rates(data, symbols)
2381
2381
 
2382
2382
  def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
2383
2383
  #
ccxt/async_support/woo.py CHANGED
@@ -2825,8 +2825,7 @@ class woo(Exchange, ImplicitAPI):
2825
2825
  # }
2826
2826
  #
2827
2827
  rows = self.safe_list(response, 'rows', [])
2828
- result = self.parse_funding_rates(rows)
2829
- return self.filter_by_array(result, 'symbol', symbols)
2828
+ return self.parse_funding_rates(rows, symbols)
2830
2829
 
2831
2830
  async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2832
2831
  """
@@ -962,8 +962,7 @@ class woofipro(Exchange, ImplicitAPI):
962
962
  #
963
963
  data = self.safe_dict(response, 'data', {})
964
964
  rows = self.safe_list(data, 'rows', [])
965
- result = self.parse_funding_rates(rows)
966
- return self.filter_by_array(result, 'symbol', symbols)
965
+ return self.parse_funding_rates(rows, symbols)
967
966
 
968
967
  async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
969
968
  """
ccxt/base/errors.py CHANGED
@@ -1,3 +1,9 @@
1
+ # ----------------------------------------------------------------------------
2
+
3
+ # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ # EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
1
7
  error_hierarchy = {
2
8
  'BaseError': {
3
9
  'ExchangeError': {
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.45'
7
+ __version__ = '4.4.47'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -343,7 +343,7 @@ class Exchange(object):
343
343
  rateLimitMaxTokens = 16
344
344
  rateLimitUpdateTime = 0
345
345
  enableLastHttpResponse = True
346
- enableLastJsonResponse = True
346
+ enableLastJsonResponse = False
347
347
  enableLastResponseHeaders = True
348
348
  last_http_response = None
349
349
  last_json_response = None
@@ -5640,19 +5640,13 @@ class Exchange(object):
5640
5640
  def parse_funding_rate(self, contract: str, market: Market = None):
5641
5641
  raise NotSupported(self.id + ' parseFundingRate() is not supported yet')
5642
5642
 
5643
- def parse_funding_rates(self, response, market: Market = None):
5644
- result = {}
5643
+ def parse_funding_rates(self, response, symbols: Strings = None):
5644
+ fundingRates = {}
5645
5645
  for i in range(0, len(response)):
5646
- parsed = self.parse_funding_rate(response[i], market)
5647
- result[parsed['symbol']] = parsed
5648
- return result
5649
-
5650
- def parse_open_interests(self, response, market: Market = None):
5651
- result = {}
5652
- for i in range(0, len(response)):
5653
- parsed = self.parse_open_interest(response[i], market)
5654
- result[parsed['symbol']] = parsed
5655
- return result
5646
+ entry = response[i]
5647
+ parsed = self.parse_funding_rate(entry)
5648
+ fundingRates[parsed['symbol']] = parsed
5649
+ return self.filter_by_array(fundingRates, 'symbol', symbols)
5656
5650
 
5657
5651
  def parse_long_short_ratio(self, info: dict, market: Market = None):
5658
5652
  raise NotSupported(self.id + ' parseLongShortRatio() is not supported yet')
@@ -5748,6 +5742,14 @@ class Exchange(object):
5748
5742
  def parse_open_interest(self, interest, market: Market = None):
5749
5743
  raise NotSupported(self.id + ' parseOpenInterest() is not supported yet')
5750
5744
 
5745
+ def parse_open_interests(self, response, symbols: Strings = None):
5746
+ result = {}
5747
+ for i in range(0, len(response)):
5748
+ entry = response[i]
5749
+ parsed = self.parse_open_interest(entry)
5750
+ result[parsed['symbol']] = parsed
5751
+ return self.filter_by_array(result, 'symbol', symbols)
5752
+
5751
5753
  def parse_open_interests_history(self, response, market=None, since: Int = None, limit: Int = None):
5752
5754
  interests = []
5753
5755
  for i in range(0, len(response)):
ccxt/bigone.py CHANGED
@@ -305,6 +305,105 @@ class bigone(Exchange, ImplicitAPI):
305
305
  # undetermined: XinFin, YAS, Ycash
306
306
  },
307
307
  },
308
+ 'features': {
309
+ 'default': {
310
+ 'sandbox': False,
311
+ 'createOrder': {
312
+ 'marginMode': False,
313
+ 'triggerPrice': True,
314
+ 'triggerPriceType': None,
315
+ 'triggerDirection': True, # todo implement
316
+ 'stopLossPrice': False, # todo by trigger
317
+ 'takeProfitPrice': False, # todo by trigger
318
+ 'attachedStopLossTakeProfit': None,
319
+ 'timeInForce': {
320
+ 'IOC': True,
321
+ 'FOK': False,
322
+ 'PO': True,
323
+ 'GTD': False,
324
+ },
325
+ 'hedged': False,
326
+ 'trailing': False,
327
+ 'leverage': False,
328
+ 'marketBuyRequiresPrice': True,
329
+ 'marketBuyByCost': True,
330
+ 'selfTradePrevention': False,
331
+ 'iceberg': False,
332
+ },
333
+ 'createOrders': None, # todo: implement
334
+ 'fetchMyTrades': {
335
+ 'marginMode': False,
336
+ 'limit': 200,
337
+ 'daysBack': None,
338
+ 'untilDays': None,
339
+ },
340
+ 'fetchOrder': {
341
+ 'marginMode': False,
342
+ 'trigger': False,
343
+ 'trailing': False,
344
+ },
345
+ 'fetchOpenOrders': {
346
+ 'marginMode': False,
347
+ 'limit': 200,
348
+ 'trigger': False,
349
+ 'trailing': False,
350
+ },
351
+ 'fetchOrders': {
352
+ 'marginMode': False,
353
+ 'limit': 200,
354
+ 'daysBack': None,
355
+ 'untilDays': None,
356
+ 'trigger': False,
357
+ 'trailing': False,
358
+ },
359
+ 'fetchClosedOrders': {
360
+ 'marginMode': False,
361
+ 'limit': 200,
362
+ 'daysBack': None,
363
+ 'daysBackCanceled': None,
364
+ 'untilDays': None,
365
+ 'trigger': False,
366
+ 'trailing': False,
367
+ },
368
+ 'fetchOHLCV': {
369
+ 'limit': 500,
370
+ },
371
+ },
372
+ 'spot': {
373
+ 'extends': 'default',
374
+ },
375
+ 'forDerivatives': {
376
+ 'extends': 'default',
377
+ 'createOrder': {
378
+ # todo: implement
379
+ 'triggerPriceType': {
380
+ 'mark': True,
381
+ 'index': True,
382
+ 'last': True,
383
+ },
384
+ },
385
+ 'fetchOrders': {
386
+ 'daysBack': 100000,
387
+ 'untilDays': 100000,
388
+ },
389
+ 'fetchClosedOrders': {
390
+ 'daysBack': 100000,
391
+ 'untilDays': 100000,
392
+ },
393
+ },
394
+ 'swap': {
395
+ 'linear': {
396
+ 'extends': 'forDerivatives',
397
+ },
398
+ 'inverse': {
399
+ 'extends': 'forDerivatives',
400
+ },
401
+ },
402
+ 'future': {
403
+ 'linear': None,
404
+ 'inverse': None,
405
+ },
406
+ },
308
407
  'precisionMode': TICK_SIZE,
309
408
  'exceptions': {
310
409
  'exact': {
@@ -1173,24 +1272,34 @@ class bigone(Exchange, ImplicitAPI):
1173
1272
  :param int [since]: timestamp in ms of the earliest candle to fetch
1174
1273
  :param int [limit]: the maximum amount of candles to fetch
1175
1274
  :param dict [params]: extra parameters specific to the exchange API endpoint
1275
+ :param int [params.until]: timestamp in ms of the earliest candle to fetch
1176
1276
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
1177
1277
  """
1178
1278
  self.load_markets()
1179
1279
  market = self.market(symbol)
1180
1280
  if market['contract']:
1181
1281
  raise BadRequest(self.id + ' fetchOHLCV() can only fetch ohlcvs for spot markets')
1282
+ until = self.safe_integer(params, 'until')
1283
+ untilIsDefined = (until is not None)
1284
+ sinceIsDefined = (since is not None)
1182
1285
  if limit is None:
1183
- limit = 100 # default 100, max 500
1286
+ limit = 500 if (sinceIsDefined and untilIsDefined) else 100 # default 100, max 500, if since and limit defined then fetch all the candles between them unless it exceeds the max of 500
1184
1287
  request: dict = {
1185
1288
  'asset_pair_name': market['id'],
1186
1289
  'period': self.safe_string(self.timeframes, timeframe, timeframe),
1187
1290
  'limit': limit,
1188
1291
  }
1189
- if since is not None:
1292
+ if sinceIsDefined:
1190
1293
  # start = self.parse_to_int(since / 1000)
1191
1294
  duration = self.parse_timeframe(timeframe)
1192
- end = self.sum(since, limit * duration * 1000)
1193
- request['time'] = self.iso8601(end)
1295
+ endByLimit = self.sum(since, limit * duration * 1000)
1296
+ if untilIsDefined:
1297
+ request['time'] = self.iso8601(min(endByLimit, until + 1))
1298
+ else:
1299
+ request['time'] = self.iso8601(endByLimit)
1300
+ elif untilIsDefined:
1301
+ request['time'] = self.iso8601(until + 1)
1302
+ params = self.omit(params, 'until')
1194
1303
  response = self.publicGetAssetPairsAssetPairNameCandles(self.extend(request, params))
1195
1304
  #
1196
1305
  # {
ccxt/binance.py CHANGED
@@ -1148,6 +1148,7 @@ class binance(Exchange, ImplicitAPI):
1148
1148
  'um/symbolConfig': 1,
1149
1149
  'cm/accountConfig': 1,
1150
1150
  'cm/symbolConfig': 1,
1151
+ 'rateLimit/order': 1,
1151
1152
  },
1152
1153
  'post': {
1153
1154
  'um/order': 1,
@@ -2495,7 +2496,7 @@ class binance(Exchange, ImplicitAPI):
2495
2496
  #
2496
2497
  '-2010': InvalidOrder, # NEW_ORDER_REJECTED
2497
2498
  '-2011': OperationRejected, # CANCEL_REJECTED
2498
- '-2013': BadRequest, # Order does not exist.
2499
+ '-2013': OrderNotFound, # Order does not exist.
2499
2500
  '-2014': OperationRejected, # API-key format invalid.
2500
2501
  '-2015': OperationRejected, # Invalid API-key, IP, or permissions for action.
2501
2502
  '-2016': OperationFailed, # No trading window could be found for the symbol. Try ticker/24hrs instead.
@@ -9323,8 +9324,7 @@ class binance(Exchange, ImplicitAPI):
9323
9324
  response = self.dapiPublicGetPremiumIndex(query)
9324
9325
  else:
9325
9326
  raise NotSupported(self.id + ' fetchFundingRates() supports linear and inverse contracts only')
9326
- result = self.parse_funding_rates(response)
9327
- return self.filter_by_array(result, 'symbol', symbols)
9327
+ return self.parse_funding_rates(response, symbols)
9328
9328
 
9329
9329
  def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
9330
9330
  # ensure it matches with https://www.binance.com/en/futures/funding-history/0
@@ -13252,8 +13252,7 @@ class binance(Exchange, ImplicitAPI):
13252
13252
  # },
13253
13253
  # ]
13254
13254
  #
13255
- result = self.parse_funding_rates(response, market)
13256
- return self.filter_by_array(result, 'symbol', symbols)
13255
+ return self.parse_funding_rates(response, symbols)
13257
13256
 
13258
13257
  def fetch_long_short_ratio_history(self, symbol: Str = None, timeframe: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LongShortRatio]:
13259
13258
  """
ccxt/binanceus.py CHANGED
@@ -209,4 +209,14 @@ class binanceus(binance, ImplicitAPI):
209
209
  },
210
210
  },
211
211
  },
212
+ 'features': {
213
+ 'swap': {
214
+ 'linear': None,
215
+ 'inverse': None,
216
+ },
217
+ 'future': {
218
+ 'linear': None,
219
+ 'inverse': None,
220
+ },
221
+ },
212
222
  })
ccxt/bingx.py CHANGED
@@ -1537,8 +1537,7 @@ class bingx(Exchange, ImplicitAPI):
1537
1537
  symbols = self.market_symbols(symbols, 'swap', True)
1538
1538
  response = self.swapV2PublicGetQuotePremiumIndex(self.extend(params))
1539
1539
  data = self.safe_list(response, 'data', [])
1540
- result = self.parse_funding_rates(data)
1541
- return self.filter_by_array(result, 'symbol', symbols)
1540
+ return self.parse_funding_rates(data, symbols)
1542
1541
 
1543
1542
  def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
1544
1543
  #
ccxt/bit2c.py CHANGED
@@ -178,6 +178,62 @@ class bit2c(Exchange, ImplicitAPI):
178
178
  'options': {
179
179
  'fetchTradesMethod': 'public_get_exchanges_pair_trades',
180
180
  },
181
+ 'features': {
182
+ 'spot': {
183
+ 'sandbox': False,
184
+ 'createOrder': {
185
+ 'marginMode': False,
186
+ 'triggerPrice': False,
187
+ 'triggerPriceType': None,
188
+ 'triggerDirection': False,
189
+ 'stopLossPrice': False,
190
+ 'takeProfitPrice': False,
191
+ 'attachedStopLossTakeProfit': None,
192
+ 'timeInForce': {
193
+ 'IOC': False,
194
+ 'FOK': False,
195
+ 'PO': False,
196
+ 'GTD': False,
197
+ },
198
+ 'hedged': False,
199
+ 'trailing': False,
200
+ 'leverage': False,
201
+ 'marketBuyRequiresPrice': False,
202
+ 'marketBuyByCost': False,
203
+ 'selfTradePrevention': False,
204
+ 'iceberg': False,
205
+ },
206
+ 'createOrders': None,
207
+ 'fetchMyTrades': {
208
+ 'marginMode': False,
209
+ 'limit': 100,
210
+ 'daysBack': 30,
211
+ 'untilDays': 30,
212
+ },
213
+ 'fetchOrder': {
214
+ 'marginMode': False,
215
+ 'trigger': False,
216
+ 'trailing': False,
217
+ },
218
+ 'fetchOpenOrders': {
219
+ 'marginMode': False,
220
+ 'limit': None,
221
+ 'trigger': False,
222
+ 'trailing': False,
223
+ },
224
+ 'fetchOrders': None,
225
+ 'fetchClosedOrders': None, # todo implement
226
+ 'fetchOHLCV': None,
227
+ },
228
+ 'swap': {
229
+ 'linear': None,
230
+ 'inverse': None,
231
+ },
232
+ 'future': {
233
+ 'linear': None,
234
+ 'inverse': None,
235
+ },
236
+ },
181
237
  'precisionMode': TICK_SIZE,
182
238
  'exceptions': {
183
239
  'exact': {
ccxt/bitbank.py CHANGED
@@ -154,6 +154,64 @@ class bitbank(Exchange, ImplicitAPI):
154
154
  ],
155
155
  },
156
156
  },
157
+ 'features': {
158
+ 'spot': {
159
+ 'sandbox': False,
160
+ 'createOrder': {
161
+ 'marginMode': False,
162
+ 'triggerPrice': True, # todo implement
163
+ 'triggerPriceType': None,
164
+ 'triggerDirection': False,
165
+ 'stopLossPrice': False,
166
+ 'takeProfitPrice': False,
167
+ 'attachedStopLossTakeProfit': None,
168
+ 'timeInForce': {
169
+ 'IOC': False,
170
+ 'FOK': False,
171
+ 'PO': True, # todo: implement
172
+ 'GTD': False,
173
+ },
174
+ 'hedged': False,
175
+ 'trailing': False,
176
+ 'leverage': False,
177
+ 'marketBuyRequiresPrice': False,
178
+ 'marketBuyByCost': False,
179
+ 'selfTradePrevention': False,
180
+ 'iceberg': False,
181
+ },
182
+ 'createOrders': None,
183
+ 'fetchMyTrades': {
184
+ 'marginMode': False,
185
+ 'limit': 1000,
186
+ 'daysBack': None,
187
+ 'untilDays': None,
188
+ },
189
+ 'fetchOrder': {
190
+ 'marginMode': False,
191
+ 'trigger': False,
192
+ 'trailing': False,
193
+ },
194
+ 'fetchOpenOrders': {
195
+ 'marginMode': False,
196
+ 'limit': 1000,
197
+ 'trigger': False,
198
+ 'trailing': False,
199
+ },
200
+ 'fetchOrders': None,
201
+ 'fetchClosedOrders': None,
202
+ 'fetchOHLCV': {
203
+ 'limit': 1000,
204
+ },
205
+ },
206
+ 'swap': {
207
+ 'linear': None,
208
+ 'inverse': None,
209
+ },
210
+ 'future': {
211
+ 'linear': None,
212
+ 'inverse': None,
213
+ },
214
+ },
157
215
  'precisionMode': TICK_SIZE,
158
216
  'exceptions': {
159
217
  'exact': {
ccxt/bitbns.py CHANGED
@@ -151,6 +151,66 @@ class bitbns(Exchange, ImplicitAPI):
151
151
  },
152
152
  },
153
153
  'precisionMode': TICK_SIZE,
154
+ 'features': {
155
+ 'spot': {
156
+ 'sandbox': False,
157
+ 'createOrder': {
158
+ 'marginMode': False,
159
+ 'triggerPrice': True,
160
+ 'triggerPriceType': None,
161
+ 'triggerDirection': False,
162
+ 'stopLossPrice': False, # todo with triggerPrice
163
+ 'takeProfitPrice': False, # todo with triggerPrice
164
+ 'attachedStopLossTakeProfit': None,
165
+ 'timeInForce': {
166
+ 'IOC': False,
167
+ 'FOK': False,
168
+ 'PO': False,
169
+ 'GTD': False,
170
+ },
171
+ 'hedged': False,
172
+ 'trailing': False, # todo recheck
173
+ 'leverage': False,
174
+ 'marketBuyRequiresPrice': False,
175
+ 'marketBuyByCost': False,
176
+ 'selfTradePrevention': False,
177
+ 'iceberg': False,
178
+ },
179
+ 'createOrders': None,
180
+ 'fetchMyTrades': {
181
+ 'marginMode': False,
182
+ 'limit': None,
183
+ 'daysBack': None,
184
+ 'untilDays': None,
185
+ },
186
+ 'fetchOrder': {
187
+ 'marginMode': False,
188
+ 'trigger': False,
189
+ 'trailing': False,
190
+ },
191
+ 'fetchOpenOrders': {
192
+ 'marginMode': False,
193
+ 'limit': None,
194
+ 'trigger': True,
195
+ 'trailing': False,
196
+ },
197
+ 'fetchOrders': None,
198
+ 'fetchClosedOrders': None,
199
+ # todo: implement fetchOHLCV
200
+ 'fetchOHLCV': {
201
+ 'limit': 100,
202
+ },
203
+ },
204
+ # todo: implement swap methods
205
+ 'swap': {
206
+ 'linear': None,
207
+ 'inverse': None,
208
+ },
209
+ 'future': {
210
+ 'linear': None,
211
+ 'inverse': None,
212
+ },
213
+ },
154
214
  'exceptions': {
155
215
  'exact': {
156
216
  '400': BadRequest, # {"msg":"Invalid Request","status":-1,"code":400}
ccxt/bitfinex.py CHANGED
@@ -3012,7 +3012,7 @@ class bitfinex(Exchange, ImplicitAPI):
3012
3012
  # ]
3013
3013
  # ]
3014
3014
  #
3015
- return self.parse_funding_rates(response)
3015
+ return self.parse_funding_rates(response, symbols)
3016
3016
 
3017
3017
  def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3018
3018
  """
@@ -3239,8 +3239,7 @@ class bitfinex(Exchange, ImplicitAPI):
3239
3239
  # ]
3240
3240
  # ]
3241
3241
  #
3242
- result = self.parse_open_interests(response)
3243
- return self.filter_by_array(result, 'symbol', symbols)
3242
+ return self.parse_open_interests(response, symbols)
3244
3243
 
3245
3244
  def fetch_open_interest(self, symbol: str, params={}):
3246
3245
  """
ccxt/bitfinex1.py CHANGED
@@ -1353,6 +1353,7 @@ class bitfinex1(Exchange, ImplicitAPI):
1353
1353
  :param int [since]: timestamp in ms of the earliest candle to fetch
1354
1354
  :param int [limit]: the maximum amount of candles to fetch
1355
1355
  :param dict [params]: extra parameters specific to the exchange API endpoint
1356
+ :param int [params.until]: timestamp in ms of the latest candle to fetch
1356
1357
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
1357
1358
  """
1358
1359
  self.load_markets()
@@ -1368,8 +1369,15 @@ class bitfinex1(Exchange, ImplicitAPI):
1368
1369
  'sort': 1,
1369
1370
  'limit': limit,
1370
1371
  }
1372
+ until = self.safe_integer(params, 'until')
1371
1373
  if since is not None:
1372
1374
  request['start'] = since
1375
+ elif until is not None:
1376
+ duration = self.parse_timeframe(timeframe)
1377
+ request['start'] = until - ((limit - 1) * duration * 1000)
1378
+ if until is not None:
1379
+ request['end'] = until
1380
+ params = self.omit(params, 'until')
1373
1381
  response = self.v2GetCandlesTradeTimeframeSymbolHist(self.extend(request, params))
1374
1382
  #
1375
1383
  # [