ApplicationClient
Defined in: algokit-utils-ts/src/types/app-client.ts:1798
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ApplicationClient(
appDetails,algod):ApplicationClient
Defined in: algokit-utils-ts/src/types/app-client.ts:1825
Parameters
Section titled “Parameters”appDetails
Section titled “appDetails”The details of the app
AlgodClient
An algod instance
Returns
Section titled “Returns”ApplicationClient
Methods
Section titled “Methods”call()
Section titled “call()”call(
call?):Promise<AppCallTransactionResult>
Defined in: algokit-utils-ts/src/types/app-client.ts:2148
Parameters
Section titled “Parameters”The call details.
Returns
Section titled “Returns”Promise<AppCallTransactionResult>
The result of the call
callOfType()
Section titled “callOfType()”callOfType(
call?,callType):Promise<AppCallTransactionResult>
Defined in: algokit-utils-ts/src/types/app-client.ts:2230
Parameters
Section titled “Parameters”AppClientCallParams = {}
The call details.
callType
Section titled “callType”NoOpOC | OptInOC | CloseOutOC | ClearStateOC | DeleteApplicationOC | "no_op" | "opt_in" | "close_out" | "clear_state" | "delete_application"
The call type
Returns
Section titled “Returns”Promise<AppCallTransactionResult>
The result of the call
clearState()
Section titled “clearState()”clearState(
call?):Promise<AppCallTransactionResult>
Defined in: algokit-utils-ts/src/types/app-client.ts:2207
Parameters
Section titled “Parameters”The call details.
Returns
Section titled “Returns”Promise<AppCallTransactionResult>
The result of the call
closeOut()
Section titled “closeOut()”closeOut(
call?):Promise<AppCallTransactionResult>
Defined in: algokit-utils-ts/src/types/app-client.ts:2196
Parameters
Section titled “Parameters”The call details.
Returns
Section titled “Returns”Promise<AppCallTransactionResult>
The result of the call
compile()
Section titled “compile()”compile(
compilation?):Promise<{approvalCompiled:CompiledTeal;clearCompiled:CompiledTeal; }>
Defined in: algokit-utils-ts/src/types/app-client.ts:1864
Parameters
Section titled “Parameters”compilation?
Section titled “compilation?”The deploy-time parameters for the compilation
Returns
Section titled “Returns”Promise<{ approvalCompiled: CompiledTeal; clearCompiled: CompiledTeal; }>
The compiled approval and clear state programs
create()
Section titled “create()”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
Parameters
Section titled “Parameters”create?
Section titled “create?”The parameters to create the app with
Returns
Section titled “Returns”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()
Section titled “delete()”delete(
call?):Promise<AppCallTransactionResult>
Defined in: algokit-utils-ts/src/types/app-client.ts:2218
Parameters
Section titled “Parameters”The call details.
Returns
Section titled “Returns”Promise<AppCallTransactionResult>
The result of the call
deploy()
Section titled “deploy()”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
Parameters
Section titled “Parameters”deploy?
Section titled “deploy?”Deployment details
Returns
Section titled “Returns”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()
Section titled “exportSourceMaps()”exportSourceMaps():
AppSourceMaps
Defined in: algokit-utils-ts/src/types/app-client.ts:1897
Export the current source maps for the app.
Returns
Section titled “Returns”The source maps
exposeLogicError()
Section titled “exposeLogicError()”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.
Parameters
Section titled “Parameters”Error
The error to parse
isClear?
Section titled “isClear?”boolean
Whether or not the code was running the clear state program
Returns
Section titled “Returns”Error
The new error, or if there was no logic error or source map then the wrapped error with source details
fundAppAccount()
Section titled “fundAppAccount()”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.
Parameters
Section titled “Parameters”AlgoAmount | FundAppAccountParams
The parameters for the funding or the funding amount
Returns
Section titled “Returns”Promise<SendTransactionResult | { confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; groupId: string; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; } & object>
The result of the funding
getABIMethod()
Section titled “getABIMethod()”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
Parameters
Section titled “Parameters”method
Section titled “method”string
Either the name of the method or the ABI method spec definition string
Returns
Section titled “Returns”ABIMethod | undefined
The ABI method for the given method
getABIMethodParams()
Section titled “getABIMethodParams()”getABIMethodParams(
method):ABIMethodParams|undefined
Defined in: algokit-utils-ts/src/types/app-client.ts:2488
Parameters
Section titled “Parameters”method
Section titled “method”string
Either the name of the method or the ABI method spec definition string
Returns
Section titled “Returns”ABIMethodParams | undefined
The ABI method params for the given method
getAppReference()
Section titled “getAppReference()”getAppReference():
Promise<AppMetadata|AppReference>
Defined in: algokit-utils-ts/src/types/app-client.ts:2522
Returns
Section titled “Returns”Promise<AppMetadata | AppReference>
The app reference, or if deployed using the deploy method, the app metadata too
getBoxNames()
Section titled “getBoxNames()”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.
Returns
Section titled “Returns”Promise<BoxName[]>
The names of the boxes
getBoxValue()
Section titled “getBoxValue()”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.
Parameters
Section titled “Parameters”string | Uint8Array<ArrayBufferLike> | BoxName
The name of the box to return either as a string, binary array or BoxName
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
The current box value as a byte array
getBoxValueFromABIType()
Section titled “getBoxValueFromABIType()”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.
Parameters
Section titled “Parameters”string | Uint8Array<ArrayBufferLike> | BoxName
The name of the box to return either as a string, binary array or BoxName
ABIType
Returns
Section titled “Returns”Promise<ABIValue>
The current box value as a byte array
getBoxValues()
Section titled “getBoxValues()”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.
Parameters
Section titled “Parameters”filter?
Section titled “filter?”(name) => boolean
Optional filter to filter which boxes’ values are returned
Returns
Section titled “Returns”Promise<object[]>
The (name, value) pair of the boxes with values as raw byte arrays
getBoxValuesFromABIType()
Section titled “getBoxValuesFromABIType()”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.
Parameters
Section titled “Parameters”ABIType
The ABI type to decode the values with
filter?
Section titled “filter?”(name) => boolean
Optional filter to filter which boxes’ values are returned
Returns
Section titled “Returns”Promise<object[]>
The (name, value) pair of the boxes with values as the ABI Value
getCallArgs()
Section titled “getCallArgs()”getCallArgs(
args,sender):Promise<AppCallArgs|undefined>
Defined in: algokit-utils-ts/src/types/app-client.ts:2418
Parameters
Section titled “Parameters”AppClientCallArgs | undefined
The call args specific to this application client
sender
Section titled “sender”The sender of this call. Will be used to fetch any default argument values if applicable
Returns
Section titled “Returns”Promise<AppCallArgs | undefined>
The call args ready to pass into an app call
getGlobalState()
Section titled “getGlobalState()”getGlobalState():
Promise<AppState>
Defined in: algokit-utils-ts/src/types/app-client.ts:2297
Returns global state for the current app.
Returns
Section titled “Returns”Promise<AppState>
The global state
getLocalState()
Section titled “getLocalState()”getLocalState(
account):Promise<AppState>
Defined in: algokit-utils-ts/src/types/app-client.ts:2311
Returns local state for the given account / account address.
Parameters
Section titled “Parameters”account
Section titled “account”string | SendTransactionFrom
Returns
Section titled “Returns”Promise<AppState>
The global state
importSourceMaps()
Section titled “importSourceMaps()”importSourceMaps(
sourceMaps):void
Defined in: algokit-utils-ts/src/types/app-client.ts:1914
Import source maps for the app.
Parameters
Section titled “Parameters”sourceMaps
Section titled “sourceMaps”The source maps to import
Returns
Section titled “Returns”void
optIn()
Section titled “optIn()”optIn(
call?):Promise<AppCallTransactionResult>
Defined in: algokit-utils-ts/src/types/app-client.ts:2185
Parameters
Section titled “Parameters”The call details.
Returns
Section titled “Returns”Promise<AppCallTransactionResult>
The result of the call
update()
Section titled “update()”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
Parameters
Section titled “Parameters”update?
Section titled “update?”The parameters to update the app with
Returns
Section titled “Returns”Promise<{ compiledApproval: CompiledTeal; compiledClear: CompiledTeal; confirmation?: PendingTransactionResponse; confirmations?: PendingTransactionResponse[]; return?: ABIReturn; transaction: Transaction; transactions: Transaction[]; }>
The transaction send result and the compilation result