erc7730.convert.ledger.eip712.convert_erc7730_to_eip712 module

final class erc7730.convert.ledger.eip712.convert_erc7730_to_eip712.ERC7730toEIP712Converter[source]View on GitHub

Bases: ERC7730Converter[ResolvedERC7730Descriptor, InputEIP712DAppDescriptor]

Converts ERC-7730 descriptor to Ledger legacy EIP-712 descriptor.

Generates 1 output InputEIP712DAppDescriptor per chain id, as EIP-712 descriptors are chain-specific.

convert(descriptor: ResolvedERC7730Descriptor, out: OutputAdder) dict[str, InputEIP712DAppDescriptor] | 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

classmethod convert_field(field: Annotated[Annotated[ResolvedFieldDescription, Tag(tag=field_description)] | Annotated[ResolvedNestedFields, Tag(tag=nested_fields)], Discriminator(discriminator=field_discriminator, custom_error_type=None, custom_error_message=None, custom_error_context=None)], prefix: DataPath | None, out: OutputAdder) list[InputEIP712MapperField] | None[source]View on GitHub
classmethod convert_field_description(field: ResolvedFieldDescription, prefix: DataPath | None, out: OutputAdder) InputEIP712MapperField | None[source]View on GitHub