TransactionComposer
Defined in: src/composer.ts:224
TransactionComposer helps you compose and execute transactions as a transaction group.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TransactionComposer(
params):TransactionComposer
Defined in: src/composer.ts:297
Create a TransactionComposer.
Parameters
Section titled “Parameters”params
Section titled “params”The configuration for this composer
Returns
Section titled “Returns”TransactionComposer
The TransactionComposer instance
Methods
Section titled “Methods”addAppCall()
Section titled “addAppCall()”addAppCall(
params):TransactionComposer
Defined in: src/composer.ts:968
Add an application call transaction to the transaction group.
If you want to create or update an app use addAppCreate or addAppUpdate.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”AppCallParams
The application call transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAppCall({ sender: 'CREATORADDRESS' })composer.addAppCall({ sender: 'CREATORADDRESS', onComplete: OnApplicationComplete.OptIn, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1,})addAppCallMethodCall()
Section titled “addAppCallMethodCall()”addAppCallMethodCall(
params):TransactionComposer
Defined in: src/composer.ts:1213
Add a non-create/non-update ABI method application call transaction to the transaction group.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”The ABI method application call transaction parameters
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.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; 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 | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- 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 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”The ABI method to call
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”NoOp | OptIn | CloseOut | 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.
sender
Section titled “sender”The address sending the transaction, optionally with an attached signer.
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”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"], onComplete: OnApplicationComplete.OptIn, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1,})addAppCreate()
Section titled “addAppCreate()”addAppCreate(
params):TransactionComposer
Defined in: src/composer.ts:838
Add an application create transaction to the transaction group.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”The application create transaction parameters
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.
appId?
Section titled “appId?”0
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
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.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
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
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.
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 sending the transaction, optionally with an attached signer.
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”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAppCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })composer.addAppCreate({ sender: 'CREATORADDRESS', approvalProgram: "TEALCODE", clearStateProgram: "TEALCODE", schema: { globalInts: 1, globalByteSlices: 2, localInts: 3, localByteSlices: 4 }, extraProgramPages: 1, onComplete: OnApplicationComplete.OptIn, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1, // Signer only needed if you want to provide one, // generally you'd register it with AlgorandClient // against the sender and not need to pass it in signer: transactionSigner, maxRoundsToWaitForConfirmation: 5, suppressLog: true,})addAppCreateMethodCall()
Section titled “addAppCreateMethodCall()”addAppCreateMethodCall(
params):TransactionComposer
Defined in: src/composer.ts:1031
Add an ABI method create application call transaction to the transaction group.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”The ABI create method application call transaction parameters
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.
appId?
Section titled “appId?”0
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; 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 | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- 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 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.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
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”The ABI method to call
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.
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 sending the transaction, optionally with an attached signer.
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”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppCreateMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"], approvalProgram: "TEALCODE", clearStateProgram: "TEALCODE", schema: { globalInts: 1, globalByteSlices: 2, localInts: 3, localByteSlices: 4 }, extraProgramPages: 1, onComplete: OnApplicationComplete.OptIn, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1,})addAppDelete()
Section titled “addAppDelete()”addAppDelete(
params):TransactionComposer
Defined in: src/composer.ts:924
Add an application delete transaction to the transaction group.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”The application delete transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAppDelete({ sender: 'CREATORADDRESS' })composer.addAppDelete({ sender: 'CREATORADDRESS', onComplete: OnApplicationComplete.DeleteApplication, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1,})addAppDeleteMethodCall()
Section titled “addAppDeleteMethodCall()”addAppDeleteMethodCall(
params):TransactionComposer
Defined in: src/composer.ts:1153
Add an ABI method delete application call transaction to the transaction group.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”The ABI delete method application call transaction parameters
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.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; 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 | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- 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 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”The ABI method to call
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 sending the transaction, optionally with an attached signer.
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”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"], onComplete: OnApplicationComplete.DeleteApplication, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1,})addAppUpdate()
Section titled “addAppUpdate()”addAppUpdate(
params):TransactionComposer
Defined in: src/composer.ts:882
Add an application update transaction to the transaction group.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”The application update transaction parameters
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.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
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.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
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.
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 sending the transaction, optionally with an attached signer.
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”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAppUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })composer.addAppUpdate({ sender: 'CREATORADDRESS', approvalProgram: "TEALCODE", clearStateProgram: "TEALCODE", onComplete: OnApplicationComplete.UpdateApplication, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1,})addAppUpdateMethodCall()
Section titled “addAppUpdateMethodCall()”addAppUpdateMethodCall(
params):TransactionComposer
Defined in: src/composer.ts:1093
Add an ABI method update application call transaction to the transaction group.
Note: we recommend using app clients to make it easier to make app calls.
Parameters
Section titled “Parameters”params
Section titled “params”The ABI update method application call transaction parameters
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.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; 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 | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- 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 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.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
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”The ABI method to call
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 sending the transaction, optionally with an attached signer.
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”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })const method = new ABIMethod({ name: 'method', args: [{ name: 'arg1', type: 'string' }], returns: { type: 'string' },})composer.addAppUpdateMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"], approvalProgram: "TEALCODE", clearStateProgram: "TEALCODE", onComplete: OnApplicationComplete.UpdateApplication, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] accessReferences: [{ appId: 1234n }] lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(), rejectVersion: 1,})addAssetConfig()
Section titled “addAssetConfig()”addAssetConfig(
params):TransactionComposer
Defined in: src/composer.ts:609
Add an asset config transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”AssetConfigParams
The asset config transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAssetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })composer.addAssetConfig({ sender: 'MANAGERADDRESS', assetId: 123456n, manager: 'MANAGERADDRESS', reserve: 'RESERVEADDRESS', freeze: 'FREEZEADDRESS', clawback: 'CLAWBACKADDRESS', lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})
***
### addAssetCreate()
> **addAssetCreate**(`params`): `TransactionComposer`
Defined in: [src/composer.ts:574](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/composer.ts#L574)
Add an asset create transaction to the transaction group.
#### Parameters
##### params
`AssetCreateParams`
The asset create transaction parameters
#### Returns
`TransactionComposer`
The composer so you can chain method calls
#### Examples
```typescriptcomposer.addAssetCreate({ sender: "CREATORADDRESS", total: 100n})composer.addAssetCreate({ sender: 'CREATORADDRESS', total: 100n, decimals: 2, assetName: 'asset', unitName: 'unit', url: 'url', metadataHash: 'metadataHash', defaultFrozen: false, manager: 'MANAGERADDRESS', reserve: 'RESERVEADDRESS', freeze: 'FREEZEADDRESS', clawback: 'CLAWBACKADDRESS', lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})
***
### addAssetDestroy()
> **addAssetDestroy**(`params`): `TransactionComposer`
Defined in: [src/composer.ts:675](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/composer.ts#L675)
Add an asset destroy transaction to the transaction group.
#### Parameters
##### params
`AssetDestroyParams`
The asset destroy transaction parameters
#### Returns
`TransactionComposer`
The composer so you can chain method calls
#### Examples
```typescriptcomposer.addAssetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })composer.addAssetDestroy({ sender: 'MANAGERADDRESS', assetId: 123456n, lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})addAssetFreeze()
Section titled “addAssetFreeze()”addAssetFreeze(
params):TransactionComposer
Defined in: src/composer.ts:643
Add an asset freeze transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”AssetFreezeParams
The asset freeze transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAssetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })composer.addAssetFreeze({ sender: 'MANAGERADDRESS', assetId: 123456n, account: 'ACCOUNTADDRESS', frozen: true, lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})addAssetOptIn()
Section titled “addAssetOptIn()”addAssetOptIn(
params):TransactionComposer
Defined in: src/composer.ts:744
Add an asset opt-in transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”AssetOptInParams
The asset opt-in transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAssetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })composer.addAssetOptIn({ sender: 'SENDERADDRESS', assetId: 123456n, lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})addAssetOptOut()
Section titled “addAssetOptOut()”addAssetOptOut(
params):TransactionComposer
Defined in: src/composer.ts:782
Add an asset opt-out transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”AssetOptOutParams
The asset opt-out transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAssetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })composer.addAssetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })composer.addAssetOptOut({ sender: 'SENDERADDRESS', assetId: 123456n, creator: 'CREATORADDRESS', ensureZeroBalance: true, lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})addAssetTransfer()
Section titled “addAssetTransfer()”addAssetTransfer(
params):TransactionComposer
Defined in: src/composer.ts:712
Add an asset transfer transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”AssetTransferParams
The asset transfer transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addAssetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })composer.addAssetTransfer({ sender: 'CLAWBACKADDRESS', assetId: 123456n, amount: 1n, receiver: 'RECEIVERADDRESS', clawbackTarget: 'HOLDERADDRESS', // This field needs to be used with caution closeAssetTo: 'ADDRESSTOCLOSETO' lease: 'lease', note: 'note', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})addOfflineKeyRegistration()
Section titled “addOfflineKeyRegistration()”addOfflineKeyRegistration(
params):TransactionComposer
Defined in: src/composer.ts:1302
Add an offline key registration transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”OfflineKeyRegistrationParams
The offline key registration transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addOfflineKeyRegistration({ sender: 'SENDERADDRESS',})composer.addOfflineKeyRegistration({ sender: 'SENDERADDRESS', lease: 'lease', note: 'note', // Use this with caution, it's generally better to use algorand.account.rekeyAccount rekeyTo: 'REKEYTOADDRESS', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})addOnlineKeyRegistration()
Section titled “addOnlineKeyRegistration()”addOnlineKeyRegistration(
params):TransactionComposer
Defined in: src/composer.ts:1267
Add an online key registration transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”OnlineKeyRegistrationParams
The online key registration transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addOnlineKeyRegistration({ sender: 'SENDERADDRESS', voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')), selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')), stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')), voteFirst: 1n, voteLast: 1000n, voteKeyDilution: 1n,})composer.addOnlineKeyRegistration({ sender: 'SENDERADDRESS', voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')), selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')), stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')), voteFirst: 1n, voteLast: 1000n, voteKeyDilution: 1n, lease: 'lease', note: 'note', // Use this with caution, it's generally better to use algorand.account.rekeyAccount rekeyTo: 'REKEYTOADDRESS', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})addPayment()
Section titled “addPayment()”addPayment(
params):TransactionComposer
Defined in: src/composer.ts:533
Add a payment transaction to the transaction group.
Parameters
Section titled “Parameters”params
Section titled “params”PaymentParams
The payment transaction parameters
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Examples
Section titled “Examples”composer.addPayment({ sender: 'SENDERADDRESS', receiver: 'RECEIVERADDRESS', amount: (4).algo(),})composer.addPayment({ amount: (4).algo(), receiver: 'RECEIVERADDRESS', sender: 'SENDERADDRESS', closeRemainderTo: 'CLOSEREMAINDERTOADDRESS', lease: 'lease', note: 'note', // Use this with caution, it's generally better to use algorand.account.rekeyAccount rekeyTo: 'REKEYTOADDRESS', // You wouldn't normally set this field firstValidRound: 1000n, validityWindow: 10, extraFee: (1000).microAlgo(), staticFee: (1000).microAlgo(), // Max fee doesn't make sense with extraFee AND staticFee // already specified, but here for completeness maxFee: (3000).microAlgo(),})
***
### addTransaction()
> **addTransaction**(`transaction`, `signer?`): `TransactionComposer`
Defined in: [src/composer.ts:462](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/composer.ts#L462)
Add a pre-built transaction to the transaction group.
#### Parameters
##### transaction
[`Transaction`](/algokit-utils-ts/api/subpaths/transact/classes/transaction/)
The pre-built transaction
##### signer?
[`TransactionSigner`](/algokit-utils-ts/api/subpaths/transact/type-aliases/transactionsigner/)
Optional signer override for the transaction
#### Returns
`TransactionComposer`
The composer so you can chain method calls
#### Example
```typescriptcomposer.addTransaction(txn)addTransactionComposer()
Section titled “addTransactionComposer()”addTransactionComposer(
composer):TransactionComposer
Defined in: src/composer.ts:493
Add another transaction composer to the current transaction composer. The transaction params of the input transaction composer will be added. If the input transaction composer is updated, it won’t affect the current transaction composer.
Parameters
Section titled “Parameters”composer
Section titled “composer”TransactionComposer
The transaction composer to add
Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
Example
Section titled “Example”const innerComposer = algorand.newGroup() .addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (1).algo() }) .addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (2).algo() })
composer.addTransactionComposer(innerComposer)build()
Section titled “build()”build():
Promise<{methodCalls:Map<number,ABIMethod>;transactions:TransactionWithSigner[]; }>
Defined in: src/composer.ts:1329
Build the transaction composer.
This method performs resource population and inner transaction fee coverage if these options are set in the composer.
Once this method is called, no further transactions will be able to be added. You can safely call this method multiple times to get the same result.
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod>; transactions: TransactionWithSigner[]; }>
The built transaction composer, the transactions and any corresponding method calls
Example
Section titled “Example”const { transactions, methodCalls } = await composer.build()buildTransactions()
Section titled “buildTransactions()”buildTransactions():
Promise<BuiltTransactions>
Defined in: src/composer.ts:1508
Builds all transactions in the composer and returns them along with method calls and signers.
Note: This method only builds the transactions as-is without resource population or automatic grouping. Use this when you need the raw transactions.
Returns
Section titled “Returns”Promise<BuiltTransactions>
An object containing the array of built transactions, method calls, and signers
Example
Section titled “Example”const { transactions, methodCalls, signers } = await composer.buildTransactions()clone()
Section titled “clone()”clone(
composerConfig?):TransactionComposer
Defined in: src/composer.ts:419
Parameters
Section titled “Parameters”composerConfig?
Section titled “composerConfig?”Returns
Section titled “Returns”TransactionComposer
count()
Section titled “count()”count():
number
Defined in: src/composer.ts:1312
Get the number of transactions currently added to this composer.
Returns
Section titled “Returns”number
The number of transactions currently added to this composer
gatherSignatures()
Section titled “gatherSignatures()”gatherSignatures():
Promise<Uint8Array<ArrayBufferLike>[]>
Defined in: src/composer.ts:2106
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>[]>
rebuild()
Section titled “rebuild()”rebuild():
Promise<{methodCalls:Map<number,ABIMethod>;transactions:TransactionWithSigner[]; }>
Defined in: src/composer.ts:1790
Rebuild the group, discarding any previously built transactions. This will potentially cause new signers and suggested params to be used if the callbacks return a new value compared to the first build.
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod>; transactions: TransactionWithSigner[]; }>
The newly built transaction composer and the transactions
Example
Section titled “Example”const { atc, transactions, methodCalls } = await composer.rebuild()registerErrorTransformer()
Section titled “registerErrorTransformer()”registerErrorTransformer(
transformer):TransactionComposer
Defined in: src/composer.ts:447
Register a function that will be used to transform an error caught when simulating or executing
Parameters
Section titled “Parameters”transformer
Section titled “transformer”Returns
Section titled “Returns”TransactionComposer
The composer so you can chain method calls
send()
Section titled “send()”send(
params?):Promise<SendTransactionComposerResults>
Defined in: src/composer.ts:1809
Compose the transaction group and send it to the network.
Parameters
Section titled “Parameters”params?
Section titled “params?”The parameters to control execution with
Returns
Section titled “Returns”Promise<SendTransactionComposerResults>
The execution result
Example
Section titled “Example”const result = await composer.send()setMaxFees()
Section titled “setMaxFees()”setMaxFees(
maxFees):void
Defined in: src/composer.ts:2179
Parameters
Section titled “Parameters”maxFees
Section titled “maxFees”Map<number, AlgoAmount>
Returns
Section titled “Returns”void
simulate()
Section titled “simulate()”Call Signature
Section titled “Call Signature”simulate():
Promise<SendTransactionComposerResults&object>
Defined in: src/composer.ts:1989
Compose the transaction group and simulate sending it to the network
Returns
Section titled “Returns”Promise<SendTransactionComposerResults & object>
The simulation result
Example
Section titled “Example”const result = await composer.simulate()Call Signature
Section titled “Call Signature”simulate(
options):Promise<SendTransactionComposerResults&object>
Defined in: src/composer.ts:2000
Compose the transaction group and simulate sending it to the network
Parameters
Section titled “Parameters”options
Section titled “options”allowMoreLogging?
Section titled “allowMoreLogging?”boolean
Lifts limits on log opcode usage during simulation.
allowUnnamedResources?
Section titled “allowUnnamedResources?”boolean
Allows access to unnamed resources during simulation.
execTraceConfig?
Section titled “execTraceConfig?”extraOpcodeBudget?
Section titled “extraOpcodeBudget?”number
Applies extra opcode budget during simulation for each transaction group.
resultOnFailure?
Section titled “resultOnFailure?”boolean
Whether or not to return the result on simulation failure instead of throwing an error
round?
Section titled “round?”bigint
If provided, specifies the round preceding the simulation. State changes through this round will be used to run this simulation. Usually only the 4 most recent rounds will be available (controlled by the node config value MaxAcctLookback). If not specified, defaults to the latest available round.
skipSignatures
Section titled “skipSignatures”boolean
Whether or not to skip signatures for all built transactions and use an empty signer instead.
This will set fixSigners and allowEmptySignatures when sending the request to the algod API.
Returns
Section titled “Returns”Promise<SendTransactionComposerResults & object>
The simulation result
Example
Section titled “Example”const result = await composer.simulate({ skipSignatures: true,})Call Signature
Section titled “Call Signature”simulate(
options):Promise<SendTransactionComposerResults&object>
Defined in: src/composer.ts:2011
Compose the transaction group and simulate sending it to the network
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<SendTransactionComposerResults & object>
The simulation result
Example
Section titled “Example”const result = await composer.simulate({ extraOpcodeBudget: 1000,})arc2Note()
Section titled “arc2Note()”
staticarc2Note(note):Uint8Array
Defined in: src/composer.ts:2100
Create an encoded transaction note that follows the ARC-2 spec.
https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
Parameters
Section titled “Parameters”The ARC-2 transaction note data
Returns
Section titled “Returns”Uint8Array
The binary encoded transaction note