chore: Improve type safety
This commit is contained in:
@@ -1027,7 +1027,6 @@ class Exchange:
|
|||||||
"status": "open",
|
"status": "open",
|
||||||
"fee": None,
|
"fee": None,
|
||||||
"info": {},
|
"info": {},
|
||||||
"leverage": leverage,
|
|
||||||
}
|
}
|
||||||
if stop_loss:
|
if stop_loss:
|
||||||
dry_order["info"] = {"stopPrice": dry_order["price"]}
|
dry_order["info"] = {"stopPrice": dry_order["price"]}
|
||||||
@@ -1552,7 +1551,9 @@ class Exchange:
|
|||||||
return order.get("status") in NON_OPEN_EXCHANGE_STATES and order.get("filled") == 0.0
|
return order.get("status") in NON_OPEN_EXCHANGE_STATES and order.get("filled") == 0.0
|
||||||
|
|
||||||
@retrier
|
@retrier
|
||||||
def cancel_order(self, order_id: str, pair: str, params: Optional[dict] = None) -> dict:
|
def cancel_order(
|
||||||
|
self, order_id: str, pair: str, params: Optional[dict] = None
|
||||||
|
) -> dict[str, Any]:
|
||||||
if self._config["dry_run"]:
|
if self._config["dry_run"]:
|
||||||
try:
|
try:
|
||||||
order = self.fetch_dry_run_order(order_id)
|
order = self.fetch_dry_run_order(order_id)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Optional, TypedDict
|
from typing import Any, Literal, Optional, TypedDict
|
||||||
|
|
||||||
from freqtrade.enums import CandleType
|
from freqtrade.enums import CandleType
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ class FtHas(TypedDict, total=False):
|
|||||||
funding_fee_timeframe: str
|
funding_fee_timeframe: str
|
||||||
floor_leverage: bool
|
floor_leverage: bool
|
||||||
needs_trading_fees: bool
|
needs_trading_fees: bool
|
||||||
order_props_in_contracts: list[str]
|
order_props_in_contracts: list[Literal["amount", "cost", "filled", "remaining"]]
|
||||||
|
|
||||||
# Websocket control
|
# Websocket control
|
||||||
ws_enabled: bool
|
ws_enabled: bool
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any, Optional
|
from typing import Optional
|
||||||
|
|
||||||
from freqtrade.constants import BuySell
|
from freqtrade.constants import BuySell
|
||||||
from freqtrade.enums import MarginMode, PriceType, TradingMode
|
from freqtrade.enums import MarginMode, PriceType, TradingMode
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Any, Optional
|
from typing import Optional
|
||||||
|
|
||||||
import ccxt
|
import ccxt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user