erc7730.convert.calldata.v1.path module

Conversion of ERC-7730 ABI paths to calldata descriptor binary paths.

erc7730.convert.calldata.v1.path.apply_path(calldata: ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Hexadecimal string', description='A byte array encoded as an hexadecimal string.', metadata=[_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)], path: ~erc7730.model.calldata.v1.value.CalldataDescriptorValuePathV1) Any[source]View on GitHub

Evaluate a path against encoded calldata, to get a decoded value.

@param calldata: serialized function call data @param path: binary path @return: decoded value

erc7730.convert.calldata.v1.path.apply_path_raw(calldata: ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Hexadecimal string', description='A byte array encoded as an hexadecimal string.', metadata=[_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)], path: ~erc7730.model.calldata.v1.value.CalldataDescriptorDataPathV1) bytes[source]View on GitHub

Evaluate a path against encoded calldata, to get a raw value.

@param calldata: serialized function call data @param path: binary path @return: raw value byte array

erc7730.convert.calldata.v1.path.convert_constant(constant: ResolvedValueConstant, out: OutputAdder) CalldataDescriptorValueConstantV1 | None[source]View on GitHub

Convert a constant to a calldata protocol value.

@param constant: input constant value @param out: error handler @return: output value

erc7730.convert.calldata.v1.path.convert_container_path(path: ContainerPath, out: OutputAdder) CalldataDescriptorValuePathV1 | None[source]View on GitHub

Convert a container path to a calldata protocol value.

@param path: input container path @param out: error handler @return: output binary data path

erc7730.convert.calldata.v1.path.convert_data_path(path: DataPath, abi: Annotated[ABIStruct | ABIStaticArray | ABIDynamicArray | ABIStaticLeaf | ABIDynamicLeaf, FieldInfo(annotation=NoneType, required=True, discriminator='type')], out: OutputAdder) CalldataDescriptorValuePathV1 | None[source]View on GitHub

Convert a data path (representing the path to reach a value in the function ABI) to a Ledger specific binary path, representing cursor movements to reach the same value in a serialized transaction calldata payload.

@param path: input data path (ABI path) @param abi: function ABI @param out: error handler @return: output binary data path

erc7730.convert.calldata.v1.path.convert_path(path: ResolvedValuePath, abi: Annotated[ABIStruct | ABIStaticArray | ABIDynamicArray | ABIStaticLeaf | ABIDynamicLeaf, FieldInfo(annotation=NoneType, required=True, discriminator='type')], out: OutputAdder) CalldataDescriptorValuePathV1 | None[source]View on GitHub

Convert a path to a calldata protocol value.

@param path: input path value @param abi: function ABI @param out: error handler @return: output value

erc7730.convert.calldata.v1.path.convert_value(value: Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)], abi: Annotated[ABIStruct | ABIStaticArray | ABIDynamicArray | ABIStaticLeaf | ABIDynamicLeaf, FieldInfo(annotation=NoneType, required=True, discriminator='type')], out: OutputAdder) Annotated[CalldataDescriptorValuePathV1 | CalldataDescriptorValueConstantV1, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None[source]View on GitHub

Convert a value to a calldata protocol value.

@param value: input container path @param abi: function ABI @param out: error handler @return: output value