erc7730.model.input.display module
- pydantic model erc7730.model.input.display.InputAddressNameParameters[source]View on GitHub
Bases:
Model
Address Names Formatting Parameters.
- Fields:
- field sources: list[str] | ~typing.Annotated[~erc7730.model.paths.DescriptorPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Descriptor Path', description='A path applying to the current file describing the structured data formatting, after merging with includes. A descriptor path can only reference a single value in the document. Such paths are prefixed with "$".', examples=['$.foo.bar']), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | 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[~erc7730.model.display.AddressNameType] | ~typing.Annotated[~erc7730.model.paths.DescriptorPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Descriptor Path', description='A path applying to the current file describing the structured data formatting, after merging with includes. A descriptor path can only reference a single value in the document. Such paths are prefixed with "$".', examples=['$.foo.bar']), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | 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.input.display.InputCallDataParameters[source]View on GitHub
Bases:
Model
Embedded Calldata Formatting Parameters.
- Fields:
- pydantic model erc7730.model.input.display.InputDateParameters[source]View on GitHub
Bases:
Model
Date Formatting Parameters
- pydantic model erc7730.model.input.display.InputDisplay[source]View on GitHub
Bases:
Model
Display Formatting Info Section.
- Fields:
- field definitions: dict[str, InputFieldDefinition] | None = None
A set of definitions that can be used to share formatting information between multiple messages / functions. The definitions can be referenced by the key name in an internal path.
- field formats: dict[str, InputFormat] [Required]
The list includes formatting info for each field of a structure. This list is indexed by a key identifying uniquely the message’s type in the abi. For smartcontracts, it is the selector of the function or its signature; and for EIP712 messages it is the primaryType of the message.
- pydantic model erc7730.model.input.display.InputEnumParameters[source]View on GitHub
Bases:
Model
Enum Formatting Parameters.
- field ref: validate, json_schema_input_type=PydanticUndefined)] [Required] (alias '$ref')
The internal path to the enum definition used to convert this value.
- Constraints:
get_pydantic_core_schema = <function <lambda> at 0x7f297455c4a0>
func = <function ErrorTypeLabel._validator.<locals>.validate at 0x7f297455c540>
json_schema_input_type = PydanticUndefined
- pydantic model erc7730.model.input.display.InputFieldBase[source]View on GitHub
Bases:
Model
A field formatter, containing formatting information of a single field in a message.
- pydantic model erc7730.model.input.display.InputFieldDefinition[source]View on GitHub
Bases:
Model
A 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: validate, json_schema_input_type=PydanticUndefined)] | 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[InputAddressNameParameters, Tag(tag=address_name)] | Annotated[InputCallDataParameters, Tag(tag=call_data)] | Annotated[InputTokenAmountParameters, Tag(tag=token_amount)] | Annotated[InputNftNameParameters, Tag(tag=nft_name)] | Annotated[InputDateParameters, Tag(tag=date)] | Annotated[InputUnitParameters, Tag(tag=unit)] | Annotated[InputEnumParameters, 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.input.display.InputFieldDescription[source]View on GitHub
Bases:
InputFieldBase
,InputFieldDefinition
A field formatter, containing formatting information of a single field in a message.
- Fields:
- pydantic model erc7730.model.input.display.InputFormat[source]View on GitHub
Bases:
FormatBase
A structured data format specification, containing formatting information of fields in a single type of message.
- Fields:
excluded (list[Annotated[erc7730.model.paths.DataPath, pydantic.types.GetPydanticSchema(get_pydantic_core_schema=erc7730.model.input.path.
required (list[Annotated[erc7730.model.paths.DataPath, pydantic.types.GetPydanticSchema(get_pydantic_core_schema=erc7730.model.input.path.
- field excluded: list[~typing.Annotated[~erc7730.model.paths.DataPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Data Path', description='A path applying to the structured data schema (ABI path for contracts, path in the message types itself for EIP-712). A data path can reference multiple values if it contains array elements or slices. Such paths are prefixed with "#".'), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)]] | 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[InputReference, Tag(tag=reference)] | Annotated[InputFieldDescription, Tag(tag=field_description)] | Annotated[InputNestedFields, 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.
- Constraints:
min_length = 1
- field required: list[~typing.Annotated[~erc7730.model.paths.DataPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Data Path', description='A path applying to the structured data schema (ABI path for contracts, path in the message types itself for EIP-712). A data path can reference multiple values if it contains array elements or slices. Such paths are prefixed with "#".'), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | ~typing.Annotated[~erc7730.model.paths.ContainerPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Input Path', description='A path applying to the container of the structured data to be signed. Such paths are prefixed with "@".'), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)]] | 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.input.display.InputNestedFields[source]View on GitHub
Bases:
InputFieldBase
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[InputField] [Required]
Nested fields formats.
- pydantic model erc7730.model.input.display.InputNftNameParameters[source]View on GitHub
Bases:
Model
NFT Names Formatting Parameters.
- pydantic model erc7730.model.input.display.InputReference[source]View on GitHub
Bases:
InputFieldBase
A reference to a shared definition that should be used as the field formatting definition.
The value is the key in the display definitions section, as a path expression $.display.definitions.DEFINITION_NAME. It is used to share definitions between multiple messages / functions.
- Fields:
label (Annotated[erc7730.model.paths.DescriptorPath, pydantic.types.GetPydanticSchema(get_pydantic_core_schema=erc7730.model.input.path.
ref (Annotated[erc7730.model.paths.DescriptorPath, pydantic.types.GetPydanticSchema(get_pydantic_core_schema=erc7730.model.input.path.
- field label: validate, json_schema_input_type=PydanticUndefined)] | str | None = None
The label of the field, that will be displayed to the user in front of the formatted field value. Overrides the label in the referenced definition if set.
- field params: dict[str, Any] | None = None
Parameters override. These values takes precedence over the ones in the definition itself.
- field ref: validate, json_schema_input_type=PydanticUndefined)] [Required] (alias '$ref')
An internal definition that should be used as the field formatting definition. The value is the key in the display definitions section, as a path expression $.display.definitions.DEFINITION_NAME.
- Constraints:
get_pydantic_core_schema = <function <lambda> at 0x7f297455c4a0>
func = <function ErrorTypeLabel._validator.<locals>.validate at 0x7f297455c540>
json_schema_input_type = PydanticUndefined
- pydantic model erc7730.model.input.display.InputTokenAmountParameters[source]View on GitHub
Bases:
Model
Token Amount Formatting Parameters.
- field message: validate, json_schema_input_type=PydanticUndefined)] | str | None = None
The message to display when the amount is above the threshold.
- field nativeCurrencyAddress: list[~typing.Annotated[~erc7730.model.paths.DescriptorPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Descriptor Path', description='A path applying to the current file describing the structured data formatting, after merging with includes. A descriptor path can only reference a single value in the document. Such paths are prefixed with "$".', examples=['$.foo.bar']), ~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, can be lowercase or EIP-55.', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-fA-F0-9]+$')]), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)]] | ~typing.Annotated[~erc7730.model.paths.DescriptorPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Descriptor Path', description='A path applying to the current file describing the structured data formatting, after merging with includes. A descriptor path can only reference a single value in the document. Such paths are prefixed with "$".', examples=['$.foo.bar']), ~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, can be lowercase or EIP-55.', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _PydanticGeneralMetadata(pattern='^0x[a-fA-F0-9]+$')]), ~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.
- pydantic model erc7730.model.input.display.InputUnitParameters[source]View on GitHub
Bases:
Model
Unit Formatting Parameters.
- Fields:
- field base: validate, json_schema_input_type=PydanticUndefined)] | 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.
- field decimals: int | ~typing.Annotated[~erc7730.model.paths.DescriptorPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Descriptor Path', description='A path applying to the current file describing the structured data formatting, after merging with includes. A descriptor path can only reference a single value in the document. Such paths are prefixed with "$".', examples=['$.foo.bar']), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | None = None
The number of decimals of the value, used to convert to a float.
- field prefix: bool | ~typing.Annotated[~erc7730.model.paths.DescriptorPath, ~pydantic.types.GetPydanticSchema(get_pydantic_core_schema=~erc7730.model.input.path.<lambda>, get_pydantic_json_schema=None), FieldInfo(annotation=NoneType, required=True, title='Descriptor Path', description='A path applying to the current file describing the structured data formatting, after merging with includes. A descriptor path can only reference a single value in the document. Such paths are prefixed with "$".', examples=['$.foo.bar']), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)] | None = None
Whether the value should be converted to a prefixed unit, like k, M, G, etc.