Skip to content

index

@algorandfoundation/algokit-utils / index

Re-exports ALGOKIT_DIR


Re-exports AVMTracesEventData


Re-exports AlgorandClient


Re-exports DEFAULT_MAX_SEARCH_DEPTH


Re-exports EventDataMap


Re-exports EventType


Re-exports SOURCES_DIR


Re-exports SearchForTransactions


Re-exports TEAL_FILE_EXT


Re-exports TEAL_SOURCEMAP_EXT


Re-exports TealSourceDebugEventData


Re-exports TealSourcesDebugEventData


Re-exports executePaginatedRequest


Re-exports lookupAccountByAddress


Re-exports lookupAccountCreatedApplicationByAddress


Re-exports lookupAssetHoldings


Re-exports lookupTransactionById


Re-exports searchTransactions

Ƭ AccountInformation: Omit<NumberConverter<AccountInformationModel>, "getEncodingSchema" | "toEncodingData" | "authAddr"> & { authAddr?: string }

Deprecated

Account information at a given round.

src/account/account.ts:135


Ƭ NumberConverter<T>: { [key in keyof T]: ToNumberIfExtends<T[key], number | bigint> }

NameType
Textends AccountInformationModel

src/account/account.ts:132

Const ALGORAND_MIN_TX_FEE: AlgoAmount

src/amount.ts:93


Const Config: UpdatableConfig

The AlgoKit config. To update it use the configure method.

src/config.ts:4


Const MAX_APP_CALL_ACCOUNT_REFERENCES: 4

src/transaction/transaction.ts:39


Const MAX_APP_CALL_FOREIGN_REFERENCES: 8

src/transaction/transaction.ts:38


Const MAX_TRANSACTION_GROUP_SIZE: 16

src/transaction/transaction.ts:37

algo(algos): AlgoAmount

Returns an amount of Algo using AlgoAmount

NameTypeDescription
algosnumber | bigintThe amount of Algo

AlgoAmount

src/amount.ts:68


algos(algos): AlgoAmount

Returns an amount of Algo using AlgoAmount

NameTypeDescription
algosnumber | bigintThe amount of Algo

AlgoAmount

src/amount.ts:61


assetBulkOptIn(optIn, algod): Promise<Record<number, string>>

NameTypeDescription
optInAssetBulkOptInOutParamsThe bulk opt-in request.
algodAlgodClientAn instance of the Algodv2 class from the algosdk library.

Promise<Record<number, string>>

A record object where the keys are the asset IDs and the values are the corresponding transaction IDs for successful opt-ins.

Deprecated

use algorand.asset.bulkOptIn() instead

Opt in to a list of assets on the Algorand blockchain.

Throws

If there is an error during the opt-in process.

Example

algokit.bulkOptIn({ account: account, assetIds: [12345, 67890] }, algod);

src/asset.ts:130


assetBulkOptOut(optOut, algod): Promise<Record<number, string>>

NameTypeDescription
optOutAssetBulkOptInOutParamsThe bulk opt-out request.
algodAlgodClientAn instance of the Algodv2 client used to interact with the Algorand blockchain.

Promise<Record<number, string>>

A record object containing asset IDs as keys and their corresponding transaction IDs as values.

Deprecated

use algorand.asset.bulkOptOut() instead

Opt out of multiple assets in Algorand blockchain.

Throws

If there is an error during the opt-out process.

Example

algokit.bulkOptOut({ account: account, assetIds: [12345, 67890] }, algod);

src/asset.ts:157


assetOptIn(optIn, algod): Promise<SendTransactionResult>

NameTypeDescription
optInAssetOptInParamsThe opt-in definition
algodAlgodClientAn algod client

Promise<SendTransactionResult>

The transaction object and optionally the confirmation if it was sent to the chain (skipSending is false or unset)

Deprecated

use algorand.send.assetOptIn() / algorand.createTransaction.assetOptIn() instead

Opt-in an account to an asset.

Example

await algokit.assetOptIn({ account, assetId }, algod);

src/asset.ts:67


assetOptOut(optOut, algod): Promise<SendTransactionResult>

NameTypeDescription
optOutAssetOptOutParamsThe opt-in definition
algodAlgodClientAn algod client

Promise<SendTransactionResult>

The transaction object and optionally the confirmation if it was sent to the chain (skipSending is false or unset)

Deprecated

use algorand.send.assetOptOut() / algorand.createTransaction.assetOptOut() instead

Opt-out an account from an asset.

Example

await algokit.assetOptOut({ account, assetId, assetCreatorAddress }, algod);

src/asset.ts:98


callApp(call, algod): Promise<AppCallTransactionResult>

NameTypeDescription
callAppCallParamsThe call details.
algodAlgodClientAn algod client

Promise<AppCallTransactionResult>

The result of the call

Deprecated

Use algorand.send.appUpdate() / algorand.createTransaction.appUpdate() / algorand.send.appUpdateMethodCall() / algorand.createTransaction.appUpdateMethodCall() instead

Issues a call to a given app.

src/app.ts:187


capTransactionFee(transaction, maxAcceptableFee): void

NameTypeDescription
transactionTransaction | SuggestedParamsThe transaction to cap or suggested params object about to be used to create a transaction
maxAcceptableFeeAlgoAmountThe maximum acceptable fee to pay

void

Deprecated

Use TransactionComposer and the maxFee field in the transaction params instead.

Limit the acceptable fee to a defined amount of µAlgo. This also sets the transaction to be flatFee to ensure the transaction only succeeds at the estimated rate.

src/transaction/transaction.ts:1056


compileTeal(tealCode, algod): Promise<CompiledTeal>

NameTypeDescription
tealCodestringThe TEAL code
algodAlgodClientAn algod client

Promise<CompiledTeal>

The information about the compiled file

Deprecated

Use algorand.app.compileTeal instead.

Compiles the given TEAL using algod and returns the result, including source map.

src/app.ts:419


controlFees<T>(transaction, feeControl): T

NameType
Textends Transaction | SuggestedParams
NameTypeDescription
transactionTThe transaction or suggested params
feeControlObjectThe fee control parameters
feeControl.fee?AlgoAmount-
feeControl.maxFee?AlgoAmount-

T

Deprecated

Use TransactionComposer and the maxFee and staticFee fields in the transaction params instead.

Allows for control of fees on a Transaction or SuggestedParams object

src/transaction/transaction.ts:1083


createApp(create, algod): Promise<Partial<AppCompilationResult> & AppCallTransactionResult & AppReference>

NameTypeDescription
createCreateAppParamsThe parameters to create the app with
algodAlgodClientAn algod client

Promise<Partial<AppCompilationResult> & AppCallTransactionResult & AppReference>

The details of the created app, or the transaction to create it if skipSending and the compilation result

Deprecated

Use algorand.send.appCreate() / algorand.createTransaction.appCreate() / algorand.send.appCreateMethodCall() / algorand.createTransaction.appCreateMethodCall() instead

Creates a smart contract app, returns the details of the created app.

src/app.ts:44


createAsset(create, algod): Promise<SendTransactionResult & { confirmation?: { assetIndex: number | bigint } }>

NameTypeDescription
createCreateAssetParamsThe asset creation definition
algodAlgodClientAn algod client

Promise<SendTransactionResult & { confirmation?: { assetIndex: number | bigint } }>

The transaction object and optionally the confirmation if it was sent to the chain (skipSending is false or unset)

Deprecated

use algorand.send.assetCreate() / algorand.createTransaction.assetCreate() instead

Create an Algorand Standard Asset (ASA).

Example

await algokit.createAsset({ creator: account, total: 1, decimals: 0, name: 'My asset' }, algod);

src/asset.ts:23


decodeAppState(state): AppState

NameTypeDescription
state{ key: string ; value: TealValue | EvalDelta }[]A global-state, local-state, global-state-deltas or local-state-deltas

AppState

An object keyeed by the UTF-8 representation of the key with various parsings of the values

Deprecated

Use AppManager.decodeAppState instead.

Converts an array of global/local state values from the algod api to a more friendly generic object keyed by the UTF-8 value of the key.

src/app.ts:345


deployApp(deployment, algod, indexer?): Promise<Partial<AppCompilationResult> & ConfirmedTransactionResults & AppMetadata & { operationPerformed: "create" | "update" ; return?: ABIReturn } | ConfirmedTransactionResults & AppMetadata & { deleteResult: ConfirmedTransactionResult ; deleteReturn?: ABIReturn ; operationPerformed: "replace" ; return?: ABIReturn } | AppMetadata & { operationPerformed: "nothing" }>

NameTypeDescription
deploymentAppDeploymentParamsThe arguments to control the app deployment
algodAlgodClientAn algod client
indexer?IndexerClientAn indexer client, needed if existingDeployments not passed in

Promise<Partial<AppCompilationResult> & ConfirmedTransactionResults & AppMetadata & { operationPerformed: "create" | "update" ; return?: ABIReturn } | ConfirmedTransactionResults & AppMetadata & { deleteResult: ConfirmedTransactionResult ; deleteReturn?: ABIReturn ; operationPerformed: "replace" ; return?: ABIReturn } | AppMetadata & { operationPerformed: "nothing" }>

The app reference of the new/existing app

Deprecated

Use algorand.appDeployer.deploy instead.

Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.

To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md

Note: When using the return from this function be sure to check operationPerformed to get access to various return properties like transaction, confirmation and deleteResult.

Note: if there is a breaking state schema change to an existing app (and onSchemaBreak is set to 'replace') the existing app will be deleted and re-created.

Note: if there is an update (different TEAL code) to an existing app (and onUpdate is set to 'replace') the existing app will be deleted and re-created.

src/app-deploy.ts:51


encodeLease(lease?): Uint8Array | undefined

Encodes a transaction lease into a 32-byte array ready to be included in an Algorand transaction.

NameTypeDescription
lease?string | Uint8ArrayThe transaction lease as a string or binary array or null/undefined if there is no lease

Uint8Array | undefined

the transaction lease ready for inclusion in a transaction or undefined if there is no lease

Throws

if the length of the data is > 32 bytes or empty

Example

algokit.encodeLease('UNIQUE_ID');

Example

algokit.encodeLease(new Uint8Array([1, 2, 3]));

src/transaction/transaction.ts:80


encodeTransactionNote(note?): Uint8Array | undefined

NameTypeDescription
note?TransactionNoteThe transaction note

Uint8Array | undefined

the transaction note ready for inclusion in a transaction

Case on the value of data this either be:

  • null | undefined: undefined
  • string: The string value
  • Uint8Array: passthrough
  • Arc2TransactionNote object: ARC-0002 compatible transaction note
  • Else: The object/value converted into a JSON string representation

Deprecated

Convert your data to a string or Uint8Array, if using ARC-2 use TransactionComposer.arc2Note.

Encodes a transaction note into a byte array ready to be included in an Algorand transaction.

src/transaction/transaction.ts:56


ensureFunded<T>(funding, algod, kmd?): Promise<EnsureFundedReturnType | undefined>

NameType
Textends EnsureFundedParams
NameTypeDescription
fundingTThe funding configuration of type EnsureFundedParams, including the account to fund, minimum spending balance, and optional parameters. If you set useDispenserApi to true, you must also set ALGOKIT_DISPENSER_ACCESS_TOKEN in your environment variables.
algodAlgodClientAn instance of the Algodv2 client.
kmd?KmdClientAn optional instance of the Kmd client.

Promise<EnsureFundedReturnType | undefined>

  • EnsureFundedReturnType if funds were transferred.
  • undefined if no funds were needed.

Deprecated

Use algorand.account.ensureFunded() / algorand.account.ensureFundedFromEnvironment() / algorand.account.ensureFundedFromTestNetDispenserApi() instead

Funds a given account using a funding source such that it has a certain amount of Algo free to spend (accounting for Algo locked in minimum balance requirement).

https://dev.algorand.co/concepts/smart-contracts/costs-constraints#mbr

src/transfer/transfer.ts:26


getABIMethodSignature(method): string

NameTypeDescription
methodABIMethodParams | ABIMethodThe method to return a signature for

string

The encoded ABI method spec e.g. method_name(uint64,string)string

Deprecated

Use abiMethod.getSignature() or new ABIMethod(abiMethodParams).getSignature() instead.

Returns the encoded ABI spec for a given ABI Method

src/app.ts:430


getABIReturn(args?, confirmation?): ABIReturn | undefined

NameTypeDescription
args?AppCallArgsThe arguments that were used for the call
confirmation?PendingTransactionResponseThe transaction confirmation from algod

ABIReturn | undefined

The return value for the method call

Deprecated

Use AppManager.getABIReturn instead.

Returns any ABI return values for the given app call arguments and transaction confirmation.

src/app.ts:235


getABIReturnValue(result, type): ABIReturn

Takes an algosdk ABIResult and converts it to an ABIReturn. Converts bigint’s for Uint’s < 64 to number for easier use.

NameTypeDescription
resultABIResultThe ABIReturn
typeABIReturnType-

ABIReturn

src/transaction/transaction.ts:922


getAccount(account, algod, kmdClient?): Promise<Account | SigningAccount>

NameTypeDescription
accountstring | { fundWith?: AlgoAmount ; name: string }The details of the account to get, either the name identifier (string) or an object with: _ name: The name identifier of the account _ fundWith: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account
algodAlgodClientAn algod client
kmdClient?KmdClientAn optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables

Promise<Account | SigningAccount>

The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)

Deprecated

use algorand.account.fromEnvironment() instead

Returns an Algorand account with private key loaded by convention based on the given name identifier.

Note: This function expects to run in a Node.js environment.

  • Non-LocalNet: will load process.env[‘{NAME}_MNEMONIC’] as a mnemonic secret; Note: Be careful how the mnemonic is handled, never commit it into source control and ideally load it via a secret storage service rather than the file system. If process.env[‘{NAME}_SENDER’] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)
  • LocalNet: will load the account from a KMD wallet called {NAME} and if that wallet doesn’t exist it will create it and fund the account for you

This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).

Example

If you have a mnemonic secret loaded into process.env.ACCOUNT_MNEMONIC then you can call the following to get that private key loaded into an account object:

const account = await getAccount('ACCOUNT', algod);

If that code runs against LocalNet then a wallet called ACCOUNT will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.

src/account/get-account.ts:41

getAccount(account, algod, kmdClient?): Promise<Account | SigningAccount>

NameTypeDescription
accountObjectThe details of the account to get, an object with: _ config: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) _ fundWith: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account
account.configAccountConfig-
account.fundWith?AlgoAmount-
algodAlgodClientAn algod client
kmdClient?KmdClientAn optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables

Promise<Account | SigningAccount>

The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)

Deprecated

use algorand.account.fromEnvironment() instead Returns an Algorand account with private key loaded by convention based on the given name identifier.

Note: This function expects to run in a Node.js environment.

Example

If you have a mnemonic secret loaded into process.env.ACCOUNT_MNEMONIC then you can call the following to get that private key loaded into an account object:

const account = await getAccount({ config: getAccountConfigFromEnvironment('ACCOUNT') }, algod);

If that code runs against LocalNet then a wallet called ACCOUNT will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.

src/account/get-account.ts:68


getAccountAddressAsString(addressEncodedInB64): string

NameTypeDescription
addressEncodedInB64stringThe base64 encoded version of the underlying byte array of the address public key

string

Deprecated

Use algosdk.encodeAddress instead.

Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key

src/account/account.ts:128


getAccountAddressAsUint8Array(account): Uint8Array

NameTypeDescription
accountstring | SendTransactionFromEither an account (with private key loaded) or the string address of an account

Uint8Array

Deprecated

Use algosdk.decodeAddress instead.

Returns an account’s address as a byte array

src/account/account.ts:117


getAccountAssetInformation(sender, assetId, algod): Promise<AccountAssetInformation>

NameTypeDescription
senderstring | SendTransactionFromThe address of the sender/account to look up
assetIdnumber | bigintThe ID of the asset to return a holding for
algodAlgodClientThe algod instance

Promise<AccountAssetInformation>

The account asset holding information

Deprecated

Use algorand.asset.getAccountInformation(sender, assetId) or new AssetManager(...).getAccountInformation(sender, assetId) instead.

Returns the given sender account’s asset holding for a given asset.

Example

const address = 'XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA';
const assetId = 123345;
const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);

Response data schema details

src/account/account.ts:201


getAccountConfigFromEnvironment(accountName): AccountConfig

NameTypeDescription
accountNamestringaccount name

AccountConfig

Deprecated

Use algokit.mnemonicAccountFromEnvironment, which doesn’t need this function Returns the Account configuration from environment variables

Example

environment variables
{accountName}_MNEMONIC
{accountName}_SENDER

src/account/get-account-config-from-environment.ts:13


getAccountInformation(sender, algod): Promise<AccountInformation>

NameTypeDescription
senderstring | SendTransactionFromThe address of the sender/account to look up
algodAlgodClientThe algod instance

Promise<AccountInformation>

The account information

Deprecated

Use algorand.account.getInformation(sender) or new AccountManager(clientManager).getInformation(sender) instead.

Returns the given sender account’s current status, balance and spendable amounts.

Example

const address = 'XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA';
const accountInfo = await account.getInformation(address, algod);

Response data schema details

src/account/account.ts:156


getAlgoClient(config?): Algodv2

NameTypeDescription
config?AlgoClientConfigThe config if you want to override the default (getting config from process.env)

Algodv2

Deprecated

Use ClientManager.getAlgodClient(config) or ClientManager.getAlgodClientFromEnvironment() instead.

Returns an algod SDK client that automatically retries transient failures on idempotent calls

Example

// Uses process.env.ALGOD_SERVER, process.env.ALGOD_PORT and process.env.ALGOD_TOKEN
// Automatically detects if you are using PureStake to switch in the right header name for ALGOD_TOKEN
const algod = getAlgoClient();
await algod.healthCheck().do();

Example

const algod = getAlgoClient(getAlgoNodeConfig('testnet', 'algod'));
await algod.healthCheck().do();

Example

const algod = getAlgoClient(getAlgoNodeConfig('mainnet', 'algod'));
await algod.healthCheck().do();

Example

const algod = getAlgoClient({
server: 'http://localhost',
port: '4001',
token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
});
await algod.healthCheck().do();

src/network-client.ts:88


getAlgoIndexerClient(config?): Indexer

NameTypeDescription
config?AlgoClientConfigThe config if you want to override the default (getting config from process.env)

Indexer

Deprecated

Use ClientManager.getIndexerClient(config, overrideIntDecoding) or ClientManager.getIndexerClientFromEnvironment(overrideIntDecoding) instead.

Returns an indexer SDK client that automatically retries transient failures on idempotent calls

Example

// Uses process.env.INDEXER_SERVER, process.env.INDEXER_PORT and process.env.INDEXER_TOKEN
const indexer = getAlgoIndexerClient();
await indexer.makeHealthCheck().do();

Example

const indexer = getAlgoIndexerClient(getAlgoNodeConfig('testnet', 'indexer'));
await indexer.makeHealthCheck().do();

Example

const indexer = getAlgoIndexerClient(getAlgoNodeConfig('mainnet', 'indexer'));
await indexer.makeHealthCheck().do();

Example

const indexer = getAlgoIndexerClient({
server: 'http://localhost',
port: '8980',
token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
});
await indexer.makeHealthCheck().do();

src/network-client.ts:121


getAlgoKmdClient(config?): Kmd

NameTypeDescription
config?AlgoClientConfigThe config if you want to override the default (getting config from process.env)

Kmd

Deprecated

Use ClientManager.getKmdClient(config) or ClientManager.getKmdClientFromEnvironment() instead.

Returns a KMD SDK client that automatically retries transient failures on idempotent calls.

KMD client allows you to export private keys, which is useful to get the default account in a LocalNet network.

Example

// Uses process.env.ALGOD_SERVER, process.env.KMD_PORT (or if not specified: port 4002) and process.env.ALGOD_TOKEN
const kmd = getAlgoKmdClient();

Example

const kmd = getAlgoKmdClient({
server: 'http://localhost',
port: '4002',
token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
});

src/network-client.ts:144


getAlgoNodeConfig(network, config): AlgoClientConfig

NameTypeDescription
network"testnet" | "mainnet"Which network to connect to - TestNet or MainNet
config"algod" | "indexer"Which algod config to return - Algod or Indexer

AlgoClientConfig

Deprecated

Use ClientManager.getAlgoNodeConfig(network, config) instead.

Returns the Algorand configuration to point to the AlgoNode service

src/network-client.ts:43


getAlgodConfigFromEnvironment(): AlgoClientConfig

AlgoClientConfig

Deprecated

Use ClientManager.getAlgodConfigFromEnvironment() instead.

Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment not algod-side)

src/network-client.ts:22


getAppArgsForABICall(args, from): Promise<{ appAccounts: undefined | string[] ; appForeignApps: undefined | number[] = args.apps; appForeignAssets: undefined | number[] = args.assets; boxes: undefined | BoxReference[] ; lease: undefined | Uint8Array ; method: ABIMethod ; methodArgs: (string | number | bigint | boolean | Uint8Array | ABIValue[] | TransactionWithSigner)[] = methodArgs; rekeyTo: undefined | string ; sender: string ; signer: TransactionSigner = signer }>

NameTypeDescription
argsABIAppCallArgsThe ABI app call args
fromSendTransactionFromThe transaction signer

Promise<{ appAccounts: undefined | string[] ; appForeignApps: undefined | number[] = args.apps; appForeignAssets: undefined | number[] = args.assets; boxes: undefined | BoxReference[] ; lease: undefined | Uint8Array ; method: ABIMethod ; methodArgs: (string | number | bigint | boolean | Uint8Array | ABIValue[] | TransactionWithSigner)[] = methodArgs; rekeyTo: undefined | string ; sender: string ; signer: TransactionSigner = signer }>

The parameters ready to pass into addMethodCall within AtomicTransactionComposer

Deprecated

Use TransactionComposer methods to construct transactions instead.

Returns the app args ready to load onto an ABI method call in AtomicTransactionComposer

src/app.ts:378


getAppArgsForTransaction(args?): undefined | { accounts: undefined | string[] ; appArgs: undefined | Uint8Array[] ; boxes: undefined | BoxReference[] ; foreignApps: undefined | number[] = args.apps; foreignAssets: undefined | number[] = args.assets; lease: undefined | Uint8Array }

NameTypeDescription
args?RawAppCallArgsThe app call args

undefined | { accounts: undefined | string[] ; appArgs: undefined | Uint8Array[] ; boxes: undefined | BoxReference[] ; foreignApps: undefined | number[] = args.apps; foreignAssets: undefined | number[] = args.assets; lease: undefined | Uint8Array }

The args ready to load into a Transaction

Deprecated

Use TransactionComposer methods to construct transactions instead.

Returns the app args ready to load onto an app Transaction object

src/app.ts:356


getAppBoxNames(appId, algod): Promise<BoxName[]>

NameTypeDescription
appIdnumber | bigintThe ID of the app return box names for
algodAlgodClientAn algod client instance

Promise<BoxName[]>

The current box names

Deprecated

Use algorand.app.getBoxNames instead. Returns the names of the boxes for the given app.

src/app.ts:276


getAppBoxValue(appId, boxName, algod): Promise<Uint8Array>

NameTypeDescription
appIdnumber | bigintThe ID of the app return box names for
boxNamestring | Uint8Array | BoxNameThe name of the box to return either as a string, binary array or BoxName
algodAlgodClientAn algod client instance

Promise<Uint8Array>

The current box value as a byte array

Deprecated

Use algorand.app.getBoxValue instead. Returns the value of the given box name for the given app.

src/app.ts:288


getAppBoxValueFromABIType(request, algod): Promise<ABIValue>

NameTypeDescription
requestBoxValueRequestParamsThe parameters for the box value request
algodAlgodClientAn algod client instance

Promise<ABIValue>

The current box value as an ABI value

Deprecated

Use algorand.app.getBoxValueFromABIType instead. Returns the value of the given box name for the given app decoded based on the given ABI type.

src/app.ts:314


getAppBoxValues(appId, boxNames, algod): Promise<Uint8Array[]>

NameTypeDescription
appIdnumberThe ID of the app return box names for
boxNames(string | Uint8Array | BoxName)[]The names of the boxes to return either as a string, binary array or BoxName
algodAlgodClientAn algod client instance

Promise<Uint8Array[]>

The current box values as a byte array in the same order as the passed in box names

Deprecated

Use algorand.app.getBoxValues instead. Returns the value of the given box names for the given app.

src/app.ts:300


getAppBoxValuesFromABIType(request, algod): Promise<ABIValue[]>

NameTypeDescription
requestBoxValuesRequestParamsThe parameters for the box value request
algodAlgodClientAn algod client instance

Promise<ABIValue[]>

The current box values as an ABI value in the same order as the passed in box names

Deprecated

Use algorand.app.getBoxValuesFromABIType instead. Returns the value of the given box names for the given app decoded based on the given ABI type.

src/app.ts:329


getAppById(appId, algod): Promise<Application>

NameTypeDescription
appIdnumber | bigintThe id of the app
algodAlgodClientAn algod client

Promise<Application>

The data about the app

Deprecated

Use algorand.app.getById instead.

Gets the current data for the given app from algod.

src/app.ts:406


getAppClient(appDetails, algod): ApplicationClient

NameTypeDescription
appDetailsAppSpecAppDetailsThe details of the app
algodAlgodClientAn algod instance

ApplicationClient

The application client

Deprecated

Use AppClient instead e.g. via algorand.client.getAppClientById or algorand.client.getAppClientByCreatorAndName. If you want to create or deploy then use AppFactory e.g. via algorand.client.getAppFactory, which will in turn give you an AppClient instance against the created/deployed app to make other calls.

Create a new ApplicationClient instance

Example

Resolve by creator and name
const client = algokit.getAppClient(
{
resolveBy: 'creatorAndName',
app: {appSpec},
sender: {account},
creatorAddress: {creator},
findExistingUsing: indexerClient,
},
algodClient,
)

Example

Resolve by id:
const client = algokit.getAppClient(
{
resolveBy: 'id',
app: {appSpec},
sender: {account},
id: {id},
},
algodClient,
)

src/app-client.ts:40


getAppClientByCreatorAndName(appDetails, algod): ApplicationClient

NameTypeDescription
appDetailsAppSpecAppDetailsByCreatorAndNameThe details of the app by creator and name
algodAlgodClientAn algod instance

ApplicationClient

The application client

Deprecated

Use AppClient instead e.g. via algorand.client.getAppClientByCreatorAndName. If you want to create or deploy then use AppFactory e.g. via algorand.client.getAppFactory, which will in turn give you an AppClient instance against the created/deployed app to make other calls.

Create a new ApplicationClient instance by creator and name

Example

const client = algokit.getAppClientByCreatorAndName(
{
app: appSpec,
sender: account,
creatorAddress: account,
findExistingUsing: indexerClient,
},
algodClient,
);

src/app-client.ts:93


getAppClientById(appDetails, algod): ApplicationClient

NameTypeDescription
appDetailsAppSpecAppDetailsByIdThe details of the app
algodAlgodClientAn algod instance

ApplicationClient

The application client

Deprecated

Use AppClient instead e.g. via algorand.client.getAppClientById. If you want to create or deploy then use AppFactory e.g. via algorand.client.getAppFactory, which will in turn give you an AppClient instance against the created/deployed app to make other calls.

Create a new ApplicationClient instance by id

Example

const client = algokit.getAppClientById(
{
app: { appSpec },
sender: { account },
id: { id },
},
algodClient,
);

src/app-client.ts:66


getAppDeploymentTransactionNote(metadata): Arc2TransactionNote

NameTypeDescription
metadataAppDeployMetadataThe metadata of the deployment

Arc2TransactionNote

The transaction note as a utf-8 string

Deprecated

Use { dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' } instead.

Return the transaction note for an app deployment.

src/app-deploy.ts:271


getAppGlobalState(appId, algod): Promise<AppState>

NameTypeDescription
appIdnumber | bigintThe ID of the app return global state for
algodAlgodClientAn algod client instance

Promise<AppState>

The current global state

Deprecated

Use algorand.app.getGlobalState instead.

Returns the current global state values for the given app ID

src/app.ts:252


getAppLocalState(appId, account, algod): Promise<AppState>

NameTypeDescription
appIdnumber | bigintThe ID of the app return global state for
accountstring | SendTransactionFromEither the string address of an account or an account object for the account to get local state for the given app
algodAlgodClientAn algod client instance

Promise<AppState>

The current local state for the given (app, account) combination

Deprecated

Use algorand.app.getLocalState instead.

Returns the current global state values for the given app ID and account

src/app.ts:265


getAppOnCompleteAction(onCompletionAction?): OnApplicationComplete

NameTypeDescription
onCompletionAction?AppCallType | OnApplicationCompleteThe on completion action

OnApplicationComplete

The algosdk.OnApplicationComplete

Deprecated

Use algosdk.OnApplicationComplete directly instead.

Returns a algosdk.OnApplicationComplete for the given onCompleteAction.

If given undefined will return OnApplicationComplete.NoOpOC.

If given an AppCallType will convert the string enum to the correct underlying algosdk.OnApplicationComplete.

src/app.ts:154


getAtomicTransactionComposerTransactions(atc): TransactionWithSigner[]

NameTypeDescription
atcAtomicTransactionComposerThe atomic transaction composer

TransactionWithSigner[]

The array of transactions with signers

Deprecated

Use atc.clone().buildGroup() instead.

Returns the array of transactions currently present in the given AtomicTransactionComposer

src/transaction/transaction.ts:1132


getBoxReference(box): algosdk.BoxReference

NameTypeDescription
boxBoxReference | BoxIdentifier | BoxReferenceThe box to return a reference for

algosdk.BoxReference

The box reference ready to pass into a Transaction

Deprecated

Use AppManager.getBoxReference() instead.

Returns a algosdk.BoxReference given a BoxIdentifier or BoxReference.

src/app.ts:389


getConfigFromEnvOrDefaults(): AlgoConfig

AlgoConfig

Deprecated

Use ClientManager.getConfigFromEnvironmentOrLocalNet() instead.

Retrieve configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment not algod-side)

src/network-client.ts:13


getCreatorAppsByName(creatorAccount, indexer): Promise<AppLookup>

NameTypeDescription
creatorAccountstring | SendTransactionFromThe account (with private key loaded) or string address of an account that is the creator of the apps you want to search for
indexerIndexerClientAn indexer client

Promise<AppLookup>

A name-based lookup of the app information (id, address)

Deprecated

Use algorand.appDeployer.getCreatorAppsByName instead.

Returns a lookup of name => app metadata (id, address, …metadata) for all apps created by the given account that have an AppDeployNote in the transaction note of the creation transaction.

Note: It’s recommended this is only called once and then stored since it’s a somewhat expensive operation (multiple indexer calls).

src/app-deploy.ts:244


getDefaultLocalNetConfig(configOrPort): AlgoClientConfig

NameTypeDescription
configOrPortnumber | "algod" | "indexer" | "kmd"Which algod config to return - algod, kmd, or indexer OR a port number

AlgoClientConfig

Deprecated

Use ClientManager.getDefaultLocalNetConfig(configOrPort) instead.

Returns the Algorand configuration to point to the default LocalNet

src/network-client.ts:54


getDispenserAccount(algod, kmd?): Promise<Address & TransactionSignerAccount & { account: SigningAccount }>

NameTypeDescription
algodAlgodClientAn algod client
kmd?KmdClientA KMD client, if not specified then a default KMD client will be loaded from environment variables

Promise<Address & TransactionSignerAccount & { account: SigningAccount }>

Deprecated

Use algorand.account.dispenserFromEnvironment() or new AccountManager(clientManager).dispenserFromEnvironment() instead

Returns an account (with private key loaded) that can act as a dispenser

If running on LocalNet then it will return the default dispenser account automatically, otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC

src/account/get-dispenser-account.ts:19


getIndexerConfigFromEnvironment(): AlgoClientConfig

AlgoClientConfig

Deprecated

Use ClientManager.getIndexerConfigFromEnvironment() instead.

Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment not algod-side)

src/network-client.ts:31


getKmdWalletAccount(walletAccount, algod, kmdClient?): Promise<Account | undefined>

NameTypeDescription
walletAccountObjectThe details of the wallet, with: _ name: The name of the wallet to retrieve an account from _ predicate: An optional filter to use to find the account (otherwise it will return a random account from the wallet)
walletAccount.namestring-
walletAccount.predicate?(account: Record<string, any>) => boolean-
algodAlgodClientAn algod client
kmdClient?KmdClientA KMD client, if not specified then a default KMD client will be loaded from environment variables

Promise<Account | undefined>

Deprecated

use algorand.account.kmd.getWalletAccount(name, predicate) or new KMDAccountManager(clientManager).getWalletAccount(name, predicate) instead.

Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).

Example

const defaultDispenserAccount = await getKmdWalletAccount(
algod,
'unencrypted-default-wallet',
a => a.status !== 'Offline' && a.amount > 1_000_000_000,
);

src/localnet/get-kmd-wallet-account.ts:27


getLocalNetDispenserAccount(algod, kmd?): Promise<Account>

NameTypeDescription
algodAlgodClientAn algod client
kmd?KmdClientA KMD client, if not specified then a default KMD client will be loaded from environment variables

Promise<Account>

Deprecated

Use algorand.account.kmd.getLocalNetDispenserAccount() instead.

Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)

src/localnet/get-localnet-dispenser-account.ts:15


getOrCreateKmdWalletAccount(walletAccount, algod, kmdClient?): Promise<Account>

NameTypeDescription
walletAccountObjectThe wallet details with: _ name: The name of the wallet to retrieve / create _ fundWith: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
walletAccount.fundWith?AlgoAmount-
walletAccount.namestring-
algodAlgodClientAn algod client
kmdClient?KmdClientA KMD client, if not specified then a default KMD client will be loaded from environment variables

Promise<Account>

An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you

Deprecated

use algorand.account.kmd.getOrCreateWalletAccount(name, fundWith) or new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith) instead.

Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.

This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).

This significantly speeds up local dev time and improves experience since you can write code that just works first go without manual config in a fresh LocalNet.

If this is used via mnemonicAccountFromEnvironment, then you can even use the same code that runs on production without changes for local development!

src/localnet/get-or-create-kmd-wallet-account.ts:28


getSenderAddress(sender): string

NameTypeDescription
senderstring | SendTransactionFromA transaction sender

string

The public address

Deprecated

Use algorand.client to interact with accounts, and use .addr to get the address and/or move from using SendTransactionFrom to TransactionSignerAccount and use .addr instead.

Returns the public address of the given transaction sender.

src/transaction/transaction.ts:116


getSenderTransactionSigner(val): TransactionSigner

NameType
valSendTransactionFrom

TransactionSigner

A transaction signer

Deprecated

Use TransactionSignerAccount instead of SendTransactionFrom or use algosdk.makeBasicAccountTransactionSigner / algosdk.makeLogicSigAccountTransactionSigner.

Returns a TransactionSigner for the given transaction sender. This function has memoization, so will return the same transaction signer for a given sender.

src/transaction/transaction.ts:174


getTestNetDispenserApiClient(params?): TestNetDispenserApiClient

NameTypeDefault valueDescription
paramsnull | TestNetDispenserApiClientParamsnullAn object containing parameters for the TestNetDispenserApiClient class. Or null if you want the client to load the access token from the environment variable ALGOKIT_DISPENSER_ACCESS_TOKEN.

TestNetDispenserApiClient

An instance of the TestNetDispenserApiClient class.

Deprecated

Use clientManager.getTestNetDispenser or clientManager.getTestNetDispenserFromEnvironment instead

Create a new TestNetDispenserApiClient instance. Refer to docs on guidance to obtain an access token.

Example

const client = algokit.getTestNetDispenserApiClient({
authToken: 'your_auth_token',
requestTimeout: 15,
});

src/dispenser-client.ts:21


getTransactionParams(params, algod): Promise<SuggestedParams>

NameTypeDescription
paramsundefined | SuggestedParamsOptionally provide parameters to use
algodAlgodClientAlgod algod

Promise<SuggestedParams>

The suggested transaction parameters

Deprecated

Use suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do() instead

Returns suggested transaction parameters from algod unless some are already provided.

src/transaction/transaction.ts:1110


getTransactionWithSigner(transaction, defaultSender?): Promise<TransactionWithSigner>

NameTypeDescription
transactionTransaction | TransactionToSign | Promise<SendTransactionResult> | TransactionWithSignerOne of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils’ helpers (signer is obtained from the defaultSender parameter)
defaultSender?SendTransactionFromThe default sender to be used to obtain a signer where the object provided to the transaction parameter does not include a signer.

Promise<TransactionWithSigner>

A TransactionWithSigner object.

Deprecated

Use AlgorandClient / TransactionComposer to construct transactions instead or construct an algosdk.TransactionWithSigner manually instead.

Given a transaction in a variety of supported formats, returns a TransactionWithSigner object ready to be passed to an AtomicTransactionComposer’s addTransaction method.

src/transaction/transaction.ts:133


isLocalNet(algod): Promise<boolean>

NameType
algodAlgodClient

Promise<boolean>

Deprecated

Use await algorand.client.isLocalNet() or await new ClientManager({ algod }).isLocalNet() instead.

Returns true if the algod client is pointing to a LocalNet Algorand network

src/localnet/is-localnet.ts:9


isMainNet(algod): Promise<boolean>

NameType
algodAlgodClient

Promise<boolean>

Deprecated

Use await algorand.client.isMainNet() or await new ClientManager({ algod }).isMainNet() instead.

src/network-client.ts:154


isSchemaIsBroken(before, after): boolean

NameTypeDescription
beforeApplicationStateSchemaThe existing schema
afterApplicationStateSchemaThe new schema

boolean

Whether or not there is a breaking change

Deprecated

Use before.numByteSlice < after.numByteSlice || before.numUint < after.numUint instead.

Returns true is there is a breaking change in the application state schema from before to after. i.e. if the schema becomes larger, since applications can’t ask for more schema after creation. Otherwise, there is no error, the app just doesn’t store data in the extra schema :(

src/app-deploy.ts:229


isTestNet(algod): Promise<boolean>

NameType
algodAlgodClient

Promise<boolean>

Deprecated

Use await algorand.client.isTestNet() or await new ClientManager({ algod }).isTestNet() instead.

src/network-client.ts:149


microAlgo(microAlgos): AlgoAmount

Returns an amount of µAlgo using AlgoAmount

NameTypeDescription
microAlgosnumber | bigintThe amount of µAlgo

AlgoAmount

src/amount.ts:82


microAlgos(microAlgos): AlgoAmount

Returns an amount of µAlgo using AlgoAmount

NameTypeDescription
microAlgosnumber | bigintThe amount of µAlgo

AlgoAmount

src/amount.ts:75


mnemonicAccount(mnemonicSecret): Account

NameTypeDescription
mnemonicSecretstringThe mnemonic secret representing the private key of an account; Note: Be careful how the mnemonic is handled, never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.

Account

Deprecated

Use algorand.account.fromMnemonic(mnemonicSecret) or algosdk.mnemonicToSecretKey(mnemonicSecret) instead.

Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.

This is a wrapper around algosdk.mnemonicToSecretKey to provide a more friendly/obvious name.

src/account/mnemonic-account.ts:14


mnemonicAccountFromEnvironment(account, algod, kmdClient?): Promise<Account | SigningAccount>

NameTypeDescription
accountstring | { fundWith?: AlgoAmount ; name: string }The details of the account to get, either the name identifier (string) or an object with: _ name: string: The name identifier of the account _ fundWith: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account
algodAlgodClientAn algod client
kmdClient?KmdClientAn optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables

Promise<Account | SigningAccount>

The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)

Deprecated

Use algorand.account.fromEnvironment(name, fundWith) or new AccountManager(clientManager).fromEnvironment() instead.

Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.

Note: This function expects to run in a Node.js environment.

  • Non-LocalNet: will load process.env[‘{NAME}_MNEMONIC’] as a mnemonic secret; Note: Be careful how the mnemonic is handled, never commit it into source control and ideally load it via a secret storage service rather than the file system. If process.env[‘{NAME}_SENDER’] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)
  • LocalNet: will load the account from a KMD wallet called {NAME} and if that wallet doesn’t exist it will create it and fund the account for you

This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).

Example

If you have a mnemonic secret loaded into process.env.MY_ACCOUNT_MNEMONIC then you can call the following to get that private key loaded into an account object:

const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod);

If that code runs against LocalNet then a wallet called MY_ACCOUNT will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser. If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.

src/account/account.ts:97


multisigAccount(multisigParams, signingAccounts): MultisigAccount

NameTypeDescription
multisigParamsMultisigMetadataThe parameters that define the multisig account
signingAccounts(default | SigningAccount)[]The signers that are currently present

MultisigAccount

A multisig account wrapper

Deprecated

Use algorand.account.multisig(multisigParams, signingAccounts) or new MultisigAccount(multisigParams, signingAccounts) instead.

Returns an account wrapper that supports partial or full multisig signing.

src/account/account.ts:24


performAtomicTransactionComposerSimulate(atc, algod, options?): Promise<SimulateResponse>

Performs a simulation of the transactions loaded into the given AtomicTransactionComposer. Uses empty transaction signers for all transactions.

NameTypeDescription
atcAtomicTransactionComposerThe AtomicTransactionComposer with transaction(s) loaded.
algodAlgodClientAn Algod client to perform the simulation.
options?Omit<{ allowEmptySignatures?: boolean ; allowMoreLogging?: boolean ; allowUnnamedResources?: boolean ; execTraceConfig?: SimulateTraceConfig ; extraOpcodeBudget?: number | bigint ; fixSigners?: boolean ; round?: number | bigint ; txnGroups: SimulateRequestTransactionGroup[] }, "txnGroups">-

Promise<SimulateResponse>

The simulation result, which includes various details about how the transactions would be processed.

src/transaction/perform-atomic-transaction-composer-simulate.ts:14


performTemplateSubstitution(tealCode, templateParams?): string

NameTypeDescription
tealCodestringThe TEAL logic to compile
templateParams?TealTemplateParamsAny parameters to replace in the .teal file before compiling

string

The TEAL code with replacements

Deprecated

Use AppManager.replaceTealTemplateParams instead

Performs template substitution of a teal file.

Looks for TMPL_{parameter} for template replacements.

src/app-deploy.ts:309


performTemplateSubstitutionAndCompile(tealCode, algod, templateParams?, deploymentMetadata?): Promise<CompiledTeal>

NameTypeDescription
tealCodestringThe TEAL logic to compile
algodAlgodClientAn algod client
templateParams?TealTemplateParamsAny parameters to replace in the .teal file before compiling
deploymentMetadata?AppDeployMetadataThe deployment metadata the app will be deployed with

Promise<CompiledTeal>

The information about the compiled code

Deprecated

Use algorand.appManager.compileTealTemplate instead.

Performs template substitution of a teal file and compiles it, returning the compiled result.

Looks for TMPL_{parameter} for template replacements.

src/app-deploy.ts:326


persistSourceMaps(_params): Promise<void>

NameType
_paramsunknown

Promise<void>

A promise that resolves when the source maps have been persisted.

Deprecated

Use latest version of AlgoKit AVM Debugger VSCode extension instead. It will automatically manage your sourcemaps.

This function persists the source maps for the given sources.

src/debugging/debugging.ts:8


populateAppCallResources(atc, algod): Promise<AtomicTransactionComposer>

Take an existing Atomic Transaction Composer and return a new one with the required app call resources populated into it

NameTypeDescription
atcAtomicTransactionComposerThe ATC containing the txn group
algodAlgodClientThe algod client to use for the simulation

Promise<AtomicTransactionComposer>

A new ATC with the resources populated into the transactions

src/transaction/transaction.ts:388


prepareGroupForSending(atc, algod, sendParams, additionalAtcContext?): Promise<AtomicTransactionComposer>

Take an existing Atomic Transaction Composer and return a new one with changes applied to the transactions based on the supplied sendParams to prepare it for sending. Please note, that before calling .execute() on the returned ATC, you must call .buildGroup().

NameTypeDescription
atcAtomicTransactionComposerThe ATC containing the txn group
algodAlgodClientThe algod client to use for the simulation
sendParamsSendParamsThe send params for the transaction group
additionalAtcContext?AdditionalAtomicTransactionComposerContextAdditional ATC context used to determine how best to change the transactions in the group

Promise<AtomicTransactionComposer>

A new ATC with the changes applied

src/transaction/transaction.ts:407


randomAccount(): Account

Account

Deprecated

Use algorand.account.random() or algosdk.generateAccount() instead.

Returns a new, random Algorand account with secret key loaded.

This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.

src/account/account.ts:60


rekeyAccount(rekey, algod): Promise<SendTransactionResult>

NameTypeDescription
rekeyAlgoRekeyParamsThe rekey definition
algodAlgodClientAn algod client

Promise<SendTransactionResult>

The transaction object and optionally the confirmation if it was sent to the chain (skipSending is false or unset)

Deprecated

Use algorand.account.rekeyAccount() instead

Rekey an account to a new address.

Note: Please be careful with this function and be sure to read the official rekey guidance.

Example

await algokit.rekeyAccount({ from, rekeyTo }, algod);

src/transfer/transfer.ts:125


rekeyedAccount(signer, sender): SigningAccount

NameTypeDescription
signerdefaultThe account, with private key loaded, that is signing
senderstringThe address of the rekeyed account that will act as a sender

SigningAccount

The SigningAccount wrapper

Deprecated

Use algorand.account.rekeyed(sender, account) or new SigningAccount(account, sender) instead.

Returns an account wrapper that supports a rekeyed account.

src/account/account.ts:36


replaceDeployTimeControlParams(tealCode, params): string

NameTypeDescription
tealCodestringThe TEAL code to substitute
paramsObjectThe deploy-time deployment control parameter value to replace
params.deletable?boolean-
params.updatable?boolean-

string

The replaced TEAL code

Deprecated

Use AppManager.replaceTealTemplateDeployTimeControlParams instead

Replaces deploy-time deployment control parameters within the given teal code.

  • TMPL_UPDATABLE for updatability / immutability control
  • TMPL_DELETABLE for deletability / permanence control

Note: If these values are not undefined, but the corresponding TMPL_* value isn’t in the teal code it will throw an exception.

src/app-deploy.ts:294


sendAtomicTransactionComposer(atcSend, algod): Promise<SendAtomicTransactionComposerResults>

Signs and sends transactions that have been collected by an AtomicTransactionComposer.

NameTypeDescription
atcSendAtomicTransactionComposerToSendThe parameters controlling the send, including atc The AtomicTransactionComposer and params to control send behaviour
algodAlgodClientAn algod client

Promise<SendAtomicTransactionComposerResults>

An object with transaction IDs, transactions, group transaction ID (groupTransactionId) if more than 1 transaction sent, and (if skipWaiting is false or unset) confirmation (confirmation)

src/transaction/transaction.ts:782


sendGroupOfTransactions(groupSend, algod): Promise<Omit<SendAtomicTransactionComposerResults, "returns">>

NameTypeDescription
groupSendTransactionGroupToSendThe group details to send, with: _ transactions: The array of transactions to send along with their signing account _ sendParams: The parameters to dictate how the group is sent
algodAlgodClientAn algod client

Promise<Omit<SendAtomicTransactionComposerResults, "returns">>

An object with transaction IDs, transactions, group transaction ID (groupTransactionId) if more than 1 transaction sent, and (if skipWaiting is false or unset) confirmation (confirmation)

Deprecated

Use TransactionComposer (algorand.newGroup()) or AtomicTransactionComposer to construct and send group transactions instead.

Signs and sends a group of up to 16 transactions to the chain

src/transaction/transaction.ts:955


sendTransaction(send, algod): Promise<SendTransactionResult>

NameTypeDescription
sendObjectThe details for the transaction to prepare/send, including: _ transaction: The unsigned transaction _ from: The account to sign the transaction with: either an account with private key loaded or a logic signature account * config: The sending configuration for this transaction
send.fromSendTransactionFrom-
send.sendParams?SendTransactionParams-
send.transactionTransaction-
algodAlgodClientAn algod client

Promise<SendTransactionResult>

An object with transaction (transaction) and (if skipWaiting is false or undefined) confirmation (confirmation)

Deprecated

Use AlgorandClient / TransactionComposer to send transactions.

Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain.

src/transaction/transaction.ts:215


signTransaction(transaction, signer): Promise<Uint8Array>

NameTypeDescription
transactionTransactionThe transaction to sign
signerSendTransactionFromThe signer to sign

Promise<Uint8Array>

The signed transaction as a Uint8Array

Deprecated

Use AlgorandClient / TransactionComposer to sign transactions or use the relevant underlying account.signTxn / algosdk.signLogicSigTransactionObject / multiSigAccount.sign / TransactionSigner methods directly.

Signs a single transaction by the given signer.

src/transaction/transaction.ts:192


stripTealComments(tealCode): string

NameTypeDescription
tealCodestringThe TEAL logic to compile

string

The TEAL without comments

Deprecated

Use AppManager.stripTealComments instead.

Remove comments from TEAL Code

src/app-deploy.ts:351


transactionFees(numberOfTransactions): AlgoAmount

Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount

NameTypeDescription
numberOfTransactionsnumberThe of standard transaction fees to return the amount of Algo

AlgoAmount

src/amount.ts:89


transactionSignerAccount(signer, sender): TransactionSignerAccount

NameTypeDescription
signerTransactionSignerThe transaction signer
senderstringThe address of sender account

TransactionSignerAccount

The SigningAccount wrapper

Deprecated

Use algorand.account.getSigner(sender) (after previously registering the signer with setSigner) or { addr: sender, signer } instead.

Returns an account wrapper that supports a transaction signer with associated sender address.

src/account/account.ts:48


transferAlgos(transfer, algod): Promise<SendTransactionResult>

NameTypeDescription
transferAlgoTransferParamsThe transfer definition
algodAlgodClientAn algod client

Promise<SendTransactionResult>

The transaction object and optionally the confirmation if it was sent to the chain (skipSending is false or unset)

Deprecated

Use algorand.send.payment() / algorand.createTransaction.payment() instead

Transfer Algo between two accounts.

Example

await algokit.transferAlgos({ from, to, amount: algokit.algo(1) }, algod);

src/transfer/transfer-algos.ts:22


transferAsset(transfer, algod): Promise<SendTransactionResult>

NameTypeDescription
transferTransferAssetParamsThe transfer definition
algodAlgodClientAn algod client

Promise<SendTransactionResult>

The transaction object and optionally the confirmation if it was sent to the chain (skipSending is false or unset)

Deprecated

Use algorand.send.assetTransfer() / algorand.createTransaction.assetTransfer() instead

Transfer asset between two accounts.

Example

await algokit.transferAsset({ from, to, assetId, amount }, algod);

src/transfer/transfer.ts:90


updateApp(update, algod): Promise<Partial<AppCompilationResult> & AppCallTransactionResult>

NameTypeDescription
updateUpdateAppParamsThe parameters to update the app with
algodAlgodClientAn algod client

Promise<Partial<AppCompilationResult> & AppCallTransactionResult>

The transaction send result and the compilation result

Deprecated

Use algorand.send.appUpdate() / algorand.createTransaction.appUpdate() / algorand.send.appUpdateMethodCall() / algorand.createTransaction.appUpdateMethodCall() instead

Updates a smart contract app.

src/app.ts:104


waitForConfirmation(transactionId, maxRoundsToWait, algod): Promise<PendingTransactionResponse>

Wait until the transaction is confirmed or rejected, or until timeout number of rounds have passed.

NameTypeDescription
transactionIdstringThe transaction ID to wait for
maxRoundsToWaitnumber | bigintMaximum number of rounds to wait
algodAlgodClientAn algod client

Promise<PendingTransactionResponse>

Pending transaction information

Throws

Throws an error if the transaction is not confirmed or rejected in the next timeout rounds

src/transaction/transaction.ts:999