method
- class Method(name: str, args: List[Argument], returns: Returns, desc: Optional[str] = None)
Bases:
objectRepresents a ABI method description.
- Parameters
name (string) – name of the method
args (list) – list of Argument objects with type, name, and optional
description –
returns (Returns) – a Returns object with a type and optional description
desc (string, optional) – optional description of the method
- get_signature() str
- get_selector() bytes
Returns the ABI method signature, which is the first four bytes of the SHA-512/256 hash of the method signature.
- Returns
first four bytes of the method signature hash
- Return type
bytes
- get_txn_calls() int
Returns the number of transactions needed to invoke this ABI method.
- dictify() MethodDict
- class Argument(arg_type: str, name: Optional[str] = None, desc: Optional[str] = None)
Bases:
objectRepresents an argument for a ABI method
- Parameters
arg_type (string) – ABI type or transaction string of the method argument
name (string, optional) – name of this method argument
desc (string, optional) – description of this method argument
- dictify() dict