(20241230) Accepting ICICI Breeze's auth. now.

This commit is contained in:
2024-12-30 14:16:46 +05:30
parent 3e6d927a99
commit 95b6d08b4a
9 changed files with 359 additions and 138 deletions
+28 -3
View File
@@ -129,6 +129,30 @@ class ZerodhaKiteAuth(BaseModel):
# ---------------------------------------------------------------------------------------------------------------------
class ICICIBreezeAuth(BaseModel):
apiKey: str = Field(
description = "??",
frozen = True
)
apiSecret: str = Field(
description = "??",
frozen = True
)
# ┏┓ ┏•
# ┃ ┏┓┏┓╋┓┏┓
# ┗┛┗┛┛┗┛┗┗┫
# ┛
class Config:
extra = "forbid"
# ---------------------------------------------------------------------------------------------------------------------
class TradingAuthRequestHeaders(BaseModel):
sessionToken: str = Field(
@@ -155,8 +179,8 @@ class TradingAuthRequestHeaders(BaseModel):
class TradingAuthRequestData(BaseModel):
client: Literal["zerodhaKite", "paperTrading"] = Field(alias = "client")
auth: Union[ZerodhaKiteAuth, PaperTradingAuth]
client: Literal["zerodhaKite", "iciciBreeze", "paperTrading"] = Field(alias = "client")
auth: Union[ZerodhaKiteAuth, ICICIBreezeAuth, PaperTradingAuth]
# ┏┓ ┏•
# ┃ ┏┓┏┓╋┓┏┓
@@ -175,7 +199,8 @@ class TradingAuthRequestData(BaseModel):
client = values.client
auth = values.auth
harmony_map = {
"zerodhaKite": ZerodhaKiteAuth,
"zerodhaKite": (ZerodhaKiteAuth, ICICIBreezeAuth),
"iciciBreeze": (ICICIBreezeAuth, ZerodhaKiteAuth),
"paperTrading": PaperTradingAuth
}
if not isinstance(auth, harmony_map[client]):
+6 -6
View File
@@ -105,12 +105,12 @@ class CoreAuthTokenModel(BaseModel):
)
client: Literal[
"gmail", "outlook", # ...................... Mail Clients
"telegram", "whatsapp", # .................. Chat Clients
"nimbusSmsIndia", "savvyBulkSmsKenya", # ... SMS Clients
"razorpay", "safaricomMPesaExpress", # ..... Payment Gateways
"zerodhaKite", "paperTrading", # ........... Stock Brokers
"theCaOfficeAi" # .......................... Software
"gmail", "outlook", # ............................. Mail Clients
"telegram", "whatsapp", # ......................... Chat Clients
"nimbusSmsIndia", "savvyBulkSmsKenya", # .......... SMS Clients
"razorpay", "safaricomMPesaExpress", # ............ Payment Gateways
"zerodhaKite", "iciciBreeze", "paperTrading", # ... Stock Brokers
"theCaOfficeAi" # ................................. Software
] = Field(
description = "the third-part client that was used",
frozen = True