erc7730.model.calldata.v1.value module

Data model for calldata descriptor references to values (a.k.a., binary paths).

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.value.CalldataDescriptorContainerPathV1(*, version: Literal[1] = 1, type: Literal['CONTAINER'] = 'CONTAINER', value: CalldataDescriptorContainerPathValueV1)[source]View on GitHub

Bases: CalldataDescriptorStructV1

Descriptor for the CONTAINER_PATH struct.

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].

type: Literal['CONTAINER']
value: CalldataDescriptorContainerPathValueV1
version: Literal[1]
class erc7730.model.calldata.v1.value.CalldataDescriptorContainerPathValueV1(*values)[source]View on GitHub

Bases: IntEnum

Type of container paths.

FROM = 0
TO = 1
VALUE = 2
class erc7730.model.calldata.v1.value.CalldataDescriptorDataPathV1(*, version: Literal[1] = 1, type: Literal['DATA'] = 'DATA', elements: Annotated[list[Annotated[CalldataDescriptorPathElementTupleV1 | CalldataDescriptorPathElementArrayV1 | CalldataDescriptorPathElementRefV1 | CalldataDescriptorPathElementLeafV1 | CalldataDescriptorPathElementSliceV1, FieldInfo(annotation=NoneType, required=True, title='Path element', description='Data path element to reach the target value in the serialized transaction', discriminator='type')]], MinLen(min_length=1), MaxLen(max_length=256)])[source]View on GitHub

Bases: CalldataDescriptorStructV1

Descriptor for the DATA_PATH struct.

elements: list[Annotated[CalldataDescriptorPathElementTupleV1 | CalldataDescriptorPathElementArrayV1 | CalldataDescriptorPathElementRefV1 | CalldataDescriptorPathElementLeafV1 | CalldataDescriptorPathElementSliceV1, FieldInfo(annotation=NoneType, required=True, title='Path element', description='Data path element to reach the target value in the serialized transaction', discriminator='type')]]
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].

type: Literal['DATA']
version: Literal[1]
class erc7730.model.calldata.v1.value.CalldataDescriptorPathElementArrayV1(*, type: Literal['ARRAY'] = 'ARRAY', weight: int, start: int | None, end: int | None)[source]View on GitHub

Bases: CalldataDescriptorPathElementBaseV1

Descriptor for the PATH_ELEMENT struct of type ARRAY.

end: int | None
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].

start: int | None
type: Literal['ARRAY']
weight: int
class erc7730.model.calldata.v1.value.CalldataDescriptorPathElementBaseV1[source]View on GitHub

Bases: Model

Descriptor for the PATH_ELEMENT payload.

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].

class erc7730.model.calldata.v1.value.CalldataDescriptorPathElementLeafV1(*, type: Literal['LEAF'] = 'LEAF', leaf_type: CalldataDescriptorPathLeafType)[source]View on GitHub

Bases: CalldataDescriptorPathElementBaseV1

Descriptor for the PATH_ELEMENT struct of type LEAF.

leaf_type: CalldataDescriptorPathLeafType
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].

type: Literal['LEAF']
class erc7730.model.calldata.v1.value.CalldataDescriptorPathElementRefV1(*, type: Literal['REF'] = 'REF')[source]View on GitHub

Bases: CalldataDescriptorPathElementBaseV1

Descriptor for the PATH_ELEMENT struct of type REF.

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].

type: Literal['REF']
class erc7730.model.calldata.v1.value.CalldataDescriptorPathElementSliceV1(*, type: Literal['SLICE'] = 'SLICE', start: int | None, end: int | None)[source]View on GitHub

Bases: CalldataDescriptorPathElementBaseV1

Descriptor for the PATH_ELEMENT struct of type SLICE.

end: int | None
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].

start: int | None
type: Literal['SLICE']
class erc7730.model.calldata.v1.value.CalldataDescriptorPathElementTupleV1(*, type: Literal['TUPLE'] = 'TUPLE', offset: int)[source]View on GitHub

Bases: CalldataDescriptorPathElementBaseV1

Descriptor for the PATH_ELEMENT struct of type TUPLE.

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].

offset: int
type: Literal['TUPLE']
class erc7730.model.calldata.v1.value.CalldataDescriptorPathElementType(*values)[source]View on GitHub

Bases: IntEnum

Type of path element.

ARRAY = 2

current slot is array length, added to offset if negative. multiple by item_size and move by result slots

LEAF = 4

current slot is a leaf type, specifying the type of path end

REF = 3

read value of current slot. apply read value as offset from current slot

SLICE = 5

specify slicing to apply to final leaf value as (start, end)

TUPLE = 1

move by {value} slots from current slot

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

Bases: IntEnum

Type of path leaf element.

ARRAY_LEAF = 1

final offset is start of array encoding

DYNAMIC_LEAF = 4

final offset contains dynamic encoded value (typ length + data)

STATIC_LEAF = 3

final offset contains static encoded value (typ data on 32 bytes)

TUPLE_LEAF = 2

final offset is start of tuple encoding

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

Bases: IntEnum

Type family of a value.

ADDRESS = 5
BOOL = 6
BYTES = 7
FIXED = 4
INT = 2
STRING = 8
UFIXED = 3
UINT = 1
class erc7730.model.calldata.v1.value.CalldataDescriptorValueBaseV1(*, version: Literal[1] = 1, type_family: CalldataDescriptorTypeFamily, type_size: Annotated[int | None, Ge(ge=0), Le(le=255)] = None)[source]View on GitHub

Bases: CalldataDescriptorStructV1

Descriptor for the VALUE struct.

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].

type_family: CalldataDescriptorTypeFamily
type_size: int | None
version: Literal[1]
class erc7730.model.calldata.v1.value.CalldataDescriptorValueConstantV1(*, version: ~typing.Literal[1] = 1, type_family: ~erc7730.model.calldata.v1.value.CalldataDescriptorTypeFamily, type_size: ~typing.Annotated[int | None, ~annotated_types.Ge(ge=0), ~annotated_types.Le(le=255)] = None, type: ~typing.Literal['constant'] = 'constant', value: str | int | bool | float, raw: ~typing.Annotated[str, _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)])[source]View on GitHub

Bases: CalldataDescriptorValueBaseV1

A constant value.

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].

raw: validate, json_schema_input_type=PydanticUndefined)]
type: Literal['constant']
value: str | int | bool | float
class erc7730.model.calldata.v1.value.CalldataDescriptorValuePathV1(*, version: Literal[1] = 1, type_family: CalldataDescriptorTypeFamily, type_size: Annotated[int | None, Ge(ge=0), Le(le=255)] = None, type: Literal['path'] = 'path', abi_path: Annotated[ContainerPath | DataPath, FieldInfo(annotation=NoneType, required=True, title='Resolved Path', description='A path in the input designating value(s) either in the container of the structured data to besigned or the structured data schema (ABI path for contracts, path in the message types itself for EIP-712).', discriminator='type'), AfterValidator(func=_validate_absolute)] | None = None, binary_path: CalldataDescriptorContainerPathV1 | CalldataDescriptorDataPathV1)[source]View on GitHub

Bases: CalldataDescriptorValueBaseV1

A path to the field in the structured data. The path is a JSON path expression that can be used to extract the field value from the structured data.

abi_path: Annotated[ContainerPath | DataPath, FieldInfo(annotation=NoneType, required=True, title='Resolved Path', description='A path in the input designating value(s) either in the container of the structured data to besigned or the structured data schema (ABI path for contracts, path in the message types itself for EIP-712).', discriminator='type'), AfterValidator(func=_validate_absolute)] | None
binary_path: Annotated[CalldataDescriptorContainerPathV1 | CalldataDescriptorDataPathV1, FieldInfo(annotation=NoneType, required=True, title='Path', description='Data or container path to reach the target value in the serialized transaction', discriminator='type')]
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].

type: Literal['path']