From 80458f26b2d90163fd6e07f430e852e41bf9582b Mon Sep 17 00:00:00 2001 From: Chipe1 Date: Tue, 16 Jul 2024 16:22:48 +0530 Subject: [PATCH] Skip before_lt only when it's None --- pytonapi/async_tonapi/methods/accounts.py | 8 ++++---- pytonapi/async_tonapi/methods/inscriptions.py | 4 ++-- pytonapi/async_tonapi/methods/nft.py | 2 +- pytonapi/tonapi/methods/accounts.py | 8 ++++---- pytonapi/tonapi/methods/blockchain.py | 4 ++-- pytonapi/tonapi/methods/inscriptions.py | 4 ++-- pytonapi/tonapi/methods/nft.py | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pytonapi/async_tonapi/methods/accounts.py b/pytonapi/async_tonapi/methods/accounts.py index 86927fd..2b8be95 100644 --- a/pytonapi/async_tonapi/methods/accounts.py +++ b/pytonapi/async_tonapi/methods/accounts.py @@ -105,7 +105,7 @@ async def get_jettons_history( """ method = f"v2/accounts/{account_id}/jettons/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" @@ -145,7 +145,7 @@ async def get_jettons_history_by_jetton( """ method = f"v2/accounts/{account_id}/jettons/{jetton_id}/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" @@ -251,7 +251,7 @@ async def get_events( """ method = f"v2/accounts/{account_id}/events" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" @@ -325,7 +325,7 @@ async def get_nft_history( """ method = f"v2/accounts/{account_id}/nfts/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" diff --git a/pytonapi/async_tonapi/methods/inscriptions.py b/pytonapi/async_tonapi/methods/inscriptions.py index 75ab4e0..66097e9 100644 --- a/pytonapi/async_tonapi/methods/inscriptions.py +++ b/pytonapi/async_tonapi/methods/inscriptions.py @@ -44,7 +44,7 @@ async def get_inscription_history( """ method = f"v2/experimental/accounts/{account_id}/inscriptions/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt headers = {"Accept-Language": accept_language} response = await self._get(method=method, params=params, headers=headers) @@ -70,7 +70,7 @@ async def get_inscription_history_by_ticker( """ method = f"v2/experimental/accounts/{account_id}/inscriptions/{ticker}/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt headers = {"Accept-Language": accept_language} response = await self._get(method=method, params=params, headers=headers) diff --git a/pytonapi/async_tonapi/methods/nft.py b/pytonapi/async_tonapi/methods/nft.py index f8e3c8c..9bd36c6 100644 --- a/pytonapi/async_tonapi/methods/nft.py +++ b/pytonapi/async_tonapi/methods/nft.py @@ -124,7 +124,7 @@ async def get_nft_history( """ method = f"v2/nfts/{account_id}/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" diff --git a/pytonapi/tonapi/methods/accounts.py b/pytonapi/tonapi/methods/accounts.py index d420863..fc82c8d 100644 --- a/pytonapi/tonapi/methods/accounts.py +++ b/pytonapi/tonapi/methods/accounts.py @@ -105,7 +105,7 @@ def get_jettons_history( """ method = f"v2/accounts/{account_id}/jettons/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" @@ -145,7 +145,7 @@ def get_jettons_history_by_jetton( """ method = f"v2/accounts/{account_id}/jettons/{jetton_id}/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" @@ -251,7 +251,7 @@ def get_events( """ method = f"v2/accounts/{account_id}/events" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" @@ -325,7 +325,7 @@ def get_nft_history( """ method = f"v2/accounts/{account_id}/nfts/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt if subject_only: params["subject_only"] = "true" diff --git a/pytonapi/tonapi/methods/blockchain.py b/pytonapi/tonapi/methods/blockchain.py index 845c97f..65ad156 100644 --- a/pytonapi/tonapi/methods/blockchain.py +++ b/pytonapi/tonapi/methods/blockchain.py @@ -197,8 +197,8 @@ def get_account_transactions( """ method = f"v2/blockchain/accounts/{account_id}/transactions" params = {"limit": limit} - if before_lt: params["before_lt"] = before_lt # noqa E701 - if after_lt: params["after_lt"] = after_lt # noqa E701 + if before_lt is not None: params["before_lt"] = before_lt # noqa E701 + if after_lt is not None: params["after_lt"] = after_lt # noqa E701 response = self._get(method=method, params=params) return Transactions(**response) diff --git a/pytonapi/tonapi/methods/inscriptions.py b/pytonapi/tonapi/methods/inscriptions.py index eb4a2eb..9405f00 100644 --- a/pytonapi/tonapi/methods/inscriptions.py +++ b/pytonapi/tonapi/methods/inscriptions.py @@ -44,7 +44,7 @@ def get_inscription_history( """ method = f"v2/experimental/accounts/{account_id}/inscriptions/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt headers = {"Accept-Language": accept_language} response = self._get(method=method, params=params, headers=headers) @@ -70,7 +70,7 @@ def get_inscription_history_by_ticker( """ method = f"v2/experimental/accounts/{account_id}/inscriptions/{ticker}/history" params = {"limit": limit} - if before_lt: + if before_lt is not None: params["before_lt"] = before_lt headers = {"Accept-Language": accept_language} response = self._get(method=method, params=params, headers=headers) diff --git a/pytonapi/tonapi/methods/nft.py b/pytonapi/tonapi/methods/nft.py index 0f11ba9..2da3ed6 100644 --- a/pytonapi/tonapi/methods/nft.py +++ b/pytonapi/tonapi/methods/nft.py @@ -120,7 +120,7 @@ def get_nft_history( """ method = f"v2/nfts/{account_id}/history" params = {"limit": limit} - if before_lt: params["before_lt"] = before_lt # noqa:E701 + if before_lt is not None: params["before_lt"] = before_lt # noqa:E701 if subject_only: params["subject_only"] = "true" # noqa:E701 if start_date: params["start_date"] = start_date # noqa:E701 if end_date: params["end_date"] = end_date # noqa:E701