Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle addition/removal of fields gracefully #46

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions paradex_py/api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def onboarding(self):
def auth(self):
headers = self.account.auth_headers()
res = self.post(api_url=self.api_url, path="auth", headers=headers)
data = AuthSchema().load(res)
data = AuthSchema().load(res, unknown="EXCLUDE", partial=True)
self.auth_timestamp = time.time()
self.account.set_jwt_token(data.jwt_token)
self.client.headers.update({"Authorization": f"Bearer {data.jwt_token}"})
Expand Down Expand Up @@ -255,7 +255,7 @@ def fetch_account_summary(self) -> AccountSummary:
Private endpoint requires authorization.
"""
res = self._get_authorized(path="account")
return AccountSummarySchema().load(res)
return AccountSummarySchema().load(res, unknown="EXCLUDE", partial=True)

def fetch_account_profile(self) -> Dict:
"""Fetch profile for this account.
Expand Down Expand Up @@ -378,7 +378,7 @@ def fetch_system_config(self) -> SystemConfig:
url=f"{self.api_url}/system/config",
http_method=HttpMethod.GET,
)
config = SystemConfigSchema().load(res)
config = SystemConfigSchema().load(res, unknown="EXCLUDE", partial=True)
self.logger.info(f"{self.classname}: SystemConfig:{config}")
return config

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "paradex_py"
version = "0.4.1"
version = "0.4.2"
description = "Paradex Python SDK"
authors = ["Paradex <finfo@paradex.trade>"]
repository = "https://github.com/tradeparadex/paradex-py"
Expand Down
Loading