Add Lock post endpoint

(allows manual locking through API)

closes #10018
This commit is contained in:
Matthias
2024-03-30 14:29:58 +01:00
parent 9726c4ae21
commit 05f8bb357f
3 changed files with 28 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
from datetime import date, datetime
from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel, RootModel, SerializeAsAny
from pydantic import AwareDatetime, BaseModel, RootModel, SerializeAsAny
from freqtrade.constants import IntOrInf
from freqtrade.enums import MarginMode, OrderTypeValues, SignalDirection, TradingMode
@@ -378,6 +378,13 @@ class Locks(BaseModel):
locks: List[LockModel]
class LocksPayload(BaseModel):
pair: str
side: str = '*' # Default to both sides
until: AwareDatetime
reason: Optional[str] = None
class DeleteLockRequest(BaseModel):
pair: Optional[str] = None
lockid: Optional[int] = None