erc7730.model.resolved.display module
- pydantic model erc7730.model.resolved.display.ResolvedAddressNameParameters[source]View on GitHub
Bases:
Model
Address Names Formatting Parameters.
- 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.display.ResolvedCallDataParameters[source]View on GitHub
Bases:
Model
Embedded Calldata Formatting Parameters.
- Fields:
- field calleePath: 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 address of the contract being called by this embedded calldata.
- Constraints:
func = <function _validate_absolute at 0x7f2974926480>
- pydantic model erc7730.model.resolved.display.ResolvedDateParameters[source]View on GitHub
Bases:
Model
Date Formatting Parameters
- field encoding: DateEncoding [Required]
The encoding of the date.
- pydantic model erc7730.model.resolved.display.ResolvedDisplay[source]View on GitHub
Bases:
Model
Display Formatting Info Section.
- field formats: dict[~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='EIP12 Type Identifier', description='An EIP-712 scalar or structured type identifier.')] | ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Selector', description='An Ethereum contract function identifier, in 4 bytes, hex encoded form.', metadata=[MinLen(min_length=10), MaxLen(max_length=10), _PydanticGeneralMetadata(pattern='^0x[a-z0-9]+$')]), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)], ~erc7730.model.resolved.display.ResolvedFormat] [Required]
The list includes formatting info for each field of a structure. This list is indexed by a keyidentifying uniquely the message’s type in the abi. For smartcontracts, it is the selector of thefunction or its signature; and for EIP712 messages it is the primaryType of the message.
- pydantic model erc7730.model.resolved.display.ResolvedEnumParameters[source]View on GitHub
Bases:
Model
Enum Formatting Parameters.
- Fields:
- pydantic model erc7730.model.resolved.display.ResolvedFieldBase[source]View on GitHub
Bases:
Model
A field formatter, containing formatting information of a single field in a message.
- field path: 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]
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.
- Constraints:
func = <function _validate_absolute at 0x7f2974926480>
- pydantic model erc7730.model.resolved.display.ResolvedFieldDescription[source]View on GitHub
Bases:
ResolvedFieldBase
A field formatter, containing formatting information of a single field in a message.
- Fields:
id (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.
- field format: FieldFormat | None [Required]
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 areference in device specific sections.
- field label: str [Required]
The label of the field, that will be displayed to the user in front of the formatted field value.
- field params: Annotated[Annotated[ResolvedAddressNameParameters, Tag(tag=address_name)] | Annotated[ResolvedCallDataParameters, Tag(tag=call_data)] | Annotated[ResolvedTokenAmountParameters, Tag(tag=token_amount)] | 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
Format specific parameters that are used to format the field value in a human readable way.
- pydantic model erc7730.model.resolved.display.ResolvedFormat[source]View on GitHub
Bases:
FormatBase
A structured data format specification, containing formatting information of fields in a single type of message.
- field excluded: list[DataPath] | None = None
Intentionally excluded fields, as an array of paths referring to specific fields. A field that has no formatter and is not declared in this list MAY be considered as an error by the wallet when interpreting the descriptor. The excluded paths should interpreted as prefixes, meaning that all fields under excluded path should be ignored
- field fields: list[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)]] [Required]
An array containing the ordered definitions of fields formats.
- field required: list[DataPath | ContainerPath] | None = None
A list of fields that are required to be displayed to the user. A field that has a formatter and is not in this list is optional. A field that does not have a formatter should be silent, ie not shown.
- pydantic model erc7730.model.resolved.display.ResolvedNestedFields[source]View on GitHub
Bases:
ResolvedFieldBase
A single set of field formats, allowing recursivity in the schema.
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.
- Fields:
- field fields: list[ResolvedField] [Required]
Nested fields formats.
- pydantic model erc7730.model.resolved.display.ResolvedNftNameParameters[source]View on GitHub
Bases:
Model
NFT Names Formatting Parameters.
- field collectionPath: 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 collection in the structured data.
- Constraints:
func = <function _validate_absolute at 0x7f2974926480>
- pydantic model erc7730.model.resolved.display.ResolvedTokenAmountParameters[source]View on GitHub
Bases:
Model
Token Amount Formatting Parameters.
- Fields:
- 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)]] | None = None
An address or array of addresses, any of which are interpreted as an amount in native currency rather than a token.
- field threshold: validate, json_schema_input_type=PydanticUndefined)] | None = None
The threshold above which the amount should be displayed using the message parameter rather than the real amount (encoded as a byte array).
- field tokenPath: 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)] | None = None
Path reference to the address of the token contract. Used to associate correct ticker. If ticker is not found or tokenPath is not set, the wallet SHOULD display the raw value instead with an”Unknown token” warning.
- pydantic model erc7730.model.resolved.display.ResolvedUnitParameters[source]View on GitHub
Bases:
Model
Unit Formatting Parameters.
- field base: str [Required]
The base symbol of the unit, displayed after the converted value. It can be an SI unit symbol or acceptable dimensionless symbols like % or bps.