Skip to content

Commit

Permalink
Merge pull request #21 from Chipe1/before_lt_0_ignored
Browse files Browse the repository at this point in the history
Skip before_lt only when it's None
  • Loading branch information
nessshon authored Jul 17, 2024
2 parents 696144f + 80458f2 commit 4af1944
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 @@ -118,7 +118,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 @@ -158,7 +158,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 @@ -264,7 +264,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 @@ -338,7 +338,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 @@ -118,7 +118,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 @@ -158,7 +158,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 @@ -264,7 +264,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 @@ -338,7 +338,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 4af1944

Please sign in to comment.