quantplay 2.0.165__tar.gz → 2.0.166__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quantplay-2.0.165 → quantplay-2.0.166}/PKG-INFO +1 -1
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/broker_factory.py +2 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/kotak.py +19 -8
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/PKG-INFO +1 -1
- {quantplay-2.0.165 → quantplay-2.0.166}/setup.py +1 -1
- {quantplay-2.0.165 → quantplay-2.0.166}/README.md +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/pyproject.toml +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/aliceblue.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/angelone.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/auto_login/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/auto_login/aliceblue.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/breeze/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/breeze/breeze_utils.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/dhan.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/finvasia_utils/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/finvasia_utils/fa_noren.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/five_paisa.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/flattrade.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/ft_utils/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/ft_utils/flattrade_utils.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/ft_utils/ft_noren.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/generics/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/generics/broker.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/icici_direct.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/iifl_xts.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/jainam_xts.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/kite_utils.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/motilal.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/noren.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/shoonya.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/uplink/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/uplink/uplink_utils.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/upstox.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/Connect.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/Exception.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/InteractiveSocketClient.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/zerodha.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/exception/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/exception/exceptions.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/broker.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/broker_response.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/generics.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/instrument_data.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/order_event.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/py.typed +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/caching.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/constant.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/exchange.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/number_utils.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/pickle_utils.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/selenium_utils.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/wrapper/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/wrapper/aws/s3.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/SOURCES.txt +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/dependency_links.txt +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/requires.txt +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/top_level.txt +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/setup.cfg +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/tests/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/tests/conftest.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/tests/wrapper/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/tests/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.165 → quantplay-2.0.166}/tests/wrapper/aws/s3_test.py +0 -0
|
@@ -188,6 +188,7 @@ class BrokerFactory:
|
|
|
188
188
|
consumer_secret=broker_data["consumer_secret"],
|
|
189
189
|
mobilenumber=broker_data["mobilenumber"],
|
|
190
190
|
password=broker_data["password"],
|
|
191
|
+
otp=broker_data.get("otp"),
|
|
191
192
|
load_instrument=False,
|
|
192
193
|
)
|
|
193
194
|
|
|
@@ -386,6 +387,7 @@ class BrokerFactory:
|
|
|
386
387
|
elif broker == Broker.KOTAK:
|
|
387
388
|
broker_client = Kotak(
|
|
388
389
|
configuration=broker_data["configuration"],
|
|
390
|
+
otp=broker_data.get("otp"),
|
|
389
391
|
load_instrument=load_instrument,
|
|
390
392
|
)
|
|
391
393
|
elif broker == Broker.ZERODHA:
|
|
@@ -45,12 +45,13 @@ class Kotak(Broker):
|
|
|
45
45
|
consumer_secret: str | None = None,
|
|
46
46
|
mobilenumber: str | None = None,
|
|
47
47
|
password: str | None = None,
|
|
48
|
+
otp: str | None = None,
|
|
48
49
|
configuration: dict[str, str] | None = None,
|
|
49
50
|
load_instrument: bool = True,
|
|
50
51
|
) -> None:
|
|
51
52
|
super().__init__()
|
|
52
53
|
|
|
53
|
-
self.configuration: dict[str, str] = {
|
|
54
|
+
self.configuration: dict[str, str | None] = {
|
|
54
55
|
"fin_key": "X6Nk8cQhUgGmJ2vBdWw4sfzrz4L5En",
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -60,15 +61,18 @@ class Kotak(Broker):
|
|
|
60
61
|
"bearer_token": configuration["bearer_token"],
|
|
61
62
|
"view_token": configuration["view_token"],
|
|
62
63
|
"sid": configuration["sid"],
|
|
63
|
-
"edit_token": configuration
|
|
64
|
-
"edit_sid": configuration
|
|
65
|
-
"edit_rid": configuration
|
|
66
|
-
"serverId": configuration
|
|
64
|
+
"edit_token": configuration.get("edit_token"),
|
|
65
|
+
"edit_sid": configuration.get("edit_sid"),
|
|
66
|
+
"edit_rid": configuration.get("edit_rid"),
|
|
67
|
+
"serverId": configuration.get("serverId"),
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
elif consumer_key and consumer_secret and mobilenumber and password:
|
|
70
71
|
self.login(consumer_key, consumer_secret, mobilenumber, password)
|
|
71
72
|
|
|
73
|
+
if otp:
|
|
74
|
+
self.verify_2fa(otp)
|
|
75
|
+
|
|
72
76
|
if load_instrument:
|
|
73
77
|
self.load_instrument()
|
|
74
78
|
|
|
@@ -145,7 +149,14 @@ class Kotak(Broker):
|
|
|
145
149
|
|
|
146
150
|
_generate_otp = json.loads(generate_otp_resp.text)
|
|
147
151
|
|
|
148
|
-
def verify_2fa(self, otp:
|
|
152
|
+
def verify_2fa(self, otp: str) -> None:
|
|
153
|
+
if (
|
|
154
|
+
self.configuration["bearer_token"] is None
|
|
155
|
+
or self.configuration["sid"] is None
|
|
156
|
+
or self.configuration["view_token"] is None
|
|
157
|
+
):
|
|
158
|
+
raise InvalidArgumentException("Missing Params")
|
|
159
|
+
|
|
149
160
|
login_resp = requests.post(
|
|
150
161
|
url=f"{PROD_BASE_URL}login/1.0/login/v2/validate",
|
|
151
162
|
headers={
|
|
@@ -154,7 +165,7 @@ class Kotak(Broker):
|
|
|
154
165
|
"Auth": self.configuration["view_token"],
|
|
155
166
|
"Content-Type": "application/json",
|
|
156
167
|
},
|
|
157
|
-
data=json.dumps({"userId": self.kotakUserId, "otp":
|
|
168
|
+
data=json.dumps({"userId": self.kotakUserId, "otp": otp}),
|
|
158
169
|
)
|
|
159
170
|
|
|
160
171
|
edit_token_resp = json.loads(login_resp.text)
|
|
@@ -580,7 +591,7 @@ class Kotak(Broker):
|
|
|
580
591
|
url = f"{PROD_BASE_URL}{url}"
|
|
581
592
|
|
|
582
593
|
request_headers = {
|
|
583
|
-
"Authorization":
|
|
594
|
+
"Authorization": f'Bearer {self.configuration["bearer_token"]}',
|
|
584
595
|
"Sid": self.configuration["edit_sid"],
|
|
585
596
|
"Auth": self.configuration["edit_token"],
|
|
586
597
|
"neo-fin-key": self.configuration["fin_key"],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/InteractiveSocketClient.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|