erc7730.generate.generate module

erc7730.generate.generate.generate_descriptor(chain_id: int, contract_address: ~typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, title='Contract Address', description='An Ethereum contract address (normalized to lowercase).', metadata=[MinLen(min_length=42), MaxLen(max_length=42), _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)], abi_file: ~pathlib.Path | None = None, eip712_schema_file: ~pathlib.Path | None = None, owner: str | None = None, legal_name: str | None = None, url: ~pydantic_string_url.HttpUrl | None = None) InputERC7730Descriptor[source]View on GitHub

Generate an ERC-7730 descriptor.

If an EIP-712 schema file is provided, an EIP-712 descriptor is generated for this schema, otherwise a calldata descriptor. If no ABI file is supplied, the ABIs are fetched from Etherscan using the chain id / contract address.

Parameters:
  • chain_id – contract chain id

  • contract_address – contract address

  • abi_file – path to a JSON ABI file (to generate a calldata descriptor)

  • eip712_schema_file – path to an EIP-712 schema (to generate an EIP-712 descriptor)

  • owner – the display name of the owner or target of the contract / message to be clear signed

  • legal_name – the full legal name of the owner if different from the owner field

  • url – URL with more info on the entity the user interacts with

Returns:

a generated ERC-7730 descriptor