AppFactory
Defined in: src/app-factory.ts:150
ARC-56/ARC-32 app factory that, for a given app spec, allows you to create and deploy one or more app instances and to create one or more app clients to interact with those (or other) app instances.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AppFactory(
params):AppFactory
Defined in: src/app-factory.ts:177
Create a new app factory.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to create the app factory
Returns
Section titled “Returns”AppFactory
The AppFactory instance
Example
Section titled “Example”const appFactory = new AppFactory({ appSpec: appSpec, algorand: AlgorandClient.mainNet(),})
## Properties
### createTransaction
> `readonly` **createTransaction**: `object`
Defined in: [src/app-factory.ts:225](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-factory.ts#L225)
Create transactions for the current app
#### bare
> **bare**: `object`
Create bare (raw) transactions for the current app
##### bare.create()
> **create**: (`params?`) => `Promise`\<[`Transaction`](/algokit-utils-ts/api/subpaths/transact/classes/transaction/)\>
Create a create app call transaction using a bare (raw) create call.
Performs deploy-time TEAL template placeholder substitutions (if specified).
###### Parameters
###### params?
The parameters to create the create call transaction
###### accessReferences?
[`ResourceReference`](/algokit-utils-ts/api/subpaths/transact/type-aliases/resourcereference/)[]
Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
###### accountReferences?
[`ReadableAddress`](/algokit-utils-ts/api/algokit-utils/type-aliases/readableaddress/)[]
Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
###### appReferences?
`bigint`[]
The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
###### args?
`Uint8Array`\<`ArrayBufferLike`\>[]
Any [arguments to pass to the smart contract call](/concepts/smart-contracts/languages/teal/#argument-passing).
###### assetReferences?
`bigint`[]
The ID of any assets to load to the [foreign assets array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
###### boxReferences?
([`BoxIdentifier`](/algokit-utils-ts/api/algokit-utils/type-aliases/boxidentifier/) \| [`BoxReference`](/algokit-utils-ts/api/algokit-utils/interfaces/boxreference/))[]
Any boxes to load to the [boxes array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
Either the name identifier (which will be set against app ID of `0` i.e. the current app), or a box identifier with the name identifier and app ID.
###### deletable?
`boolean`
Whether or not the contract should have deploy-time permanence control set, undefined = ignore
###### deployTimeParams?
[`TealTemplateParams`](/algokit-utils-ts/api/algokit-utils/interfaces/tealtemplateparams/)
Any deploy-time parameters to replace in the TEAL code
###### extraFee?
[`AlgoAmount`](/algokit-utils-ts/api/algokit-utils/classes/algoamount/)
The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
###### extraProgramPages?
`number`
Number of extra pages required for the programs.Defaults to the number needed for the programs in this call if not specified.This is immutable once the app is created.
###### firstValidRound?
`bigint`
Set the first round this transaction is valid.If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
###### lastValidRound?
`bigint`
The last round this transaction is valid. It is recommended to use `validityWindow` instead.
###### lease?
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
Prevent multiple transactions with the same lease being included within the validity window.
A [lease](https://dev.algorand.co/concepts/transactions/leases) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
###### maxFee?
[`AlgoAmount`](/algokit-utils-ts/api/algokit-utils/classes/algoamount/)
Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
###### note?
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
Note to attach to the transaction. Max of 1000 bytes.
###### onComplete?
[`NoOp`](/algokit-utils-ts/api/subpaths/transact/enumerations/onapplicationcomplete/#noop) \| [`OptIn`](/algokit-utils-ts/api/subpaths/transact/enumerations/onapplicationcomplete/#optin) \| [`CloseOut`](/algokit-utils-ts/api/subpaths/transact/enumerations/onapplicationcomplete/#closeout) \| [`UpdateApplication`](/algokit-utils-ts/api/subpaths/transact/enumerations/onapplicationcomplete/#updateapplication) \| [`DeleteApplication`](/algokit-utils-ts/api/subpaths/transact/enumerations/onapplicationcomplete/#deleteapplication)
###### rejectVersion?
`number`
If set, the transaction will be rejected when the app's version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
###### rekeyTo?
[`ReadableAddress`](/algokit-utils-ts/api/algokit-utils/type-aliases/readableaddress/)
Change the signing key of the sender to the given address.
**Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://dev.algorand.co/concepts/accounts/rekeying).
###### schema?
\{ `globalByteSlices`: `number`; `globalInts`: `number`; `localByteSlices`: `number`; `localInts`: `number`; \}
The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec.
###### schema.globalByteSlices
`number`
The number of byte slices saved in global state.
###### schema.globalInts
`number`
The number of integers saved in global state.
###### schema.localByteSlices
`number`
The number of byte slices saved in local state.
###### schema.localInts
`number`
The number of integers saved in local state.
###### sender?
[`ReadableAddress`](/algokit-utils-ts/api/algokit-utils/type-aliases/readableaddress/)
The address of the account sending the transaction, if undefined then the app client's defaultSender is used.
###### signer?
[`AddressWithTransactionSigner`](/algokit-utils-ts/api/subpaths/transact/interfaces/addresswithtransactionsigner/) \| [`TransactionSigner`](/algokit-utils-ts/api/subpaths/transact/type-aliases/transactionsigner/)
The function used to sign transaction(s); if not specified then an attempt will be made to find a registered signer for the given `sender` or use a default signer (if configured).
###### staticFee?
[`AlgoAmount`](/algokit-utils-ts/api/algokit-utils/classes/algoamount/)
The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction.
###### updatable?
`boolean`
Whether or not the contract should have deploy-time immutability control set, undefined = ignore
###### validityWindow?
`number` \| `bigint`
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
###### Returns
`Promise`\<[`Transaction`](/algokit-utils-ts/api/subpaths/transact/classes/transaction/)\>
The create call transaction
#### create()
> **create**: (`params`) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, [`ABIMethod`](/algokit-utils-ts/api/subpaths/abi/classes/abimethod/)\>; `signers`: `Map`\<`number`, [`TransactionSigner`](/algokit-utils-ts/api/subpaths/transact/type-aliases/transactionsigner/)\>; `transactions`: [`Transaction`](/algokit-utils-ts/api/subpaths/transact/classes/transaction/)[]; \}\>
Create a create app call transaction using an ABI create call.
Performs deploy-time TEAL template placeholder substitutions (if specified).
##### Parameters
###### params
The parameters to create the create call transaction
###### accessReferences?
[`ResourceReference`](/algokit-utils-ts/api/subpaths/transact/type-aliases/resourcereference/)[]
Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
###### accountReferences?
[`ReadableAddress`](/algokit-utils-ts/api/algokit-utils/type-aliases/readableaddress/)[]
Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
###### appReferences?
`bigint`[]
The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
###### args?
([`ABIValue`](/algokit-utils-ts/api/subpaths/abi/type-aliases/abivalue/) \| `AppMethodCallTransactionArgument` \| `undefined`)[]
Arguments to the ABI method, either:* An ABI value* An ARC-56 struct* A transaction with explicit signer* A transaction (where the signer will be automatically assigned)* An unawaited transaction (e.g. from algorand.createTransaction.transactionType())* Another method call (via method call params object)* undefined (this represents a placeholder for either a default argument or a transaction argument that is fulfilled by another method call argument)
###### assetReferences?
`bigint`[]
The ID of any assets to load to the [foreign assets array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
###### boxReferences?
([`BoxIdentifier`](/algokit-utils-ts/api/algokit-utils/type-aliases/boxidentifier/) \| [`BoxReference`](/algokit-utils-ts/api/algokit-utils/interfaces/boxreference/))[]
Any boxes to load to the [boxes array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
Either the name identifier (which will be set against app ID of `0` i.e. the current app), or a box identifier with the name identifier and app ID.
###### deletable?
`boolean`
Whether or not the contract should have deploy-time permanence control set, undefined = ignore
###### deployTimeParams?
[`TealTemplateParams`](/algokit-utils-ts/api/algokit-utils/interfaces/tealtemplateparams/)
Any deploy-time parameters to replace in the TEAL code
###### extraFee?
[`AlgoAmount`](/algokit-utils-ts/api/algokit-utils/classes/algoamount/)
The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
###### extraProgramPages?
`number`
Number of extra pages required for the programs.Defaults to the number needed for the programs in this call if not specified.This is immutable once the app is created.
###### firstValidRound?
`bigint`
Set the first round this transaction is valid.If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
###### lastValidRound?
`bigint`
The last round this transaction is valid. It is recommended to use `validityWindow` instead.
###### lease?
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
Prevent multiple transactions with the same lease being included within the validity window.
A [lease](https://dev.algorand.co/concepts/transactions/leases) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
###### maxFee?
[`AlgoAmount`](/algokit-utils-ts/api/algokit-utils/classes/algoamount/)
Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
###### method
`string`
The method name or method signature to call if an ABI call is being emitted
**Examples**
```tsMethod name`my_method`Method signature`my_method(unit64,string)bytes`string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication
The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
schema?
Section titled “schema?”{ globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }
The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec.
schema.globalByteSlices
Section titled “schema.globalByteSlices”number
The number of byte slices saved in global state.
schema.globalInts
Section titled “schema.globalInts”number
The number of integers saved in global state.
schema.localByteSlices
Section titled “schema.localByteSlices”number
The number of byte slices saved in local state.
schema.localInts
Section titled “schema.localInts”number
The number of integers saved in local state.
sender?
Section titled “sender?”The address of the account sending the transaction, if undefined then the app client’s defaultSender is used.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
updatable?
Section titled “updatable?”boolean
Whether or not the contract should have deploy-time immutability control set, undefined = ignore
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>
The create call transaction
readonlysend:object
Defined in: src/app-factory.ts:253
Send transactions to the current app
bare:
object
Send bare (raw) transactions for the current app
bare.create()
Section titled “bare.create()”create: (
params?) =>Promise<{appClient:AppClient;result: {appAddress:Address;appId:bigint;compiledApproval?:CompiledTeal;compiledClear?:CompiledTeal;confirmation:PendingTransactionResponse;confirmations:PendingTransactionResponse[];groupId:string|undefined;return:undefined;returns?:ABIReturn[];transaction:Transaction;transactions:Transaction[];txIds:string[]; }; }>
Creates an instance of the app using a bare (raw) create call and returns the result of the creation transaction and an app client to interact with that app instance.
Performs deploy-time TEAL template placeholder substitutions (if specified).
Parameters
Section titled “Parameters”params?
Section titled “params?”object & SendParams
The parameters to create the app
Returns
Section titled “Returns”Promise<{ appClient: AppClient; result: { appAddress: Address; appId: bigint; compiledApproval?: CompiledTeal; compiledClear?: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; groupId: string | undefined; return: undefined; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; }; }>
The app client and the result of the creation transaction
create()
Section titled “create()”create: (
params) =>Promise<{appClient:AppClient;result: {appAddress:Address;appId:bigint;compiledApproval?:CompiledTeal;compiledClear?:CompiledTeal;confirmation:PendingTransactionResponse;confirmations:PendingTransactionResponse[];groupId:string|undefined;return:ABIValue|undefined;returns?:ABIReturn[];transaction:Transaction;transactions:Transaction[];txIds:string[]; }; }>
Creates an instance of the app and returns the result of the creation transaction and an app client to interact with that app instance.
Performs deploy-time TEAL template placeholder substitutions (if specified).
Parameters
Section titled “Parameters”params
Section titled “params”object & SendParams
The parameters to create the app
Returns
Section titled “Returns”Promise<{ appClient: AppClient; result: { appAddress: Address; appId: bigint; compiledApproval?: CompiledTeal; compiledClear?: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; groupId: string | undefined; return: ABIValue | undefined; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; }; }>
The app client and the result of the creation transaction
Accessors
Section titled “Accessors”algorand
Section titled “algorand”Get Signature
Section titled “Get Signature”get algorand():
AlgorandClient
Defined in: src/app-factory.ts:201
Return the algorand client this factory is using.
Returns
Section titled “Returns”appName
Section titled “appName”Get Signature
Section titled “Get Signature”get appName():
string
Defined in: src/app-factory.ts:191
The name of the app (from the ARC-32 / ARC-56 app spec or override).
Returns
Section titled “Returns”string
appSpec
Section titled “appSpec”Get Signature
Section titled “Get Signature”get appSpec():
Arc56Contract
Defined in: src/app-factory.ts:196
The ARC-56 app spec being used
Returns
Section titled “Returns”params
Section titled “params”Get Signature
Section titled “Get Signature”get params():
object
Defined in: src/app-factory.ts:220
Get parameters to create transactions (create and deploy related calls) for the current app.
A good mental model for this is that these parameters represent a deferred transaction creation.
Examples
Section titled “Examples”const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})// ...await algorand.send.AppCreateMethodCall(createAppParams)const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})await appClient.send.call({method: 'my_method', args: [createAppParams]})Returns
Section titled “Returns”bare:
object
bare.create()
Section titled “bare.create()”create: (
params?) =>Promise<object&object>
Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided
Parameters
Section titled “Parameters”params?
Section titled “params?”accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
Uint8Array<ArrayBufferLike>[]
Any arguments to pass to the smart contract call.
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
deletable?
Section titled “deletable?”boolean
Whether or not the contract should have deploy-time permanence control set, undefined = ignore
deployTimeParams?
Section titled “deployTimeParams?”Any deploy-time parameters to replace in the TEAL code
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
extraProgramPages?
Section titled “extraProgramPages?”number
Number of extra pages required for the programs. Defaults to the number needed for the programs in this call if not specified. This is immutable once the app is created.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
schema?
Section titled “schema?”{ globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }
The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec.
schema.globalByteSlices
Section titled “schema.globalByteSlices”number
The number of byte slices saved in global state.
schema.globalInts
Section titled “schema.globalInts”number
The number of integers saved in global state.
schema.localByteSlices
Section titled “schema.localByteSlices”number
The number of byte slices saved in local state.
schema.localInts
Section titled “schema.localInts”number
The number of integers saved in local state.
sender?
Section titled “sender?”The address of the account sending the transaction, if undefined then the app client’s defaultSender is used.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
updatable?
Section titled “updatable?”boolean
Whether or not the contract should have deploy-time immutability control set, undefined = ignore
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<object & object>
bare.deployDelete()
Section titled “bare.deployDelete()”deployDelete: (
params?) =>object&object
Return params for a deployment delete bare call
Parameters
Section titled “Parameters”params?
Section titled “params?”accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
Uint8Array<ArrayBufferLike>[]
Any arguments to pass to the smart contract call.
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender?
Section titled “sender?”The address of the account sending the transaction, if undefined then the app client’s defaultSender is used.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”bare.deployUpdate()
Section titled “bare.deployUpdate()”deployUpdate: (
params?) =>object&object
Return params for a deployment update bare call
Parameters
Section titled “Parameters”params?
Section titled “params?”accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
Uint8Array<ArrayBufferLike>[]
Any arguments to pass to the smart contract call.
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender?
Section titled “sender?”The address of the account sending the transaction, if undefined then the app client’s defaultSender is used.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”create()
Section titled “create()”create: (
params) =>Promise<object&object>
Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided
Parameters
Section titled “Parameters”params
Section titled “params”accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
(ABIValue | AppMethodCallTransactionArgument | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- An ARC-56 struct
- A transaction with explicit signer
- A transaction (where the signer will be automatically assigned)
- An unawaited transaction (e.g. from algorand.createTransaction.transactionType())
- Another method call (via method call params object)
- undefined (this represents a placeholder for either a default argument or a transaction argument that is fulfilled by another method call argument)
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
deletable?
Section titled “deletable?”boolean
Whether or not the contract should have deploy-time permanence control set, undefined = ignore
deployTimeParams?
Section titled “deployTimeParams?”Any deploy-time parameters to replace in the TEAL code
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
extraProgramPages?
Section titled “extraProgramPages?”number
Number of extra pages required for the programs. Defaults to the number needed for the programs in this call if not specified. This is immutable once the app is created.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
method
Section titled “method”string
The method name or method signature to call if an ABI call is being emitted
Examples
Method name`my_method`Method signature`my_method(unit64,string)bytes`string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication
The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
schema?
Section titled “schema?”{ globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }
The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec.
schema.globalByteSlices
Section titled “schema.globalByteSlices”number
The number of byte slices saved in global state.
schema.globalInts
Section titled “schema.globalInts”number
The number of integers saved in global state.
schema.localByteSlices
Section titled “schema.localByteSlices”number
The number of byte slices saved in local state.
schema.localInts
Section titled “schema.localInts”number
The number of integers saved in local state.
sender?
Section titled “sender?”The address of the account sending the transaction, if undefined then the app client’s defaultSender is used.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
updatable?
Section titled “updatable?”boolean
Whether or not the contract should have deploy-time immutability control set, undefined = ignore
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<object & object>
deployDelete()
Section titled “deployDelete()”deployDelete: (
params) =>object&object
Return params for a deployment delete ABI call
Parameters
Section titled “Parameters”params
Section titled “params”accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
(ABIValue | AppMethodCallTransactionArgument | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- An ARC-56 struct
- A transaction with explicit signer
- A transaction (where the signer will be automatically assigned)
- An unawaited transaction (e.g. from algorand.createTransaction.transactionType())
- Another method call (via method call params object)
- undefined (this represents a placeholder for either a default argument or a transaction argument that is fulfilled by another method call argument)
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
method
Section titled “method”string
The method name or method signature to call if an ABI call is being emitted
Examples
Method name`my_method`Method signature`my_method(unit64,string)bytes`string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender?
Section titled “sender?”The address of the account sending the transaction, if undefined then the app client’s defaultSender is used.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”deployUpdate()
Section titled “deployUpdate()”deployUpdate: (
params) =>object&object
Return params for a deployment update ABI call
Parameters
Section titled “Parameters”params
Section titled “params”accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
(ABIValue | AppMethodCallTransactionArgument | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- An ARC-56 struct
- A transaction with explicit signer
- A transaction (where the signer will be automatically assigned)
- An unawaited transaction (e.g. from algorand.createTransaction.transactionType())
- Another method call (via method call params object)
- undefined (this represents a placeholder for either a default argument or a transaction argument that is fulfilled by another method call argument)
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
method
Section titled “method”string
The method name or method signature to call if an ABI call is being emitted
Examples
Method name`my_method`Method signature`my_method(unit64,string)bytes`string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender?
Section titled “sender?”The address of the account sending the transaction, if undefined then the app client’s defaultSender is used.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Methods
Section titled “Methods”compile()
Section titled “compile()”compile(
compilation?):Promise<AppClientCompilationResult>
Defined in: src/app-factory.ts:600
Compiles the approval and clear state programs (if TEAL templates provided), performing any provided deploy-time parameter replacement and stores the source maps.
If no TEAL templates provided it will use any byte code provided in the app spec.
Will store any generated source maps for later use in debugging.
Parameters
Section titled “Parameters”compilation?
Section titled “compilation?”AppClientCompilationParams
Optional compilation parameters to use for the compilation
Returns
Section titled “Returns”Promise<AppClientCompilationResult>
The compilation result
Example
Section titled “Example”const result = await factory.compile()deploy()
Section titled “deploy()”deploy(
params):Promise<{appClient:AppClient;result: {appAddress:Address;appId:bigint;compiledApproval?:CompiledTeal;compiledClear?:CompiledTeal;confirmation:PendingTransactionResponse;confirmations:PendingTransactionResponse[];createdMetadata:AppDeployMetadata;createdRound:bigint;deletable?:boolean;deleted:boolean;deleteReturn:ABIValue|undefined;groupId:string|undefined;name:string;operationPerformed:"create";return:ABIValue|undefined;returns?:ABIReturn[];transaction:Transaction;transactions:Transaction[];txIds:string[];updatable?:boolean;updatedRound:bigint;version:string; } | {appAddress:Address;appId:bigint;compiledApproval?:CompiledTeal;compiledClear?:CompiledTeal;confirmation:PendingTransactionResponse;confirmations:PendingTransactionResponse[];createdMetadata:AppDeployMetadata;createdRound:bigint;deletable?:boolean;deleted:boolean;deleteReturn:ABIValue|undefined;groupId:string|undefined;name:string;operationPerformed:"update";return:ABIValue|undefined;returns?:ABIReturn[];transaction:Transaction;transactions:Transaction[];txIds:string[];updatable?:boolean;updatedRound:bigint;version:string; } | {appAddress:Address;appId:bigint;compiledApproval?:CompiledTeal;compiledClear?:CompiledTeal;confirmation:PendingTransactionResponse;confirmations:PendingTransactionResponse[];createdMetadata:AppDeployMetadata;createdRound:bigint;deletable?:boolean;deleted:boolean;deleteResult:ConfirmedTransactionResult;deleteReturn:ABIValue|undefined;groupId:string|undefined;name:string;operationPerformed:"replace";return:ABIValue|undefined;returns?:ABIReturn[];transaction:Transaction;transactions:Transaction[];txIds:string[];updatable?:boolean;updatedRound:bigint;version:string; } | {appAddress:Address;appId:bigint;compiledApproval?:CompiledTeal;compiledClear?:CompiledTeal;createdMetadata:AppDeployMetadata;createdRound:bigint;deletable?:boolean;deleted:boolean;deleteReturn:ABIValue|undefined;name:string;operationPerformed:"nothing";return:ABIValue|undefined;updatable?:boolean;updatedRound:bigint;version:string; }; }>
Defined in: src/app-factory.ts:354
Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified).
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.
Parameters
Section titled “Parameters”params
Section titled “params”The arguments to control the app deployment
appName?
Section titled “appName?”string
Override the app name for this deployment
coverAppCallInnerTransactionFees?
Section titled “coverAppCallInnerTransactionFees?”boolean
Whether to use simulate to automatically calculate required app call inner transaction fees and cover them in the parent app call transaction fee
createParams?
Section titled “createParams?”{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appReferences?: bigint[]; args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[]; assetReferences?: bigint[]; boxReferences?: (BoxIdentifier | BoxReference)[]; extraFee?: AlgoAmount; extraProgramPages?: number; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; method: string; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication; rejectVersion?: number; rekeyTo?: ReadableAddress; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender?: ReadableAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; } | { accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appReferences?: bigint[]; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: (BoxIdentifier | BoxReference)[]; extraFee?: AlgoAmount; extraProgramPages?: number; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication; rejectVersion?: number; rekeyTo?: ReadableAddress; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender?: ReadableAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }
Create transaction parameters to use if a create needs to be issued as part of deployment
deletable?
Section titled “deletable?”boolean
Whether or not the contract should have deploy-time permanence control set.
undefined = use AppFactory constructor value if set or base it on the app spec.
deleteParams?
Section titled “deleteParams?”{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appReferences?: bigint[]; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: (BoxIdentifier | BoxReference)[]; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; rejectVersion?: number; rekeyTo?: ReadableAddress; sender?: ReadableAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; } | { accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appReferences?: bigint[]; args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[]; assetReferences?: bigint[]; boxReferences?: (BoxIdentifier | BoxReference)[]; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; method: string; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: OnApplicationComplete; rejectVersion?: number; rekeyTo?: ReadableAddress; sender?: ReadableAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }
Delete transaction parameters to use if a create needs to be issued as part of deployment
deployTimeParams?
Section titled “deployTimeParams?”Any deploy-time parameters to replace in the TEAL code before compiling it (used if teal code is passed in as a string)
existingDeployments?
Section titled “existingDeployments?”Optional cached value of the existing apps for the given creator; use this to avoid an indexer lookup
ignoreCache?
Section titled “ignoreCache?”boolean
Whether or not to ignore the app metadata cache and force a lookup, default: use the cache *
maxRoundsToWaitForConfirmation?
Section titled “maxRoundsToWaitForConfirmation?”number
The number of rounds to wait for confirmation. By default until the latest lastValid has past.
onSchemaBreak?
Section titled “onSchemaBreak?”"replace" | OnSchemaBreak | "fail" | "append"
What action to perform if a schema break (storage schema or extra pages change) is detected:
fail- Fail the deployment (throw an error, default)replace- Delete the old app and create a new oneappend- Deploy a new app and leave the old one as is
onUpdate?
Section titled “onUpdate?”"replace" | "update" | "fail" | "append" | OnUpdate
What action to perform if a TEAL code update is detected:
fail- Fail the deployment (throw an error, default)update- Update the app with the new TEAL codereplace- Delete the old app and create a new oneappend- Deploy a new app and leave the old one as is
populateAppCallResources?
Section titled “populateAppCallResources?”boolean
Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to Config.populateAppCallResources.
suppressLog?
Section titled “suppressLog?”boolean
Whether to suppress log messages from transaction send, default: do not suppress.
updatable?
Section titled “updatable?”boolean
Whether or not the contract should have deploy-time immutability control set.
undefined = use AppFactory constructor value if set or base it on the app spec.
updateParams?
Section titled “updateParams?”{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appReferences?: bigint[]; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: (BoxIdentifier | BoxReference)[]; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; rejectVersion?: number; rekeyTo?: ReadableAddress; sender?: ReadableAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; } | { accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appReferences?: bigint[]; args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[]; assetReferences?: bigint[]; boxReferences?: (BoxIdentifier | BoxReference)[]; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; method: string; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: OnApplicationComplete; rejectVersion?: number; rekeyTo?: ReadableAddress; sender?: ReadableAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }
Update transaction parameters to use if a create needs to be issued as part of deployment
Returns
Section titled “Returns”Promise<{ appClient: AppClient; result: { appAddress: Address; appId: bigint; compiledApproval?: CompiledTeal; compiledClear?: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; createdMetadata: AppDeployMetadata; createdRound: bigint; deletable?: boolean; deleted: boolean; deleteReturn: ABIValue | undefined; groupId: string | undefined; name: string; operationPerformed: "create"; return: ABIValue | undefined; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; updatable?: boolean; updatedRound: bigint; version: string; } | { appAddress: Address; appId: bigint; compiledApproval?: CompiledTeal; compiledClear?: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; createdMetadata: AppDeployMetadata; createdRound: bigint; deletable?: boolean; deleted: boolean; deleteReturn: ABIValue | undefined; groupId: string | undefined; name: string; operationPerformed: "update"; return: ABIValue | undefined; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; updatable?: boolean; updatedRound: bigint; version: string; } | { appAddress: Address; appId: bigint; compiledApproval?: CompiledTeal; compiledClear?: CompiledTeal; confirmation: PendingTransactionResponse; confirmations: PendingTransactionResponse[]; createdMetadata: AppDeployMetadata; createdRound: bigint; deletable?: boolean; deleted: boolean; deleteResult: ConfirmedTransactionResult; deleteReturn: ABIValue | undefined; groupId: string | undefined; name: string; operationPerformed: "replace"; return: ABIValue | undefined; returns?: ABIReturn[]; transaction: Transaction; transactions: Transaction[]; txIds: string[]; updatable?: boolean; updatedRound: bigint; version: string; } | { appAddress: Address; appId: bigint; compiledApproval?: CompiledTeal; compiledClear?: CompiledTeal; createdMetadata: AppDeployMetadata; createdRound: bigint; deletable?: boolean; deleted: boolean; deleteReturn: ABIValue | undefined; name: string; operationPerformed: "nothing"; return: ABIValue | undefined; updatable?: boolean; updatedRound: bigint; version: string; }; }>
The app client and the result of the deployment
Example
Section titled “Example”const { appClient, result } = await factory.deploy({ createParams: { sender: 'SENDER_ADDRESS', approvalProgram: 'APPROVAL PROGRAM', clearStateProgram: 'CLEAR PROGRAM', schema: { globalByteSlices: 0, globalInts: 0, localByteSlices: 0, localInts: 0 } }, updateParams: { sender: 'SENDER_ADDRESS' }, deleteParams: { sender: 'SENDER_ADDRESS' }, onSchemaBreak: 'append', onUpdate: 'append' })exportSourceMaps()
Section titled “exportSourceMaps()”exportSourceMaps():
AppSourceMaps
Defined in: src/app-factory.ts:481
Export the current source maps for the app.
Returns
Section titled “Returns”AppSourceMaps
The source maps
exposeLogicError()
Section titled “exposeLogicError()”exposeLogicError(
e,isClearStateProgram?):Error
Defined in: src/app-factory.ts:469
Takes an error that may include a logic error from a call to the current app and re-exposes the error to include source code information via the source map and ARC-56 spec.
Parameters
Section titled “Parameters”Error
The error to parse
isClearStateProgram?
Section titled “isClearStateProgram?”boolean
Whether or not the code was running the clear state program (defaults to approval 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
getAppClientByCreatorAndName()
Section titled “getAppClientByCreatorAndName()”getAppClientByCreatorAndName(
params):Promise<AppClient>
Defined in: src/app-factory.ts:450
Returns a new AppClient client, resolving the app by creator address and name
using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
Automatically populates appName, defaultSender and source maps from the factory if not specified in the params.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to create the app client
appLookupCache?
Section titled “appLookupCache?”An optional cached app lookup that matches a name to on-chain details;
either this is needed or indexer is required to be passed in to this ClientManager on construction.
appName?
Section titled “appName?”string
Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name
approvalSourceMap?
Section titled “approvalSourceMap?”ProgramSourceMap
Optional source map for the approval program
clearSourceMap?
Section titled “clearSourceMap?”ProgramSourceMap
Optional source map for the clear state program
creatorAddress
Section titled “creatorAddress”The address of the creator account for the app
defaultSender?
Section titled “defaultSender?”Optional address to use for the account to use as the default sender for calls.
defaultSigner?
Section titled “defaultSigner?”Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from AlgorandClient).
ignoreCache?
Section titled “ignoreCache?”boolean
Whether or not to ignore the AppDeployer lookup cache and force an on-chain lookup, default: use any cached value
Returns
Section titled “Returns”Promise<AppClient>
The AppClient instance
Example
Section titled “Example”const appClient = factory.getAppClientByCreatorAndName({ creatorAddress: 'CREATOR_ADDRESS', appName: 'my_app' })getAppClientById()
Section titled “getAppClientById()”getAppClientById(
params):AppClient
Defined in: src/app-factory.ts:424
Returns a new AppClient client for an app instance of the given ID.
Automatically populates appName, defaultSender and source maps from the factory if not specified in the params.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to create the app client
bigint
The ID of the app instance this client should make calls against.
appName?
Section titled “appName?”string
Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name
approvalSourceMap?
Section titled “approvalSourceMap?”ProgramSourceMap
Optional source map for the approval program
clearSourceMap?
Section titled “clearSourceMap?”ProgramSourceMap
Optional source map for the clear state program
defaultSender?
Section titled “defaultSender?”Optional address to use for the account to use as the default sender for calls.
defaultSigner?
Section titled “defaultSigner?”Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from AlgorandClient).
Returns
Section titled “Returns”The AppClient instance
Example
Section titled “Example”const appClient = factory.getAppClientById({ appId: 12345n })importSourceMaps()
Section titled “importSourceMaps()”importSourceMaps(
sourceMaps):void
Defined in: src/app-factory.ts:498
Import source maps for the app.
Parameters
Section titled “Parameters”sourceMaps
Section titled “sourceMaps”AppSourceMaps
The source maps to import
Returns
Section titled “Returns”void