AlgorandClientTransactionCreator
Defined in: src/algorand-client-transaction-creator.ts:6
Orchestrates creating transactions for AlgorandClient.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AlgorandClientTransactionCreator(
newGroup):AlgorandClientTransactionCreator
Defined in: src/algorand-client-transaction-creator.ts:17
Creates a new AlgorandClientTransactionCreator
Parameters
Section titled “Parameters”newGroup
Section titled “newGroup”(config?) => TransactionComposer
A lambda that starts a new TransactionComposer transaction group
Returns
Section titled “Returns”AlgorandClientTransactionCreator
Example
Section titled “Example”const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer())Properties
Section titled “Properties”appCall()
Section titled “appCall()”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.
Parameters
Section titled “Parameters”params
Section titled “params”AppCallParams
The parameters for the app call transaction
Returns
Section titled “Returns”Promise<Transaction>
The application call transaction
Examples
Section titled “Examples”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()
Section titled “appCallMethodCall()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters for the app call transaction
accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; extraProgramPages?: number; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- A transaction with explicit signer
- A transaction (where the signer will be automatically assigned)
- An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
- Another method call (via method call params object)
- undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
method
Section titled “method”The ABI method to call
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”NoOp | OptIn | CloseOut | DeleteApplication
The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender
Section titled “sender”The address sending the transaction, optionally with an attached signer.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>
The application ABI method call transaction
Examples
Section titled “Examples”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()
Section titled “appCreate()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters for the app creation transaction
accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appId?
Section titled “appId?”0
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
Uint8Array<ArrayBufferLike>[]
Any arguments to pass to the smart contract call.
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
extraProgramPages?
Section titled “extraProgramPages?”number
Number of extra pages required for the programs. Defaults to the number needed for the programs in this call if not specified. This is immutable once the app is created.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication
The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
schema?
Section titled “schema?”{ globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }
The state schema for the app. This is immutable once the app is created.
schema.globalByteSlices
Section titled “schema.globalByteSlices”number
The number of byte slices saved in global state.
schema.globalInts
Section titled “schema.globalInts”number
The number of integers saved in global state.
schema.localByteSlices
Section titled “schema.localByteSlices”number
The number of byte slices saved in local state.
schema.localInts
Section titled “schema.localInts”number
The number of integers saved in local state.
sender
Section titled “sender”The address sending the transaction, optionally with an attached signer.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<Transaction>
The application create transaction
Examples
Section titled “Examples”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()
Section titled “appCreateMethodCall()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters for the app creation transaction
accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
appId?
Section titled “appId?”0
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; extraProgramPages?: number; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- A transaction with explicit signer
- A transaction (where the signer will be automatically assigned)
- An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
- Another method call (via method call params object)
- undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)).
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
extraProgramPages?
Section titled “extraProgramPages?”number
Number of extra pages required for the programs. Defaults to the number needed for the programs in this call if not specified. This is immutable once the app is created.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
method
Section titled “method”The ABI method to call
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication
The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
schema?
Section titled “schema?”{ globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }
The state schema for the app. This is immutable once the app is created.
schema.globalByteSlices
Section titled “schema.globalByteSlices”number
The number of byte slices saved in global state.
schema.globalInts
Section titled “schema.globalInts”number
The number of integers saved in global state.
schema.localByteSlices
Section titled “schema.localByteSlices”number
The number of byte slices saved in local state.
schema.localInts
Section titled “schema.localInts”number
The number of integers saved in local state.
sender
Section titled “sender”The address sending the transaction, optionally with an attached signer.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>
The application ABI method create transaction
Examples
Section titled “Examples”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()
Section titled “appDelete()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters for the app deletion transaction
Returns
Section titled “Returns”Promise<Transaction>
The application delete transaction
Examples
Section titled “Examples”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()
Section titled “appDeleteMethodCall()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters for the app deletion transaction
accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; extraProgramPages?: number; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- A transaction with explicit signer
- A transaction (where the signer will be automatically assigned)
- An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
- Another method call (via method call params object)
- undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
method
Section titled “method”The ABI method to call
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender
Section titled “sender”The address sending the transaction, optionally with an attached signer.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>
The application ABI method delete transaction
Examples
Section titled “Examples”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()
Section titled “appUpdate()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters for the app update transaction
accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
Uint8Array<ArrayBufferLike>[]
Any arguments to pass to the smart contract call.
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender
Section titled “sender”The address sending the transaction, optionally with an attached signer.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<Transaction>
The application update transaction
Examples
Section titled “Examples”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()
Section titled “appUpdateMethodCall()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters for the app update transaction
accessReferences?
Section titled “accessReferences?”Access references unifies accountReferences, appReferences, assetReferences, and boxReferences under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
accountReferences?
Section titled “accountReferences?”Any account addresses to add to the accounts array.
bigint
ID of the application; 0 if the application is being created.
appReferences?
Section titled “appReferences?”bigint[]
The ID of any apps to load to the foreign apps array.
approvalProgram
Section titled “approvalProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
(Transaction | ABIValue | Promise<Transaction> | TransactionWithSigner | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId?: 0; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; extraProgramPages?: number; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: NoOp | OptIn | CloseOut | UpdateApplication | DeleteApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; schema?: { globalByteSlices: number; globalInts: number; localByteSlices: number; localInts: number; }; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<{ accessReferences?: ResourceReference[]; accountReferences?: ReadableAddress[]; appId: bigint; appReferences?: bigint[]; approvalProgram: string | Uint8Array<ArrayBufferLike>; args?: Uint8Array<ArrayBufferLike>[]; assetReferences?: bigint[]; boxReferences?: BoxIdentifier | BoxReference[]; clearStateProgram: string | Uint8Array<ArrayBufferLike>; extraFee?: AlgoAmount; firstValidRound?: bigint; lastValidRound?: bigint; lease?: string | Uint8Array<ArrayBufferLike>; maxFee?: AlgoAmount; note?: string | Uint8Array<ArrayBufferLike>; onComplete?: UpdateApplication; rejectVersion?: number; rekeyTo?: ReadableAddress | undefined; sender: SendingAddress; signer?: AddressWithTransactionSigner | TransactionSigner; staticFee?: AlgoAmount; validityWindow?: number | bigint; }> | AppMethodCall<AppMethodCallParams> | undefined)[]
Arguments to the ABI method, either:
- An ABI value
- A transaction with explicit signer
- A transaction (where the signer will be automatically assigned)
- An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
- Another method call (via method call params object)
- undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
assetReferences?
Section titled “assetReferences?”bigint[]
The ID of any assets to load to the foreign assets array.
boxReferences?
Section titled “boxReferences?”(BoxIdentifier | BoxReference)[]
Any boxes to load to the boxes array.
Either the name identifier (which will be set against app ID of 0 i.e.
the current app), or a box identifier with the name identifier and app ID.
clearStateProgram
Section titled “clearStateProgram”string | Uint8Array<ArrayBufferLike>
The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
extraFee?
Section titled “extraFee?”The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
firstValidRound?
Section titled “firstValidRound?”bigint
Set the first round this transaction is valid. If left undefined, the value from algod will be used.
We recommend you only set this when you intentionally want this to be some time in the future.
lastValidRound?
Section titled “lastValidRound?”bigint
The last round this transaction is valid. It is recommended to use validityWindow instead.
lease?
Section titled “lease?”string | Uint8Array<ArrayBufferLike>
Prevent multiple transactions with the same lease being included within the validity window.
A lease enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
maxFee?
Section titled “maxFee?”Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
method
Section titled “method”The ABI method to call
string | Uint8Array<ArrayBufferLike>
Note to attach to the transaction. Max of 1000 bytes.
onComplete?
Section titled “onComplete?”The on-complete action of the call; defaults to no-op.
rejectVersion?
Section titled “rejectVersion?”number
If set, the transaction will be rejected when the app’s version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check.
rekeyTo?
Section titled “rekeyTo?”Change the signing key of the sender to the given address.
Warning: Please be careful with this parameter and be sure to read the official rekey guidance.
sender
Section titled “sender”The address sending the transaction, optionally with an attached signer.
signer?
Section titled “signer?”AddressWithTransactionSigner | TransactionSigner
The function used to sign transaction(s); if not specified then
an attempt will be made to find a registered signer for the
given sender or use a default signer (if configured).
staticFee?
Section titled “staticFee?”The static transaction fee. In most cases you want to use extraFee unless setting the fee to 0 to be covered by another transaction.
validityWindow?
Section titled “validityWindow?”number | bigint
How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod>; signers: Map<number, TransactionSigner>; transactions: Transaction[]; }>
The application ABI method update transaction
Examples
Section titled “Examples”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()
Section titled “assetConfig()”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.
Parameters
Section titled “Parameters”params
Section titled “params”AssetConfigParams
The parameters for the asset config transaction
Returns
Section titled “Returns”Promise<Transaction>
The asset config transaction
Examples
Section titled “Examples”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()
Section titled “assetCreate()”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.
Parameters
Section titled “Parameters”params
Section titled “params”AssetCreateParams
The parameters for the asset creation transaction
Returns
Section titled “Returns”Promise<Transaction>
The asset create transaction
Examples
Section titled “Examples”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()
Section titled “assetDestroy()”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.
Parameters
Section titled “Parameters”params
Section titled “params”AssetDestroyParams
The parameters for the asset destroy transaction
Returns
Section titled “Returns”Promise<Transaction>
The asset destroy transaction
Examples
Section titled “Examples”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()
Section titled “assetFreeze()”assetFreeze: (
params) =>Promise<Transaction>
Defined in: src/algorand-client-transaction-creator.ts:179
Create an Algorand Standard Asset freeze transaction.
Parameters
Section titled “Parameters”params
Section titled “params”AssetFreezeParams
The parameters for the asset freeze transaction
Returns
Section titled “Returns”Promise<Transaction>
The asset freeze transaction
Examples
Section titled “Examples”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()
Section titled “assetOptIn()”assetOptIn: (
params) =>Promise<Transaction>
Defined in: src/algorand-client-transaction-creator.ts:272
Create an Algorand Standard Asset opt-in transaction.
Parameters
Section titled “Parameters”params
Section titled “params”AssetOptInParams
The parameters for the asset opt-in transaction
Returns
Section titled “Returns”Promise<Transaction>
The asset opt-in transaction
Examples
Section titled “Examples”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()
Section titled “assetOptOut()”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
Parameters
Section titled “Parameters”params
Section titled “params”AssetOptOutParams
The parameters for the asset opt-out transaction
Returns
Section titled “Returns”Promise<Transaction>
The asset opt-out transaction
Examples
Section titled “Examples”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()
Section titled “assetTransfer()”assetTransfer: (
params) =>Promise<Transaction>
Defined in: src/algorand-client-transaction-creator.ts:244
Create an Algorand Standard Asset transfer transaction.
Parameters
Section titled “Parameters”params
Section titled “params”AssetTransferParams
The parameters for the asset transfer transaction
Returns
Section titled “Returns”Promise<Transaction>
The result of the asset transfer transaction
Examples
Section titled “Examples”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()
Section titled “offlineKeyRegistration()”offlineKeyRegistration: (
params) =>Promise<Transaction>
Defined in: src/algorand-client-transaction-creator.ts:739
Create an offline key registration transaction.
Parameters
Section titled “Parameters”params
Section titled “params”OfflineKeyRegistrationParams
The parameters for the key registration transaction
Returns
Section titled “Returns”Promise<Transaction>
The offline key registration transaction
Examples
Section titled “Examples”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()
Section titled “onlineKeyRegistration()”onlineKeyRegistration: (
params) =>Promise<Transaction>
Defined in: src/algorand-client-transaction-creator.ts:709
Create an online key registration transaction.
Parameters
Section titled “Parameters”params
Section titled “params”OnlineKeyRegistrationParams
The parameters for the key registration transaction
Returns
Section titled “Returns”Promise<Transaction>
The online key registration transaction
Examples
Section titled “Examples”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()
Section titled “payment()”payment: (
params) =>Promise<Transaction>
Defined in: src/algorand-client-transaction-creator.ts:72
Create a payment transaction to transfer Algo between accounts.
Parameters
Section titled “Parameters”params
Section titled “params”PaymentParams
The parameters for the payment transaction
Returns
Section titled “Returns”Promise<Transaction>
The payment transaction
Examples
Section titled “Examples”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(),})