ccxt 4.4.43__py2.py3-none-any.whl → 4.4.45__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 (91) 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/blofin.py +22 -0
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/base/exchange.py +1 -1
  9. ccxt/async_support/binance.py +235 -107
  10. ccxt/async_support/bingx.py +20 -9
  11. ccxt/async_support/bitfinex.py +7 -3
  12. ccxt/async_support/bitget.py +6 -4
  13. ccxt/async_support/bitmart.py +7 -10
  14. ccxt/async_support/bitmex.py +4 -6
  15. ccxt/async_support/bitstamp.py +5 -0
  16. ccxt/async_support/blofin.py +22 -0
  17. ccxt/async_support/bybit.py +12 -27
  18. ccxt/async_support/coinbase.py +14 -10
  19. ccxt/async_support/coinbaseinternational.py +13 -9
  20. ccxt/async_support/coincatch.py +2 -2
  21. ccxt/async_support/coinex.py +6 -6
  22. ccxt/async_support/cryptocom.py +5 -3
  23. ccxt/async_support/defx.py +2 -2
  24. ccxt/async_support/delta.py +1 -1
  25. ccxt/async_support/exmo.py +16 -8
  26. ccxt/async_support/gate.py +10 -5
  27. ccxt/async_support/gemini.py +5 -0
  28. ccxt/async_support/hashkey.py +15 -10
  29. ccxt/async_support/htx.py +103 -5
  30. ccxt/async_support/hyperliquid.py +6 -1
  31. ccxt/async_support/kraken.py +10 -3
  32. ccxt/async_support/krakenfutures.py +6 -1
  33. ccxt/async_support/kucoin.py +10 -8
  34. ccxt/async_support/kucoinfutures.py +7 -8
  35. ccxt/async_support/lykke.py +1 -1
  36. ccxt/async_support/mexc.py +20 -14
  37. ccxt/async_support/myokx.py +8 -0
  38. ccxt/async_support/ndax.py +1 -1
  39. ccxt/async_support/oceanex.py +1 -1
  40. ccxt/async_support/okx.py +9 -10
  41. ccxt/async_support/onetrading.py +2 -1
  42. ccxt/async_support/whitebit.py +35 -10
  43. ccxt/async_support/woo.py +6 -4
  44. ccxt/async_support/woofipro.py +7 -4
  45. ccxt/base/exchange.py +1 -1
  46. ccxt/binance.py +235 -107
  47. ccxt/bingx.py +20 -9
  48. ccxt/bitfinex.py +7 -3
  49. ccxt/bitget.py +6 -4
  50. ccxt/bitmart.py +7 -10
  51. ccxt/bitmex.py +4 -6
  52. ccxt/bitstamp.py +5 -0
  53. ccxt/blofin.py +22 -0
  54. ccxt/bybit.py +12 -27
  55. ccxt/coinbase.py +14 -10
  56. ccxt/coinbaseinternational.py +13 -9
  57. ccxt/coincatch.py +2 -2
  58. ccxt/coinex.py +6 -6
  59. ccxt/cryptocom.py +5 -3
  60. ccxt/defx.py +2 -2
  61. ccxt/delta.py +1 -1
  62. ccxt/exmo.py +16 -8
  63. ccxt/gate.py +10 -5
  64. ccxt/gemini.py +5 -0
  65. ccxt/hashkey.py +15 -10
  66. ccxt/htx.py +103 -5
  67. ccxt/hyperliquid.py +6 -1
  68. ccxt/kraken.py +10 -3
  69. ccxt/krakenfutures.py +6 -1
  70. ccxt/kucoin.py +10 -8
  71. ccxt/kucoinfutures.py +7 -8
  72. ccxt/lykke.py +1 -1
  73. ccxt/mexc.py +20 -14
  74. ccxt/myokx.py +8 -0
  75. ccxt/ndax.py +1 -1
  76. ccxt/oceanex.py +1 -1
  77. ccxt/okx.py +9 -10
  78. ccxt/onetrading.py +2 -1
  79. ccxt/pro/__init__.py +1 -1
  80. ccxt/pro/binance.py +2 -1
  81. ccxt/pro/bitcoincom.py +4 -1
  82. ccxt/pro/bitopro.py +1 -1
  83. ccxt/pro/myokx.py +5 -0
  84. ccxt/whitebit.py +35 -10
  85. ccxt/woo.py +6 -4
  86. ccxt/woofipro.py +7 -4
  87. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/METADATA +4 -4
  88. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/RECORD +91 -91
  89. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/LICENSE.txt +0 -0
  90. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/WHEEL +0 -0
  91. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/top_level.txt +0 -0
ccxt/bingx.py CHANGED
@@ -565,7 +565,7 @@ class bingx(Exchange, ImplicitAPI):
565
565
  'mark': True,
566
566
  'index': True,
567
567
  },
568
- 'limitPrice': True,
568
+ 'price': True,
569
569
  },
570
570
  'timeInForce': {
571
571
  'IOC': True,
@@ -575,6 +575,11 @@ class bingx(Exchange, ImplicitAPI):
575
575
  },
576
576
  'hedged': True,
577
577
  'trailing': True,
578
+ 'leverage': False,
579
+ 'marketBuyRequiresPrice': False,
580
+ 'marketBuyByCost': True,
581
+ 'selfTradePrevention': False,
582
+ 'iceberg': False,
578
583
  },
579
584
  'createOrders': {
580
585
  'max': 5,
@@ -607,7 +612,7 @@ class bingx(Exchange, ImplicitAPI):
607
612
  'fetchClosedOrders': {
608
613
  'marginMode': False,
609
614
  'limit': 1000,
610
- 'daysBackClosed': None,
615
+ 'daysBack': None,
611
616
  'daysBackCanceled': None,
612
617
  'untilDays': 7,
613
618
  'trigger': False,
@@ -631,7 +636,7 @@ class bingx(Exchange, ImplicitAPI):
631
636
  'fetchClosedOrders': {
632
637
  'marginMode': False,
633
638
  'limit': 1000,
634
- 'daysBackClosed': None,
639
+ 'daysBack': None,
635
640
  'daysBackCanceled': None,
636
641
  'untilDays': 7,
637
642
  'trigger': False,
@@ -2646,8 +2651,10 @@ class bingx(Exchange, ImplicitAPI):
2646
2651
  :param dict [params]: extra parameters specific to the exchange API endpoint
2647
2652
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2648
2653
  """
2649
- params['quoteOrderQty'] = cost
2650
- return self.create_order(symbol, 'market', side, cost, None, params)
2654
+ req = {
2655
+ 'quoteOrderQty': cost,
2656
+ }
2657
+ return self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
2651
2658
 
2652
2659
  def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
2653
2660
  """
@@ -2657,8 +2664,10 @@ class bingx(Exchange, ImplicitAPI):
2657
2664
  :param dict [params]: extra parameters specific to the exchange API endpoint
2658
2665
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2659
2666
  """
2660
- params['quoteOrderQty'] = cost
2661
- return self.create_order(symbol, 'market', 'buy', cost, None, params)
2667
+ req = {
2668
+ 'quoteOrderQty': cost,
2669
+ }
2670
+ return self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
2662
2671
 
2663
2672
  def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
2664
2673
  """
@@ -2668,8 +2677,10 @@ class bingx(Exchange, ImplicitAPI):
2668
2677
  :param dict [params]: extra parameters specific to the exchange API endpoint
2669
2678
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2670
2679
  """
2671
- params['quoteOrderQty'] = cost
2672
- return self.create_order(symbol, 'market', 'sell', cost, None, params)
2680
+ req = {
2681
+ 'quoteOrderQty': cost,
2682
+ }
2683
+ return self.create_order(symbol, 'market', 'sell', cost, None, self.extend(req, params))
2673
2684
 
2674
2685
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
2675
2686
  """
ccxt/bitfinex.py CHANGED
@@ -438,8 +438,12 @@ class bitfinex(Exchange, ImplicitAPI):
438
438
  'GTD': False,
439
439
  },
440
440
  'hedged': False,
441
- 'trailing': True, # todo: unify
442
- # todo: leverage unify
441
+ 'trailing': True, # todo: implement
442
+ 'leverage': True, # todo: implement
443
+ 'marketBuyRequiresPrice': False,
444
+ 'marketBuyByCost': True,
445
+ 'selfTradePrevention': False,
446
+ 'iceberg': False,
443
447
  },
444
448
  'createOrders': {
445
449
  'max': 75,
@@ -465,7 +469,7 @@ class bitfinex(Exchange, ImplicitAPI):
465
469
  'fetchClosedOrders': {
466
470
  'marginMode': False,
467
471
  'limit': None,
468
- 'daysBackClosed': None,
472
+ 'daysBack': None,
469
473
  'daysBackCanceled': None,
470
474
  'untilDays': 100000,
471
475
  'trigger': False,
ccxt/bitget.py CHANGED
@@ -1482,7 +1482,7 @@ class bitget(Exchange, ImplicitAPI):
1482
1482
  'mark': False,
1483
1483
  'index': False,
1484
1484
  },
1485
- 'limitPrice': True,
1485
+ 'price': True,
1486
1486
  },
1487
1487
  'timeInForce': {
1488
1488
  'IOC': True,
@@ -1524,7 +1524,7 @@ class bitget(Exchange, ImplicitAPI):
1524
1524
  'fetchClosedOrders': {
1525
1525
  'marginMode': True,
1526
1526
  'limit': 100,
1527
- 'daysBackClosed': None,
1527
+ 'daysBack': None,
1528
1528
  'daysBackCanceled': None,
1529
1529
  'untilDays': 90,
1530
1530
  'trigger': True,
@@ -1552,7 +1552,7 @@ class bitget(Exchange, ImplicitAPI):
1552
1552
  'mark': True,
1553
1553
  'index': True,
1554
1554
  },
1555
- 'limitPrice': False,
1555
+ 'price': False,
1556
1556
  },
1557
1557
  'timeInForce': {
1558
1558
  'IOC': True,
@@ -6613,8 +6613,10 @@ class bitget(Exchange, ImplicitAPI):
6613
6613
  # },
6614
6614
  # ]
6615
6615
  # }
6616
+ symbols = self.market_symbols(symbols)
6616
6617
  data = self.safe_list(response, 'data', [])
6617
- return self.parse_funding_rates(data, market)
6618
+ result = self.parse_funding_rates(data, market)
6619
+ return self.filter_by_array(result, 'symbol', symbols)
6618
6620
 
6619
6621
  def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
6620
6622
  #
ccxt/bitmart.py CHANGED
@@ -726,14 +726,11 @@ class bitmart(Exchange, ImplicitAPI):
726
726
  },
727
727
  'hedged': False,
728
728
  'trailing': False,
729
- 'marketBuyRequiresPrice': True,
729
+ 'marketBuyRequiresPrice': False, # todo: https://developer-pro.bitmart.com/en/spot/#new-order-v2-signed
730
730
  'marketBuyByCost': True,
731
- # exchange-supported features
732
- # 'leverage': True,
733
- # 'selfTradePrevention': False,
734
- # 'twap': False,
735
- # 'iceberg': False,
736
- # 'oco': False,
731
+ 'leverage': True, # todo: implement
732
+ 'selfTradePrevention': False,
733
+ 'iceberg': False,
737
734
  },
738
735
  'createOrders': {
739
736
  'max': 10,
@@ -759,7 +756,7 @@ class bitmart(Exchange, ImplicitAPI):
759
756
  'fetchClosedOrders': {
760
757
  'marginMode': True,
761
758
  'limit': 200,
762
- 'daysBackClosed': None,
759
+ 'daysBack': None,
763
760
  'daysBackCanceled': None,
764
761
  'untilDays': None,
765
762
  'trigger': False,
@@ -788,7 +785,7 @@ class bitmart(Exchange, ImplicitAPI):
788
785
  'mark': True,
789
786
  'index': False,
790
787
  },
791
- 'limitPrice': False,
788
+ 'price': False,
792
789
  },
793
790
  'timeInForce': {
794
791
  'IOC': True,
@@ -826,7 +823,7 @@ class bitmart(Exchange, ImplicitAPI):
826
823
  'fetchClosedOrders': {
827
824
  'marginMode': True,
828
825
  'limit': 200,
829
- 'daysBackClosed': None,
826
+ 'daysBack': None,
830
827
  'daysBackCanceled': None,
831
828
  'untilDays': None,
832
829
  'trigger': False,
ccxt/bitmex.py CHANGED
@@ -310,11 +310,9 @@ class bitmex(Exchange, ImplicitAPI):
310
310
  'trailing': True,
311
311
  'marketBuyRequiresPrice': False,
312
312
  'marketBuyByCost': False,
313
- # exchange-supported features
314
- # 'selfTradePrevention': True,
315
- # 'twap': False,
316
- # 'iceberg': False,
317
- # 'oco': False,
313
+ 'leverage': False,
314
+ 'selfTradePrevention': False,
315
+ 'iceberg': True, # todo
318
316
  },
319
317
  'createOrders': None,
320
318
  'fetchMyTrades': {
@@ -345,7 +343,7 @@ class bitmex(Exchange, ImplicitAPI):
345
343
  'fetchClosedOrders': {
346
344
  'marginMode': False,
347
345
  'limit': 500,
348
- 'daysBackClosed': None,
346
+ 'daysBack': None,
349
347
  'daysBackCanceled': None,
350
348
  'untilDays': 1000000,
351
349
  'trigger': False,
ccxt/bitstamp.py CHANGED
@@ -525,6 +525,11 @@ class bitstamp(Exchange, ImplicitAPI):
525
525
  },
526
526
  'hedged': False,
527
527
  'trailing': False,
528
+ 'leverage': False,
529
+ 'marketBuyByCost': False,
530
+ 'marketBuyRequiresPrice': False,
531
+ 'selfTradePrevention': False,
532
+ 'iceberg': False,
528
533
  },
529
534
  'createOrders': None,
530
535
  'fetchMyTrades': {
ccxt/blofin.py CHANGED
@@ -204,6 +204,18 @@ class blofin(Exchange, ImplicitAPI):
204
204
  'trade/orders-tpsl-history': 1,
205
205
  'user/query-apikey': 1,
206
206
  'affiliate/basic': 1,
207
+ 'copytrading/instruments': 1,
208
+ 'copytrading/account/balance': 1,
209
+ 'copytrading/account/positions-by-order': 1,
210
+ 'copytrading/account/positions-details-by-order': 1,
211
+ 'copytrading/account/positions-by-contract': 1,
212
+ 'copytrading/account/position-mode': 1,
213
+ 'copytrading/account/leverage-info': 1,
214
+ 'copytrading/trade/orders-pending': 1,
215
+ 'copytrading/trade/pending-tpsl-by-contract': 1,
216
+ 'copytrading/trade/position-history-by-order': 1,
217
+ 'copytrading/trade/orders-history': 1,
218
+ 'copytrading/trade/pending-tpsl-by-order': 1,
207
219
  },
208
220
  'post': {
209
221
  'trade/order': 1,
@@ -215,6 +227,16 @@ class blofin(Exchange, ImplicitAPI):
215
227
  'trade/cancel-tpsl': 1,
216
228
  'trade/close-position': 1,
217
229
  'asset/transfer': 1,
230
+ 'copytrading/account/set-position-mode': 1,
231
+ 'copytrading/account/set-leverage': 1,
232
+ 'copytrading/trade/place-order': 1,
233
+ 'copytrading/trade/cancel-order': 1,
234
+ 'copytrading/trade/place-tpsl-by-contract': 1,
235
+ 'copytrading/trade/cancel-tpsl-by-contract': 1,
236
+ 'copytrading/trade/place-tpsl-by-order': 1,
237
+ 'copytrading/trade/cancel-tpsl-by-order': 1,
238
+ 'copytrading/trade/close-position-by-order': 1,
239
+ 'copytrading/trade/close-position-by-contract': 1,
218
240
  },
219
241
  },
220
242
  },
ccxt/bybit.py CHANGED
@@ -1115,7 +1115,7 @@ class bybit(Exchange, ImplicitAPI):
1115
1115
  'mark': True,
1116
1116
  'index': True,
1117
1117
  },
1118
- 'limitPrice': True,
1118
+ 'price': True,
1119
1119
  },
1120
1120
  'timeInForce': {
1121
1121
  'IOC': True,
@@ -1124,12 +1124,12 @@ class bybit(Exchange, ImplicitAPI):
1124
1124
  'GTD': False,
1125
1125
  },
1126
1126
  'hedged': True,
1127
- # exchange-supported features
1128
- 'selfTradePrevention': True,
1127
+ 'selfTradePrevention': True, # todo: implement
1129
1128
  'trailing': True,
1130
- 'twap': False,
1131
1129
  'iceberg': False,
1132
- 'oco': False,
1130
+ 'leverage': False,
1131
+ 'marketBuyRequiresPrice': False,
1132
+ 'marketBuyByCost': True,
1133
1133
  },
1134
1134
  'createOrders': {
1135
1135
  'max': 10,
@@ -1155,7 +1155,7 @@ class bybit(Exchange, ImplicitAPI):
1155
1155
  'fetchClosedOrders': {
1156
1156
  'marginMode': False,
1157
1157
  'limit': 50,
1158
- 'daysBackClosed': 365 * 2, # 2 years
1158
+ 'daysBack': 365 * 2, # 2 years
1159
1159
  'daysBackCanceled': 1,
1160
1160
  'untilDays': 7,
1161
1161
  'trigger': True,
@@ -1168,29 +1168,13 @@ class bybit(Exchange, ImplicitAPI):
1168
1168
  'spot': {
1169
1169
  'extends': 'default',
1170
1170
  'createOrder': {
1171
- 'marginMode': False,
1172
- 'triggerPrice': True,
1173
1171
  'triggerPriceType': None,
1174
1172
  'triggerDirection': False,
1175
- 'stopLossPrice': True,
1176
- 'takeProfitPrice': True,
1177
1173
  'attachedStopLossTakeProfit': {
1178
1174
  'triggerPriceType': None,
1179
- 'limitPrice': True,
1180
- },
1181
- 'timeInForce': {
1182
- 'IOC': True,
1183
- 'FOK': True,
1184
- 'PO': True,
1185
- 'GTD': False,
1175
+ 'price': True,
1186
1176
  },
1187
- 'hedged': True,
1188
- # exchange-supported features
1189
- 'selfTradePrevention': True,
1190
- 'trailing': True,
1191
- 'twap': False,
1192
- 'iceberg': False,
1193
- 'oco': False,
1177
+ 'marketBuyRequiresPrice': True,
1194
1178
  },
1195
1179
  },
1196
1180
  'swap': {
@@ -1269,7 +1253,7 @@ class bybit(Exchange, ImplicitAPI):
1269
1253
  :param dict [params]: extra parameters specific to the exchange API endpoint
1270
1254
  :returns any: [enableUnifiedMargin, enableUnifiedAccount]
1271
1255
  """
1272
- # The API key of user id must own one of permissions will be allowed to call following API endpoints.
1256
+ # The API key of user id must own one of permissions will be allowed to call following API endpoints:
1273
1257
  # SUB UID: "Account Transfer"
1274
1258
  # MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
1275
1259
  enableUnifiedMargin = self.safe_bool(self.options, 'enableUnifiedMargin')
@@ -2056,6 +2040,7 @@ class bybit(Exchange, ImplicitAPI):
2056
2040
  'quoteId': quoteId,
2057
2041
  'settleId': settleId,
2058
2042
  'type': 'option',
2043
+ 'subType': 'linear',
2059
2044
  'spot': False,
2060
2045
  'margin': False,
2061
2046
  'swap': False,
@@ -2063,8 +2048,8 @@ class bybit(Exchange, ImplicitAPI):
2063
2048
  'option': True,
2064
2049
  'active': isActive,
2065
2050
  'contract': True,
2066
- 'linear': None,
2067
- 'inverse': None,
2051
+ 'linear': True,
2052
+ 'inverse': False,
2068
2053
  'taker': self.safe_number(market, 'takerFee', self.parse_number('0.0006')),
2069
2054
  'maker': self.safe_number(market, 'makerFee', self.parse_number('0.0001')),
2070
2055
  'contractSize': self.parse_number('1'),
ccxt/coinbase.py CHANGED
@@ -385,7 +385,7 @@ class coinbase(Exchange, ImplicitAPI):
385
385
  'user_native_currency': 'USD', # needed to get fees for v3
386
386
  },
387
387
  'features': {
388
- 'spot': {
388
+ 'default': {
389
389
  'sandbox': False,
390
390
  'createOrder': {
391
391
  'marginMode': True,
@@ -403,6 +403,11 @@ class coinbase(Exchange, ImplicitAPI):
403
403
  },
404
404
  'hedged': False,
405
405
  'trailing': False,
406
+ 'leverage': True, # todo implement
407
+ 'marketBuyByCost': True,
408
+ 'marketBuyRequiresPrice': True,
409
+ 'selfTradePrevention': False,
410
+ 'iceberg': False,
406
411
  },
407
412
  'createOrders': None,
408
413
  'fetchMyTrades': {
@@ -433,7 +438,7 @@ class coinbase(Exchange, ImplicitAPI):
433
438
  'fetchClosedOrders': {
434
439
  'marginMode': False,
435
440
  'limit': None,
436
- 'daysBackClosed': None,
441
+ 'daysBack': None,
437
442
  'daysBackCanceled': None,
438
443
  'untilDays': 10000,
439
444
  'trigger': False,
@@ -443,21 +448,20 @@ class coinbase(Exchange, ImplicitAPI):
443
448
  'limit': 350,
444
449
  },
445
450
  },
451
+ 'spot': {
452
+ 'extends': 'default',
453
+ },
446
454
  'swap': {
447
455
  'linear': {
448
- 'extends': 'spot',
449
- },
450
- 'inverse': {
451
- 'extends': 'spot',
456
+ 'extends': 'default',
452
457
  },
458
+ 'inverse': None,
453
459
  },
454
460
  'future': {
455
461
  'linear': {
456
- 'extends': 'spot',
457
- },
458
- 'inverse': {
459
- 'extends': 'spot',
462
+ 'extends': 'default',
460
463
  },
464
+ 'inverse': None,
461
465
  },
462
466
  },
463
467
  })
@@ -265,7 +265,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
265
265
  },
266
266
  },
267
267
  'features': {
268
- 'spot': {
268
+ 'default': {
269
269
  'sandbox': True,
270
270
  'createOrder': {
271
271
  'marginMode': False,
@@ -284,6 +284,11 @@ class coinbaseinternational(Exchange, ImplicitAPI):
284
284
  },
285
285
  'hedged': False,
286
286
  'trailing': False,
287
+ 'leverage': False,
288
+ 'marketBuyByCost': False,
289
+ 'marketBuyRequiresPrice': True,
290
+ 'selfTradePrevention': True, # todo: implement
291
+ 'iceberg': False,
287
292
  },
288
293
  'createOrders': None,
289
294
  'fetchMyTrades': {
@@ -309,21 +314,20 @@ class coinbaseinternational(Exchange, ImplicitAPI):
309
314
  'limit': 300,
310
315
  },
311
316
  },
317
+ 'spot': {
318
+ 'extends': 'default',
319
+ },
312
320
  'swap': {
313
321
  'linear': {
314
- 'extends': 'spot',
322
+ 'extends': 'default',
315
323
  },
316
324
  'inverse': {
317
- 'extends': 'spot',
325
+ 'extends': 'default',
318
326
  },
319
327
  },
320
328
  'future': {
321
- 'linear': {
322
- 'extends': 'spot',
323
- },
324
- 'inverse': {
325
- 'extends': 'spot',
326
- },
329
+ 'linear': None,
330
+ 'inverse': None,
327
331
  },
328
332
  },
329
333
  })
ccxt/coincatch.py CHANGED
@@ -848,8 +848,8 @@ class coincatch(Exchange, ImplicitAPI):
848
848
  settleId = self.safe_string(supportMarginCoins, 0)
849
849
  settle = self.safe_currency_code(settleId)
850
850
  suffix = ':' + settle
851
- isLinear = baseId == settleId # todo check
852
- isInverse = quoteId == settleId # todo check
851
+ isLinear = quoteId == settleId # todo check
852
+ isInverse = baseId == settleId # todo check
853
853
  if isLinear:
854
854
  subType = 'linear'
855
855
  elif isInverse:
ccxt/coinex.py CHANGED
@@ -532,11 +532,11 @@ class coinex(Exchange, ImplicitAPI):
532
532
  },
533
533
  'hedged': False,
534
534
  'trailing': False,
535
- # exchange-supported features
536
- # 'marketBuyRequiresPrice': True,
537
- # 'marketBuyByCost': True,
538
- # 'selfTradePrevention': True,
539
- # 'iceberg': True,
535
+ 'leverage': False,
536
+ 'marketBuyByCost': True,
537
+ 'marketBuyRequiresPrice': True,
538
+ 'selfTradePrevention': True, # todo: implement
539
+ 'iceberg': True, # todo implement
540
540
  },
541
541
  'createOrders': {
542
542
  'max': 5,
@@ -562,7 +562,7 @@ class coinex(Exchange, ImplicitAPI):
562
562
  'fetchClosedOrders': {
563
563
  'marginMode': True,
564
564
  'limit': 1000,
565
- 'daysBackClosed': None,
565
+ 'daysBack': None,
566
566
  'daysBackCanceled': None,
567
567
  'untilDays': None,
568
568
  'trigger': True,
ccxt/cryptocom.py CHANGED
@@ -389,10 +389,12 @@ class cryptocom(Exchange, ImplicitAPI):
389
389
  'GTD': False,
390
390
  },
391
391
  'hedged': False,
392
- # exchange-supported features
393
- 'selfTradePrevention': True,
392
+ 'selfTradePrevention': True, # todo: implement
394
393
  'trailing': False,
395
394
  'iceberg': False,
395
+ 'leverage': False,
396
+ 'marketBuyByCost': True,
397
+ 'marketBuyRequiresPrice': True,
396
398
  },
397
399
  'createOrders': {
398
400
  'max': 10,
@@ -425,7 +427,7 @@ class cryptocom(Exchange, ImplicitAPI):
425
427
  'fetchClosedOrders': {
426
428
  'marginMode': False,
427
429
  'limit': 100,
428
- 'daysBackClosed': None,
430
+ 'daysBack': None,
429
431
  'daysBackCanceled': None,
430
432
  'untilDays': 1,
431
433
  'trigger': False,
ccxt/defx.py CHANGED
@@ -925,10 +925,10 @@ class defx(Exchange, ImplicitAPI):
925
925
  id = self.safe_string(trade, 'id')
926
926
  oid = self.safe_string(trade, 'orderId')
927
927
  takerOrMaker = self.safe_string_lower(trade, 'role')
928
- buyerMaker = self.safe_string(trade, 'buyerMaker')
928
+ buyerMaker = self.safe_bool(trade, 'buyerMaker')
929
929
  side = self.safe_string_lower(trade, 'side')
930
930
  if buyerMaker is not None:
931
- if buyerMaker == 'true':
931
+ if buyerMaker:
932
932
  side = 'sell'
933
933
  else:
934
934
  side = 'buy'
ccxt/delta.py CHANGED
@@ -734,7 +734,7 @@ class delta(Exchange, ImplicitAPI):
734
734
  else:
735
735
  # other markets(swap, futures, move, spread, irs) seem to use the step of '1' contract
736
736
  amountPrecision = self.parse_number('1')
737
- linear = (settle == base)
737
+ linear = (settle == quote)
738
738
  optionType = None
739
739
  symbol = base + '/' + quote
740
740
  if swap or future or option:
ccxt/exmo.py CHANGED
@@ -846,32 +846,40 @@ class exmo(Exchange, ImplicitAPI):
846
846
  :param int [since]: timestamp in ms of the earliest candle to fetch
847
847
  :param int [limit]: the maximum amount of candles to fetch
848
848
  :param dict [params]: extra parameters specific to the exchange API endpoint
849
+ :param int [params.until]: timestamp in ms of the latest candle to fetch
849
850
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
850
851
  """
851
852
  self.load_markets()
852
853
  market = self.market(symbol)
854
+ until = self.safe_integer_product(params, 'until', 0.001)
855
+ untilIsDefined = (until is not None)
853
856
  request: dict = {
854
857
  'symbol': market['id'],
855
858
  'resolution': self.safe_string(self.timeframes, timeframe, timeframe),
856
859
  }
857
860
  maxLimit = 3000
858
861
  duration = self.parse_timeframe(timeframe)
859
- now = self.milliseconds()
862
+ now = self.parse_to_int(self.milliseconds() / 1000)
860
863
  if since is None:
864
+ to = min(until, now) if untilIsDefined else now
861
865
  if limit is None:
862
866
  limit = 1000 # cap default at generous amount
863
867
  else:
864
868
  limit = min(limit, maxLimit)
865
- request['from'] = self.parse_to_int(now / 1000) - limit * duration - 1
866
- request['to'] = self.parse_to_int(now / 1000)
869
+ request['from'] = to - (limit * duration) - 1
870
+ request['to'] = to
867
871
  else:
868
872
  request['from'] = self.parse_to_int(since / 1000) - 1
869
- if limit is None:
870
- limit = maxLimit
873
+ if untilIsDefined:
874
+ request['to'] = min(until, now)
871
875
  else:
872
- limit = min(limit, maxLimit)
873
- to = self.sum(since, limit * duration * 1000)
874
- request['to'] = self.parse_to_int(to / 1000)
876
+ if limit is None:
877
+ limit = maxLimit
878
+ else:
879
+ limit = min(limit, maxLimit)
880
+ to = self.sum(since, limit * duration)
881
+ request['to'] = min(to, now)
882
+ params = self.omit(params, 'until')
875
883
  response = self.publicGetCandlesHistory(self.extend(request, params))
876
884
  #
877
885
  # {
ccxt/gate.py CHANGED
@@ -723,7 +723,7 @@ class gate(Exchange, ImplicitAPI):
723
723
  },
724
724
  },
725
725
  'features': {
726
- 'spot': {
726
+ 'default': {
727
727
  'sandbox': True,
728
728
  'createOrder': {
729
729
  'marginMode': True,
@@ -742,9 +742,11 @@ class gate(Exchange, ImplicitAPI):
742
742
  },
743
743
  'hedged': False,
744
744
  'trailing': False,
745
- # exchange-specific features
746
- 'iceberg': True,
747
- 'selfTradePrevention': True,
745
+ 'iceberg': True, # todo implement
746
+ 'selfTradePrevention': True, # todo implement
747
+ 'leverage': False,
748
+ 'marketBuyByCost': True,
749
+ 'marketBuyRequiresPrice': True,
748
750
  },
749
751
  'createOrders': {
750
752
  'max': 40, # NOTE! max 10 per symbol
@@ -773,13 +775,16 @@ class gate(Exchange, ImplicitAPI):
773
775
  'trailing': False,
774
776
  'limit': 100,
775
777
  'untilDays': 30,
776
- 'daysBackClosed': None,
778
+ 'daysBack': None,
777
779
  'daysBackCanceled': None,
778
780
  },
779
781
  'fetchOHLCV': {
780
782
  'limit': 1000,
781
783
  },
782
784
  },
785
+ 'spot': {
786
+ 'extends': 'default',
787
+ },
783
788
  'forDerivatives': {
784
789
  'extends': 'spot',
785
790
  'createOrder': {