erc7730.convert.resolved.v2.values module
- erc7730.convert.resolved.v2.values.deployment_map_key(key_path: ContainerPath | DataPath, chain_id: int, address: str) str | None[source]View on GitHub
Get the map key a deployment provides, for map lookups keyed on the chain id or target contract address.
- Parameters:
key_path – resolved map key path
chain_id – deployment chain id
address – deployment contract address
- Returns:
map key, or None if the key is not determined by the deployment
- erc7730.convert.resolved.v2.values.encode_value(value: str | int | bool | float, abi_type: ABIDataType, out: OutputAdder) validate, json_schema_input_type=PydanticUndefined)] | None[source]View on GitHub
- erc7730.convert.resolved.v2.values.is_deployment_key(key_path: ContainerPath | DataPath) TypeGuard[ContainerPath][source]View on GitHub
Whether a map key is determined by the deployment: the chain id or the target contract address.
- Parameters:
key_path – resolved map key path
- Returns:
True if the key is the chain id or the target contract address
- erc7730.convert.resolved.v2.values.lookup_map_key(values: Mapping[str, Any], key: str) str | None[source]View on GitHub
Find the map key matching a key, matching hex keys (addresses) case-insensitively.
- Parameters:
values – map values, indexed by key
key – map key
- Returns:
matching map key, or None if the map has no value for the key
- erc7730.convert.resolved.v2.values.lookup_map_value(values: dict[str, ResolvedValueConstant], key: str) ResolvedValueConstant | None[source]View on GitHub
Look up a map value, matching hex keys (addresses) case-insensitively.
- Parameters:
values – resolved map values, indexed by key
key – map key
- Returns:
resolved constant value, or None if the map has no value for the key
- erc7730.convert.resolved.v2.values.resolve_field_value(prefix: DataPath, input_field: InputFieldBase, input_field_format: FieldFormat | None, constants: ConstantProvider, out: OutputAdder) Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None[source]View on GitHub
Resolve value, as a data path or constant value, for a field or reference.
- Parameters:
prefix – current path prefix
input_field – field description or definition
input_field_format – input field format
constants – descriptor paths constants resolver
out – error handler
- Returns:
resolved value or None if error
- erc7730.convert.resolved.v2.values.resolve_map_reference_value(prefix: DataPath, map_ref: InputMapReference, abi_type: ABIDataType, constants: ConstantProvider, out: OutputAdder) ResolvedValueConstant | ResolvedValueMap | None[source]View on GitHub
Resolve a map reference, as a constant value if the key is a constant, or as a map lookup otherwise.
- Parameters:
prefix – current path prefix
map_ref – input map reference
abi_type – expected encoded value data type
constants – descriptor paths constants resolver
out – error handler
- Returns:
resolved value or None if error
- erc7730.convert.resolved.v2.values.resolve_path_constant_or_map_value(prefix: DataPath, input_path: DescriptorPath | DataPath | ContainerPath | None, input_value: DescriptorPath | str | int | bool | float | InputMapReference | None, abi_type: ABIDataType, constants: ConstantProvider, out: OutputAdder) Annotated[ResolvedValuePath | ResolvedValueConstant | ResolvedValueMap, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None[source]View on GitHub
Resolve value, as a data path, constant value or map lookup.
- Parameters:
prefix – current path prefix
input_path – input data path, if provided
input_value – input constant value or map reference, if provided
abi_type – expected encoded value data type
constants – descriptor paths constants resolver
out – error handler
- Returns:
resolved value or None if error or value resolves to None
- erc7730.convert.resolved.v2.values.resolve_path_or_constant_value(prefix: DataPath, input_path: DescriptorPath | DataPath | ContainerPath | None, input_value: DescriptorPath | str | int | bool | float | None, abi_type: ABIDataType, constants: ConstantProvider, out: OutputAdder) Annotated[ResolvedValuePath | ResolvedValueConstant, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None[source]View on GitHub
Resolve value, as a data path or constant value.
- Parameters:
prefix – current path prefix
input_path – input data path, if provided
input_value – input constant value, if provided
abi_type – expected encoded value data type
constants – descriptor paths constants resolver
out – error handler
- Returns:
resolved value or None if error or value resolves to None