algokit_utils.accounts.kmd_account_manager ========================================== .. py:module:: algokit_utils.accounts.kmd_account_manager Classes ------- .. autoapisummary:: algokit_utils.accounts.kmd_account_manager.KmdAccount algokit_utils.accounts.kmd_account_manager.KmdAccountManager Module Contents --------------- .. py:class:: KmdAccount(private_key: str, address: str | None = None) Bases: :py:obj:`algokit_utils.models.account.SigningAccount` Account retrieved from KMD with signing capabilities, extending base Account. Provides an account implementation that can be used to sign transactions using keys stored in KMD. :param private_key: Base64 encoded private key :param address: Optional address override for rekeyed accounts, defaults to None .. py:class:: KmdAccountManager(client_manager: algokit_utils.clients.client_manager.ClientManager) Provides abstractions over KMD that makes it easier to get and manage accounts. .. py:method:: kmd() -> algosdk.kmd.KMDClient Returns the KMD client, initializing it if needed. :raises Exception: If KMD client is not configured and not running against LocalNet :return: The KMD client .. py:method:: get_wallet_account(wallet_name: str, predicate: collections.abc.Callable[[dict[str, Any]], bool] | None = None, sender: str | None = None) -> KmdAccount | None Returns an Algorand signing account with private key loaded from the given KMD wallet. Retrieves an account from a KMD wallet that matches the given predicate, or a random account if no predicate is provided. :param wallet_name: The name of the wallet to retrieve an account from :param predicate: Optional filter to use to find the account (otherwise gets a random account from the wallet) :param sender: Optional sender address to use this signer for (aka a rekeyed account) :return: The signing account or None if no matching wallet or account was found .. py:method:: get_or_create_wallet_account(name: str, fund_with: algokit_utils.models.amount.AlgoAmount | None = None) -> KmdAccount Gets or creates a funded account in a KMD wallet of the given name. Provides idempotent access to accounts from LocalNet without specifying the private key. :param name: The name of the wallet to retrieve / create :param fund_with: The number of Algos to fund the account with when created :return: An Algorand account with private key loaded .. py:method:: get_localnet_dispenser_account() -> KmdAccount Returns an Algorand account with private key loaded for the default LocalNet dispenser account. Retrieves the default funded account from LocalNet that can be used to fund other accounts. :raises Exception: If not running against LocalNet or dispenser account not found :return: The default LocalNet dispenser account