Conversation
Add a stateless, RPC-provider-agnostic device that speaks standard
Ethereum JSON-RPC (eth_blockNumber, eth_getLogs) to fetch and decode
contract event logs. Works with Alchemy, Moralis, Infura, QuikNode,
or any compliant endpoint.
Key design decisions:
- Stateless: every request is self-contained (RPC URL, contract,
event signature, mode). No session state or configure step.
- Uses relay@1.0 internally for all HTTP calls to RPC providers.
- Supports four block-range modes:
- latest-only: single latest block (default)
- incremental: resume from last-block with configurable offset
- rolling-window: sliding N-block window behind chain head
- range: explicit from-block/to-block
- Full ABI event decoding when event-signature is provided:
indexed params decoded from topics, non-indexed from data field.
Supports address, uint*, int* (with two's complement), bool types.
- Raw mode (raw=true) returns events as-is from RPC.
- Integer values always returned as binary strings to avoid
serialization overflow on large uint256 values.
Internal structure:
- parse_params/2: normalizes all request params once upfront
- rpc/4: centralized JSON-RPC call + response parsing wrapper
- calculate_block_range/4: pure block arithmetic per mode
- event_metadata/1: shared metadata extraction for all decode paths
Includes unit tests for block range calculation, JSON-RPC response
parsing, ABI value decoding, and full Transfer event decoding.
Registered as eth-events@1.0 in hb_opts.erl preloaded_devices.
…to feat/lido-oracle
… log queries Implements a general-purpose Ethereum client device with three keys: - rpc: raw JSON-RPC proxy (eth_blockNumber, etc.) - call: ABI-encoded eth_call with automatic encoding/decoding - get-data: event log fetching with incremental, range, and block modes Includes ABI encoding/decoding for common Solidity types (uint, address, string, bytes, bool, tuples), keccak256 topic hashing, multi-event signature support, and safe block resolution (head - 40 finality offset).
eth-client@1.0 DeviceA stateless, RPC-provider agnostic device for interacting with Ethereum from HyperBEAM. Every request is self-contained, the caller passes all parameters. Works with any standard Ethereum JSON-RPC endpoint The device exports three keys:
Examples:
Examples:
Examples:
Authentication
|
eth-events@1.0 device for event log retrievaleth-client@1.0 device
Adds a new device,
eth-events@1.0, to fetch Ethereum contract event logs.This device is RPC-provider agnostic and supports multiple event signatures, as well as different modes for fetching logs (latest-only, incremental, rolling-window, range).
Also, this change allows scheduling of base message in
~scheduler@1.0.