erc7730.model.input.v2.metadata module

Object model for ERC-7730 v2 descriptors metadata section.

Specification: https://github.com/LedgerHQ/clear-signing-erc7730-registry/tree/master/specs JSON schema: https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/specs/erc7730-v2.schema.json

pydantic model erc7730.model.input.v2.metadata.InputMapDefinition[source]View on GitHub

Bases: Model

A map definition for context-dependent constants.

Maps are used to provide context-dependent values based on a key resolution.

Fields:
field keyType: str | None = None (alias '$keyType')

The type of the key used for map resolution.

field values: dict[str, Any] [Required]

The mapping of keys to values that will be used for dynamic resolution.

Constraints:
  • min_length = 1

pydantic model erc7730.model.input.v2.metadata.InputMetadata[source]View on GitHub

Bases: Model

Metadata Section (v2).

The metadata section contains information about constant values relevant in the scope of the current contract / message (as matched by the context section)

Fields:
field constants: dict[~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Id', description='An internal identifier that can be used either for clarity specifying what the element is or as a reference in device specific sections.', examples=['some_identifier'], metadata=[MinLen(min_length=1)]), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)], str | int | bool | float | None] | None = None

A set of values that can be used in format parameters. Can be referenced with a path expression like $.metadata.constants.CONSTANT_NAME

field contractName: str | None = None

The name of the contract targeted by the transaction or message.

field enums: dict[~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Id', description='An internal identifier that can be used either for clarity specifying what the element is or as a reference in device specific sections.', examples=['some_identifier'], metadata=[MinLen(min_length=1)]), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)], ~pydantic_string_url.HttpUrl | ~typing.Annotated[dict[str, str], FieldInfo(annotation=NoneType, required=True, title='Enum Definition', description='A mapping of enum values to human readable strings.', examples=[{'1': 'stable', '2': 'variable'}], metadata=[MinLen(min_length=1), MaxLen(max_length=32)])]] | None = None

A set of enums that are used to format fields replacing values with human readable strings.

Constraints:
  • max_length = 32

field info: InputOwnerInfo | None = None

The owner info section contains detailed information about the owner or target of the contract / message to be clear signed.

field maps: dict[~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Id', description='An internal identifier that can be used either for clarity specifying what the element is or as a reference in device specific sections.', examples=['some_identifier'], metadata=[MinLen(min_length=1)]), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)], ~erc7730.model.input.v2.metadata.InputMapDefinition] | None = None

A set of maps that are used to manage context dependent constants. Maps can be used in place of constants, and the corresponding constant is based on the map key resolved value.

field owner: str | None = None

The display name of the owner or target of the contract / message to be clear signed.

field token: TokenInfo | None = None

A description of an ERC20 token exported by this format, that should be trusted. Not mandatory if the corresponding metadata can be fetched from the contract itself.

pydantic model erc7730.model.input.v2.metadata.InputOwnerInfo[source]View on GitHub

Bases: Model

Main contract’s owner detailed information (v2).

The owner info section contains detailed information about the owner or target of the contract / message to be clear signed.

Note: legalName and lastUpdate are v1 backward compatibility extensions not present in the v2 JSON schema. The v2 schema only defines deploymentDate and url for info. These fields are retained for smooth migration.

Fields:
field deploymentDate: datetime | None = None

The date of deployment of the contract / message.

field lastUpdate: datetime | None = None

[v1 compat] The date of the last update of the contract / message. Not present in v2 schema, retained for backward compatibility. Use deploymentDate instead.

field legalName: str | None = None

[v1 compat] The full legal name of the owner if different from the owner field. Not present in v2 schema, retained for backward compatibility.

Constraints:
  • min_length = 1

field url: HttpUrl [Required]

URL with more info on the entity the user interacts with.