erc7730.convert.calldata.v1.selector module
Conversion of an ERC-7730 descriptor to a calldata descriptor (for a single chain + selector).
- erc7730.convert.calldata.v1.selector.convert_selector(descriptor: ~erc7730.model.resolved.descriptor.ResolvedERC7730Descriptor, deployment: ~erc7730.model.resolved.context.ResolvedDeployment, selector: ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Selector', description='An Ethereum contract function identifier, in 4 bytes, hex encoded form.', metadata=[MinLen(min_length=10), MaxLen(max_length=10), _PydanticGeneralMetadata(pattern='^0x[a-z0-9]+$')]), ~erc7730.common.pydantic.ErrorTypeLabel(func=~erc7730.common.pydantic.ErrorTypeLabel._validator.<locals>.validate, json_schema_input_type=PydanticUndefined)], format: ~erc7730.model.resolved.display.ResolvedFormat, abi: ~erc7730.model.abi.Function, source: ~pydantic_string_url.HttpUrl | None, out: ~erc7730.common.output.OutputAdder) Annotated[CalldataDescriptorV1, FieldInfo(annotation=NoneType, required=True, title='Calldata descriptor', description='A clear signing descriptor for a smart contract function calldata. Also referred to as a "generic parser descriptor".', discriminator='version')] | None [source]View on GitHub
Generate output calldata descriptor for a single selector (“format” in ERC-7730 source descriptor).
If descriptor is invalid, None is returned. Errors are logged to the console.
- Parameters:
descriptor – resolved source ERC-7730 descriptor
deployment – chain id / contract address for which the descriptor is generated
selector – function for which the descriptor is generated
format – ERC-7730 format for the selector
abi – ABI of the function
source – source of the descriptor file
out – error handler
- Returns:
output calldata descriptors (1 per chain + selector)