ccxt 4.4.86__py2.py3-none-any.whl → 4.4.88__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 (58) hide show
  1. ccxt/__init__.py +5 -1
  2. ccxt/abstract/modetrade.py +119 -0
  3. ccxt/abstract/okxus.py +349 -0
  4. ccxt/async_support/__init__.py +5 -1
  5. ccxt/async_support/base/exchange.py +8 -5
  6. ccxt/async_support/binance.py +1 -1
  7. ccxt/async_support/bitteam.py +31 -0
  8. ccxt/async_support/bybit.py +19 -57
  9. ccxt/async_support/coinmetro.py +3 -0
  10. ccxt/async_support/gate.py +91 -73
  11. ccxt/async_support/htx.py +10 -8
  12. ccxt/async_support/hyperliquid.py +32 -16
  13. ccxt/async_support/kraken.py +5 -8
  14. ccxt/async_support/modetrade.py +2727 -0
  15. ccxt/async_support/okx.py +90 -3
  16. ccxt/async_support/okxus.py +54 -0
  17. ccxt/async_support/paradex.py +4 -1
  18. ccxt/async_support/phemex.py +4 -6
  19. ccxt/async_support/poloniex.py +172 -159
  20. ccxt/async_support/probit.py +18 -47
  21. ccxt/async_support/timex.py +5 -10
  22. ccxt/async_support/vertex.py +3 -4
  23. ccxt/async_support/whitebit.py +41 -11
  24. ccxt/async_support/woo.py +101 -75
  25. ccxt/async_support/woofipro.py +25 -20
  26. ccxt/async_support/xt.py +31 -41
  27. ccxt/base/exchange.py +13 -9
  28. ccxt/binance.py +1 -1
  29. ccxt/bitteam.py +31 -0
  30. ccxt/bybit.py +19 -57
  31. ccxt/coinmetro.py +3 -0
  32. ccxt/gate.py +91 -73
  33. ccxt/htx.py +10 -8
  34. ccxt/hyperliquid.py +32 -16
  35. ccxt/kraken.py +5 -8
  36. ccxt/modetrade.py +2727 -0
  37. ccxt/okx.py +90 -3
  38. ccxt/okxus.py +54 -0
  39. ccxt/paradex.py +4 -1
  40. ccxt/phemex.py +4 -6
  41. ccxt/poloniex.py +172 -159
  42. ccxt/pro/__init__.py +69 -1
  43. ccxt/pro/modetrade.py +1271 -0
  44. ccxt/pro/okxus.py +38 -0
  45. ccxt/probit.py +18 -47
  46. ccxt/test/tests_async.py +17 -1
  47. ccxt/test/tests_sync.py +17 -1
  48. ccxt/timex.py +5 -10
  49. ccxt/vertex.py +3 -4
  50. ccxt/whitebit.py +41 -11
  51. ccxt/woo.py +100 -75
  52. ccxt/woofipro.py +24 -20
  53. ccxt/xt.py +31 -41
  54. {ccxt-4.4.86.dist-info → ccxt-4.4.88.dist-info}/METADATA +18 -6
  55. {ccxt-4.4.86.dist-info → ccxt-4.4.88.dist-info}/RECORD +58 -50
  56. {ccxt-4.4.86.dist-info → ccxt-4.4.88.dist-info}/LICENSE.txt +0 -0
  57. {ccxt-4.4.86.dist-info → ccxt-4.4.88.dist-info}/WHEEL +0 -0
  58. {ccxt-4.4.86.dist-info → ccxt-4.4.88.dist-info}/top_level.txt +0 -0
ccxt/async_support/xt.py CHANGED
@@ -912,48 +912,30 @@ class xt(Exchange, ImplicitAPI):
912
912
  entry = currenciesData[i]
913
913
  currencyId = self.safe_string(entry, 'currency')
914
914
  code = self.safe_currency_code(currencyId)
915
- minPrecision = self.parse_number(self.parse_precision(self.safe_string(entry, 'maxPrecision')))
916
915
  networkEntry = self.safe_value(chainsDataIndexed, currencyId, {})
917
916
  rawNetworks = self.safe_value(networkEntry, 'supportChains', [])
918
917
  networks = {}
919
- minWithdrawString = None
920
- minWithdrawFeeString = None
921
- active = False
922
- deposit = False
923
- withdraw = False
924
918
  for j in range(0, len(rawNetworks)):
925
919
  rawNetwork = rawNetworks[j]
926
920
  networkId = self.safe_string(rawNetwork, 'chain')
927
- network = self.network_id_to_code(networkId)
928
- depositEnabled = self.safe_value(rawNetwork, 'depositEnabled')
929
- deposit = depositEnabled if (depositEnabled) else deposit
930
- withdrawEnabled = self.safe_value(rawNetwork, 'withdrawEnabled')
931
- withdraw = withdrawEnabled if (withdrawEnabled) else withdraw
932
- networkActive = depositEnabled and withdrawEnabled
933
- active = networkActive if (networkActive) else active
934
- withdrawFeeString = self.safe_string(rawNetwork, 'withdrawFeeAmount')
935
- if withdrawFeeString is not None:
936
- minWithdrawFeeString = withdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(withdrawFeeString, minWithdrawFeeString)
937
- minNetworkWithdrawString = self.safe_string(rawNetwork, 'withdrawMinAmount')
938
- if minNetworkWithdrawString is not None:
939
- minWithdrawString = minNetworkWithdrawString if (minWithdrawString is None) else Precise.string_min(minNetworkWithdrawString, minWithdrawString)
940
- networks[network] = {
921
+ networkCode = self.network_id_to_code(networkId, code)
922
+ networks[networkCode] = {
941
923
  'info': rawNetwork,
942
924
  'id': networkId,
943
- 'network': network,
925
+ 'network': networkCode,
944
926
  'name': None,
945
- 'active': networkActive,
946
- 'fee': self.parse_number(withdrawFeeString),
947
- 'precision': minPrecision,
948
- 'deposit': depositEnabled,
949
- 'withdraw': withdrawEnabled,
927
+ 'active': None,
928
+ 'fee': self.safe_number(rawNetwork, 'withdrawFeeAmount'),
929
+ 'precision': None,
930
+ 'deposit': self.safe_bool(rawNetwork, 'depositEnabled'),
931
+ 'withdraw': self.safe_bool(rawNetwork, 'withdrawEnabled'),
950
932
  'limits': {
951
933
  'amount': {
952
934
  'min': None,
953
935
  'max': None,
954
936
  },
955
937
  'withdraw': {
956
- 'min': self.parse_number(minNetworkWithdrawString),
938
+ 'min': self.safe_number(rawNetwork, 'withdrawMinAmount'),
957
939
  'max': None,
958
940
  },
959
941
  'deposit': {
@@ -968,16 +950,16 @@ class xt(Exchange, ImplicitAPI):
968
950
  type = 'crypto'
969
951
  else:
970
952
  type = 'other'
971
- result[code] = {
953
+ result[code] = self.safe_currency_structure({
972
954
  'info': entry,
973
955
  'id': currencyId,
974
956
  'code': code,
975
957
  'name': self.safe_string(entry, 'fullName'),
976
- 'active': active,
977
- 'fee': self.parse_number(minWithdrawFeeString),
978
- 'precision': minPrecision,
979
- 'deposit': deposit,
980
- 'withdraw': withdraw,
958
+ 'active': None,
959
+ 'fee': None,
960
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(entry, 'maxPrecision'))),
961
+ 'deposit': self.safe_string(entry, 'depositStatus') == '1',
962
+ 'withdraw': self.safe_string(entry, 'withdrawStatus') == '1',
981
963
  'networks': networks,
982
964
  'type': type,
983
965
  'limits': {
@@ -986,7 +968,7 @@ class xt(Exchange, ImplicitAPI):
986
968
  'max': None,
987
969
  },
988
970
  'withdraw': {
989
- 'min': self.parse_number(minWithdrawString),
971
+ 'min': None,
990
972
  'max': None,
991
973
  },
992
974
  'deposit': {
@@ -994,7 +976,7 @@ class xt(Exchange, ImplicitAPI):
994
976
  'max': None,
995
977
  },
996
978
  },
997
- }
979
+ })
998
980
  return result
999
981
 
1000
982
  async def fetch_markets(self, params={}) -> List[Market]:
@@ -2850,17 +2832,21 @@ class xt(Exchange, ImplicitAPI):
2850
2832
  if symbol is not None:
2851
2833
  market = self.market(symbol)
2852
2834
  request['symbol'] = market['id']
2835
+ if limit is not None:
2836
+ request['size'] = limit
2837
+ if since is not None:
2838
+ request['startTime'] = since
2853
2839
  type = None
2854
2840
  subType = None
2855
2841
  response = None
2856
2842
  type, params = self.handle_market_type_and_params('fetchOrdersByStatus', market, params)
2857
2843
  subType, params = self.handle_sub_type_and_params('fetchOrdersByStatus', market, params)
2858
- trigger = self.safe_value(params, 'stop')
2844
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
2859
2845
  stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
2860
2846
  if status == 'open':
2861
2847
  if trigger or stopLossTakeProfit:
2862
2848
  request['state'] = 'NOT_TRIGGERED'
2863
- elif subType is not None:
2849
+ elif type == 'swap':
2864
2850
  request['state'] = 'NEW'
2865
2851
  elif status == 'closed':
2866
2852
  if trigger or stopLossTakeProfit:
@@ -2880,7 +2866,7 @@ class xt(Exchange, ImplicitAPI):
2880
2866
  if limit is not None:
2881
2867
  request['size'] = limit
2882
2868
  if trigger:
2883
- params = self.omit(params, 'stop')
2869
+ params = self.omit(params, ['stop', 'trigger'])
2884
2870
  if subType == 'inverse':
2885
2871
  response = await self.privateInverseGetFutureTradeV1EntrustPlanList(self.extend(request, params))
2886
2872
  else:
@@ -2905,6 +2891,7 @@ class xt(Exchange, ImplicitAPI):
2905
2891
  if since is not None:
2906
2892
  request['startTime'] = since
2907
2893
  if limit is not None:
2894
+ request = self.omit(request, 'size')
2908
2895
  request['limit'] = limit
2909
2896
  response = await self.privateSpotGetHistoryOrder(self.extend(request, params))
2910
2897
  else:
@@ -3087,9 +3074,12 @@ class xt(Exchange, ImplicitAPI):
3087
3074
  # }
3088
3075
  # }
3089
3076
  #
3090
- isSpotOpenOrders = ((status == 'open') and (subType is None))
3091
- data = self.safe_value(response, 'result', {})
3092
- orders = self.safe_value(response, 'result', []) if isSpotOpenOrders else self.safe_value(data, 'items', [])
3077
+ orders = []
3078
+ resultDict = self.safe_dict(response, 'result')
3079
+ if resultDict is not None:
3080
+ orders = self.safe_list(resultDict, 'items', [])
3081
+ else:
3082
+ orders = self.safe_list(response, 'result')
3093
3083
  return self.parse_orders(orders, market, since, limit)
3094
3084
 
3095
3085
  async def fetch_open_orders(self, symbol: str = None, since: Int = None, limit: Int = None, params={}):
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.86'
7
+ __version__ = '4.4.88'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -311,6 +311,7 @@ class Exchange(object):
311
311
  base_currencies = None
312
312
  quote_currencies = None
313
313
  currencies = None
314
+
314
315
  options = None # Python does not allow to define properties in run-time with setattr
315
316
  isSandboxModeEnabled = False
316
317
  accounts = None
@@ -1533,7 +1534,10 @@ class Exchange(object):
1533
1534
  currencies = None
1534
1535
  if self.has['fetchCurrencies'] is True:
1535
1536
  currencies = self.fetch_currencies()
1537
+ self.options['cachedCurrencies'] = currencies
1536
1538
  markets = self.fetch_markets(params)
1539
+ if 'cachedCurrencies' in self.options:
1540
+ del self.options['cachedCurrencies']
1537
1541
  return self.set_markets(markets, currencies)
1538
1542
 
1539
1543
  def fetch_markets(self, params={}):
@@ -4166,11 +4170,11 @@ class Exchange(object):
4166
4170
  raise NotSupported(self.id + ' - ' + networkCode + ' network did not return any result for ' + currencyCode)
4167
4171
  else:
4168
4172
  # if networkCode was provided by user, we should check it after response, referenced exchange doesn't support network-code during request
4169
- networkId = networkCode if isIndexedByUnifiedNetworkCode else self.network_code_to_id(networkCode, currencyCode)
4170
- if networkId in indexedNetworkEntries:
4171
- chosenNetworkId = networkId
4173
+ networkIdOrCode = networkCode if isIndexedByUnifiedNetworkCode else self.network_code_to_id(networkCode, currencyCode)
4174
+ if networkIdOrCode in indexedNetworkEntries:
4175
+ chosenNetworkId = networkIdOrCode
4172
4176
  else:
4173
- raise NotSupported(self.id + ' - ' + networkId + ' network was not found for ' + currencyCode + ', use one of ' + ', '.join(availableNetworkIds))
4177
+ raise NotSupported(self.id + ' - ' + networkIdOrCode + ' network was not found for ' + currencyCode + ', use one of ' + ', '.join(availableNetworkIds))
4174
4178
  else:
4175
4179
  if responseNetworksLength == 0:
4176
4180
  raise NotSupported(self.id + ' - no networks were returned for ' + currencyCode)
@@ -4458,15 +4462,15 @@ class Exchange(object):
4458
4462
  if self.enableRateLimit:
4459
4463
  cost = self.calculate_rate_limiter_cost(api, method, path, params, config)
4460
4464
  self.throttle(cost)
4465
+ retries = None
4466
+ retries, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailure', 0)
4467
+ retryDelay = None
4468
+ retryDelay, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailureDelay', 0)
4461
4469
  self.lastRestRequestTimestamp = self.milliseconds()
4462
4470
  request = self.sign(path, api, method, params, headers, body)
4463
4471
  self.last_request_headers = request['headers']
4464
4472
  self.last_request_body = request['body']
4465
4473
  self.last_request_url = request['url']
4466
- retries = None
4467
- retries, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailure', 0)
4468
- retryDelay = None
4469
- retryDelay, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailureDelay', 0)
4470
4474
  for i in range(0, retries + 1):
4471
4475
  try:
4472
4476
  return self.fetch(request['url'], request['method'], request['headers'], request['body'])
ccxt/binance.py CHANGED
@@ -5023,13 +5023,13 @@ class binance(Exchange, ImplicitAPI):
5023
5023
  postOnly = self.is_post_only(initialUppercaseType == 'MARKET', initialUppercaseType == 'LIMIT_MAKER', params)
5024
5024
  if postOnly:
5025
5025
  uppercaseType = 'LIMIT_MAKER'
5026
- request['type'] = uppercaseType
5027
5026
  triggerPrice = self.safe_number_2(params, 'stopPrice', 'triggerPrice')
5028
5027
  if triggerPrice is not None:
5029
5028
  if uppercaseType == 'MARKET':
5030
5029
  uppercaseType = 'STOP_LOSS'
5031
5030
  elif uppercaseType == 'LIMIT':
5032
5031
  uppercaseType = 'STOP_LOSS_LIMIT'
5032
+ request['type'] = uppercaseType
5033
5033
  validOrderTypes = self.safe_list(market['info'], 'orderTypes')
5034
5034
  if not self.in_array(uppercaseType, validOrderTypes):
5035
5035
  if initialUppercaseType != uppercaseType:
ccxt/bitteam.py CHANGED
@@ -38,12 +38,18 @@ class bitteam(Exchange, ImplicitAPI):
38
38
  'future': False,
39
39
  'option': False,
40
40
  'addMargin': False,
41
+ 'borrowCrossMargin': False,
42
+ 'borrowIsolatedMargin': False,
41
43
  'borrowMargin': False,
42
44
  'cancelAllOrders': True,
43
45
  'cancelOrder': True,
44
46
  'cancelOrders': False,
47
+ 'closeAllPositions': False,
48
+ 'closePosition': False,
45
49
  'createDepositAddress': False,
46
50
  'createOrder': True,
51
+ 'createOrderWithTakeProfitAndStopLoss': False,
52
+ 'createOrderWithTakeProfitAndStopLossWs': False,
47
53
  'createPostOnlyOrder': False,
48
54
  'createReduceOnlyOrder': False,
49
55
  'createStopLimitOrder': False,
@@ -55,8 +61,11 @@ class bitteam(Exchange, ImplicitAPI):
55
61
  'fetchBalance': True,
56
62
  'fetchBidsAsks': False,
57
63
  'fetchBorrowInterest': False,
64
+ 'fetchBorrowRate': False,
58
65
  'fetchBorrowRateHistories': False,
59
66
  'fetchBorrowRateHistory': False,
67
+ 'fetchBorrowRates': False,
68
+ 'fetchBorrowRatesPerSymbol': False,
60
69
  'fetchCanceledOrders': True,
61
70
  'fetchClosedOrder': False,
62
71
  'fetchClosedOrders': True,
@@ -72,24 +81,42 @@ class bitteam(Exchange, ImplicitAPI):
72
81
  'fetchDepositWithdrawFee': False,
73
82
  'fetchDepositWithdrawFees': False,
74
83
  'fetchFundingHistory': False,
84
+ 'fetchFundingInterval': False,
85
+ 'fetchFundingIntervals': False,
75
86
  'fetchFundingRate': False,
76
87
  'fetchFundingRateHistory': False,
77
88
  'fetchFundingRates': False,
89
+ 'fetchGreeks': False,
78
90
  'fetchIndexOHLCV': False,
79
91
  'fetchIsolatedBorrowRate': False,
80
92
  'fetchIsolatedBorrowRates': False,
93
+ 'fetchIsolatedPositions': False,
81
94
  'fetchL3OrderBook': False,
82
95
  'fetchLedger': False,
83
96
  'fetchLeverage': False,
97
+ 'fetchLeverages': False,
84
98
  'fetchLeverageTiers': False,
99
+ 'fetchLiquidations': False,
100
+ 'fetchLongShortRatio': False,
101
+ 'fetchLongShortRatioHistory': False,
102
+ 'fetchMarginAdjustmentHistory': False,
103
+ 'fetchMarginMode': False,
104
+ 'fetchMarginModes': False,
85
105
  'fetchMarketLeverageTiers': False,
86
106
  'fetchMarkets': True,
87
107
  'fetchMarkOHLCV': False,
108
+ 'fetchMarkPrices': False,
109
+ 'fetchMyLiquidations': False,
110
+ 'fetchMySettlementHistory': False,
88
111
  'fetchMyTrades': True,
89
112
  'fetchOHLCV': True,
113
+ 'fetchOpenInterest': False,
90
114
  'fetchOpenInterestHistory': False,
115
+ 'fetchOpenInterests': False,
91
116
  'fetchOpenOrder': False,
92
117
  'fetchOpenOrders': True,
118
+ 'fetchOption': False,
119
+ 'fetchOptionChain': False,
93
120
  'fetchOrder': True,
94
121
  'fetchOrderBook': True,
95
122
  'fetchOrderBooks': False,
@@ -103,6 +130,7 @@ class bitteam(Exchange, ImplicitAPI):
103
130
  'fetchPositionsHistory': False,
104
131
  'fetchPositionsRisk': False,
105
132
  'fetchPremiumIndexOHLCV': False,
133
+ 'fetchSettlementHistory': False,
106
134
  'fetchStatus': False,
107
135
  'fetchTicker': True,
108
136
  'fetchTickers': True,
@@ -115,10 +143,13 @@ class bitteam(Exchange, ImplicitAPI):
115
143
  'fetchTransactionFees': False,
116
144
  'fetchTransactions': True,
117
145
  'fetchTransfers': False,
146
+ 'fetchVolatilityHistory': False,
118
147
  'fetchWithdrawal': False,
119
148
  'fetchWithdrawals': False,
120
149
  'fetchWithdrawalWhitelist': False,
121
150
  'reduceMargin': False,
151
+ 'repayCrossMargin': False,
152
+ 'repayIsolatedMargin': False,
122
153
  'repayMargin': False,
123
154
  'setLeverage': False,
124
155
  'setMargin': False,
ccxt/bybit.py CHANGED
@@ -2301,15 +2301,9 @@ class bybit(Exchange, ImplicitAPI):
2301
2301
  # 'baseCoin': '', Base coin. For option only
2302
2302
  # 'expDate': '', Expiry date. e.g., 25DEC22. For option only
2303
2303
  }
2304
- if market['spot']:
2305
- request['category'] = 'spot'
2306
- else:
2307
- if market['option']:
2308
- request['category'] = 'option'
2309
- elif market['linear']:
2310
- request['category'] = 'linear'
2311
- elif market['inverse']:
2312
- request['category'] = 'inverse'
2304
+ category = None
2305
+ category, params = self.get_bybit_type('fetchTicker', market, params)
2306
+ request['category'] = category
2313
2307
  response = self.publicGetV5MarketTickers(self.extend(request, params))
2314
2308
  #
2315
2309
  # {
@@ -2401,24 +2395,14 @@ class bybit(Exchange, ImplicitAPI):
2401
2395
  # 'baseCoin': '', # Base coin. For option only
2402
2396
  # 'expDate': '', # Expiry date. e.g., 25DEC22. For option only
2403
2397
  }
2404
- type = None
2405
- type, params = self.handle_market_type_and_params('fetchTickers', market, params)
2406
- # Calls like `.fetchTickers(None, {subType:'inverse'})` should be supported for self exchange, so
2407
- # as "options.defaultSubType" is also set in exchange options, we should consider `params.subType`
2408
- # with higher priority and only default to spot, if `subType` is not set in params
2409
- passedSubType = self.safe_string(params, 'subType')
2410
- subType = None
2411
- subType, params = self.handle_sub_type_and_params('fetchTickers', market, params, 'linear')
2412
- # only if passedSubType is None, then use spot
2413
- if type == 'spot' and passedSubType is None:
2414
- request['category'] = 'spot'
2415
- elif type == 'option':
2398
+ category = None
2399
+ category, params = self.get_bybit_type('fetchTickers', market, params)
2400
+ request['category'] = category
2401
+ if category == 'option':
2416
2402
  request['category'] = 'option'
2417
2403
  if code is None:
2418
2404
  code = 'BTC'
2419
2405
  request['baseCoin'] = code
2420
- elif type == 'swap' or type == 'future' or subType is not None:
2421
- request['category'] = subType
2422
2406
  response = self.publicGetV5MarketTickers(self.extend(request, params))
2423
2407
  #
2424
2408
  # {
@@ -3890,14 +3874,9 @@ class bybit(Exchange, ImplicitAPI):
3890
3874
  request['orderLinkId'] = self.uuid16()
3891
3875
  if isLimit:
3892
3876
  request['price'] = priceString
3893
- if market['spot']:
3894
- request['category'] = 'spot'
3895
- elif market['option']:
3896
- request['category'] = 'option'
3897
- elif market['linear']:
3898
- request['category'] = 'linear'
3899
- elif market['inverse']:
3900
- request['category'] = 'inverse'
3877
+ category = None
3878
+ category, params = self.get_bybit_type('createOrderRequest', market, params)
3879
+ request['category'] = category
3901
3880
  cost = self.safe_string(params, 'cost')
3902
3881
  params = self.omit(params, 'cost')
3903
3882
  # if the cost is inferable, let's keep the old logic and ignore marketUnit, to minimize the impact of the changes
@@ -4090,14 +4069,9 @@ class bybit(Exchange, ImplicitAPI):
4090
4069
  # Valid for option only.
4091
4070
  # 'orderIv': '0', # Implied volatility; parameters are passed according to the real value; for example, for 10%, 0.1 is passed
4092
4071
  }
4093
- if market['spot']:
4094
- request['category'] = 'spot'
4095
- elif market['linear']:
4096
- request['category'] = 'linear'
4097
- elif market['inverse']:
4098
- request['category'] = 'inverse'
4099
- elif market['option']:
4100
- request['category'] = 'option'
4072
+ category = None
4073
+ category, params = self.get_bybit_type('editOrderRequest', market, params)
4074
+ request['category'] = category
4101
4075
  if amount is not None:
4102
4076
  request['qty'] = self.get_amount(symbol, amount)
4103
4077
  if price is not None:
@@ -4288,14 +4262,9 @@ class bybit(Exchange, ImplicitAPI):
4288
4262
  request['orderFilter'] = 'StopOrder' if isTrigger else 'Order'
4289
4263
  if id is not None: # The user can also use argument params["orderLinkId"]
4290
4264
  request['orderId'] = id
4291
- if market['spot']:
4292
- request['category'] = 'spot'
4293
- elif market['linear']:
4294
- request['category'] = 'linear'
4295
- elif market['inverse']:
4296
- request['category'] = 'inverse'
4297
- elif market['option']:
4298
- request['category'] = 'option'
4265
+ category = None
4266
+ category, params = self.get_bybit_type('cancelOrderRequest', market, params)
4267
+ request['category'] = category
4299
4268
  return self.extend(request, params)
4300
4269
 
4301
4270
  def cancel_order(self, id: str, symbol: Str = None, params={}) -> Order:
@@ -7188,14 +7157,7 @@ classic accounts only/ spot not supported* fetches information on an order made
7188
7157
  'symbol': market['id'],
7189
7158
  }
7190
7159
  category = None
7191
- if market['linear']:
7192
- category = 'linear'
7193
- elif market['inverse']:
7194
- category = 'inverse'
7195
- elif market['spot']:
7196
- category = 'spot'
7197
- else:
7198
- category = 'option'
7160
+ category, params = self.get_bybit_type('fetchTradingFee', market, params)
7199
7161
  request['category'] = category
7200
7162
  response = self.privateGetV5AccountFeeRate(self.extend(request, params))
7201
7163
  #
@@ -7434,9 +7396,9 @@ classic accounts only/ spot not supported* fetches information on an order made
7434
7396
  request['symbol'] = market['id']
7435
7397
  type = None
7436
7398
  type, params = self.get_bybit_type('fetchMySettlementHistory', market, params)
7437
- if type == 'spot' or type == 'inverse':
7399
+ if type == 'spot':
7438
7400
  raise NotSupported(self.id + ' fetchMySettlementHistory() is not supported for spot market')
7439
- request['category'] = 'linear'
7401
+ request['category'] = type
7440
7402
  if limit is not None:
7441
7403
  request['limit'] = limit
7442
7404
  response = self.privateGetV5AssetDeliveryRecord(self.extend(request, params))
ccxt/coinmetro.py CHANGED
@@ -394,6 +394,9 @@ class coinmetro(Exchange, ImplicitAPI):
394
394
  elif typeRaw == 'fiat':
395
395
  type = 'fiat'
396
396
  precisionDigits = self.safe_string_2(currency, 'digits', 'notabeneDecimals')
397
+ if code == 'RENDER':
398
+ # RENDER is an exception(with broken info)
399
+ precisionDigits = '4'
397
400
  result[code] = self.safe_currency_structure({
398
401
  'id': id,
399
402
  'code': code,