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:
ModelAddress Names Formatting Parameters (resolved).
- Fields:
- field senderAddress: ResolvedValueMap | 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. Can also be a map lookup.
- 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:
ModelEmbedded Calldata Formatting Parameters (resolved).
- Fields:
- field amount: Annotated[ResolvedValuePath | ResolvedValueConstant | ResolvedValueMap, 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, constant value or map lookup.
- field callee: Annotated[ResolvedValuePath | ResolvedValueConstant | ResolvedValueMap, 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, constant value or map lookup.
- Constraints:
discriminator = type
- field selector: Annotated[ResolvedValuePath | ResolvedValueConstant | ResolvedValueMap, 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, constant value or map lookup.
- field spender: Annotated[ResolvedValuePath | ResolvedValueConstant | ResolvedValueMap, 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, constant value or map lookup.
- pydantic model erc7730.model.resolved.v2.display.ResolvedDateParameters[source]View on GitHub
Bases:
ModelDate Formatting Parameters (resolved)
- field encoding: DateEncoding [Required]
The resolved encoding of the date.
- pydantic model erc7730.model.resolved.v2.display.ResolvedDisplay[source]View on GitHub
Bases:
ModelDisplay 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:
ModelEncrypted Value Parameters (resolved).
- 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:
ModelEnum Formatting Parameters (resolved).
- 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 0x7f644bfa7240>
func = <function ErrorTypeLabel._validator.<locals>.validate at 0x7f644bfa72e0>
json_schema_input_type = PydanticUndefined
- pydantic model erc7730.model.resolved.v2.display.ResolvedFieldBase[source]View on GitHub
Bases:
ModelA 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
- pydantic model erc7730.model.resolved.v2.display.ResolvedFieldDefinition[source]View on GitHub
Bases:
ModelA 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 | None = None
The resolved label of the field, displayed to the user in front of the formatted field value. Can be None when the field visibility is ‘never’ or ‘mustMatch’.
- 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,ResolvedFieldDefinitionA 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[VisibilityRule, 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:
ModelA 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.
- 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: IterationStrategy | None = None
Specifies how iteration over arrays should be handled: ‘sequential’ or ‘bundled’.
- pydantic model erc7730.model.resolved.v2.display.ResolvedFormat[source]View on GitHub
Bases:
FormatBaseA 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.
- pydantic model erc7730.model.resolved.v2.display.ResolvedInteroperableAddressNameParameters[source]View on GitHub
Bases:
ModelInteroperable Address Names Formatting Parameters (resolved).
- Fields:
- field senderAddress: ResolvedValueMap | None = None
Either a string or an array of strings for sender address matching, or a map lookup.
- field sources: list[str] | None = None
An array of acceptable sources for names.
- Constraints:
min_length = 1
- field types: list[AddressNameType] | 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:
ModelNFT Names Formatting Parameters (resolved).
- field collection: Annotated[ResolvedValuePath | ResolvedValueConstant | ResolvedValueMap, 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, constant value or map lookup.
- Constraints:
discriminator = type
- pydantic model erc7730.model.resolved.v2.display.ResolvedTokenAmountParameters[source]View on GitHub
Bases:
ModelToken Amount Formatting Parameters (resolved).
- Fields:
- Validators:
_validate_token_amount_parameters»all fields
- field chainId: int | ResolvedValueMap | None = None
Optional. The resolved chain on which the token is deployed, as constant or map lookup. 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 | ResolvedValueMap, 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, constant value or map lookup. 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:
ModelToken Ticker Formatting Parameters (resolved).
- Fields:
- Validators:
_validate_chainid_mutually_exclusive»all fields
- field chainId: int | ResolvedValueMap | None = None
Optional. The resolved chain on which the token is deployed, as constant or map lookup. 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:
ModelUnit Formatting Parameters (resolved).
- 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.
- pydantic model erc7730.model.resolved.v2.display.ResolvedValueMap[source]View on GitHub
Bases:
ModelA constant value looked up in a map, using a key read from the structured data or its container (resolved).
The map values are inlined and encoded, the key is only known when the structured data is signed (or, for keys read from the container like the chain id or the target contract address, for a given deployment).
- Fields:
- field keyPath: Annotated[ContainerPath | DataPath, FieldInfo(annotation=NoneType, required=True, title='Resolved Path', description='A path in the input designating value(s) either in the container of the structured data to besigned or the structured data schema (ABI path for contracts, path in the message types itself for EIP-712).', discriminator='type'), AfterValidator(func=_validate_absolute)] [Required]
The path to the key used to look up the value in the map.
- Constraints:
func = <function _validate_absolute at 0x7f64500e05e0>
- field map: validate, json_schema_input_type=PydanticUndefined)] [Required]
The path to the referenced map, identifying the map when its values are served to a wallet.
- Constraints:
get_pydantic_core_schema = <function <lambda> at 0x7f644bfa7240>
func = <function ErrorTypeLabel._validator.<locals>.validate at 0x7f644bfa72e0>
json_schema_input_type = PydanticUndefined
- field type: Literal['map'] = 'map'
The value type identifier (discriminator for values discriminated union).
- field values: dict[str, ResolvedValueConstant] [Required]
The resolved constant values, indexed by key.
- Constraints:
min_length = 1
- pydantic model erc7730.model.resolved.v2.display.ResolvedVisibilityConditions[source]View on GitHub
Bases:
ModelComplex visibility conditions for field display rules (resolved).
- Fields:
- Validators:
_validate_exactly_one_condition»all fields