ScanManager
- class ScanWatch.ScanManager.ScanManager(address: str, nt_type: ScanWatch.utils.enums.NETWORK, api_token: str, net: str = 'main')[source]
This class is the interface between the user, the API and the Database
- __init__(address: str, nt_type: ScanWatch.utils.enums.NETWORK, api_token: str, net: str = 'main')[source]
Initiate the manager
- Parameters
address (str) – address to monitor
nt_type (NETWORK) – type of the network
api_token (str) – token to communicate with the API
net (str, default 'main') – name of the network, used to differentiate main and test nets
- get_erc20_holdings() Dict[source]
Return the amount of every erc20 the address holds at the last update time. WARNING: Some tokens trigger non-erc20 events, such as internal exchange fee. This will not be picked up by this function. As a consequence, the balance of such tokens might be wrong.
- Returns
a dictionary of token amount per token name
- Return type
Dict
- get_erc721_holdings() List[Dict][source]
Return the erc721 tokens that the address holds at the time of the last update
- Returns
List of erc721 tokens owned by the address
- Return type
List[Dict]
- get_transactions(tr_type: ScanWatch.utils.enums.TRANSACTION)[source]
Return the transactions of the provided type that are saved locally for the address of the manager
- Parameters
tr_type (TRANSACTION) – type of transaction to fetch
- Returns
list of transactions
- Return type
List[Dict]
- update_all_transactions()[source]
Update all the transactions for the address
- Returns
None
- Return type
None
- update_transactions(tr_type: ScanWatch.utils.enums.TRANSACTION)[source]
Update the transactions of a certain type in the database
- Parameters
tr_type (TRANSACTION) – type of transaction to update
- Returns
None
- Return type
None