Skip to content

AlgorandClientTransactionCreator

Defined in: src/algorand-client-transaction-creator.ts:6

Orchestrates creating transactions for AlgorandClient.

new AlgorandClientTransactionCreator(newGroup): AlgorandClientTransactionCreator

Defined in: src/algorand-client-transaction-creator.ts:17

Creates a new AlgorandClientTransactionCreator

(config?) => TransactionComposer

A lambda that starts a new TransactionComposer transaction group

AlgorandClientTransactionCreator

const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer())

appCall: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:464

Create an application call transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

AppCallParams

The parameters for the app call transaction

Promise<Transaction>

The application call transaction

await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })
await algorand.createTransaction.appCall({
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,
})

appCallMethodCall: (params) => Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

Defined in: src/algorand-client-transaction-creator.ts:667

Create an application call with ABI method call transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

The parameters for the app call transaction

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.

Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

The application ABI method call transaction

const method = new ABIMethod({
name: 'method',
args: [{ name: 'arg1', type: 'string' }],
returns: { type: 'string' },
})
await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
const method = new ABIMethod({
name: 'method',
args: [{ name: 'arg1', type: 'string' }],
returns: { type: 'string' },
})
await algorand.createTransaction.appCallMethodCall({
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,
})

appCreate: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:354

Create an application create transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

The parameters for the app creation transaction

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.

Promise<Transaction>

The application create transaction

await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
await algorand.createTransaction.appCreate({
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,
})

appCreateMethodCall: (params) => Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

Defined in: src/algorand-client-transaction-creator.ts:521

Create an application create call with ABI method call transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

The parameters for the app creation transaction

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.

Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

The application ABI method create transaction

const method = new ABIMethod({
name: 'method',
args: [{ name: 'arg1', type: 'string' }],
returns: { type: 'string' },
})
await algorand.createTransaction.appCreateMethodCall({ 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' },
})
await algorand.createTransaction.appCreateMethodCall({
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,
})

appDelete: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:428

Create an application delete transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

AppDeleteParams

The parameters for the app deletion transaction

Promise<Transaction>

The application delete transaction

await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })
await algorand.createTransaction.appDelete({
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,
})

appDeleteMethodCall: (params) => Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

Defined in: src/algorand-client-transaction-creator.ts:619

Create an application delete call with ABI method call transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

The parameters for the app deletion transaction

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.

Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

The application ABI method delete transaction

const method = new ABIMethod({
name: 'method',
args: [{ name: 'arg1', type: 'string' }],
returns: { type: 'string' },
})
await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
const method = new ABIMethod({
name: 'method',
args: [{ name: 'arg1', type: 'string' }],
returns: { type: 'string' },
})
await algorand.createTransaction.appDeleteMethodCall({
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,
})

appUpdate: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:392

Create an application update transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

The parameters for the app update transaction

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.

Promise<Transaction>

The application update transaction

await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
await algorand.createTransaction.appUpdate({
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,
})

appUpdateMethodCall: (params) => Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

Defined in: src/algorand-client-transaction-creator.ts:571

Create an application update call with ABI method call transaction.

Note: you may prefer to use algorand.client to get an app client for more advanced functionality.

The parameters for the app update transaction

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.

Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>

The application ABI method update transaction

const method = new ABIMethod({
name: 'method',
args: [{ name: 'arg1', type: 'string' }],
returns: { type: 'string' },
})
await algorand.createTransaction.appUpdateMethodCall({ 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' },
})
await algorand.createTransaction.appUpdateMethodCall({
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,
})

assetConfig: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:149

Create an asset config transaction to reconfigure an existing Algorand Standard Asset.

Note: The manager, reserve, freeze, and clawback addresses are immutably empty if they are not set. If manager is not set then all fields are immutable from that point forward.

AssetConfigParams

The parameters for the asset config transaction

Promise<Transaction>

The asset config transaction

await algorand.createTransaction.assetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
await algorand.createTransaction.assetConfig({
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(),
})

assetCreate: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:113

Create a create Algorand Standard Asset transaction.

The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.

AssetCreateParams

The parameters for the asset creation transaction

Promise<Transaction>

The asset create transaction

await algorand.createTransaction.assetCreate({ sender: "CREATORADDRESS", total: 100n})
await algorand.createTransaction.assetCreate({
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(),
})

assetDestroy: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:211

Create an Algorand Standard Asset destroy transaction.

Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.

AssetDestroyParams

The parameters for the asset destroy transaction

Promise<Transaction>

The asset destroy transaction

await algorand.createTransaction.assetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
await algorand.createTransaction.assetDestroy({
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(),
})

assetFreeze: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:179

Create an Algorand Standard Asset freeze transaction.

AssetFreezeParams

The parameters for the asset freeze transaction

Promise<Transaction>

The asset freeze transaction

await algorand.createTransaction.assetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
await algorand.createTransaction.assetFreeze({
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(),
})

assetOptIn: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:272

Create an Algorand Standard Asset opt-in transaction.

AssetOptInParams

The parameters for the asset opt-in transaction

Promise<Transaction>

The asset opt-in transaction

await algorand.createTransaction.assetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
await algorand.createTransaction.assetOptIn({
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(),
})

assetOptOut: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:309

Create an asset opt-out transaction.

Note: If the account has a balance of the asset, it will lose those assets

AssetOptOutParams

The parameters for the asset opt-out transaction

Promise<Transaction>

The asset opt-out transaction

await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
await algorand.createTransaction.assetOptOut({
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(),
})

assetTransfer: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:244

Create an Algorand Standard Asset transfer transaction.

AssetTransferParams

The parameters for the asset transfer transaction

Promise<Transaction>

The result of the asset transfer transaction

await algorand.createTransaction.assetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
await algorand.createTransaction.assetTransfer({
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(),
})

offlineKeyRegistration: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:739

Create an offline key registration transaction.

OfflineKeyRegistrationParams

The parameters for the key registration transaction

Promise<Transaction>

The offline key registration transaction

await algorand.createTransaction.offlineKeyRegistration({
sender: 'SENDERADDRESS',
})
await algorand.createTransaction.offlineKeyRegistration({
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(),
})

onlineKeyRegistration: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:709

Create an online key registration transaction.

OnlineKeyRegistrationParams

The parameters for the key registration transaction

Promise<Transaction>

The online key registration transaction

await algorand.createTransaction.onlineKeyRegistration({
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,
})
await algorand.createTransaction.onlineKeyRegistration({
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(),
})

payment: (params) => Promise<Transaction>

Defined in: src/algorand-client-transaction-creator.ts:72

Create a payment transaction to transfer Algo between accounts.

PaymentParams

The parameters for the payment transaction

Promise<Transaction>

The payment transaction

await algorand.createTransaction.payment({
sender: 'SENDERADDRESS',
receiver: 'RECEIVERADDRESS',
amount: (4).algo(),
})
await algorand.createTransaction.payment({
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(),
})