erc7730.model.paths package

Submodules

Module contents

pydantic model erc7730.model.paths.Array[source]View on GitHub

Bases: Model

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

Fields:
field type: Literal['array'] = 'array'

The path component type identifier (discriminator for path components discriminated union).

pydantic model erc7730.model.paths.ArrayElement[source]View on GitHub

Bases: Model

A path component designating a single element of an array.

Fields:
field 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)])] [Required]

The index of the element in the array. It can be negative to count from the end of the array.

Constraints:
  • ge = -32767

  • le = 32768

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

The path component type identifier (discriminator for path components discriminated union).

pydantic model erc7730.model.paths.ArraySlice[source]View on GitHub

Bases: Model

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

Fields:
Validators:
  • _validate » all fields

field 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

The end index of the slice (exclusive). Must be greater than the start index. If unset, slice ends at the end of the array.

Validated by:
  • _validate

field 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

The start index of the slice (inclusive). Must be lower than the end index. If unset, slice starts from the beginning of the array.

Validated by:
  • _validate

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

The path component type identifier (discriminator for path components discriminated union).

Validated by:
  • _validate

class erc7730.model.paths.ContainerField(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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.

pydantic model erc7730.model.paths.ContainerPath[source]View on GitHub

Bases: Model

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

Such paths are prefixed with “@”.

Fields:
field field: ContainerField [Required]

The referenced field in the container, only some well-known values are allowed.

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

The path type identifier (discriminator for paths discriminated union).

pydantic model erc7730.model.paths.DataPath[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 “#”.

Fields:
field absolute: bool [Required]

Whether the path is absolute (starting from the structured data root) or relative (starting fromthe current field).

field 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')]] [Required]

The path elements, as a list of references to be interpreted left to right from the structureddata root to reach the referenced value(s).

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

The path type identifier (discriminator for paths discriminated union).

pydantic model erc7730.model.paths.DescriptorPath[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 “$”.

Fields:
field 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')]] [Required]

The path elements, as a list of references to be interpreted left to right from the current fileroot to reach the referenced value.

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

The path type identifier (discriminator for paths discriminated union).

pydantic model erc7730.model.paths.Field[source]View on GitHub

Bases: Model

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

Fields:
field identifier: str [Required]

The identifier of the referenced field in the structured data schema.

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

The path component type identifier (discriminator for path components discriminated union).