Skip to content

Commit 3fa9c40

Browse files
joe-plempira
authored andcommitted
fix mypy errors
1 parent 6d98339 commit 3fa9c40

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

examples/live_monitoring/live_monitoring.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
from typing import TYPE_CHECKING
2+
13
from algokit_subscriber.subscriber import AlgorandSubscriber
24
from algokit_subscriber.types.subscription import SubscribedTransaction
35
from algokit_utils.beta.algorand_client import AlgorandClient
46

7+
if TYPE_CHECKING:
8+
from algokit_subscriber.types.indexer import (
9+
AssetTransferTransactionResult,
10+
PaymentTransactionResult,
11+
)
12+
513
algorand = AlgorandClient.main_net()
614

715
# Every subscriber instance uses a water to track what block it processed last.
@@ -70,6 +78,7 @@ def print_transfer(transaction: SubscribedTransaction, filter_name: str) -> None
7078
* The transaction data
7179
* The filter name (from the 'filters' list) that the transaction matched
7280
"""
81+
details: PaymentTransactionResult | AssetTransferTransactionResult
7382
if filter_name == "USDC":
7483
details = transaction["asset-transfer-transaction"]
7584
elif filter_name == "ALGO":

examples/transaction_recording/transaction_recording.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
track_address = "PDS6KDTDQBBIL34FZSZWL3CEO454VKAMGWRPPP2D52W52WJW2OBDUQJRZM"
1111

1212
# The list of balance changes to write to the CSV file
13-
balance_changes = []
13+
balance_changes: list[tuple[int, str, int, int]] = []
1414

1515
# The directory of this file
1616
this_dir = Path(__file__).parent
@@ -89,12 +89,12 @@ def record_transaction(transaction: SubscribedTransaction, _: str) -> None:
8989

9090
for bc in transaction["balance_changes"]:
9191
balance_changes.append(
92-
[
92+
(
9393
transaction["confirmed-round"],
9494
transaction["id"],
9595
bc["asset_id"],
9696
bc["amount"],
97-
]
97+
)
9898
)
9999

100100

0 commit comments

Comments
 (0)