Skip to content

AlgorandClientTransactionCreator

@algorandfoundation/algokit-utils / types/algorand-client-transaction-creator / AlgorandClientTransactionCreator

types/algorand-client-transaction-creator.AlgorandClientTransactionCreator

Orchestrates creating transactions for AlgorandClient.

new AlgorandClientTransactionCreator(newGroup): AlgorandClientTransactionCreator

Creates a new AlgorandClientTransactionCreator

NameTypeDescription
newGroup() => TransactionComposerA lambda that starts a new TransactionComposer transaction group

AlgorandClientTransactionCreator

Example

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

src/types/algorand-client-transaction-creator.ts:19

Private _newGroup: () => TransactionComposer

▸ (): TransactionComposer

TransactionComposer

src/types/algorand-client-transaction-creator.ts:9


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(),
})

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAppCallParamsThe parameters for the app call transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:458


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(),
})

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

NameTypeDescription
paramsAppCallMethodCallThe parameters for the app call transaction

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

src/types/algorand-client-transaction-creator.ts:653


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(),
})

▸ (params): Promise<Transaction>

NameTypeDescription
paramsObjectThe 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.approvalProgramstring | Uint8ArrayThe 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.clearStateProgramstring | Uint8ArrayThe 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?AlgoAmountThe fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
params.extraProgramPages?numberNumber 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?bigintSet 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?bigintThe last round this transaction is valid. It is recommended to use validityWindow instead.
params.lease?string | Uint8ArrayPrevent 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?AlgoAmountThrow an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
params.note?string | Uint8ArrayNote to attach to the transaction. Max of 1000 bytes.
params.onComplete?NoOpOC | OptInOC | CloseOutOC | UpdateApplicationOC | DeleteApplicationOCThe on-complete action of the call; defaults to no-op.
params.rekeyTo?string | AddressChange 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?ObjectThe state schema for the app. This is immutable once the app is created.
params.schema.globalByteSlicesnumberThe number of byte slices saved in global state.
params.schema.globalIntsnumberThe number of integers saved in global state.
params.schema.localByteSlicesnumberThe number of byte slices saved in local state.
params.schema.localIntsnumberThe number of integers saved in local state.
params.senderstring | AddressThe address of the account sending the transaction.
params.signer?TransactionSigner | TransactionSignerAccountThe 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?AlgoAmountThe 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 | bigintHow many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:354


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(),
})

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

NameTypeDescription
paramsAppCreateMethodCallThe parameters for the app creation transaction

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

src/types/algorand-client-transaction-creator.ts:513


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(),
})

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAppDeleteParamsThe parameters for the app deletion transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:424


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(),
})

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

NameTypeDescription
paramsAppDeleteMethodCallThe parameters for the app deletion transaction

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

src/types/algorand-client-transaction-creator.ts:607


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(),
})

▸ (params): Promise<Transaction>

NameTypeDescription
paramsObjectThe parameters for the app update transaction
params.accountReferences?(string | Address)[]Any account addresses to add to the accounts array.
params.appIdbigintID 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.approvalProgramstring | Uint8ArrayThe 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.clearStateProgramstring | Uint8ArrayThe program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array))
params.extraFee?AlgoAmountThe fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees.
params.firstValidRound?bigintSet 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?bigintThe last round this transaction is valid. It is recommended to use validityWindow instead.
params.lease?string | Uint8ArrayPrevent 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?AlgoAmountThrow an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods.
params.note?string | Uint8ArrayNote to attach to the transaction. Max of 1000 bytes.
params.onComplete?UpdateApplicationOCThe on-complete action of the call; defaults to no-op.
params.rekeyTo?string | AddressChange 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.senderstring | AddressThe address of the account sending the transaction.
params.signer?TransactionSigner | TransactionSignerAccountThe 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?AlgoAmountThe 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 | bigintHow many rounds the transaction should be valid for, if not specified then the registered default validity window will be used.

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:390


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(),
})

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

NameTypeDescription
paramsAppUpdateMethodCallThe parameters for the app update transaction

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

src/types/algorand-client-transaction-creator.ts:561


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAssetConfigParamsThe parameters for the asset config transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:151


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAssetCreateParamsThe parameters for the asset creation transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:115


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAssetDestroyParamsThe parameters for the asset destroy transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:213


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAssetFreezeParamsThe parameters for the asset freeze transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:181


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAssetOptInParamsThe parameters for the asset opt-in transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:274


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAssetOptOutParamsThe parameters for the asset opt-out transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:311


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(),
})

▸ (params): Promise<Transaction>

NameTypeDescription
paramsAssetTransferParamsThe parameters for the asset transfer transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:246


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsOfflineKeyRegistrationParamsThe parameters for the key registration transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:725


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsOnlineKeyRegistrationParamsThe parameters for the key registration transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:695


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(),
});

▸ (params): Promise<Transaction>

NameTypeDescription
paramsPaymentParamsThe parameters for the payment transaction

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:74

_transaction<T>(c): (params: T) => Promise<Transaction>

Name
T
NameType
c(c: TransactionComposer) => (params: T) => TransactionComposer

fn

▸ (params): Promise<Transaction>

NameType
paramsT

Promise<Transaction>

src/types/algorand-client-transaction-creator.ts:23


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

Name
T
NameType
c(c: TransactionComposer) => (params: T) => TransactionComposer

fn

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

NameType
paramsT

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

src/types/algorand-client-transaction-creator.ts:31