AsyncPublicContract
Async contract wrapper with transparent read-only access
Asynchronous contract wrapper for read-only transparent access to Seismic contracts.
Overview
AsyncPublicContract is the async version of PublicContract, providing non-blocking read-only access to contract state. It exposes only the .tread namespace for standard async eth_call operations. All methods return coroutines that must be awaited. Use this class in async applications when you only need to read public contract data.
Definition
class AsyncPublicContract:
def __init__(
self,
w3: AsyncWeb3,
address: ChecksumAddress,
abi: list[dict[str, Any]],
) -> None:
...Constructor Parameters
w3
AsyncWeb3
Yes
Asynchronous AsyncWeb3 instance connected to RPC endpoint
address
ChecksumAddress
Yes
Contract address (checksummed Ethereum address)
abi
list[dict[str, Any]]
Yes
Contract ABI (list of function entries)
Namespace
.tread - Transparent Read
Executes standard async eth_call with unencrypted calldata. This is the only namespace available on AsyncPublicContract.
Returns: Coroutine[Any] (ABI-decoded Python value)
Optional Parameters: None (pass positional arguments only)
Examples
Basic Read Operations
Concurrent Reads
Single and Multiple Returns
Array Results
Error Handling
Notes
All methods return coroutines: Must use
awaitwith every.treadcallRead-only: No write operations available
No encryption required: Does not use
EncryptionStateor private keysNo authentication: Standard unsigned async
eth_calloperationsGas not consumed:
eth_callis free (doesn't create transactions)
See Also
PublicContract - Synchronous version of this class
AsyncShieldedContract - Full async contract wrapper with write operations
create_async_public_client - Create async client without private key
Contract Instance Guide - Overview of contract interaction patterns
Last updated

