clients.client_manager | Algorand Developer Portal

clients.client_manager

Classes

AlgoSdkClients Container for Algorand SDK client instances.
NetworkDetail Details about an Algorand network.
ClientManager Manager for Algorand SDK clients.

Module Contents

class algokit_utils.clients.client_manager.AlgoSdkClients(algod: algosdk.v2client.algod.AlgodClient, indexer: algosdk.v2client.indexer.IndexerClient | None = None, kmd: algosdk.kmd.KMDClient | None = None)

Container for Algorand SDK client instances.

Holds references to Algod, Indexer and KMD clients.

algod

indexer = None

kmd = None

class algokit_utils.clients.client_manager.NetworkDetail

Details about an Algorand network.

Contains network type flags and genesis information.

istestnet: bool_

Whether the network is a testnet

ismainnet: bool_

Whether the network is a mainnet

islocalnet: bool_

Whether the network is a localnet

genesisid: str_

The genesis ID of the network

genesishash: str_

The genesis hash of the network

class algokit_utils.clients.client_manager.ClientManager(clients_or_configs: algokit_utils.models.network.AlgoClientConfigs | AlgoSdkClients, algorand_client: algokit_utils.algorand.AlgorandClient)

Manager for Algorand SDK clients.

Provides access to Algod, Indexer and KMD clients and helper methods for working with them.

# Algod only

client_manager = ClientManager(algod_client)

# Algod and Indexer

client_manager = ClientManager(algod_client, indexer_client)

# Algod config only

client_manager = ClientManager(ClientManager.get_algod_config_from_environment())

# Algod and Indexer config

client_manager = ClientManager(ClientManager.get_algod_config_from_environment(),

ClientManager.get_indexer_config_from_environment())

property algod : algosdk.v2client.algod.AlgodClient

Returns an algosdk Algod API client.

property indexer : algosdk.v2client.indexer.IndexerClient

Returns an algosdk Indexer API client.

property indexerif_present: algosdk.v2client.indexer.IndexerClient | None_

Returns the Indexer client if configured, otherwise None.

property kmd : algosdk.kmd.KMDClient

Returns an algosdk KMD API client.

network() → NetworkDetail

Get details about the connected Algorand network.

client_manager = ClientManager(algod_client)

network_detail = client_manager.network()

is_localnet() → bool

Check if connected to a local network.

is_testnet() → bool

Check if connected to TestNet.

is_mainnet() → bool

Check if connected to MainNet.

get_testnet_dispenser(auth_token: str | None = None, request_timeout: int | None = None) → algokit_utils.clients.dispenser_api_client.TestNetDispenserApiClient

Get a TestNet dispenser API client.

get_app_factory(app_spec: algokit_utils.applications.app_spec.arc56.Arc56Contract | algokit_utils._legacy_v2.application_specification.ApplicationSpecification | str, app_name: str | None = None, default_sender: str | None = None, default_signer: algosdk.atomic_transaction_composer.TransactionSigner | None = None, version: str | None = None, compilation_params: algokit_utils.applications.app_client.AppClientCompilationParams | None = None) → algokit_utils.applications.app_factory.AppFactory

Get an application factory for deploying smart contracts.

...