degenbot.types.rpc_types¶
TypedDict definitions for Ethereum RPC response data returned by the Rust extension provider.
Field types correspond to the Rust converters in rust/src/py_converters.rs. All hash/data fields
use bytes, all addresses are EIP-55 checksummed strings, and all numeric values are Python
ints.
Key naming: Block/transaction dicts use snake_case (produced by the typed Rust converters). Log
dicts use camelCase (matching the web3.py convention, as produced by log_to_py_dict).
The web3.types imports (BlockIdentifier, BlockData, FilterParams,
LogReceipt, RPCEndpoint, RPCResponse, TxParams) are reproduced here natively
so the codebase carries zero web3 type imports (no web3.types.* anywhere). The shapes are
deliberately loose (total=False TypedDicts with the fields actually
produced/consumed) so they survive the full web3py retirement epic (Pass C) without
type-check churn.
Module Contents¶
- degenbot.types.rpc_types.BlockIdentifier¶
- class degenbot.types.rpc_types.BlockTag¶
Bases:
enum.StrEnumThe canonical block-position tags (the
eth_getBlockBy*ladder).Public provider APIs keep accepting the wire strings;
parse()is the ONE string → member conversion and provider internals dispatch on members.Member values are the wire spellings —
StrEnumkeeps them comparable with the persisted/over-the-wire strings at the read boundary only.- EARLIEST = 'earliest'¶
- LATEST = 'latest'¶
- PENDING = 'pending'¶
- classmethod parse(raw: str) BlockTag¶
Parse one canonical tag string.
- Parameters:
raw – The wire spelling (
"latest","earliest","pending").- Returns:
The matching member.
- Raises:
ValueError – On any other string — the provider ladder’s loud unsupported-identifier contract.
- degenbot.types.rpc_types.TxParams¶
- degenbot.types.rpc_types.TransactionData¶
- class degenbot.types.rpc_types.BlockData¶
Bases:
TypedDictFull block data returned by
get_block().All fields are optional at the type level because the set of present fields varies by network and hardfork. In practice,
hash,parent_hash,sha3_uncles,miner,state_root,transactions_root,receipts_root,logs_bloom,difficulty,number,gas_limit,gas_used,timestamp,extra_data,mix_hash, andnonceare always present for post-merge blocks.
- degenbot.types.rpc_types.TransactionReceiptData¶
- class degenbot.types.rpc_types.LogData¶
Bases:
TypedDictLoose log entry data —
eth_getLogs/ subscription stream entries.Some fields may be
Nonefor pending (un-mined) entries. Uses camelCase keys matching the web3.py convention.
- class degenbot.types.rpc_types.LogReceipt¶
Bases:
TypedDictConfirmed-log entry shape — was
web3.types.LogReceipt.Strict TypedDict (all fields required) for log entries consumed from confirmed blocks: consumers expect plain
int(notint | None), matching web3’s exact shape without the looseness the pending-awareLogDatacarries.- address: degenbot._ffi.ChecksummedAddress¶