feat: has_optional should check for replacement methods
This commit is contained in:
@@ -78,31 +78,31 @@ EXCHANGE_HAS_REQUIRED: dict[str, list[str]] = {
|
|||||||
"fetchOHLCV": [],
|
"fetchOHLCV": [],
|
||||||
}
|
}
|
||||||
|
|
||||||
EXCHANGE_HAS_OPTIONAL = [
|
EXCHANGE_HAS_OPTIONAL: dict[str, list[str]] = {
|
||||||
# Private
|
# Private
|
||||||
"fetchMyTrades", # Trades for order - fee detection
|
"fetchMyTrades": [], # Trades for order - fee detection
|
||||||
"createLimitOrder",
|
"createLimitOrder": [],
|
||||||
"createMarketOrder", # Either OR for orders
|
"createMarketOrder": [], # Either OR for orders
|
||||||
# 'setLeverage', # Margin/Futures trading
|
# "setLeverage": [], # Margin/Futures trading
|
||||||
# 'setMarginMode', # Margin/Futures trading
|
# "setMarginMode": [], # Margin/Futures trading
|
||||||
# 'fetchFundingHistory', # Futures trading
|
# "fetchFundingHistory": [], # Futures trading
|
||||||
# Public
|
# Public
|
||||||
"fetchOrderBook",
|
"fetchOrderBook": [],
|
||||||
"fetchL2OrderBook",
|
"fetchL2OrderBook": [],
|
||||||
"fetchTicker", # OR for pricing
|
"fetchTicker": [], # OR for pricing
|
||||||
"fetchTickers", # For volumepairlist?
|
"fetchTickers": [], # For volumepairlist?
|
||||||
"fetchTrades", # Downloading trades data
|
"fetchTrades": [], # Downloading trades data
|
||||||
# 'fetchFundingRateHistory', # Futures trading
|
# "fetchFundingRateHistory": [], # Futures trading
|
||||||
# 'fetchPositions', # Futures trading
|
# "fetchPositions": [], # Futures trading
|
||||||
# 'fetchLeverageTiers', # Futures initialization
|
# "fetchLeverageTiers": [], # Futures initialization
|
||||||
# 'fetchMarketLeverageTiers', # Futures initialization
|
# "fetchMarketLeverageTiers": [], # Futures initialization
|
||||||
# 'fetchOpenOrders', 'fetchClosedOrders', # 'fetchOrders', # Refinding balance...
|
# "fetchOrders": ["fetchOpenOrders", "fetchClosedOrders"], # , # Refinding balance...
|
||||||
# "fetchPremiumIndexOHLCV", # Futures additional data
|
# "fetchPremiumIndexOHLCV": [], # Futures additional data
|
||||||
# "fetchMarkOHLCV", # Futures additional data
|
# "fetchMarkOHLCV": [], # Futures additional data
|
||||||
# "fetchIndexOHLCV", # Futures additional data
|
# "fetchIndexOHLCV": [], # Futures additional data
|
||||||
# ccxt.pro
|
# ccxt.pro
|
||||||
"watchOHLCV",
|
"watchOHLCV": [],
|
||||||
]
|
}
|
||||||
|
|
||||||
|
|
||||||
def calculate_backoff(retrycount, max_retries):
|
def calculate_backoff(retrycount, max_retries):
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ def validate_exchange(exchange: str) -> tuple[bool, str, ccxt.Exchange | None]:
|
|||||||
result = False
|
result = False
|
||||||
reason += f"missing: {', '.join(missing)}"
|
reason += f"missing: {', '.join(missing)}"
|
||||||
|
|
||||||
missing_opt = [k for k in EXCHANGE_HAS_OPTIONAL if not ex_mod.has.get(k)]
|
missing_opt = _exchange_has_helper(ex_mod, EXCHANGE_HAS_OPTIONAL)
|
||||||
|
|
||||||
if exchange.lower() in BAD_EXCHANGES:
|
if exchange.lower() in BAD_EXCHANGES:
|
||||||
result = False
|
result = False
|
||||||
|
|||||||
Reference in New Issue
Block a user