types/composer
@algorandfoundation/algokit-utils / types/composer
Table of contents
Section titled “Table of contents”Classes
Section titled “Classes”Interfaces
Section titled “Interfaces”Type Aliases
Section titled “Type Aliases”- AppCallMethodCall
- AppCallParams
- AppCreateMethodCall
- AppCreateParams
- AppDeleteMethodCall
- AppDeleteParams
- AppMethodCall
- AppMethodCallParams
- AppMethodCallTransactionArgument
- AppUpdateMethodCall
- AppUpdateParams
- AssetConfigParams
- AssetCreateParams
- AssetDestroyParams
- AssetFreezeParams
- AssetOptInParams
- AssetOptOutParams
- AssetTransferParams
- CommonAppCallParams
- CommonTransactionParams
- ErrorTransformer
- OfflineKeyRegistrationParams
- OnlineKeyRegistrationParams
- PaymentParams
- RawSimulateOptions
- SimulateOptions
- SkipSignaturesSimulateOptions
- TransactionComposerParams
- Txn
Variables
Section titled “Variables”Type Aliases
Section titled “Type Aliases”AppCallMethodCall
Section titled “AppCallMethodCall”Ƭ AppCallMethodCall: AppMethodCall<AppMethodCallParams>
Parameters to define an ABI method call transaction.
Defined in
Section titled “Defined in”AppCallParams
Section titled “AppCallParams”Ƭ AppCallParams: CommonAppCallParams & { onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC> }
Parameters to define an application call transaction.
Defined in
Section titled “Defined in”AppCreateMethodCall
Section titled “AppCreateMethodCall”Ƭ AppCreateMethodCall: AppMethodCall<AppCreateParams>
Parameters to define an ABI method call create transaction.
Defined in
Section titled “Defined in”AppCreateParams
Section titled “AppCreateParams”Ƭ AppCreateParams: Expand<Omit<CommonAppCallParams, "appId"> & { approvalProgram: string | Uint8Array ; clearStateProgram: string | Uint8Array ; extraProgramPages?: number ; onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.ClearStateOC> ; schema?: { globalByteSlices: number ; globalInts: number ; localByteSlices: number ; localInts: number } }>
Parameters to define an app create transaction
Defined in
Section titled “Defined in”AppDeleteMethodCall
Section titled “AppDeleteMethodCall”Ƭ AppDeleteMethodCall: AppMethodCall<AppDeleteParams>
Parameters to define an ABI method call delete transaction.
Defined in
Section titled “Defined in”AppDeleteParams
Section titled “AppDeleteParams”Ƭ AppDeleteParams: CommonAppCallParams & { onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC }
Parameters to define an application delete call transaction.
Defined in
Section titled “Defined in”AppMethodCall
Section titled “AppMethodCall”Ƭ AppMethodCall<T>: Expand<Omit<T, "args">> & { args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> | undefined)[] ; method: algosdk.ABIMethod }
Parameters to define an ABI method call.
Type parameters
Section titled “Type parameters”| Name |
|---|
T |
Defined in
Section titled “Defined in”AppMethodCallParams
Section titled “AppMethodCallParams”Ƭ AppMethodCallParams: CommonAppCallParams & { onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC> }
Common parameters to define an ABI method call transaction.
Defined in
Section titled “Defined in”AppMethodCallTransactionArgument
Section titled “AppMethodCallTransactionArgument”Ƭ AppMethodCallTransactionArgument: TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>
Types that can be used to define a transaction argument for an ABI call transaction.
Defined in
Section titled “Defined in”AppUpdateMethodCall
Section titled “AppUpdateMethodCall”Ƭ AppUpdateMethodCall: AppMethodCall<AppUpdateParams>
Parameters to define an ABI method call update transaction.
Defined in
Section titled “Defined in”AppUpdateParams
Section titled “AppUpdateParams”Ƭ AppUpdateParams: Expand<CommonAppCallParams & { approvalProgram: string | Uint8Array ; clearStateProgram: string | Uint8Array ; onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC }>
Parameters to define an app update transaction
Defined in
Section titled “Defined in”AssetConfigParams
Section titled “AssetConfigParams”Ƭ AssetConfigParams: CommonTransactionParams & { assetId: bigint ; clawback?: string | Address ; freeze?: string | Address ; manager: string | Address | undefined ; reserve?: string | Address }
Parameters to define an asset reconfiguration transaction.
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.
Defined in
Section titled “Defined in”AssetCreateParams
Section titled “AssetCreateParams”Ƭ AssetCreateParams: CommonTransactionParams & { assetName?: string ; clawback?: string | Address ; decimals?: number ; defaultFrozen?: boolean ; freeze?: string | Address ; manager?: string | Address ; metadataHash?: string | Uint8Array ; reserve?: string | Address ; total: bigint ; unitName?: string ; url?: string }
Parameters to define an asset create transaction.
The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.
Defined in
Section titled “Defined in”AssetDestroyParams
Section titled “AssetDestroyParams”Ƭ AssetDestroyParams: CommonTransactionParams & { assetId: bigint }
Parameters to define an 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.
Defined in
Section titled “Defined in”AssetFreezeParams
Section titled “AssetFreezeParams”Ƭ AssetFreezeParams: CommonTransactionParams & { account: string | Address ; assetId: bigint ; frozen: boolean }
Parameters to define an asset freeze transaction.
Defined in
Section titled “Defined in”AssetOptInParams
Section titled “AssetOptInParams”Ƭ AssetOptInParams: CommonTransactionParams & { assetId: bigint }
Parameters to define an asset opt-in transaction.
Defined in
Section titled “Defined in”AssetOptOutParams
Section titled “AssetOptOutParams”Ƭ AssetOptOutParams: CommonTransactionParams & { assetId: bigint ; creator: string | Address }
Parameters to define an asset opt-out transaction.
Defined in
Section titled “Defined in”AssetTransferParams
Section titled “AssetTransferParams”Ƭ AssetTransferParams: CommonTransactionParams & { amount: bigint ; assetId: bigint ; clawbackTarget?: string | Address ; closeAssetTo?: string | Address ; receiver: string | Address }
Parameters to define an asset transfer transaction.
Defined in
Section titled “Defined in”CommonAppCallParams
Section titled “CommonAppCallParams”Ƭ CommonAppCallParams: CommonTransactionParams & { accountReferences?: (string | Address)[] ; appId: bigint ; appReferences?: bigint[] ; args?: Uint8Array[] ; assetReferences?: bigint[] ; boxReferences?: (BoxReference | BoxIdentifier)[] ; onComplete?: algosdk.OnApplicationComplete }
Common parameters for defining an application call transaction.
Defined in
Section titled “Defined in”CommonTransactionParams
Section titled “CommonTransactionParams”Ƭ CommonTransactionParams: Object
Common parameters for defining a transaction.
Type declaration
Section titled “Type declaration”| Name | Type | Description |
|---|---|---|
extraFee? | AlgoAmount | The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees. |
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? | bigint | The last round this transaction is valid. It is recommended to use validityWindow instead. |
lease? | Uint8Array | string | 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? | AlgoAmount | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. |
note? | Uint8Array | string | Note to attach to the transaction. Max of 1000 bytes. |
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. |
sender | string | Address | The address of the account sending the transaction. |
signer? | algosdk.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). |
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. |
validityWindow? | number | bigint | How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. |
Defined in
Section titled “Defined in”ErrorTransformer
Section titled “ErrorTransformer”Ƭ ErrorTransformer: (error: Error) => Promise<Error>
A function that transforms an error into a new error.
In most cases, an ErrorTransformer should first check if it can or should transform the error and return the input error if it cannot or should not transform it.
Type declaration
Section titled “Type declaration”▸ (error): Promise<Error>
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
error | Error |
Returns
Section titled “Returns”Promise<Error>
Defined in
Section titled “Defined in”OfflineKeyRegistrationParams
Section titled “OfflineKeyRegistrationParams”Ƭ OfflineKeyRegistrationParams: CommonTransactionParams & { preventAccountFromEverParticipatingAgain?: boolean }
Parameters to define an offline key registration transaction.
Defined in
Section titled “Defined in”OnlineKeyRegistrationParams
Section titled “OnlineKeyRegistrationParams”Ƭ OnlineKeyRegistrationParams: CommonTransactionParams & { selectionKey: Uint8Array ; stateProofKey?: Uint8Array ; voteFirst: bigint ; voteKey: Uint8Array ; voteKeyDilution: bigint ; voteLast: bigint }
Parameters to define an online key registration transaction.
Defined in
Section titled “Defined in”PaymentParams
Section titled “PaymentParams”Ƭ PaymentParams: CommonTransactionParams & { amount: AlgoAmount ; closeRemainderTo?: string | Address ; receiver: string | Address }
Parameters to define a payment transaction.
Defined in
Section titled “Defined in”RawSimulateOptions
Section titled “RawSimulateOptions”Ƭ RawSimulateOptions: Expand<Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], "txnGroups">>
The raw API options to control a simulate request. See algod API docs for more information: https://dev.algorand.co/reference/rest-apis/algod/#simulatetransaction
Defined in
Section titled “Defined in”SimulateOptions
Section titled “SimulateOptions”Ƭ SimulateOptions: Expand<Partial<SkipSignaturesSimulateOptions> & RawSimulateOptions>
All options to control a simulate request
Defined in
Section titled “Defined in”SkipSignaturesSimulateOptions
Section titled “SkipSignaturesSimulateOptions”Ƭ SkipSignaturesSimulateOptions: Expand<Omit<RawSimulateOptions, "fixSigners" | "allowEmptySignatures"> & { skipSignatures: boolean }>
Options to control a simulate request, that does not require transaction signing
Defined in
Section titled “Defined in”TransactionComposerParams
Section titled “TransactionComposerParams”Ƭ TransactionComposerParams: Object
Parameters to create an TransactionComposer.
Type declaration
Section titled “Type declaration”| Name | Type | Description |
|---|---|---|
algod | algosdk.Algodv2 | The algod client to use to get suggestedParams and send the transaction group |
appManager? | AppManager | An existing AppManager to use to manage app compilation and cache compilation results. If not specified then an ephemeral one will be created. |
defaultValidityWindow? | bigint | How many rounds a transaction should be valid for by default; if not specified then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet). |
errorTransformers? | ErrorTransformer[] | An array of error transformers to use when an error is caught in simulate or execute callbacks can later be registered with registerErrorTransformer |
getSigner | (address: string | Address) => algosdk.TransactionSigner | - |
getSuggestedParams? | () => Promise<algosdk.SuggestedParams> | - |
Defined in
Section titled “Defined in”Ƭ Txn: PaymentParams & { type: "pay" } | AssetCreateParams & { type: "assetCreate" } | AssetConfigParams & { type: "assetConfig" } | AssetFreezeParams & { type: "assetFreeze" } | AssetDestroyParams & { type: "assetDestroy" } | AssetTransferParams & { type: "assetTransfer" } | AssetOptInParams & { type: "assetOptIn" } | AssetOptOutParams & { type: "assetOptOut" } | AppCallParams | AppCreateParams | AppUpdateParams & { type: "appCall" } | OnlineKeyRegistrationParams | OfflineKeyRegistrationParams & { type: "keyReg" } | algosdk.TransactionWithSigner & { type: "txnWithSigner" } | { atc: algosdk.AtomicTransactionComposer ; type: "atc" } | AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall & { type: "methodCall" }
Defined in
Section titled “Defined in”Variables
Section titled “Variables”MAX_TRANSACTION_GROUP_SIZE
Section titled “MAX_TRANSACTION_GROUP_SIZE”• Const MAX_TRANSACTION_GROUP_SIZE: 16