Skip to content

ApplicationClient

Defined in: algokit-utils-ts/src/types/app-client.ts:1798

new ApplicationClient(appDetails, algod): ApplicationClient

Defined in: algokit-utils-ts/src/types/app-client.ts:1825

AppSpecAppDetails

The details of the app

AlgodClient

An algod instance

ApplicationClient

call(call?): Promise<AppCallTransactionResult>

Defined in: algokit-utils-ts/src/types/app-client.ts:2148

AppClientCallParams

The call details.

Promise<AppCallTransactionResult>

The result of the call


callOfType(call?, callType): Promise<AppCallTransactionResult>

Defined in: algokit-utils-ts/src/types/app-client.ts:2230

AppClientCallParams = {}

The call details.

NoOpOC | OptInOC | CloseOutOC | ClearStateOC | DeleteApplicationOC | "no_op" | "opt_in" | "close_out" | "clear_state" | "delete_application"

The call type

Promise<AppCallTransactionResult>

The result of the call


clearState(call?): Promise<AppCallTransactionResult>

Defined in: algokit-utils-ts/src/types/app-client.ts:2207

AppClientClearStateParams

The call details.

Promise<AppCallTransactionResult>

The result of the call


closeOut(call?): Promise<AppCallTransactionResult>

Defined in: algokit-utils-ts/src/types/app-client.ts:2196

AppClientCallParams

The call details.

Promise<AppCallTransactionResult>

The result of the call


compile(compilation?): Promise<{ approvalCompiled: CompiledTeal; clearCompiled: CompiledTeal; }>

Defined in: algokit-utils-ts/src/types/app-client.ts:1864

AppClientCompilationParams

The deploy-time parameters for the compilation

Promise<{ approvalCompiled: CompiledTeal; clearCompiled: CompiledTeal; }>

The compiled approval and clear state programs


create(create?): Promise<{ appAddress: string; appId: number | bigint; compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation?: PendingTransactionResponse; confirmations?: PendingTransactionResponse[]; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; }>

Defined in: algokit-utils-ts/src/types/app-client.ts:2043

AppClientCreateParams

The parameters to create the app with

Promise<{ appAddress: string; appId: number | bigint; compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation?: PendingTransactionResponse; confirmations?: PendingTransactionResponse[]; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; }>

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


delete(call?): Promise<AppCallTransactionResult>

Defined in: algokit-utils-ts/src/types/app-client.ts:2218

AppClientCallParams

The call details.

Promise<AppCallTransactionResult>

The result of the call


deploy(deploy?): Promise<Partial<AppCompilationResult> & AppMetadata & object | { appAddress: string; appId: number | bigint; compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; createdMetadata: AppDeployMetadata; createdRound: number; deletable?: boolean; deleted: boolean; name: string; operationPerformed: "update" | "create"; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; updatable?: boolean; updatedRound: number; version: string; } | { appAddress: string; appId: number | bigint; compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; createdMetadata: AppDeployMetadata; createdRound: number; deletable?: boolean; deleted: boolean; deleteResult: ConfirmedTransactionResult; deleteReturn?: ABIReturn; name: string; operationPerformed: "replace"; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; updatable?: boolean; updatedRound: number; version: string; }>

Defined in: algokit-utils-ts/src/types/app-client.ts:1932

AppClientDeployParams

Deployment details

Promise<Partial<AppCompilationResult> & AppMetadata & object | { appAddress: string; appId: number | bigint; compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; createdMetadata: AppDeployMetadata; createdRound: number; deletable?: boolean; deleted: boolean; name: string; operationPerformed: "update" | "create"; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; updatable?: boolean; updatedRound: number; version: string; } | { appAddress: string; appId: number | bigint; compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; createdMetadata: AppDeployMetadata; createdRound: number; deletable?: boolean; deleted: boolean; deleteResult: ConfirmedTransactionResult; deleteReturn?: ABIReturn; name: string; operationPerformed: "replace"; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; updatable?: boolean; updatedRound: number; version: string; }>

The metadata and transaction result(s) of the deployment, or just the metadata if it didn’t need to issue transactions


exportSourceMaps(): AppSourceMaps

Defined in: algokit-utils-ts/src/types/app-client.ts:1897

Export the current source maps for the app.

AppSourceMaps

The source maps


exposeLogicError(e, isClear?): Error

Defined in: algokit-utils-ts/src/types/app-client.ts:2552

Takes an error that may include a logic error from a smart contract call and re-exposes the error to include source code information via the source map. This is automatically used within ApplicationClient but if you pass skipSending: true e.g. if doing a group transaction then you can use this in a try/catch block to get better debugging information.

Error

The error to parse

boolean

Whether or not the code was running the clear state program

Error

The new error, or if there was no logic error or source map then the wrapped error with source details


fundAppAccount(fund): Promise<SendTransactionResult | { confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; groupId: string; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; } & object>

Defined in: algokit-utils-ts/src/types/app-client.ts:2269

Funds Algo into the app account for this app.

AlgoAmount | FundAppAccountParams

The parameters for the funding or the funding amount

Promise<SendTransactionResult | { confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; groupId: string; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; } & object>

The result of the funding


getABIMethod(method): ABIMethod | undefined

Defined in: algokit-utils-ts/src/types/app-client.ts:2510

Returns the ABI Method for the given method name string for the app represented by this application client instance

string

Either the name of the method or the ABI method spec definition string

ABIMethod | undefined

The ABI method for the given method


getABIMethodParams(method): ABIMethodParams | undefined

Defined in: algokit-utils-ts/src/types/app-client.ts:2488

string

Either the name of the method or the ABI method spec definition string

ABIMethodParams | undefined

The ABI method params for the given method


getAppReference(): Promise<AppMetadata | AppReference>

Defined in: algokit-utils-ts/src/types/app-client.ts:2522

Promise<AppMetadata | AppReference>

The app reference, or if deployed using the deploy method, the app metadata too


getBoxNames(): Promise<BoxName[]>

Defined in: algokit-utils-ts/src/types/app-client.ts:2325

Returns the names of all current boxes for the current app.

Promise<BoxName[]>

The names of the boxes


getBoxValue(name): Promise<Uint8Array<ArrayBufferLike>>

Defined in: algokit-utils-ts/src/types/app-client.ts:2340

Returns the value of the given box for the current app.

string | Uint8Array<ArrayBufferLike> | BoxName

The name of the box to return either as a string, binary array or BoxName

Promise<Uint8Array<ArrayBufferLike>>

The current box value as a byte array


getBoxValueFromABIType(name, type): Promise<ABIValue>

Defined in: algokit-utils-ts/src/types/app-client.ts:2356

Returns the value of the given box for the current app.

string | Uint8Array<ArrayBufferLike> | BoxName

The name of the box to return either as a string, binary array or BoxName

ABIType

Promise<ABIValue>

The current box value as a byte array


getBoxValues(filter?): Promise<object[]>

Defined in: algokit-utils-ts/src/types/app-client.ts:2372

Returns the values of all current boxes for the current app. Note: This will issue multiple HTTP requests (one per box) and it’s not an atomic operation so values may be out of sync.

(name) => boolean

Optional filter to filter which boxes’ values are returned

Promise<object[]>

The (name, value) pair of the boxes with values as raw byte arrays


getBoxValuesFromABIType(type, filter?): Promise<object[]>

Defined in: algokit-utils-ts/src/types/app-client.ts:2394

Returns the values of all current boxes for the current app decoded using an ABI Type. Note: This will issue multiple HTTP requests (one per box) and it’s not an atomic operation so values may be out of sync.

ABIType

The ABI type to decode the values with

(name) => boolean

Optional filter to filter which boxes’ values are returned

Promise<object[]>

The (name, value) pair of the boxes with values as the ABI Value


getCallArgs(args, sender): Promise<AppCallArgs | undefined>

Defined in: algokit-utils-ts/src/types/app-client.ts:2418

AppClientCallArgs | undefined

The call args specific to this application client

SendTransactionFrom

The sender of this call. Will be used to fetch any default argument values if applicable

Promise<AppCallArgs | undefined>

The call args ready to pass into an app call


getGlobalState(): Promise<AppState>

Defined in: algokit-utils-ts/src/types/app-client.ts:2297

Returns global state for the current app.

Promise<AppState>

The global state


getLocalState(account): Promise<AppState>

Defined in: algokit-utils-ts/src/types/app-client.ts:2311

Returns local state for the given account / account address.

string | SendTransactionFrom

Promise<AppState>

The global state


importSourceMaps(sourceMaps): void

Defined in: algokit-utils-ts/src/types/app-client.ts:1914

Import source maps for the app.

AppSourceMaps

The source maps to import

void


optIn(call?): Promise<AppCallTransactionResult>

Defined in: algokit-utils-ts/src/types/app-client.ts:2185

AppClientCallParams

The call details.

Promise<AppCallTransactionResult>

The result of the call


update(update?): Promise<{ compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation?: PendingTransactionResponse; confirmations?: PendingTransactionResponse[]; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; }>

Defined in: algokit-utils-ts/src/types/app-client.ts:2107

AppClientUpdateParams

The parameters to update the app with

Promise<{ compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation?: PendingTransactionResponse; confirmations?: PendingTransactionResponse[]; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; }>

The transaction send result and the compilation result