A system to create an Ethereum log filter and have parsed events passed back to registered processes.
Summary
Functions
Returns a specification to start this module under a supervisor.
Registers the calling process as a listener on filter. The filter will
send {:event, {name, params}, log} for matched, decoded events and
{:log, log} for every raw log it receives.
Starts a Cartouche.Filter GenServer that polls Ethereum logs matching the given filter and forwards parsed events to registered listeners.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec listen(GenServer.server()) :: :ok
Registers the calling process as a listener on filter. The filter will
send {:event, {name, params}, log} for matched, decoded events and
{:log, log} for every raw log it receives.
@spec start_link(Keyword.t()) :: GenServer.on_start()
Starts a Cartouche.Filter GenServer that polls Ethereum logs matching the given filter and forwards parsed events to registered listeners.
Options
:name— registered name for the GenServer (defaults to__MODULE__):address— contract address to filter on (omit to match any):topics— list of topic filters:events— list ofABI.FunctionSelector.t()or signature strings; events are decoded and dispatched as{:event, {name, params}, log}:rpc_opts— keyword list forwarded toCartouche.RPCcalls:extra_data— opaque value attached to every log/event message:check_delay— milliseconds between filter polls (default 3000)