erc7730.convert package

Submodules

Module contents

class erc7730.convert.ERC7730Converter[source]View on GitHub

Bases: ABC, Generic[InputType, OutputType]

Converter from/to ERC-7730 descriptor.

A converter may fail partially, in which case it should emit errors with ERROR level, or totally, in which case it should emit errors with FATAL level.

abstract convert(descriptor: InputType, out: OutputAdder) OutputType | dict[str, OutputType] | None[source]View on GitHub

Convert a descriptor from/to ERC-7730.

Conversion may fail partially, in which case it should emit errors with WARNING level, or totally, in which case it should emit errors with ERROR level.

Conversion can return a single descriptor, or multiple ones, in the form of a dictionary with unique identifiers.

Parameters:
  • descriptor – input descriptor to convert

  • out – output sink

Returns:

converted descriptor, or None if conversion failed