Skip to content

Commit

Permalink
Skip before_lt only when it's None
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipe1 committed Jul 16, 2024
1 parent c045918 commit 80458f2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions pytonapi/async_tonapi/methods/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pytonapi/async_tonapi/methods/inscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pytonapi/async_tonapi/methods/nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions pytonapi/tonapi/methods/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pytonapi/tonapi/methods/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pytonapi/tonapi/methods/inscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pytonapi/tonapi/methods/nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80458f2

Please sign in to comment.