(20260623) Migrate to new server.

This commit is contained in:
2026-06-23 17:06:44 +05:30
parent 7a73bee6d3
commit 122be77d19
3 changed files with 56 additions and 3 deletions
+50 -1
View File
@@ -86,6 +86,36 @@ class PaperTradingAuth(BaseModel):
frozen = True
)
perTrade: int | float = Field(
description = "??",
default = 0,
frozen = True
)
perLot: int | float = Field(
description = "??",
default = 0,
frozen = True
)
perCrore: int | float = Field(
description = "??",
default = 0,
frozen = True
)
perCroreEq: int | float = Field(
description = "??",
default = 0,
frozen = True
)
perCroreFut: int | float = Field(
description = "??",
default = 0,
frozen = True
)
# ┏┓ ┏•
# ┃ ┏┓┏┓╋┓┏┓
# ┗┛┗┛┛┗┛┗┗┫
@@ -94,6 +124,17 @@ class PaperTradingAuth(BaseModel):
class Config:
extra = "forbid"
# ┏┓ ┏┓
# ┃ ┓┏┏╋┏┓┏┳┓ ┣ ┓┏┏┓┏┏
# ┗┛┗┻┛┗┗┛┛┗┗ ┻ ┗┻┛┗┗┛
@field_validator("perTrade", "perLot", "perCrore", "perCroreEq", "perCroreFut", mode = "before")
@classmethod
def ensure_number(cls, value):
if value is None: value = 0
if isinstance(value, str): value = float(value)
return value
# ---------------------------------------------------------------------------------------------------------------------
@@ -222,4 +263,12 @@ class TradingOAuthCallbackResponse(BaseModel):
if __name__ == "__main__":
pass
my_obj = PaperTradingAuth(
username = "Yatmesh",
password = "yatmesh123",
perTrade = 10.25,
perCrore = "100.12345",
perCroreEq = "0.12345",
perLot = None
)
print(my_obj)