erc7730.model.calldata package

Subpackages

Submodules

Module contents

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

See documentation in https://github.com/LedgerHQ/app-ethereum for specifications of this protocol

This data model is exposed in the public API and used by client applications to interact with the Ethereum application using the generic parser protocol.

class erc7730.model.calldata.CalldataDescriptorBase(*, type: ~typing.Literal['calldata'] = 'calldata', source: ~pydantic_string_url.HttpUrl | None = None, network: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)], chain_id: ~typing.Annotated[int, ~annotated_types.Ge(ge=1)], address: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=42), ~annotated_types.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)], selector: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=10), ~annotated_types.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)])[source]View on GitHub

Bases: Model, ABC

A clear signing descriptor for a smart contract function calldata.

Note a calldata descriptor is bound to a single deployment (single chain id/contract address) and a single function.

Also referred to as a “generic parser descriptor”.

address: validate, json_schema_input_type=PydanticUndefined)]
chain_id: int
model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network: validate, json_schema_input_type=PydanticUndefined)]
selector: validate, json_schema_input_type=PydanticUndefined)]
source: HttpUrl | None
type: Literal['calldata']
class erc7730.model.calldata.CalldataDescriptorVersion(*values)[source]View on GitHub

Bases: StrEnum

Version of the calldata descriptor.

v1 = 'v1'