ccxt 4.4.94__py2.py3-none-any.whl → 4.4.96__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 (92) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/bingx.py +3 -0
  3. ccxt/abstract/foxbit.py +26 -0
  4. ccxt/abstract/hyperliquid.py +1 -1
  5. ccxt/abstract/woo.py +59 -4
  6. ccxt/apex.py +3 -3
  7. ccxt/ascendex.py +2 -2
  8. ccxt/async_support/__init__.py +3 -1
  9. ccxt/async_support/apex.py +3 -3
  10. ccxt/async_support/ascendex.py +2 -2
  11. ccxt/async_support/base/exchange.py +5 -3
  12. ccxt/async_support/base/ws/future.py +5 -1
  13. ccxt/async_support/bingx.py +129 -92
  14. ccxt/async_support/bitget.py +31 -144
  15. ccxt/async_support/bitmart.py +2 -2
  16. ccxt/async_support/bitrue.py +13 -8
  17. ccxt/async_support/bitstamp.py +2 -0
  18. ccxt/async_support/blofin.py +6 -1
  19. ccxt/async_support/bybit.py +15 -6
  20. ccxt/async_support/coinbase.py +36 -0
  21. ccxt/async_support/coinbaseexchange.py +4 -2
  22. ccxt/async_support/coinbaseinternational.py +2 -2
  23. ccxt/async_support/coinmate.py +34 -0
  24. ccxt/async_support/coinone.py +34 -0
  25. ccxt/async_support/coinsph.py +29 -0
  26. ccxt/async_support/coinspot.py +36 -1
  27. ccxt/async_support/cryptocom.py +2 -1
  28. ccxt/async_support/cryptomus.py +41 -1
  29. ccxt/async_support/defx.py +1 -1
  30. ccxt/async_support/derive.py +1 -1
  31. ccxt/async_support/ellipx.py +40 -0
  32. ccxt/async_support/foxbit.py +1935 -0
  33. ccxt/async_support/gate.py +1 -1
  34. ccxt/async_support/hyperliquid.py +3 -2
  35. ccxt/async_support/kucoin.py +1 -1
  36. ccxt/async_support/kucoinfutures.py +3 -2
  37. ccxt/async_support/mexc.py +28 -13
  38. ccxt/async_support/modetrade.py +3 -3
  39. ccxt/async_support/okcoin.py +1 -1
  40. ccxt/async_support/okx.py +10 -3
  41. ccxt/async_support/onetrading.py +1 -1
  42. ccxt/async_support/oxfun.py +2 -1
  43. ccxt/async_support/paradex.py +2 -2
  44. ccxt/async_support/vertex.py +3 -2
  45. ccxt/async_support/woo.py +1255 -875
  46. ccxt/async_support/woofipro.py +2 -2
  47. ccxt/base/exchange.py +8 -5
  48. ccxt/bingx.py +129 -92
  49. ccxt/bitget.py +31 -144
  50. ccxt/bitmart.py +2 -2
  51. ccxt/bitrue.py +13 -8
  52. ccxt/bitstamp.py +2 -0
  53. ccxt/blofin.py +6 -1
  54. ccxt/bybit.py +15 -6
  55. ccxt/coinbase.py +36 -0
  56. ccxt/coinbaseexchange.py +4 -2
  57. ccxt/coinbaseinternational.py +2 -2
  58. ccxt/coinmate.py +34 -0
  59. ccxt/coinone.py +34 -0
  60. ccxt/coinsph.py +29 -0
  61. ccxt/coinspot.py +36 -1
  62. ccxt/cryptocom.py +2 -1
  63. ccxt/cryptomus.py +41 -1
  64. ccxt/defx.py +1 -1
  65. ccxt/derive.py +1 -1
  66. ccxt/ellipx.py +40 -0
  67. ccxt/foxbit.py +1935 -0
  68. ccxt/gate.py +1 -1
  69. ccxt/hyperliquid.py +3 -2
  70. ccxt/kucoin.py +1 -1
  71. ccxt/kucoinfutures.py +3 -2
  72. ccxt/mexc.py +28 -13
  73. ccxt/modetrade.py +3 -3
  74. ccxt/okcoin.py +1 -1
  75. ccxt/okx.py +10 -3
  76. ccxt/onetrading.py +1 -1
  77. ccxt/oxfun.py +2 -1
  78. ccxt/paradex.py +2 -2
  79. ccxt/pro/__init__.py +1 -1
  80. ccxt/pro/hyperliquid.py +6 -6
  81. ccxt/pro/kraken.py +17 -16
  82. ccxt/pro/mexc.py +10 -10
  83. ccxt/test/tests_async.py +17 -2
  84. ccxt/test/tests_sync.py +17 -2
  85. ccxt/vertex.py +3 -2
  86. ccxt/woo.py +1255 -875
  87. ccxt/woofipro.py +2 -2
  88. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/METADATA +8 -8
  89. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/RECORD +92 -89
  90. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/LICENSE.txt +0 -0
  91. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/WHEEL +0 -0
  92. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/top_level.txt +0 -0
ccxt/bitget.py CHANGED
@@ -1997,7 +1997,7 @@ class bitget(Exchange, ImplicitAPI):
1997
1997
  'cross': hasCrossMargin,
1998
1998
  'isolated': hasIsolatedMargin,
1999
1999
  }
2000
- isMarginTradingAllowed = hasCrossMargin or hasCrossMargin
2000
+ isMarginTradingAllowed = hasCrossMargin or hasIsolatedMargin
2001
2001
  else:
2002
2002
  if symbolType == 'perpetual':
2003
2003
  type = 'swap'
@@ -4111,82 +4111,35 @@ class bitget(Exchange, ImplicitAPI):
4111
4111
  # "result": "success"
4112
4112
  # }
4113
4113
  #
4114
- # spot: fetchOrder
4115
- #
4116
- # {
4117
- # "userId": "7264631750",
4118
- # "symbol": "BTCUSDT",
4119
- # "orderId": "1111461743123927040",
4120
- # "clientOid": "63f95110-93b5-4309-8f77-46339f1bcf3c",
4121
- # "price": "25000.0000000000000000",
4122
- # "size": "0.0002000000000000",
4123
- # "orderType": "limit",
4124
- # "side": "buy",
4125
- # "status": "live",
4126
- # "priceAvg": "0",
4127
- # "baseVolume": "0.0000000000000000",
4128
- # "quoteVolume": "0.0000000000000000",
4129
- # "enterPointSource": "API",
4130
- # "feeDetail": "",
4131
- # "orderSource": "normal",
4132
- # "cTime": "1700719050198",
4133
- # "uTime": "1700719050198"
4134
- # }
4135
- #
4136
- # swap and future: fetchOrder
4137
- #
4138
- # {
4139
- # "symbol": "BTCUSDT",
4140
- # "size": "0.001",
4141
- # "orderId": "1111465253393825792",
4142
- # "clientOid": "1111465253431574529",
4143
- # "baseVolume": "0",
4144
- # "fee": "0",
4145
- # "price": "27000",
4146
- # "priceAvg": "",
4147
- # "state": "live",
4148
- # "side": "buy",
4149
- # "force": "gtc",
4150
- # "totalProfits": "0",
4151
- # "posSide": "long",
4152
- # "marginCoin": "USDT",
4153
- # "presetStopSurplusPrice": "",
4154
- # "presetStopLossPrice": "",
4155
- # "quoteVolume": "0",
4156
- # "orderType": "limit",
4157
- # "leverage": "20",
4158
- # "marginMode": "crossed",
4159
- # "reduceOnly": "NO",
4160
- # "enterPointSource": "API",
4161
- # "tradeSide": "open",
4162
- # "posMode": "hedge_mode",
4163
- # "orderSource": "normal",
4164
- # "cTime": "1700719887120",
4165
- # "uTime": "1700719887120"
4166
- # }
4167
- #
4168
- # spot: fetchOpenOrders
4114
+ # spot: fetchOrder, fetchOpenOrders, fetchCanceledAndClosedOrders
4169
4115
  #
4170
4116
  # {
4171
4117
  # "userId": "7264631750",
4172
4118
  # "symbol": "BTCUSDT",
4173
4119
  # "orderId": "1111499608327360513",
4174
4120
  # "clientOid": "d0d4dad5-18d0-4869-a074-ec40bb47cba6",
4175
- # "priceAvg": "25000.0000000000000000",
4176
- # "size": "0.0002000000000000",
4121
+ # "size": "0.0002000000000000", # COST for 'buy market' order! AMOUNT in all other cases
4122
+ # "price": "0", # in fetchOrder: 0 for market order, otherwise limit price(field not present in fetchOpenOrders
4177
4123
  # "orderType": "limit",
4178
4124
  # "side": "buy",
4179
4125
  # "status": "live",
4180
4126
  # "basePrice": "0",
4181
- # "baseVolume": "0.0000000000000000",
4182
- # "quoteVolume": "0.0000000000000000",
4127
+ # "priceAvg": "25000.0000000000000000", # 0 if nothing filled
4128
+ # "baseVolume": "0.0000000000000000", # 0 if nothing filled
4129
+ # "quoteVolume": "0.0000000000000000", # 0 if nothing filled
4183
4130
  # "enterPointSource": "WEB",
4184
4131
  # "orderSource": "normal",
4185
4132
  # "cTime": "1700728077966",
4186
4133
  # "uTime": "1700728077966"
4134
+ # "feeDetail": "{\\"newFees\\":{\\"c\\":0,\\"d\\":0,\\"deduction\\":false,\\"r\\":-0.0064699886,\\"t\\":-0.0064699886,\\"totalDeductionFee\\":0},\\"USDT\\":{\\"deduction\\":false,\\"feeCoinCode\\":\\"USDT\\",\\"totalDeductionFee\\":0,\\"totalFee\\":-0.0064699886000000}}", # might not be present in fetchOpenOrders
4135
+ # "triggerPrice": null,
4136
+ # "tpslType": "normal",
4137
+ # "quoteCoin": "USDT", # not present in fetchOpenOrders
4138
+ # "baseCoin": "DOT", # not present in fetchOpenOrders
4139
+ # "cancelReason": "", # not present in fetchOpenOrders
4187
4140
  # }
4188
4141
  #
4189
- # spot stop: fetchOpenOrders, fetchCanceledAndClosedOrders
4142
+ # spot trigger: fetchOpenOrders, fetchCanceledAndClosedOrders
4190
4143
  #
4191
4144
  # {
4192
4145
  # "orderId": "1111503385931620352",
@@ -4227,18 +4180,19 @@ class bitget(Exchange, ImplicitAPI):
4227
4180
  # "uTime": "1700729691866"
4228
4181
  # }
4229
4182
  #
4230
- # swap: fetchOpenOrders, fetchCanceledAndClosedOrders
4183
+ # swap and future: fetchOrder, fetchOpenOrders, fetchCanceledAndClosedOrders
4231
4184
  #
4232
4185
  # {
4233
4186
  # "symbol": "BTCUSDT",
4234
- # "size": "0.002",
4235
- # "orderId": "1111488897767604224",
4236
- # "clientOid": "1111488897805352960",
4187
+ # "size": "0.001",
4188
+ # "orderId": "1111465253393825792",
4189
+ # "clientOid": "1111465253431574529",
4237
4190
  # "baseVolume": "0",
4238
4191
  # "fee": "0",
4239
- # "price": "25000",
4192
+ # "price": "27000",
4240
4193
  # "priceAvg": "",
4241
- # "status": "live",
4194
+ # "state": "live",
4195
+ # # "status": "live", # key for fetchOpenOrders, fetchClosedOrders
4242
4196
  # "side": "buy",
4243
4197
  # "force": "gtc",
4244
4198
  # "totalProfits": "0",
@@ -4247,7 +4201,7 @@ class bitget(Exchange, ImplicitAPI):
4247
4201
  # "quoteVolume": "0",
4248
4202
  # "leverage": "20",
4249
4203
  # "marginMode": "crossed",
4250
- # "enterPointSource": "web",
4204
+ # "enterPointSource": "API",
4251
4205
  # "tradeSide": "open",
4252
4206
  # "posMode": "hedge_mode",
4253
4207
  # "orderType": "limit",
@@ -4255,94 +4209,22 @@ class bitget(Exchange, ImplicitAPI):
4255
4209
  # "presetStopSurplusPrice": "",
4256
4210
  # "presetStopLossPrice": "",
4257
4211
  # "reduceOnly": "NO",
4258
- # "cTime": "1700725524378",
4259
- # "uTime": "1700725524378"
4260
- # }
4212
+ # "cTime": "1700719887120",
4213
+ # "uTime": "1700719887120"
4261
4214
  #
4262
- # swap stop: fetchOpenOrders
4215
+ # for swap trigger order, the additional below fields are present:
4263
4216
  #
4264
- # {
4265
4217
  # "planType": "normal_plan",
4266
- # "symbol": "BTCUSDT",
4267
- # "size": "0.001",
4268
- # "orderId": "1111491399869075457",
4269
- # "clientOid": "1111491399869075456",
4270
- # "price": "27000",
4271
4218
  # "callbackRatio": "",
4272
4219
  # "triggerPrice": "24000",
4273
4220
  # "triggerType": "mark_price",
4274
4221
  # "planStatus": "live",
4275
- # "side": "buy",
4276
- # "posSide": "long",
4277
- # "marginCoin": "USDT",
4278
- # "marginMode": "crossed",
4279
- # "enterPointSource": "API",
4280
- # "tradeSide": "open",
4281
- # "posMode": "hedge_mode",
4282
- # "orderType": "limit",
4283
- # "stopSurplusTriggerPrice": "",
4284
- # "stopSurplusExecutePrice": "",
4285
- # "stopSurplusTriggerType": "fill_price",
4286
- # "stopLossTriggerPrice": "",
4287
- # "stopLossExecutePrice": "",
4288
- # "stopLossTriggerType": "fill_price",
4289
- # "cTime": "1700726120917",
4290
- # "uTime": "1700726120917"
4291
- # }
4292
- #
4293
- # spot: fetchCanceledAndClosedOrders
4294
- #
4295
- # {
4296
- # "userId": "7264631750",
4297
- # "symbol": "BTCUSDT",
4298
- # "orderId": "1111499608327360513",
4299
- # "clientOid": "d0d4dad5-18d0-4869-a074-ec40bb47cba6",
4300
- # "price": "25000.0000000000000000",
4301
- # "size": "0.0002000000000000",
4302
- # "orderType": "limit",
4303
- # "side": "buy",
4304
- # "status": "cancelled",
4305
- # "priceAvg": "0",
4306
- # "baseVolume": "0.0000000000000000",
4307
- # "quoteVolume": "0.0000000000000000",
4308
- # "enterPointSource": "WEB",
4309
- # "feeDetail": "",
4310
- # "orderSource": "normal",
4311
- # "cTime": "1700728077966",
4312
- # "uTime": "1700728911471"
4313
- # }
4314
- #
4315
- # swap stop: fetchCanceledAndClosedOrders
4316
- #
4317
- # {
4318
- # "planType": "normal_plan",
4319
- # "symbol": "BTCUSDT",
4320
- # "size": "0.001",
4321
- # "orderId": "1111491399869075457",
4322
- # "clientOid": "1111491399869075456",
4323
- # "planStatus": "cancelled",
4324
- # "price": "27000",
4325
- # "feeDetail": null,
4326
- # "baseVolume": "0",
4327
- # "callbackRatio": "",
4328
- # "triggerPrice": "24000",
4329
- # "triggerType": "mark_price",
4330
- # "side": "buy",
4331
- # "posSide": "long",
4332
- # "marginCoin": "USDT",
4333
- # "marginMode": "crossed",
4334
- # "enterPointSource": "API",
4335
- # "tradeSide": "open",
4336
- # "posMode": "hedge_mode",
4337
- # "orderType": "limit",
4338
4222
  # "stopSurplusTriggerPrice": "",
4339
4223
  # "stopSurplusExecutePrice": "",
4340
4224
  # "stopSurplusTriggerType": "fill_price",
4341
4225
  # "stopLossTriggerPrice": "",
4342
4226
  # "stopLossExecutePrice": "",
4343
4227
  # "stopLossTriggerType": "fill_price",
4344
- # "cTime": "1700726120917",
4345
- # "uTime": "1700727879652"
4346
4228
  # }
4347
4229
  #
4348
4230
  errorMessage = self.safe_string(order, 'errorMsg')
@@ -4420,6 +4302,11 @@ class bitget(Exchange, ImplicitAPI):
4420
4302
  side = 'sell' if (side == 'buy') else 'buy'
4421
4303
  # on bitget hedge mode if the position is long the side is always buy, and if the position is short the side is always sell
4422
4304
  # so the side of the reduceOnly order is inversed
4305
+ orderType = self.safe_string(order, 'orderType')
4306
+ isBuyMarket = (side == 'buy') and (orderType == 'market')
4307
+ if market['spot'] and isBuyMarket:
4308
+ # in top comment, for 'buy market' the 'size' field is COST, not AMOUNT
4309
+ size = self.safe_string(order, 'baseVolume')
4423
4310
  return self.safe_order({
4424
4311
  'info': order,
4425
4312
  'id': self.safe_string_2(order, 'orderId', 'data'),
@@ -4429,7 +4316,7 @@ class bitget(Exchange, ImplicitAPI):
4429
4316
  'lastTradeTimestamp': updateTimestamp,
4430
4317
  'lastUpdateTimestamp': updateTimestamp,
4431
4318
  'symbol': market['symbol'],
4432
- 'type': self.safe_string(order, 'orderType'),
4319
+ 'type': orderType,
4433
4320
  'side': side,
4434
4321
  'price': price,
4435
4322
  'amount': size,
ccxt/bitmart.py CHANGED
@@ -3083,7 +3083,7 @@ class bitmart(Exchange, ImplicitAPI):
3083
3083
  # }
3084
3084
  #
3085
3085
  if market['swap']:
3086
- return response
3086
+ return self.safe_order({'info': response})
3087
3087
  data = self.safe_value(response, 'data')
3088
3088
  if data is True:
3089
3089
  return self.safe_order({'id': id}, market)
@@ -3200,7 +3200,7 @@ class bitmart(Exchange, ImplicitAPI):
3200
3200
  # "trace": "7f9c94e10f9d4513bc08a7bfc2a5559a.70.16954131323145323"
3201
3201
  # }
3202
3202
  #
3203
- return response
3203
+ return [self.safe_order({'info': response})]
3204
3204
 
3205
3205
  def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3206
3206
  if symbol is None:
ccxt/bitrue.py CHANGED
@@ -394,11 +394,9 @@ class bitrue(Exchange, ImplicitAPI):
394
394
  # exchange-specific options
395
395
  'options': {
396
396
  'createMarketBuyOrderRequiresPrice': True,
397
- 'fetchMarkets': [
398
- 'spot',
399
- 'linear',
400
- 'inverse',
401
- ],
397
+ 'fetchMarkets': {
398
+ 'types': ['spot', 'linear', 'inverse'],
399
+ },
402
400
  # 'fetchTradesMethod': 'publicGetAggTrades', # publicGetTrades, publicGetHistoricalTrades
403
401
  'fetchMyTradesMethod': 'v2PrivateGetMyTrades', # spotV1PrivateGetMyTrades
404
402
  'hasAlreadyAuthenticatedSuccessfully': False,
@@ -844,9 +842,16 @@ class bitrue(Exchange, ImplicitAPI):
844
842
  :returns dict[]: an array of objects representing market data
845
843
  """
846
844
  promisesRaw = []
847
- fetchMarkets = self.safe_value(self.options, 'fetchMarkets', ['spot', 'linear', 'inverse'])
848
- for i in range(0, len(fetchMarkets)):
849
- marketType = fetchMarkets[i]
845
+ types = None
846
+ defaultTypes = ['spot', 'linear', 'inverse']
847
+ fetchMarketsOptions = self.safe_dict(self.options, 'fetchMarkets')
848
+ if fetchMarketsOptions is not None:
849
+ types = self.safe_list(fetchMarketsOptions, 'types', defaultTypes)
850
+ else:
851
+ # for backward-compatibility
852
+ types = self.safe_list(self.options, 'fetchMarkets', defaultTypes)
853
+ for i in range(0, len(types)):
854
+ marketType = types[i]
850
855
  if marketType == 'spot':
851
856
  promisesRaw.append(self.spotV1PublicGetExchangeInfo(params))
852
857
  elif marketType == 'linear':
ccxt/bitstamp.py CHANGED
@@ -11,6 +11,7 @@ from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
13
13
  from ccxt.base.errors import PermissionDenied
14
+ from ccxt.base.errors import AccountSuspended
14
15
  from ccxt.base.errors import BadRequest
15
16
  from ccxt.base.errors import InsufficientFunds
16
17
  from ccxt.base.errors import InvalidAddress
@@ -531,6 +532,7 @@ class bitstamp(Exchange, ImplicitAPI):
531
532
  "Bitstamp.net is under scheduled maintenance. We'll be back soon.": OnMaintenance, # {"error": "Bitstamp.net is under scheduled maintenance. We'll be back soon."}
532
533
  'Order could not be placed.': ExchangeNotAvailable, # Order could not be placed(perhaps due to internal error or trade halt). Please retry placing order.
533
534
  'Invalid offset.': BadRequest,
535
+ 'Trading is currently unavailable for your account.': AccountSuspended, # {"status": "error", "reason": {"__all__": ["Trading is currently unavailable for your account."]}, "response_code": "403.004"}
534
536
  },
535
537
  'broad': {
536
538
  'Minimum order size is': InvalidOrder, # Minimum order size is 5.0 EUR.
ccxt/blofin.py CHANGED
@@ -904,6 +904,7 @@ class blofin(Exchange, ImplicitAPI):
904
904
  :param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
905
905
  :param dict [params]: extra parameters specific to the exchange API endpoint
906
906
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
907
+ :param int [params.until]: timestamp in ms of the latest funding rate to fetch
907
908
  :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
908
909
  """
909
910
  if symbol is None:
@@ -912,7 +913,7 @@ class blofin(Exchange, ImplicitAPI):
912
913
  paginate = False
913
914
  paginate, params = self.handle_option_and_params(params, 'fetchFundingRateHistory', 'paginate')
914
915
  if paginate:
915
- return self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params)
916
+ return self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 100)
916
917
  market = self.market(symbol)
917
918
  request: dict = {
918
919
  'instId': market['id'],
@@ -921,6 +922,10 @@ class blofin(Exchange, ImplicitAPI):
921
922
  request['before'] = max(since - 1, 0)
922
923
  if limit is not None:
923
924
  request['limit'] = limit
925
+ until = self.safe_integer(params, 'until')
926
+ if until is not None:
927
+ request['after'] = until
928
+ params = self.omit(params, 'until')
924
929
  response = self.publicGetMarketFundingRateHistory(self.extend(request, params))
925
930
  rates = []
926
931
  data = self.safe_list(response, 'data', [])
ccxt/bybit.py CHANGED
@@ -1040,7 +1040,9 @@ class bybit(Exchange, ImplicitAPI):
1040
1040
  'options': {
1041
1041
  'usePrivateInstrumentsInfo': False,
1042
1042
  'enableDemoTrading': False,
1043
- 'fetchMarkets': ['spot', 'linear', 'inverse', 'option'],
1043
+ 'fetchMarkets': {
1044
+ 'types': ['spot', 'linear', 'inverse', 'option'],
1045
+ },
1044
1046
  'enableUnifiedMargin': None,
1045
1047
  'enableUnifiedAccount': None,
1046
1048
  'unifiedMarginStatus': None,
@@ -1701,9 +1703,16 @@ class bybit(Exchange, ImplicitAPI):
1701
1703
  if self.options['adjustForTimeDifference']:
1702
1704
  self.load_time_difference()
1703
1705
  promisesUnresolved = []
1704
- fetchMarkets = self.safe_list(self.options, 'fetchMarkets', ['spot', 'linear', 'inverse'])
1705
- for i in range(0, len(fetchMarkets)):
1706
- marketType = fetchMarkets[i]
1706
+ types = None
1707
+ defaultTypes = ['spot', 'linear', 'inverse', 'option']
1708
+ fetchMarketsOptions = self.safe_dict(self.options, 'fetchMarkets')
1709
+ if fetchMarketsOptions is not None:
1710
+ types = self.safe_list(fetchMarketsOptions, 'types', defaultTypes)
1711
+ else:
1712
+ # for backward-compatibility
1713
+ types = self.safe_list(self.options, 'fetchMarkets', defaultTypes)
1714
+ for i in range(0, len(types)):
1715
+ marketType = types[i]
1707
1716
  if marketType == 'spot':
1708
1717
  promisesUnresolved.append(self.fetch_spot_markets(params))
1709
1718
  elif marketType == 'linear':
@@ -4576,7 +4585,7 @@ class bybit(Exchange, ImplicitAPI):
4576
4585
  result = self.safe_dict(response, 'result', {})
4577
4586
  orders = self.safe_list(result, 'list')
4578
4587
  if not isinstance(orders, list):
4579
- return response
4588
+ return [self.safe_order({'info': response})]
4580
4589
  return self.parse_orders(orders, market)
4581
4590
 
4582
4591
  def fetch_order_classic(self, id: str, symbol: Str = None, params={}) -> Order:
@@ -8082,7 +8091,7 @@ classic accounts only/ spot not supported* fetches information on an order made
8082
8091
  'timestamp': timestamp,
8083
8092
  'datetime': self.iso8601(timestamp),
8084
8093
  'id': self.safe_string(income, 'execId'),
8085
- 'amount': self.safe_number(income, 'execQty'),
8094
+ 'amount': self.safe_number(income, 'execFee'),
8086
8095
  'rate': self.safe_number(income, 'feeRate'),
8087
8096
  }
8088
8097
 
ccxt/coinbase.py CHANGED
@@ -51,6 +51,9 @@ class coinbase(Exchange, ImplicitAPI):
51
51
  'future': False,
52
52
  'option': False,
53
53
  'addMargin': False,
54
+ 'borrowCrossMargin': False,
55
+ 'borrowIsolatedMargin': False,
56
+ 'borrowMargin': False,
54
57
  'cancelOrder': True,
55
58
  'cancelOrders': True,
56
59
  'closeAllPositions': False,
@@ -65,6 +68,8 @@ class coinbase(Exchange, ImplicitAPI):
65
68
  'createMarketSellOrder': True,
66
69
  'createMarketSellOrderWithCost': False,
67
70
  'createOrder': True,
71
+ 'createOrderWithTakeProfitAndStopLoss': False,
72
+ 'createOrderWithTakeProfitAndStopLossWs': False,
68
73
  'createPostOnlyOrder': True,
69
74
  'createReduceOnlyOrder': False,
70
75
  'createStopLimitOrder': True,
@@ -75,8 +80,12 @@ class coinbase(Exchange, ImplicitAPI):
75
80
  'fetchAccounts': True,
76
81
  'fetchBalance': True,
77
82
  'fetchBidsAsks': True,
83
+ 'fetchBorrowInterest': False,
84
+ 'fetchBorrowRate': False,
78
85
  'fetchBorrowRateHistories': False,
79
86
  'fetchBorrowRateHistory': False,
87
+ 'fetchBorrowRates': False,
88
+ 'fetchBorrowRatesPerSymbol': False,
80
89
  'fetchCanceledOrders': True,
81
90
  'fetchClosedOrders': True,
82
91
  'fetchConvertQuote': True,
@@ -94,42 +103,69 @@ class coinbase(Exchange, ImplicitAPI):
94
103
  'fetchDeposits': True,
95
104
  'fetchDepositsWithdrawals': True,
96
105
  'fetchFundingHistory': False,
106
+ 'fetchFundingInterval': False,
107
+ 'fetchFundingIntervals': False,
97
108
  'fetchFundingRate': False,
98
109
  'fetchFundingRateHistory': False,
99
110
  'fetchFundingRates': False,
111
+ 'fetchGreeks': False,
100
112
  'fetchIndexOHLCV': False,
101
113
  'fetchIsolatedBorrowRate': False,
102
114
  'fetchIsolatedBorrowRates': False,
115
+ 'fetchIsolatedPositions': False,
103
116
  'fetchL2OrderBook': False,
104
117
  'fetchLedger': True,
105
118
  'fetchLeverage': False,
119
+ 'fetchLeverages': False,
106
120
  'fetchLeverageTiers': False,
121
+ 'fetchLiquidations': False,
122
+ 'fetchLongShortRatio': False,
123
+ 'fetchLongShortRatioHistory': False,
124
+ 'fetchMarginAdjustmentHistory': False,
107
125
  'fetchMarginMode': False,
126
+ 'fetchMarginModes': False,
127
+ 'fetchMarketLeverageTiers': False,
108
128
  'fetchMarkets': True,
109
129
  'fetchMarkOHLCV': False,
130
+ 'fetchMarkPrices': False,
110
131
  'fetchMyBuys': True,
132
+ 'fetchMyLiquidations': False,
111
133
  'fetchMySells': True,
134
+ 'fetchMySettlementHistory': False,
112
135
  'fetchMyTrades': True,
113
136
  'fetchOHLCV': True,
137
+ 'fetchOpenInterest': False,
114
138
  'fetchOpenInterestHistory': False,
139
+ 'fetchOpenInterests': False,
115
140
  'fetchOpenOrders': True,
141
+ 'fetchOption': False,
142
+ 'fetchOptionChain': False,
116
143
  'fetchOrder': True,
117
144
  'fetchOrderBook': True,
118
145
  'fetchOrders': True,
119
146
  'fetchPosition': True,
147
+ 'fetchPositionHistory': False,
120
148
  'fetchPositionMode': False,
121
149
  'fetchPositions': True,
150
+ 'fetchPositionsForSymbol': False,
151
+ 'fetchPositionsHistory': False,
122
152
  'fetchPositionsRisk': False,
123
153
  'fetchPremiumIndexOHLCV': False,
154
+ 'fetchSettlementHistory': False,
124
155
  'fetchTicker': True,
125
156
  'fetchTickers': True,
126
157
  'fetchTime': True,
127
158
  'fetchTrades': True,
128
159
  'fetchTradingFee': 'emulated',
129
160
  'fetchTradingFees': True,
161
+ 'fetchVolatilityHistory': False,
130
162
  'fetchWithdrawals': True,
131
163
  'reduceMargin': False,
164
+ 'repayCrossMargin': False,
165
+ 'repayIsolatedMargin': False,
166
+ 'repayMargin': False,
132
167
  'setLeverage': False,
168
+ 'setMargin': False,
133
169
  'setMarginMode': False,
134
170
  'setPositionMode': False,
135
171
  'withdraw': True,
ccxt/coinbaseexchange.py CHANGED
@@ -1541,7 +1541,8 @@ class coinbaseexchange(Exchange, ImplicitAPI):
1541
1541
  if symbol is not None:
1542
1542
  market = self.market(symbol)
1543
1543
  request['product_id'] = market['symbol'] # the request will be more performant if you include it
1544
- return getattr(self, method)(self.extend(request, params))
1544
+ response = getattr(self, method)(self.extend(request, params))
1545
+ return self.safe_order({'info': response})
1545
1546
 
1546
1547
  def cancel_all_orders(self, symbol: Str = None, params={}):
1547
1548
  """
@@ -1559,7 +1560,8 @@ class coinbaseexchange(Exchange, ImplicitAPI):
1559
1560
  if symbol is not None:
1560
1561
  market = self.market(symbol)
1561
1562
  request['product_id'] = market['symbol'] # the request will be more performant if you include it
1562
- return self.privateDeleteOrders(self.extend(request, params))
1563
+ response = self.privateDeleteOrders(self.extend(request, params))
1564
+ return [self.safe_order({'info': response})]
1563
1565
 
1564
1566
  def fetch_payment_methods(self, params={}):
1565
1567
  return self.privateGetPaymentMethods(params)
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.coinbaseinternational import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
+ from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, MarginModification, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -875,7 +875,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
875
875
  },
876
876
  })
877
877
 
878
- def set_margin(self, symbol: str, amount: float, params={}) -> Any:
878
+ def set_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
879
879
  """
880
880
  Either adds or reduces margin in order to set the margin to a specific value
881
881
 
ccxt/coinmate.py CHANGED
@@ -35,32 +35,60 @@ class coinmate(Exchange, ImplicitAPI):
35
35
  'future': False,
36
36
  'option': False,
37
37
  'addMargin': False,
38
+ 'borrowCrossMargin': False,
39
+ 'borrowIsolatedMargin': False,
40
+ 'borrowMargin': False,
38
41
  'cancelOrder': True,
39
42
  'closeAllPositions': False,
40
43
  'closePosition': False,
41
44
  'createOrder': True,
45
+ 'createOrderWithTakeProfitAndStopLoss': False,
46
+ 'createOrderWithTakeProfitAndStopLossWs': False,
47
+ 'createPostOnlyOrder': False,
42
48
  'createReduceOnlyOrder': False,
43
49
  'fetchBalance': True,
50
+ 'fetchBorrowInterest': False,
51
+ 'fetchBorrowRate': False,
44
52
  'fetchBorrowRateHistories': False,
45
53
  'fetchBorrowRateHistory': False,
54
+ 'fetchBorrowRates': False,
55
+ 'fetchBorrowRatesPerSymbol': False,
46
56
  'fetchCrossBorrowRate': False,
47
57
  'fetchCrossBorrowRates': False,
48
58
  'fetchDepositsWithdrawals': True,
49
59
  'fetchFundingHistory': False,
60
+ 'fetchFundingInterval': False,
61
+ 'fetchFundingIntervals': False,
50
62
  'fetchFundingRate': False,
51
63
  'fetchFundingRateHistory': False,
52
64
  'fetchFundingRates': False,
65
+ 'fetchGreeks': False,
53
66
  'fetchIndexOHLCV': False,
54
67
  'fetchIsolatedBorrowRate': False,
55
68
  'fetchIsolatedBorrowRates': False,
69
+ 'fetchIsolatedPositions': False,
56
70
  'fetchLeverage': False,
71
+ 'fetchLeverages': False,
57
72
  'fetchLeverageTiers': False,
73
+ 'fetchLiquidations': False,
74
+ 'fetchLongShortRatio': False,
75
+ 'fetchLongShortRatioHistory': False,
76
+ 'fetchMarginAdjustmentHistory': False,
58
77
  'fetchMarginMode': False,
78
+ 'fetchMarginModes': False,
79
+ 'fetchMarketLeverageTiers': False,
59
80
  'fetchMarkets': True,
60
81
  'fetchMarkOHLCV': False,
82
+ 'fetchMarkPrices': False,
83
+ 'fetchMyLiquidations': False,
84
+ 'fetchMySettlementHistory': False,
61
85
  'fetchMyTrades': True,
86
+ 'fetchOpenInterest': False,
62
87
  'fetchOpenInterestHistory': False,
88
+ 'fetchOpenInterests': False,
63
89
  'fetchOpenOrders': True,
90
+ 'fetchOption': False,
91
+ 'fetchOptionChain': False,
64
92
  'fetchOrder': True,
65
93
  'fetchOrderBook': True,
66
94
  'fetchOrders': True,
@@ -72,14 +100,20 @@ class coinmate(Exchange, ImplicitAPI):
72
100
  'fetchPositionsHistory': False,
73
101
  'fetchPositionsRisk': False,
74
102
  'fetchPremiumIndexOHLCV': False,
103
+ 'fetchSettlementHistory': False,
75
104
  'fetchTicker': True,
76
105
  'fetchTickers': True,
77
106
  'fetchTrades': True,
78
107
  'fetchTradingFee': True,
79
108
  'fetchTradingFees': False,
80
109
  'fetchTransactions': 'emulated',
110
+ 'fetchVolatilityHistory': False,
81
111
  'reduceMargin': False,
112
+ 'repayCrossMargin': False,
113
+ 'repayIsolatedMargin': False,
114
+ 'repayMargin': False,
82
115
  'setLeverage': False,
116
+ 'setMargin': False,
83
117
  'setMarginMode': False,
84
118
  'setPositionMode': False,
85
119
  'transfer': False,