Utils

The utils module houses public utility functions and classes.

ABI

utils.get_abi_input_names(abi)

Return the input names for an ABI function or event.

utils.get_abi_output_names(abi)

Return the output names an ABI function or event.

Caching

class utils.SimpleCache

The main cache class being used internally by web3.py. In some cases, it may prove useful to set your own cache size and pass in your own instance of this class where supported.

Exception Handling

utils.handle_offchain_lookup(offchain_lookup_payload, transaction)

Handle OffchainLookup reverts on contract function calls manually. For an example, see CCIP Read support for offchain lookup within the examples section.

utils.async_handle_offchain_lookup(offchain_lookup_payload, transaction)

The async version of the handle_offchain_lookup() utility method described above.