erc7730.model.calldata.v1.param module

Data model for calldata descriptor field parameters.

These model classes represent the exact same data fields that are serialized into TLV structs. See documentation in https://github.com/LedgerHQ/app-ethereum for specifications of this protocol

class erc7730.model.calldata.v1.param.CalldataDescriptorDateType(*values)[source]View on GitHub

Bases: IntEnum

Type of date formatting.

BLOCK_HEIGHT = 1
UNIX = 0
pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamAmountV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_AMOUNT struct.

Fields:
field type: Literal['AMOUNT'] = 'AMOUNT'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_AMOUNT struct

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamBaseV1[source]View on GitHub

Bases: CalldataDescriptorStructV1, ABC

Base class for calldata descriptor PARAM_* structs.

Fields:
field value: Annotated[CalldataDescriptorValuePathV1 | CalldataDescriptorValueConstantV1, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] [Required]

Reference to value to display (as a path in serialized data)

Constraints:
  • discriminator = type

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamDatetimeV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_DATETIME struct.

Fields:
field date_type: CalldataDescriptorDateType [Required]

Type of date formatting

field type: Literal['DATETIME'] = 'DATETIME'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_DATETIME struct

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamDurationV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_DURATION struct.

Fields:
field type: Literal['DURATION'] = 'DURATION'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_DURATION struct

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamEnumV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_ENUM struct.

Fields:
field id: int [Required]

Identifier of the enum (to differentiate multiple enums in one contract)

Constraints:
  • ge = 0

  • le = 255

field type: Literal['ENUM'] = 'ENUM'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_ENUM struct

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamNFTV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_NFT struct.

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

Reference to the collection address (as a path in serialized data)

Constraints:
  • discriminator = type

field type: Literal['NFT'] = 'NFT'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_NFT struct

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamRawV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_RAW struct.

Fields:
field type: Literal['RAW'] = 'RAW'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_RAW struct

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamTokenAmountV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_TOKEN_AMOUNT struct.

Fields:
field above_threshold_message: str | None = None

Label to display for unlimited amount

Constraints:
  • min_length = 1

  • max_length = 32

field native_currencies: 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

Addresses to interpret as native currency

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

Amount threshold to display as unlimited amount

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

Reference to token address (as a path in serialized data)

field type: Literal['TOKEN_AMOUNT'] = 'TOKEN_AMOUNT'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_TOKEN_AMOUNT struct

pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamTrustedNameV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_TRUSTED_NAME struct.

Fields:
field sources: list[TrustedNameSource] [Required]

Allowed sources for trusted names display

Constraints:
  • min_length = 1

field type: Literal['TRUSTED_NAME'] = 'TRUSTED_NAME'

Type of the parameter

field types: list[TrustedNameType] [Required]

Allowed types for trusted names display

Constraints:
  • min_length = 1

field version: Literal[1] = 1

Version of the PARAM_TRUSTED_NAME struct

class erc7730.model.calldata.v1.param.CalldataDescriptorParamType(*values)[source]View on GitHub

Bases: IntEnum

Type of calldata field parameters.

AMOUNT = 1
CALLDATA = 9
DATETIME = 4
DURATION = 5
ENUM = 7
NFT = 3
RAW = 0
TOKEN_AMOUNT = 2
TRUSTED_NAME = 8
UNIT = 6
pydantic model erc7730.model.calldata.v1.param.CalldataDescriptorParamUnitV1[source]View on GitHub

Bases: CalldataDescriptorParamBaseV1

Descriptor for the PARAM_UNIT struct.

Fields:
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.

Constraints:
  • min_length = 1

  • max_length = 32

field decimals: int | None = None

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

Constraints:
  • ge = 0

  • le = 255

field prefix: bool | None = None

Whether the value should be converted to a prefixed unit, like k, M, G, etc.

field type: Literal['UNIT'] = 'UNIT'

Type of the parameter

field version: Literal[1] = 1

Version of the PARAM_UNIT struct