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:
CalldataDescriptorBaseA 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:
address (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.domain_separator (Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Hexadecimal string', description='A byte array encoded as an hexadecimal string.', metadata=[_PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), pydantic.functional_validators.BeforeValidator(func=erc7730.model.types.enums (list[erc7730.model.calldata.v1.instruction.CalldataDescriptorInstructionEnumValueV1])fields (list[erc7730.model.calldata.v1.instruction.CalldataDescriptorInstructionFieldV1])maps (list[erc7730.model.calldata.v1.instruction.CalldataDescriptorInstructionMapEntryV1])network (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.primary_type_hash (Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Hexadecimal string', description='A byte array encoded as an hexadecimal string.', metadata=[_PydanticGeneralMetadata(pattern='^0x[a-f0-9]+$')]), pydantic.functional_validators.BeforeValidator(func=erc7730.model.types.schema_info (erc7730.model.calldata.v1.eip712.CalldataDescriptorInstructionEIP712SchemaV1)
- 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:
CalldataDescriptorBaseA clear signing descriptor for a smart contract function calldata.
Also referred to as a “generic parser descriptor”.
- Fields:
address (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.enums (list[erc7730.model.calldata.v1.instruction.CalldataDescriptorInstructionEnumValueV1])fields (list[erc7730.model.calldata.v1.instruction.CalldataDescriptorInstructionFieldV1])maps (list[erc7730.model.calldata.v1.instruction.CalldataDescriptorInstructionMapEntryV1])network (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.selector (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.
- 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)