BatchCallState

Documentation for eth_defi.event_reader.multicall_batcher.BatchCallState Python class.

class BatchCallState

Bases: abc.ABC

Allow mutlicall calls to maintain state over the multiple invocations.

  • Mostly useful for historical mutlticall read and frequency management

Methods summary

__init__()

load(data)

Persist state across multiple runs

requires_result_feedback()

Whether subsequent scheduling needs the completed observation.

save()

Persist state across multiple runs.

should_invoke(call, block_identifier, timestamp)

Check the condition if this multicall is good to go.

requires_result_feedback()

Whether subsequent scheduling needs the completed observation.

Consumers must process a complete yielded block before requesting the next result. Legacy states keep their existing buffered behaviour.

Returns

True when the scheduler must drain its current block buffer.

Return type

bool

abstract should_invoke(call, block_identifier, timestamp)

Check the condition if this multicall is good to go.

Parameters
Return type

bool

abstract save()

Persist state across multiple runs.

Returns

Pickleable Python object

Return type

dict

abstract load(data)

Persist state across multiple runs

Parameters

data (dict) –