AlgorandClient
AlgorandClient
Section titled “AlgorandClient”The main entry point for interacting with the Algorand network. Provides access to all AlgoKit Utils functionality.
Constructor
Section titled “Constructor”AlgorandClient.defaultLocalNet()
Section titled “AlgorandClient.defaultLocalNet()”Creates a client configured for the default LocalNet.
const algorand = AlgorandClient.defaultLocalNet();AlgorandClient.testNet()
Section titled “AlgorandClient.testNet()”Creates a client configured for TestNet.
const algorand = AlgorandClient.testNet();AlgorandClient.mainNet()
Section titled “AlgorandClient.mainNet()”Creates a client configured for MainNet.
const algorand = AlgorandClient.mainNet();AlgorandClient.fromConfig(config)
Section titled “AlgorandClient.fromConfig(config)”Creates a client from a custom configuration.
| Parameter | Type | Description |
|---|---|---|
config.algodConfig | AlgoClientConfig | Algod client configuration |
config.indexerConfig | AlgoClientConfig | Optional indexer configuration |
config.kmdConfig | AlgoClientConfig | Optional KMD configuration |
const algorand = AlgorandClient.fromConfig({ algodConfig: { server: 'http://localhost', port: 4001, token: 'a]'.repeat(32) },});Properties
Section titled “Properties”account
Section titled “account”Returns an AccountManager instance for managing accounts.
Returns an AppManager instance for interacting with applications.
Returns a transaction sender for submitting transactions.
client
Section titled “client”Provides access to the underlying algod, indexer, and KMD clients.
Methods
Section titled “Methods”newGroup()
Section titled “newGroup()”Creates a new TransactionComposer for building atomic transaction groups.
const result = await algorand .newGroup() .addPayment({ sender: alice, receiver: bob, amount: (1).algo() }) .addAssetTransfer({ sender: alice, receiver: bob, assetId: 123n, amount: 1n }) .send();