# Types

Frozen dataclasses for decoded SRC20 events and callback type aliases.

## Event Data Types

| Type                                                                                                   | Description                          |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------ |
| [DecryptedTransferLog](https://docs.seismic.systems/clients/python/src20/types/decrypted-transfer-log) | Transfer event with decrypted amount |
| [DecryptedApprovalLog](https://docs.seismic.systems/clients/python/src20/types/decrypted-approval-log) | Approval event with decrypted amount |

## Callback Type Aliases

```python
# Sync
TransferCallback = Callable[[DecryptedTransferLog], None]
ApprovalCallback = Callable[[DecryptedApprovalLog], None]
ErrorCallback = Callable[[Exception], None]

# Async
AsyncTransferCallback = Callable[[DecryptedTransferLog], Awaitable[None]]
AsyncApprovalCallback = Callable[[DecryptedApprovalLog], Awaitable[None]]
AsyncErrorCallback = Callable[[Exception], Awaitable[None]]
```

## Common Fields

Both event types share these fields:

| Field              | Type       | Description                                          |
| ------------------ | ---------- | ---------------------------------------------------- |
| `encrypt_key_hash` | `bytes`    | 32-byte `keccak256` of the viewing key (event topic) |
| `encrypted_amount` | `bytes`    | Raw AES-GCM ciphertext with auth tag                 |
| `decrypted_amount` | `int`      | Decrypted token amount (raw — consider decimals)     |
| `transaction_hash` | `HexBytes` | Transaction containing the event                     |
| `block_number`     | `int`      | Block containing the event                           |

## See Also

* [Event Watching](https://docs.seismic.systems/clients/python/src20/event-watching) — Watch and decrypt SRC20 events
* [Intelligence Providers](https://docs.seismic.systems/clients/python/src20/intelligence-providers) — Manage viewing keys
