erc7730.model.calldata.v1.descriptor module

Data model for Ledger specific calldata descriptor, version 1 (also referred to as “generic parser” descriptor).

pydantic model erc7730.model.calldata.v1.descriptor.CalldataDescriptorEIP712V1[source]View on GitHub

Bases: CalldataDescriptorBase

A clear signing descriptor for an EIP-712 typed message.

Reuses the calldata (generic parser) v1 FIELD / PARAM_* / ENUM_VALUE structs, adding the EIP712_SCHEMA and EIP712_MESSAGE_INFO structs and the EIP712_PATH value source. Referred to as “EIP712 v2” in the Ethereum app specifications.

Fields:
field address: validate, json_schema_input_type=PydanticUndefined)] | None = None

The verifying contract address, if the domain has one. The descriptor is addressed by its domain separator and primary type hash, the contract is only a way to look it up.

field chain_id: int | None = None

The EIP-155 chain id of the deployment, if the descriptor is bound to a chain.

Constraints:
  • ge = 1

field domain_separator: validate, json_schema_input_type=PydanticUndefined)] [Required]

hashStruct(domain) of the EIP-712 message domain.

Constraints:
  • min_length = 66

  • max_length = 66

  • pattern = ^0x[a-f0-9]+$

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

  • json_schema_input_type = PydanticUndefined

field enums: list[CalldataDescriptorInstructionEnumValueV1] [Required]

Descriptor and metadata to craft ENUM APDUs.

field fields: list[CalldataDescriptorInstructionFieldV1] [Required]

Descriptor and metadata to craft EIP712_FIELD_DESCRIPTOR APDUs.

field maps: list[CalldataDescriptorInstructionMapEntryV1] [Optional]

Descriptor and metadata to craft MAP_ENTRY APDUs, one per key of the maps looked up by the device. Only the entries matching the keys read from the message need to be provided.

field message_info: CalldataDescriptorInstructionEIP712MessageInfoV1 [Required]

Descriptor and metadata to craft an EIP712_MESSAGE_INFO APDU.

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

The Ledger network this descriptor applies to, if the descriptor is bound to a chain.

field primary_type_hash: validate, json_schema_input_type=PydanticUndefined)] [Required]

keccak256(encodeType(primaryType)) of the EIP-712 message primary type.

Constraints:
  • min_length = 66

  • max_length = 66

  • pattern = ^0x[a-f0-9]+$

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

  • json_schema_input_type = PydanticUndefined

field schema_info: CalldataDescriptorInstructionEIP712SchemaV1 [Required]

Descriptor and metadata to craft an EIP712_SCHEMA APDU.

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

Type of the descriptor (EIP-712 message).

field version: Literal['v1'] = 'v1'

Version of the descriptor type (not the version of this specific descriptor, the version of the descriptor specification)

pydantic model erc7730.model.calldata.v1.descriptor.CalldataDescriptorV1[source]View on GitHub

Bases: CalldataDescriptorBase

A clear signing descriptor for a smart contract function calldata.

Also referred to as a “generic parser descriptor”.

Fields:
field address: validate, json_schema_input_type=PydanticUndefined)] [Required]

The contract deployment address.

Constraints:
  • min_length = 42

  • max_length = 42

  • pattern = ^0x[a-f0-9]+$

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

  • json_schema_input_type = PydanticUndefined

field chain_id: int [Required]

The contract deployment EIP-155 chain id.

Constraints:
  • ge = 1

field enums: list[CalldataDescriptorInstructionEnumValueV1] [Required]

Descriptor and metadata to craft ENUM APDUs.

field fields: list[CalldataDescriptorInstructionFieldV1] [Required]

Descriptor and metadata to craft FIELD APDUs.

field maps: list[CalldataDescriptorInstructionMapEntryV1] [Optional]

Descriptor and metadata to craft MAP_ENTRY APDUs, one per key of the maps looked up by the device. Only the entries matching the keys read from the transaction need to be provided.

field network: validate, json_schema_input_type=PydanticUndefined)] [Required]

The Ledger network this descriptor applies to.

Constraints:
  • min_length = 1

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

  • json_schema_input_type = PydanticUndefined

field selector: validate, json_schema_input_type=PydanticUndefined)] [Required]

The 4-bytes function selector this descriptor applies to.

Constraints:
  • min_length = 10

  • max_length = 10

  • pattern = ^0x[a-z0-9]+$

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

  • json_schema_input_type = PydanticUndefined

field transaction_info: CalldataDescriptorInstructionTransactionInfoV1 [Required]

Descriptor and metadata to craft a TRANSACTION_INFO APDU.

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

Type of the descriptor (contract calldata).

field version: Literal['v1'] = 'v1'

Version of the descriptor type (not the version of this specific descriptor, the version of the descriptor specification)