erc7730.model.paths package

Submodules

Module contents

class erc7730.model.paths.Array(*, type: Literal['array'] = 'array')[source]View on GitHub

Bases: Model

A path component designating all elements of an array (in which case, the path targets multiple values).

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['array']
class erc7730.model.paths.ArrayElement(*, type: Literal['array_element'] = 'array_element', index: Annotated[int, Ge(ge=-32767), Le(le=32768)])[source]View on GitHub

Bases: Model

A path component designating a single element of an array.

index: Annotated[int, FieldInfo(annotation=NoneType, required=True, title='Array index', description='Index of an element in an array. An index can be negative to count from the end of the array.', metadata=[Ge(ge=-32767), Le(le=32768)])]
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['array_element']
class erc7730.model.paths.ArraySlice(*, type: Literal['array_slice'] = 'array_slice', start: Annotated[int, FieldInfo(annotation=NoneType, required=True, title='Array index', description='Index of an element in an array. An index can be negative to count from the end of the array.', metadata=[Ge(ge=-32767), Le(le=32768)])] | None = None, end: Annotated[int, FieldInfo(annotation=NoneType, required=True, title='Array index', description='Index of an element in an array. An index can be negative to count from the end of the array.', metadata=[Ge(ge=-32767), Le(le=32768)])] | None = None)[source]View on GitHub

Bases: Model

A path component designating an element range of an array (in which case, the path targets multiple values).

end: Annotated[int, FieldInfo(annotation=NoneType, required=True, title='Array index', description='Index of an element in an array. An index can be negative to count from the end of the array.', metadata=[Ge(ge=-32767), Le(le=32768)])] | 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: Annotated[int, FieldInfo(annotation=NoneType, required=True, title='Array index', description='Index of an element in an array. An index can be negative to count from the end of the array.', metadata=[Ge(ge=-32767), Le(le=32768)])] | None
type: Literal['array_slice']
class erc7730.model.paths.ContainerField(*values)[source]View on GitHub

Bases: StrEnum

Path applying to the container of the structured data to be signed.

Such paths are prefixed with “@”.

FROM = 'from'

The address of the sender of the transaction / signer of the message.

TO = 'to'

The destination address of the containing transaction, ie the target smart contract address.

VALUE = 'value'

The native currency value of the transaction containing the structured data.

class erc7730.model.paths.ContainerPath(*, type: Literal['container'] = 'container', field: ContainerField)[source]View on GitHub

Bases: Model

Path applying to the container of the structured data to be signed.

Such paths are prefixed with “@”.

field: ContainerField
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']
class erc7730.model.paths.DataPath(*, type: Literal['data'] = 'data', absolute: bool, elements: list[Annotated[Field | ArrayElement | ArraySlice | Array, FieldInfo(annotation=NoneType, required=True, title='Data Path Element', description='An element of a data path, applying to the structured data schema (ABI path for contracts, pathin the message types itself for EIP-712)', discriminator='type')]])[source]View on GitHub

Bases: Model

Path applying to the structured data schema (ABI path for contracts, path in the message types itself for EIP-712).

A data path can reference multiple values if it contains array elements or slices.

Such paths are prefixed with “#”.

absolute: bool
elements: list[Annotated[Field | ArrayElement | ArraySlice | Array, FieldInfo(annotation=NoneType, required=True, title='Data Path Element', description='An element of a data path, applying to the structured data schema (ABI path for contracts, pathin the message types itself for EIP-712)', 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']
class erc7730.model.paths.DescriptorPath(*, type: Literal['descriptor'] = 'descriptor', elements: list[Annotated[Field | ArrayElement, FieldInfo(annotation=NoneType, required=True, title='Descriptor Path Element', description='An element of a descriptor path, applying to the current file describing the structured dataformatting, after merging with includes.', discriminator='type')]])[source]View on GitHub

Bases: Model

Path applying to the current file describing the structured data formatting, after merging with includes.

A descriptor path can only reference a single value in the document.

Such paths are prefixed with “$”.

elements: list[Annotated[Field | ArrayElement, FieldInfo(annotation=NoneType, required=True, title='Descriptor Path Element', description='An element of a descriptor path, applying to the current file describing the structured dataformatting, after merging with includes.', 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['descriptor']
class erc7730.model.paths.Field(*, type: Literal['field'] = 'field', identifier: Annotated[str, _PydanticGeneralMetadata(pattern='^[a-zA-Z0-9_]+$')])[source]View on GitHub

Bases: Model

A path component designating a field in a structured data schema.

identifier: str
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['field']