arrow-rightDecryptedTransferLog

Decoded SRC20 Transfer event with decrypted amount

Frozen dataclass representing a decoded SRC20 Transfer event with decrypted amount.

Overview

DecryptedTransferLog contains all data from an SRC20 Transfer event, including the decrypted amount. It is returned by event watcher callbacks when a Transfer event is detected and successfully decrypted.

SRC20 Transfer events have the signature:

event Transfer(
    address indexed from,
    address indexed to,
    bytes32 indexed encryptKeyHash,
    bytes encryptedAmount
)

Definition

@dataclass(frozen=True)
class DecryptedTransferLog:
    """Decoded SRC20 Transfer event with decrypted amount."""

    from_address: ChecksumAddress
    to_address: ChecksumAddress
    encrypt_key_hash: bytes
    encrypted_amount: bytes
    decrypted_amount: int
    transaction_hash: HexBytes
    block_number: int

Fields

Field
Type
Description

from_address

ChecksumAddress

Address sending the tokens (checksummed)

to_address

ChecksumAddress

Address receiving the tokens (checksummed)

encrypt_key_hash

bytes

32-byte keccak256 hash of the viewing key

encrypted_amount

bytes

Raw encrypted amount bytes (AES-256-GCM ciphertext)

decrypted_amount

int

Decrypted token amount as integer

transaction_hash

HexBytes

Transaction hash containing this event

block_number

int

Block number containing this event

Properties

  • Immutable - All fields are frozen after creation

  • Type-safe - Uses proper types (ChecksumAddress, HexBytes)

  • Complete - Contains both encrypted and decrypted data

Examples

Basic Callback Usage

Access All Fields

Filter by Address

Store to Database

Async Callback

Format Amount

Track Balance Changes

Wait for Transaction Confirmation

Immutability

Notes

  • All instances are immutable (frozen dataclass)

  • from_address and to_address are checksummed addresses

  • decrypted_amount is the raw token amount (consider decimals when displaying)

  • encrypted_amount includes the AES-GCM authentication tag

  • encrypt_key_hash matches the key hash in event topics

  • Created automatically by event watchers during decryption

See Also

Last updated