erc7730.model.paths package
Submodules
- erc7730.model.paths.path_ops module
data_or_container_path_concat()data_path_append()data_path_concat()data_path_ends_with()data_path_starts_with()data_path_strip_prefix()descriptor_path_append()descriptor_path_ends_with()descriptor_path_starts_with()descriptor_path_strip_prefix()path_starts_with()to_absolute()to_relative()
- erc7730.model.paths.path_parser module
PathTransformerPathTransformer.absolute_data_path()PathTransformer.array()PathTransformer.array_element()PathTransformer.array_index()PathTransformer.array_slice()PathTransformer.container_field()PathTransformer.container_path()PathTransformer.descriptor_path()PathTransformer.field()PathTransformer.relative_data_path()PathTransformer.slice_array_index()
to_path()
- erc7730.model.paths.path_schemas module
Module contents
- class erc7730.model.paths.Array(*, type: Literal['array'] = 'array')[source]View on GitHub
Bases:
ModelA 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:
ModelA 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:
ModelA 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:
StrEnumPath applying to the container of the structured data to be signed.
Such paths are prefixed with “@”.
- class erc7730.model.paths.ContainerPath(*, type: Literal['container'] = 'container', field: ContainerField)[source]View on GitHub
Bases:
ModelPath 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:
ModelPath 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:
ModelPath 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:
ModelA 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']