erc7730.model.resolved.v2.display module

Object model for ERC-7730 v2 resolved descriptors display 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.resolved.v2.display.ResolvedAddressNameParameters[source]View on GitHub

Bases: Model

Address Names Formatting Parameters (resolved).

Fields:
field senderAddress: list[~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Contract Address', description='An Ethereum contract address (normalized to lowercase).', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), ~pydantic.functional_validators.BeforeValidator(func=~erc7730.model.types.<lambda>, json_schema_input_type=PydanticUndefined), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)]] | ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Contract Address', description='An Ethereum contract address (normalized to lowercase).', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), ~pydantic.functional_validators.BeforeValidator(func=~erc7730.model.types.<lambda>, json_schema_input_type=PydanticUndefined), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | None = None

Either a string or an array of strings. If the address pointed to by addressName is equal to one of the addresses in senderAddress, the addressName is interpreted as the sender referenced by @.from

field sources: list[str] | None = None

An array of acceptable sources for names. If set, the wallet SHOULD restrict name lookup to relevant sources.

Constraints:
  • min_length = 1

field types: list[AddressNameType] | None = None

An array of expected types of the address. If set, the wallet SHOULD check that the address matches one of the types provided.

Constraints:
  • min_length = 1

pydantic model erc7730.model.resolved.v2.display.ResolvedCallDataParameters[source]View on GitHub

Bases: Model

Embedded Calldata Formatting Parameters (resolved).

Fields:
field amount: Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None = None

The resolved amount being transferred, if not contained in the calldata, either as path or constant value.

field callee: Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] [Required]

The resolved address of the contract being called by this embedded calldata, either as path or constant value.

Constraints:
  • discriminator = type

field selector: Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None = None

The resolved selector being called, if not contained in the calldata, either as path or constant value.

field spender: Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None = None

The resolved spender, if not contained in the calldata, either as path or constant value.

pydantic model erc7730.model.resolved.v2.display.ResolvedDateParameters[source]View on GitHub

Bases: Model

Date Formatting Parameters (resolved)

Fields:
field encoding: DateEncoding [Required]

The resolved encoding of the date.

pydantic model erc7730.model.resolved.v2.display.ResolvedDisplay[source]View on GitHub

Bases: Model

Display Formatting Info Section (v2, resolved).

Fields:
Validators:
  • _validate_definitions_resolved » all fields

field definitions: dict[str, ResolvedFieldDefinition] | None = None

A set of resolved definitions that can be used to share formatting information between multiple messages or functions. All references have been inlined.

Validated by:
  • _validate_definitions_resolved

field formats: dict[str, ResolvedFormat] [Required]

The resolved list includes formatting info for each field of a structure. This list is indexed by a key uniquely identifying the message type in the ABI. For smart contracts, it is the selector or function signature, and for EIP-712 messages it is the primaryType of the message.

Validated by:
  • _validate_definitions_resolved

pydantic model erc7730.model.resolved.v2.display.ResolvedEncryptionParameters[source]View on GitHub

Bases: Model

Encrypted Value Parameters (resolved).

Fields:
field fallbackLabel: str | None = None

Optional label to display when decryption is not possible. Defaults to “[Encrypted]”.

field plaintextType: str | None = None

Solidity type of the decrypted value (the handle does not encode this).

field scheme: str [Required]

The encryption scheme used to produce the handle.

pydantic model erc7730.model.resolved.v2.display.ResolvedEnumParameters[source]View on GitHub

Bases: Model

Enum Formatting Parameters (resolved).

Fields:
field ref: validate, json_schema_input_type=PydanticUndefined)] [Required] (alias '$ref')

The resolved internal path to the enum definition used to convert this value.

Constraints:
  • get_pydantic_core_schema = <function <lambda> at 0x7fb0a74502c0>

  • func = <function ErrorTypeLabel._validator.<locals>.validate at 0x7fb0a7450400>

  • json_schema_input_type = PydanticUndefined

pydantic model erc7730.model.resolved.v2.display.ResolvedFieldBase[source]View on GitHub

Bases: Model

A resolved field formatter, containing formatting information of a single field in a message.

Fields:
Validators:
  • _validate_one_of_path_or_value » all fields

field path: validate, json_schema_input_type=PydanticUndefined)] | None = None

A path to the field in the structured data. The path is a JSON path expression that can be used to extract the field value from the structured data. Exactly one of “path” or “value” must be set.

Validated by:
  • _validate_one_of_path_or_value

field value: str | int | bool | float | None = None

A resolved literal value on which the format should be applied instead of looking up a field in the structured data. Exactly one of “path” or “value” must be set.

Validated by:
  • _validate_one_of_path_or_value

pydantic model erc7730.model.resolved.v2.display.ResolvedFieldDefinition[source]View on GitHub

Bases: Model

A resolved field formatter, containing formatting information of a single field in a message.

Fields:
field format: FieldFormat | None = None

The format of the field, that will be used to format the field value in a human readable way.

field id: validate, json_schema_input_type=PydanticUndefined)] | None = None (alias '$id')

An internal identifier that can be used either for clarity specifying what the element is or as a reference in device specific sections.

field label: str [Required]

The resolved label of the field, displayed to the user in front of the formatted field value.

field params: Annotated[Annotated[ResolvedAddressNameParameters, Tag(tag=address_name)] | Annotated[ResolvedInteroperableAddressNameParameters, Tag(tag=interoperable_address_name)] | Annotated[ResolvedCallDataParameters, Tag(tag=call_data)] | Annotated[ResolvedTokenAmountParameters, Tag(tag=token_amount)] | Annotated[ResolvedTokenTickerParameters, Tag(tag=token_ticker)] | Annotated[ResolvedNftNameParameters, Tag(tag=nft_name)] | Annotated[ResolvedDateParameters, Tag(tag=date)] | Annotated[ResolvedUnitParameters, Tag(tag=unit)] | Annotated[ResolvedEnumParameters, Tag(tag=enum)], Discriminator(discriminator=field_parameters_discriminator, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None = None

Resolved format specific parameters that are used to format the field value in a human readable way.

pydantic model erc7730.model.resolved.v2.display.ResolvedFieldDescription[source]View on GitHub

Bases: ResolvedFieldBase, ResolvedFieldDefinition

A resolved field formatter, containing formatting information of a single field in a message.

Fields:
Validators:

field encryption: ResolvedEncryptionParameters | None = None

If present, the field value is encrypted. The format specifies how to display the decrypted value.

Validated by:
  • _validate_one_of_path_or_value

field separator: str | None = None

Optional separator for array values with {index} interpolation support.

Validated by:
  • _validate_one_of_path_or_value

field visible: Annotated[Annotated[str, Tag(tag=simple)] | Annotated[ResolvedVisibilityConditions, Tag(tag=conditions)], Discriminator(discriminator=visibility_rules_discriminator, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None = None

Specifies when a field should be displayed based on its value or context. Defaults to ‘always’ if not specified.

Validated by:
  • _validate_one_of_path_or_value

pydantic model erc7730.model.resolved.v2.display.ResolvedFieldGroup[source]View on GitHub

Bases: Model

A resolved group of field formats, allowing recursivity in the schema and control over grouping and iteration.

Used to group whole definitions for structures for instance. This allows nesting definitions of formats, but note that support for deep nesting will be device dependent.

Unlike ResolvedFieldBase, field groups do not require path or value (per v2 schema). The path is optional and there is no value field — field groups scope their children under the given path, or act as logical groupings when no path is provided.

Fields:
field fields: list[ResolvedField] [Required]

Resolved group of field formats.

field id: validate, json_schema_input_type=PydanticUndefined)] | None = None (alias '$id')

An internal identifier that can be used either for clarity specifying what the element is or as a reference in device specific sections.

field iteration: str | None = None

Specifies how iteration over arrays should be handled: ‘sequential’ or ‘bundled’.

field label: str | None = None

An optional resolved label for the field group.

field path: validate, json_schema_input_type=PydanticUndefined)] | None = None

An optional resolved path to scope the field group under.

pydantic model erc7730.model.resolved.v2.display.ResolvedFormat[source]View on GitHub

Bases: FormatBase

A resolved structured data format specification containing formatting information of fields in a single type of message (v2).

Fields:
field fields: list[Annotated[Annotated[ResolvedFieldDescription, Tag(tag=field_description)] | Annotated[ResolvedFieldGroup, Tag(tag=field_group)], Discriminator(discriminator=field_discriminator, custom_error_type=None, custom_error_message=None, custom_error_context=None)]] [Required]

An array containing the ordered resolved definitions of fields formats.

field interpolatedIntent: str | None = None

An optional resolved intent string with embedded field values using {path} interpolation syntax. This provides a dynamic, contextual description by embedding actual transaction or message values directly in the intent string.

pydantic model erc7730.model.resolved.v2.display.ResolvedInteroperableAddressNameParameters[source]View on GitHub

Bases: Model

Interoperable Address Names Formatting Parameters (resolved).

Fields:
field senderAddress: list[~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Contract Address', description='An Ethereum contract address (normalized to lowercase).', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), ~pydantic.functional_validators.BeforeValidator(func=~erc7730.model.types.<lambda>, json_schema_input_type=PydanticUndefined), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)]] | ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Contract Address', description='An Ethereum contract address (normalized to lowercase).', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), ~pydantic.functional_validators.BeforeValidator(func=~erc7730.model.types.<lambda>, json_schema_input_type=PydanticUndefined), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | None = None

Either a string or an array of strings for sender address matching.

field sources: list[str] | None = None

An array of acceptable sources for names.

Constraints:
  • min_length = 1

field types: list[str] | None = None

An array of expected types of the address (wallet, eoa, contract, token, collection).

Constraints:
  • min_length = 1

pydantic model erc7730.model.resolved.v2.display.ResolvedNftNameParameters[source]View on GitHub

Bases: Model

NFT Names Formatting Parameters (resolved).

Fields:
field collection: Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] [Required]

The resolved address of the collection contract, either as path or constant value.

Constraints:
  • discriminator = type

pydantic model erc7730.model.resolved.v2.display.ResolvedTokenAmountParameters[source]View on GitHub

Bases: Model

Token Amount Formatting Parameters (resolved).

Fields:
Validators:
  • _validate_token_amount_parameters » all fields

field chainId: int | None = None

Optional. The resolved chain on which the token is deployed. When present, the wallet SHOULD resolve token metadata (ticker, decimals) for this chain. Useful for cross-chain swap clear signing where the same token address may refer to different chains.

Validated by:
  • _validate_token_amount_parameters

field chainIdPath: validate, json_schema_input_type=PydanticUndefined)] | None = None

Optional. Path to the chain ID in the structured data. When present, the wallet SHOULD resolve token metadata for the chain at this path. Useful for cross-chain swap clear signing.

Validated by:
  • _validate_token_amount_parameters

field message: str | None = None

The resolved message to display when the amount is above the threshold.

Validated by:
  • _validate_token_amount_parameters

field nativeCurrencyAddress: list[~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Contract Address', description='An Ethereum contract address (normalized to lowercase).', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), ~pydantic.functional_validators.BeforeValidator(func=~erc7730.model.types.<lambda>, json_schema_input_type=PydanticUndefined), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)]] | ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Contract Address', description='An Ethereum contract address (normalized to lowercase).', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), ~pydantic.functional_validators.BeforeValidator(func=~erc7730.model.types.<lambda>, json_schema_input_type=PydanticUndefined), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | None = None

An address or array of resolved addresses, any of which are interpreted as an amount in native currency rather than a token.

Validated by:
  • _validate_token_amount_parameters

field threshold: validate, json_schema_input_type=PydanticUndefined)] | int | None = None

The resolved threshold above which the amount should be displayed using the message parameter rather than the real amount (encoded as an int or byte array).

Validated by:
  • _validate_token_amount_parameters

field token: Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None = None

The resolved address of the token contract, either as path or constant value. Used to associate correct ticker. If ticker is not found or value is not set, the wallet SHOULD display the raw value instead with an “Unknown token” warning.

Validated by:
  • _validate_token_amount_parameters

pydantic model erc7730.model.resolved.v2.display.ResolvedTokenTickerParameters[source]View on GitHub

Bases: Model

Token Ticker Formatting Parameters (resolved).

Fields:
Validators:
  • _validate_chainid_mutually_exclusive » all fields

field chainId: int | None = None

Optional. The resolved chain on which the token is deployed. When present, the wallet SHOULD resolve the token ticker for this chain. Useful for cross-chain swap clear signing.

Validated by:
  • _validate_chainid_mutually_exclusive

field chainIdPath: validate, json_schema_input_type=PydanticUndefined)] | None = None

Optional. Path to the chain ID in the structured data. When present, the wallet SHOULD resolve the token ticker for the chain at this path. Useful for cross-chain swap clear signing.

Validated by:
  • _validate_chainid_mutually_exclusive

pydantic model erc7730.model.resolved.v2.display.ResolvedUnitParameters[source]View on GitHub

Bases: Model

Unit Formatting Parameters (resolved).

Fields:
field base: str [Required]

The resolved base symbol of the unit, displayed after the converted value. It can be an SI unit symbol or acceptable dimensionless symbols like % or bps.

field decimals: int | None = None

The resolved number of decimals of the value, used to convert to a float.

field prefix: bool | None = None

The resolved value indicating whether the value should be converted to a prefixed unit, like k, M, G, etc.

pydantic model erc7730.model.resolved.v2.display.ResolvedVisibilityConditions[source]View on GitHub

Bases: Model

Complex visibility conditions for field display rules (resolved).

Fields:
Validators:
  • _validate_at_least_one_condition » all fields

field ifNotIn: list[str] | None = None

Display this field only if its value is NOT in this list.

Validated by:
  • _validate_at_least_one_condition

field mustBe: list[str] | None = None

Skip displaying this field but its value MUST match one of these values.

Validated by:
  • _validate_at_least_one_condition