Skip to content

TransactionComposer

Defined in: src/composer.ts:224

TransactionComposer helps you compose and execute transactions as a transaction group.

new TransactionComposer(params): TransactionComposer

Defined in: src/composer.ts:297

Create a TransactionComposer.

TransactionComposerParams

The configuration for this composer

TransactionComposer

The TransactionComposer instance

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.

AppCallParams

The application call transaction parameters

TransactionComposer

The composer so you can chain method calls

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(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.

The ABI method application call transaction parameters

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.

ReadableAddress[]

Any account addresses to add to the accounts array.

bigint

ID of the application; 0 if the application is being created.

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)

bigint[]

The ID of any assets to load to the foreign assets array.

(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.

AlgoAmount

The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.

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.

bigint

The last round this transaction is valid. It is recommended to use validityWindow instead.

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).

AlgoAmount

Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.

ABIMethod

The ABI method to call

string | Uint8Array<ArrayBufferLike>

Note to attach to the transaction. Max of 1000 bytes.

NoOp | OptIn | CloseOut | DeleteApplication

The on-complete action of the call; defaults to no-op.

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.

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.

SendingAddress

The address sending the transaction, optionally with an attached 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).

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.

number | bigint

How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

TransactionComposer

The composer so you can chain method calls

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(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.

The application create transaction parameters

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.

ReadableAddress[]

Any account addresses to add to the accounts array.

0

bigint[]

The ID of any apps to load to the foreign apps array.

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.

bigint[]

The ID of any assets to load to the foreign assets array.

(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.

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)).

AlgoAmount

The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.

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.

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.

bigint

The last round this transaction is valid. It is recommended to use validityWindow instead.

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).

AlgoAmount

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.

NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication

The on-complete action of the call; defaults to no-op.

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.

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.

{ globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }

The state schema for the app. This is immutable once the app is created.

number

The number of byte slices saved in global state.

number

The number of integers saved in global state.

number

The number of byte slices saved in local state.

number

The number of integers saved in local state.

SendingAddress

The address sending the transaction, optionally with an attached 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).

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.

number | bigint

How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

TransactionComposer

The composer so you can chain method calls

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(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.

The ABI create method application call transaction parameters

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.

ReadableAddress[]

Any account addresses to add to the accounts array.

0

bigint[]

The ID of any apps to load to the foreign apps array.

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)

bigint[]

The ID of any assets to load to the foreign assets array.

(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.

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)).

AlgoAmount

The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.

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.

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.

bigint

The last round this transaction is valid. It is recommended to use validityWindow instead.

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).

AlgoAmount

Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.

ABIMethod

The ABI method to call

string | Uint8Array<ArrayBufferLike>

Note to attach to the transaction. Max of 1000 bytes.

NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication

The on-complete action of the call; defaults to no-op.

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.

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.

{ globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }

The state schema for the app. This is immutable once the app is created.

number

The number of byte slices saved in global state.

number

The number of integers saved in global state.

number

The number of byte slices saved in local state.

number

The number of integers saved in local state.

SendingAddress

The address sending the transaction, optionally with an attached 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).

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.

number | bigint

How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

TransactionComposer

The composer so you can chain method calls

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(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.

AppDeleteParams

The application delete transaction parameters

TransactionComposer

The composer so you can chain method calls

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(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.

The ABI delete method application call transaction parameters

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.

ReadableAddress[]

Any account addresses to add to the accounts array.

bigint

ID of the application; 0 if the application is being created.

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)

bigint[]

The ID of any assets to load to the foreign assets array.

(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.

AlgoAmount

The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.

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.

bigint

The last round this transaction is valid. It is recommended to use validityWindow instead.

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).

AlgoAmount

Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.

ABIMethod

The ABI method to call

string | Uint8Array<ArrayBufferLike>

Note to attach to the transaction. Max of 1000 bytes.

DeleteApplication

The on-complete action of the call; defaults to no-op.

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.

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.

SendingAddress

The address sending the transaction, optionally with an attached 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).

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.

number | bigint

How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

TransactionComposer

The composer so you can chain method calls

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(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.

The application update transaction parameters

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.

ReadableAddress[]

Any account addresses to add to the accounts array.

bigint

ID of the application; 0 if the application is being created.

bigint[]

The ID of any apps to load to the foreign apps array.

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.

bigint[]

The ID of any assets to load to the foreign assets array.

(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.

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))

AlgoAmount

The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.

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.

bigint

The last round this transaction is valid. It is recommended to use validityWindow instead.

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).

AlgoAmount

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.

UpdateApplication

The on-complete action of the call; defaults to no-op.

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.

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.

SendingAddress

The address sending the transaction, optionally with an attached 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).

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.

number | bigint

How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

TransactionComposer

The composer so you can chain method calls

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(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.

The ABI update method application call transaction parameters

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.

ReadableAddress[]

Any account addresses to add to the accounts array.

bigint

ID of the application; 0 if the application is being created.

bigint[]

The ID of any apps to load to the foreign apps array.

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)

bigint[]

The ID of any assets to load to the foreign assets array.

(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.

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))

AlgoAmount

The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.

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.

bigint

The last round this transaction is valid. It is recommended to use validityWindow instead.

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).

AlgoAmount

Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.

ABIMethod

The ABI method to call

string | Uint8Array<ArrayBufferLike>

Note to attach to the transaction. Max of 1000 bytes.

UpdateApplication

The on-complete action of the call; defaults to no-op.

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.

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.

SendingAddress

The address sending the transaction, optionally with an attached 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).

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.

number | bigint

How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

TransactionComposer

The composer so you can chain method calls

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(params): TransactionComposer

Defined in: src/composer.ts:609

Add an asset config transaction to the transaction group.

AssetConfigParams

The asset config transaction parameters

TransactionComposer

The composer so you can chain method calls

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
```typescript
composer.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
```typescript
composer.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(params): TransactionComposer

Defined in: src/composer.ts:643

Add an asset freeze transaction to the transaction group.

AssetFreezeParams

The asset freeze transaction parameters

TransactionComposer

The composer so you can chain method calls

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(params): TransactionComposer

Defined in: src/composer.ts:744

Add an asset opt-in transaction to the transaction group.

AssetOptInParams

The asset opt-in transaction parameters

TransactionComposer

The composer so you can chain method calls

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(params): TransactionComposer

Defined in: src/composer.ts:782

Add an asset opt-out transaction to the transaction group.

AssetOptOutParams

The asset opt-out transaction parameters

TransactionComposer

The composer so you can chain method calls

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(params): TransactionComposer

Defined in: src/composer.ts:712

Add an asset transfer transaction to the transaction group.

AssetTransferParams

The asset transfer transaction parameters

TransactionComposer

The composer so you can chain method calls

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(params): TransactionComposer

Defined in: src/composer.ts:1302

Add an offline key registration transaction to the transaction group.

OfflineKeyRegistrationParams

The offline key registration transaction parameters

TransactionComposer

The composer so you can chain method calls

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(params): TransactionComposer

Defined in: src/composer.ts:1267

Add an online key registration transaction to the transaction group.

OnlineKeyRegistrationParams

The online key registration transaction parameters

TransactionComposer

The composer so you can chain method calls

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(params): TransactionComposer

Defined in: src/composer.ts:533

Add a payment transaction to the transaction group.

PaymentParams

The payment transaction parameters

TransactionComposer

The composer so you can chain method calls

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
```typescript
composer.addTransaction(txn)

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.

TransactionComposer

The transaction composer to add

TransactionComposer

The composer so you can chain method calls

const innerComposer = algorand.newGroup()
.addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (1).algo() })
.addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (2).algo() })
composer.addTransactionComposer(innerComposer)

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.

Promise<{ methodCalls: Map<number, ABIMethod>; transactions: TransactionWithSigner[]; }>

The built transaction composer, the transactions and any corresponding method calls

const { transactions, methodCalls } = await composer.build()

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.

Promise<BuiltTransactions>

An object containing the array of built transactions, method calls, and signers

const { transactions, methodCalls, signers } = await composer.buildTransactions()

clone(composerConfig?): TransactionComposer

Defined in: src/composer.ts:419

TransactionComposerConfig

TransactionComposer


count(): number

Defined in: src/composer.ts:1312

Get the number of transactions currently added to this composer.

number

The number of transactions currently added to this composer


gatherSignatures(): Promise<Uint8Array<ArrayBufferLike>[]>

Defined in: src/composer.ts:2106

Promise<Uint8Array<ArrayBufferLike>[]>


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.

Promise<{ methodCalls: Map<number, ABIMethod>; transactions: TransactionWithSigner[]; }>

The newly built transaction composer and the transactions

const { atc, transactions, methodCalls } = await composer.rebuild()

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

ErrorTransformer

TransactionComposer

The composer so you can chain method calls


send(params?): Promise<SendTransactionComposerResults>

Defined in: src/composer.ts:1809

Compose the transaction group and send it to the network.

SendParams

The parameters to control execution with

Promise<SendTransactionComposerResults>

The execution result

const result = await composer.send()

setMaxFees(maxFees): void

Defined in: src/composer.ts:2179

Map<number, AlgoAmount>

void


simulate(): Promise<SendTransactionComposerResults & object>

Defined in: src/composer.ts:1989

Compose the transaction group and simulate sending it to the network

Promise<SendTransactionComposerResults & object>

The simulation result

const result = await composer.simulate()

simulate(options): Promise<SendTransactionComposerResults & object>

Defined in: src/composer.ts:2000

Compose the transaction group and simulate sending it to the network

boolean

Lifts limits on log opcode usage during simulation.

boolean

Allows access to unnamed resources during simulation.

SimulateTraceConfig

number

Applies extra opcode budget during simulation for each transaction group.

boolean

Whether or not to return the result on simulation failure instead of throwing an error

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.

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.

Promise<SendTransactionComposerResults & object>

The simulation result

const result = await composer.simulate({
skipSignatures: true,
})

simulate(options): Promise<SendTransactionComposerResults & object>

Defined in: src/composer.ts:2011

Compose the transaction group and simulate sending it to the network

RawSimulateOptions

Promise<SendTransactionComposerResults & object>

The simulation result

const result = await composer.simulate({
extraOpcodeBudget: 1000,
})

static arc2Note(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

Arc2TransactionNote

The ARC-2 transaction note data

Uint8Array

The binary encoded transaction note