Skip to content

plugins.aea-ledger-fetchai.aea_ledger_fetchai.fetchai

Fetchai module wrapping the public and private key cryptography and ledger api.

FetchAIHelper Objects

class FetchAIHelper(CosmosHelper)

Helper class usable as Mixin for FetchAIApi or as standalone class.

FetchAICrypto Objects

class FetchAICrypto(CosmosCrypto)

Class wrapping the Entity Generation from Fetch.AI ledger.

FetchAIApi Objects

class FetchAIApi(_CosmosApi, FetchAIHelper)

Class to interact with the Fetch ledger APIs.

__init__

def __init__(**kwargs: Any) -> None

Initialize the Fetch.ai ledger APIs.

contract_method_call

def contract_method_call(contract_instance: Any, method_name: str,
                         **method_args: Any) -> Optional[JSONLike]

Call a contract's method

Arguments:

  • contract_instance: the contract to use
  • method_name: the contract method to call
  • method_args: the contract call parameters

build_transaction

def build_transaction(contract_instance: Any,
                      method_name: str,
                      method_args: Optional[Dict],
                      tx_args: Optional[Dict],
                      raise_on_try: bool = False) -> Optional[JSONLike]

Prepare a transaction

Arguments:

  • contract_instance: the contract to use
  • method_name: the contract method to call
  • method_args: the contract parameters
  • tx_args: the transaction parameters
  • raise_on_try: whether the method will raise or log on error

get_transaction_transfer_logs

def get_transaction_transfer_logs(
        contract_instance: Any,
        tx_hash: str,
        target_address: Optional[str] = None) -> Optional[JSONLike]

Get all transfer events derived from a transaction.

Arguments:

  • contract_instance: the contract
  • tx_hash: the transaction hash
  • target_address: optional address to filter transfer events to just those that affect it

send_signed_transactions

def send_signed_transactions(signed_transactions: List[JSONLike],
                             raise_on_try: bool = False,
                             **kwargs: Any) -> Optional[List[str]]

Simulate and send a bundle of transactions.

This operation is not supported for fetchai.

Arguments:

  • signed_transactions: the raw signed transactions to bundle together and send.
  • raise_on_try: whether the method will raise or log on error.
  • kwargs: the keyword arguments.

FetchAIFaucetApi Objects

class FetchAIFaucetApi(CosmosFaucetApi)

Fetchai testnet faucet API.