aea.contracts.base

The base contract.

Contract

class Contract(Component,  ABC)

Abstract definition of a contract.

__init__

 | __init__(config: ContractConfig, contract_interface: Dict[str, Any])

Initialize the contract.

Arguments:

  • config: the contract configurations.
  • contract_interface: the contract interface

id

 | @property
 | id() -> ContractId

Get the name.

config

 | @property
 | config() -> ContractConfig

Get the configuration.

contract_interface

 | @property
 | contract_interface() -> Dict[str, Any]

Get the contract interface.

set_instance

 | @abstractmethod
 | set_instance(ledger_api: LedgerApi) -> None

Set the instance.

Arguments:

  • ledger_api: the ledger api we are using.

Returns:

None

set_address

 | @abstractmethod
 | set_address(ledger_api: LedgerApi, contract_address: str) -> None

Set the contract address.

Arguments:

  • ledger_api: the ledger_api we are using.
  • contract_address: the contract address

Returns:

None

set_deployed_instance

 | @abstractmethod
 | set_deployed_instance(ledger_api: LedgerApi, contract_address: str) -> None

Set the contract address.

Arguments:

  • ledger_api: the ledger_api we are using.
  • contract_address: the contract address

Returns:

None

from_dir

 | @classmethod
 | from_dir(cls, directory: str) -> "Contract"

Load the protocol from a directory.

Arguments:

  • directory: the directory to the skill package.

Returns:

the contract object.

from_config

 | @classmethod
 | from_config(cls, configuration: ContractConfig) -> "Contract"

Load contract from configuration

Arguments:

  • configuration: the contract configuration.

Returns:

the contract object.