watcher¶
watcher.py
Module to monitor Algorand account states.
- watcher.watcher.check_account_states(run_once=False)[source]¶
Background task to monitor changes in account states.
- Parameters:
run_once (bool) – If True, the function runs only one iteration (used for testing).
- watcher.watcher.get_account_info(address)[source]¶
Fetch account information from the Algorand node.
- Parameters:
address (str) – The Algorand address to fetch information for.
- Returns:
The account information or an error message.
- Return type:
dict
- watcher.watcher.list_accounts()[source]¶
API endpoint to list watched accounts and their current state.
- Returns:
JSON response with the list of accounts and their information.
- Return type:
Response
- watcher.watcher.monitor_changes(address, previous_state, current_state)[source]¶
Monitor and log changes in the account state.
- Parameters:
address (str) – The Algorand address being monitored.
previous_state (dict) – The previous state of the account.
current_state (dict) – The current state of the account.