AlgorandClientTransactionCreator
@algorandfoundation/algokit-utils / types/algorand-client-transaction-creator / AlgorandClientTransactionCreator
types/algorand-client-transaction-creator.AlgorandClientTransactionCreator
Orchestrates creating transactions for AlgorandClient.
Table of contents
Section titled “Table of contents”Constructors
Section titled “Constructors”Properties
Section titled “Properties”- _newGroup
- appCall
- appCallMethodCall
- appCreate
- appCreateMethodCall
- appDelete
- appDeleteMethodCall
- appUpdate
- appUpdateMethodCall
- assetConfig
- assetCreate
- assetDestroy
- assetFreeze
- assetOptIn
- assetOptOut
- assetTransfer
- offlineKeyRegistration
- onlineKeyRegistration
- payment
Methods
Section titled “Methods”Constructors
Section titled “Constructors”constructor
Section titled “constructor”• new AlgorandClientTransactionCreator(newGroup): AlgorandClientTransactionCreator
Creates a new AlgorandClientTransactionCreator
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
newGroup | () => TransactionComposer | A lambda that starts a new TransactionComposer transaction group |
Returns
Section titled “Returns”AlgorandClientTransactionCreator
Example
const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer());Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:19
Properties
Section titled “Properties”_newGroup
Section titled “_newGroup”• Private _newGroup: () => TransactionComposer
Type declaration
Section titled “Type declaration”▸ (): TransactionComposer
Returns
Section titled “Returns”Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:9
appCall
Section titled “appCall”• appCall: (params: AppCallParams) => Promise<Transaction>
Create an application call transaction.
Note: you may prefer to use algorand.client to get an app client for more advanced functionality.
Example
await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' });Example
await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS', onComplete: algosdk.OnApplicationComplete.OptInOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AppCallParams | The parameters for the app call transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:458
appCallMethodCall
Section titled “appCallMethodCall”• appCallMethodCall: (params: AppCallMethodCall) => Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
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.
Example
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'],});Example
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: algosdk.OnApplicationComplete.OptInOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AppCallMethodCall | The parameters for the app call transaction |
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:653
appCreate
Section titled “appCreate”• appCreate: (params: { accountReferences?: (string | Address)[] ; appReferences?: bigint[] ; approvalProgram: string | Uint8Array ; args?: Uint8Array[] ; assetReferences?: bigint[] ; boxReferences?: (BoxIdentifier | BoxReference)[] ; clearStateProgram: string | Uint8Array ; extraFee?: AlgoAmount ; extraProgramPages?: number ; firstValidRound?: bigint ; lastValidRound?: bigint ; lease?: string | Uint8Array ; maxFee?: AlgoAmount ; note?: string | Uint8Array ; onComplete?: NoOpOC | OptInOC | CloseOutOC | UpdateApplicationOC | DeleteApplicationOC ; rekeyTo?: string | Address ; schema?: { globalByteSlices: number ; globalInts: number ; localByteSlices: number ; localInts: number } ; sender: string | Address ; signer?: TransactionSigner | TransactionSignerAccount ; staticFee?: AlgoAmount ; validityWindow?: number | bigint }) => Promise<Transaction>
Create an application create transaction.
Note: you may prefer to use algorand.client to get an app client for more advanced functionality.
Example
await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE',});Example
await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: "TEALCODE", clearStateProgram: "TEALCODE", schema: { globalInts: 1, globalByteSlices: 2, localInts: 3, localByteSlices: 4 }, extraProgramPages: 1, onComplete: algosdk.OnApplicationComplete.OptInOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | Object | The parameters for the app creation transaction |
params.accountReferences? | (string | Address)[] | Any account addresses to add to the accounts array. |
params.appReferences? | bigint[] | The ID of any apps to load to the foreign apps array. |
params.approvalProgram | string | Uint8Array | 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)). |
params.args? | Uint8Array[] | Any arguments to pass to the smart contract call. |
params.assetReferences? | bigint[] | The ID of any assets to load to the foreign assets array. |
params.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. |
params.clearStateProgram | string | Uint8Array | The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). |
params.extraFee? | AlgoAmount | The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees. |
params.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. |
params.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. |
params.lastValidRound? | bigint | The last round this transaction is valid. It is recommended to use validityWindow instead. |
params.lease? | string | Uint8Array | 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). |
params.maxFee? | AlgoAmount | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. |
params.note? | string | Uint8Array | Note to attach to the transaction. Max of 1000 bytes. |
params.onComplete? | NoOpOC | OptInOC | CloseOutOC | UpdateApplicationOC | DeleteApplicationOC | The on-complete action of the call; defaults to no-op. |
params.rekeyTo? | string | Address | 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. |
params.schema? | Object | The state schema for the app. This is immutable once the app is created. |
params.schema.globalByteSlices | number | The number of byte slices saved in global state. |
params.schema.globalInts | number | The number of integers saved in global state. |
params.schema.localByteSlices | number | The number of byte slices saved in local state. |
params.schema.localInts | number | The number of integers saved in local state. |
params.sender | string | Address | The address of the account sending the transaction. |
params.signer? | TransactionSigner | TransactionSignerAccount | 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). |
params.staticFee? | 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. |
params.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>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:354
appCreateMethodCall
Section titled “appCreateMethodCall”• appCreateMethodCall: (params: AppCreateMethodCall) => Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
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.
Example
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'],});Example
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: algosdk.OnApplicationComplete.OptInOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AppCreateMethodCall | The parameters for the app creation transaction |
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:513
appDelete
Section titled “appDelete”• appDelete: (params: AppDeleteParams) => Promise<Transaction>
Create an application delete transaction.
Note: you may prefer to use algorand.client to get an app client for more advanced functionality.
Example
await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' });Example
await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS', onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AppDeleteParams | The parameters for the app deletion transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:424
appDeleteMethodCall
Section titled “appDeleteMethodCall”• appDeleteMethodCall: (params: AppDeleteMethodCall) => Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
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.
Example
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'],});Example
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: algosdk.OnApplicationComplete.DeleteApplicationOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AppDeleteMethodCall | The parameters for the app deletion transaction |
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:607
appUpdate
Section titled “appUpdate”• appUpdate: (params: { accountReferences?: (string | Address)[] ; appId: bigint ; appReferences?: bigint[] ; approvalProgram: string | Uint8Array ; args?: Uint8Array[] ; assetReferences?: bigint[] ; boxReferences?: (BoxIdentifier | BoxReference)[] ; clearStateProgram: string | Uint8Array ; extraFee?: AlgoAmount ; firstValidRound?: bigint ; lastValidRound?: bigint ; lease?: string | Uint8Array ; maxFee?: AlgoAmount ; note?: string | Uint8Array ; onComplete?: UpdateApplicationOC ; rekeyTo?: string | Address ; sender: string | Address ; signer?: TransactionSigner | TransactionSignerAccount ; staticFee?: AlgoAmount ; validityWindow?: number | bigint }) => Promise<Transaction>
Create an application update transaction.
Note: you may prefer to use algorand.client to get an app client for more advanced functionality.
Example
await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE',});Example
await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: "TEALCODE", clearStateProgram: "TEALCODE", onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | Object | The parameters for the app update transaction |
params.accountReferences? | (string | Address)[] | Any account addresses to add to the accounts array. |
params.appId | bigint | ID of the application; 0 if the application is being created. |
params.appReferences? | bigint[] | The ID of any apps to load to the foreign apps array. |
params.approvalProgram | string | Uint8Array | 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)) |
params.args? | Uint8Array[] | Any arguments to pass to the smart contract call. |
params.assetReferences? | bigint[] | The ID of any assets to load to the foreign assets array. |
params.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. |
params.clearStateProgram | string | Uint8Array | The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) |
params.extraFee? | AlgoAmount | The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees. |
params.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. |
params.lastValidRound? | bigint | The last round this transaction is valid. It is recommended to use validityWindow instead. |
params.lease? | string | Uint8Array | 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). |
params.maxFee? | AlgoAmount | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. |
params.note? | string | Uint8Array | Note to attach to the transaction. Max of 1000 bytes. |
params.onComplete? | UpdateApplicationOC | The on-complete action of the call; defaults to no-op. |
params.rekeyTo? | string | Address | 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. |
params.sender | string | Address | The address of the account sending the transaction. |
params.signer? | TransactionSigner | TransactionSignerAccount | 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). |
params.staticFee? | 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. |
params.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>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:390
appUpdateMethodCall
Section titled “appUpdateMethodCall”• appUpdateMethodCall: (params: AppUpdateMethodCall) => Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
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.
Example
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'],});Example
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: algosdk.OnApplicationComplete.UpdateApplicationOC, args: [new Uint8Array(1, 2, 3, 4)] accountReferences: ["ACCOUNT_1"] appReferences: [123n, 1234n] assetReferences: [12345n] boxReferences: ["box1", {appId: 1234n, name: "box2"}] 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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AppUpdateMethodCall | The parameters for the app update transaction |
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:561
assetConfig
Section titled “assetConfig”• assetConfig: (params: AssetConfigParams) => Promise<Transaction>
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.
Example
await algorand.createTransaction.assetConfig({ sender: 'MANAGERADDRESS', assetId: 123456n, manager: 'MANAGERADDRESS',});Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AssetConfigParams | The parameters for the asset config transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:151
assetCreate
Section titled “assetCreate”• assetCreate: (params: AssetCreateParams) => Promise<Transaction>
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.
Example
await algorand.createTransaction.assetCreate({ sender: 'CREATORADDRESS', total: 100n });Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AssetCreateParams | The parameters for the asset creation transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:115
assetDestroy
Section titled “assetDestroy”• assetDestroy: (params: AssetDestroyParams) => Promise<Transaction>
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.
Example
await algorand.createTransaction.assetDestroy({ sender: 'MANAGERADDRESS', assetId: 123456n });Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AssetDestroyParams | The parameters for the asset destroy transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:213
assetFreeze
Section titled “assetFreeze”• assetFreeze: (params: AssetFreezeParams) => Promise<Transaction>
Create an Algorand Standard Asset freeze transaction.
Example
await algorand.createTransaction.assetFreeze({ sender: 'MANAGERADDRESS', assetId: 123456n, account: 'ACCOUNTADDRESS', frozen: true,});Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AssetFreezeParams | The parameters for the asset freeze transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:181
assetOptIn
Section titled “assetOptIn”• assetOptIn: (params: AssetOptInParams) => Promise<Transaction>
Create an Algorand Standard Asset opt-in transaction.
Example
await algorand.createTransaction.assetOptIn({ sender: 'SENDERADDRESS', assetId: 123456n });Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AssetOptInParams | The parameters for the asset opt-in transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:274
assetOptOut
Section titled “assetOptOut”• assetOptOut: (params: AssetOptOutParams) => Promise<Transaction>
Create an asset opt-out transaction.
Note: If the account has a balance of the asset, it will lose those assets
Example
await algorand.createTransaction.assetOptOut({ sender: 'SENDERADDRESS', assetId: 123456n, ensureZeroBalance: true,});Example
await algorand.createTransaction.assetOptOut({ sender: 'SENDERADDRESS', creator: 'CREATORADDRESS', assetId: 123456n, ensureZeroBalance: true,});Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AssetOptOutParams | The parameters for the asset opt-out transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:311
assetTransfer
Section titled “assetTransfer”• assetTransfer: (params: AssetTransferParams) => Promise<Transaction>
Create an Algorand Standard Asset transfer transaction.
Example
await algorand.createTransaction.assetTransfer({ sender: 'HOLDERADDRESS', assetId: 123456n, amount: 1n, receiver: 'RECEIVERADDRESS',});Example
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(),})Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | AssetTransferParams | The parameters for the asset transfer transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:246
offlineKeyRegistration
Section titled “offlineKeyRegistration”• offlineKeyRegistration: (params: OfflineKeyRegistrationParams) => Promise<Transaction>
Create an offline key registration transaction.
Example
await algorand.createTransaction.offlineKeyRegistration({ sender: 'SENDERADDRESS',});Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | OfflineKeyRegistrationParams | The parameters for the key registration transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:725
onlineKeyRegistration
Section titled “onlineKeyRegistration”• onlineKeyRegistration: (params: OnlineKeyRegistrationParams) => Promise<Transaction>
Create an online key registration transaction.
Example
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,});Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | OnlineKeyRegistrationParams | The parameters for the key registration transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:695
payment
Section titled “payment”• payment: (params: PaymentParams) => Promise<Transaction>
Create a payment transaction to transfer Algo between accounts.
Example
await algorand.createTransaction.payment({ sender: 'SENDERADDRESS', receiver: 'RECEIVERADDRESS', amount: (4).algo(),});Example
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(),});Type declaration
Section titled “Type declaration”▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
params | PaymentParams | The parameters for the payment transaction |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:74
Methods
Section titled “Methods”_transaction
Section titled “_transaction”▸ _transaction<T>(c): (params: T) => Promise<Transaction>
Type parameters
Section titled “Type parameters”| Name |
|---|
T |
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
c | (c: TransactionComposer) => (params: T) => TransactionComposer |
Returns
Section titled “Returns”fn
▸ (params): Promise<Transaction>
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
params | T |
Returns
Section titled “Returns”Promise<Transaction>
Defined in
Section titled “Defined in”src/types/algorand-client-transaction-creator.ts:23
_transactions
Section titled “_transactions”▸ _transactions<T>(c): (params: T) => Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Type parameters
Section titled “Type parameters”| Name |
|---|
T |
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
c | (c: TransactionComposer) => (params: T) => TransactionComposer |
Returns
Section titled “Returns”fn
▸ (params): Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
params | T |
Returns
Section titled “Returns”Promise<{ methodCalls: Map<number, ABIMethod> ; signers: Map<number, TransactionSigner> ; transactions: Transaction[] }>