import { Transaction } from './transaction.js'; import { SuggestedParams, PaymentTransactionParams, KeyRegistrationTransactionParams, AssetConfigurationTransactionParams, AssetTransferTransactionParams, AssetFreezeTransactionParams, ApplicationCallTransactionParams, ApplicationCallReferenceParams } from './types/transactions/base.js'; import { Address } from './encoding/address.js'; /** Contains parameters common to every transaction type */ export interface CommonTransactionParams { /** Algorand address of sender */ sender: string | Address; /** Suggested parameters relevant to the network that will accept this transaction */ suggestedParams: SuggestedParams; /** Optional, arbitrary data to be stored in the transaction's note field */ note?: Uint8Array; /** * Optional, 32-byte lease to associate with this transaction. * * The sender cannot send another transaction with the same lease until the last round of original * transaction has passed. */ lease?: Uint8Array; /** The Algorand address that will be used to authorize all future transactions from the sender, if provided. */ rekeyTo?: string | Address; } /** * Create a new payment transaction * * @param options - Payment transaction parameters */ export declare function makePaymentTxnWithSuggestedParamsFromObject({ sender, receiver, amount, closeRemainderTo, suggestedParams, note, lease, rekeyTo, }: PaymentTransactionParams & CommonTransactionParams): Transaction; /** * Create a new key registration transaction * * @param options - Key registration transaction parameters */ export declare function makeKeyRegistrationTxnWithSuggestedParamsFromObject({ sender, voteKey, selectionKey, stateProofKey, voteFirst, voteLast, voteKeyDilution, nonParticipation, suggestedParams, note, lease, rekeyTo, }: KeyRegistrationTransactionParams & CommonTransactionParams): Transaction; /** * Base function for creating any type of asset config transaction. * * @param options - Asset config transaction parameters */ export declare function makeBaseAssetConfigTxn({ sender, assetIndex, total, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, assetMetadataHash, note, lease, rekeyTo, suggestedParams, }: AssetConfigurationTransactionParams & CommonTransactionParams): Transaction; /** * Create a new asset creation transaction * * @param options - Asset creation transaction parameters */ export declare function makeAssetCreateTxnWithSuggestedParamsFromObject({ sender, total, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, assetMetadataHash, note, lease, rekeyTo, suggestedParams, }: Omit & CommonTransactionParams): Transaction; /** Contains asset modification transaction parameters */ export interface AssetModificationTransactionParams { /** * The unique ID of the asset to be modified */ assetIndex: number | bigint; /** * The Algorand address in charge of reserve, freeze, clawback, destruction, etc. * * If empty, this role will be irrevocably removed from this asset. */ manager?: string | Address; /** * The Algorand address representing asset reserve. * * If empty, this role will be irrevocably removed from this asset. */ reserve?: string | Address; /** * The Algorand address with power to freeze/unfreeze asset holdings. * * If empty, this role will be irrevocably removed from this asset. */ freeze?: string | Address; /** * The Algorand address with power to revoke asset holdings. * * If empty, this role will be irrevocably removed from this asset. */ clawback?: string | Address; /** * This is a safety flag to prevent unintentionally removing a role from an asset. If undefined or * true, an error will be thrown if any of assetManager, assetReserve, assetFreeze, or * assetClawback are empty. * * Set this to false to allow removing roles by leaving the corresponding address empty. */ strictEmptyAddressChecking?: boolean; } /** * Create a new asset config transaction. This transaction can be issued by the asset manager to * change the manager, reserve, freeze, or clawback address. * * You must respecify existing addresses to keep them the same; leaving a field blank is the same as * turning that feature off for this asset. * * @param options - Asset modification transaction parameters */ export declare function makeAssetConfigTxnWithSuggestedParamsFromObject({ sender, assetIndex, manager, reserve, freeze, clawback, strictEmptyAddressChecking, note, lease, rekeyTo, suggestedParams, }: AssetModificationTransactionParams & CommonTransactionParams): Transaction; /** * Create a new asset destroy transaction. This will allow the asset's manager to remove this asset * from the ledger, provided all outstanding assets are held by the creator. * * @param options - Asset destroy transaction parameters */ export declare function makeAssetDestroyTxnWithSuggestedParamsFromObject({ sender, assetIndex, note, lease, rekeyTo, suggestedParams, }: Required> & CommonTransactionParams): Transaction; /** * Create a new asset freeze transaction. This transaction allows the asset's freeze manager to * freeze or un-freeze an account, blocking or allowing asset transfers to and from the targeted * account. * * @param options - Asset freeze transaction parameters */ export declare function makeAssetFreezeTxnWithSuggestedParamsFromObject({ sender, assetIndex, freezeTarget, frozen, suggestedParams, note, lease, rekeyTo, }: AssetFreezeTransactionParams & CommonTransactionParams): Transaction; /** * Create a new asset transfer transaction. * * Special case: to opt into an assets, set amount=0 and sender=receiver. * * @param options - Asset transfer transaction parameters */ export declare function makeAssetTransferTxnWithSuggestedParamsFromObject({ sender, receiver, amount, closeRemainderTo, assetSender, note, assetIndex, suggestedParams, rekeyTo, lease, }: AssetTransferTransactionParams & CommonTransactionParams): Transaction; /** * Base function for creating any application call transaction. * * @param options - Application call transaction parameters */ export declare function makeApplicationCallTxnFromObject({ sender, appIndex, onComplete, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, approvalProgram, clearProgram, numLocalInts, numLocalByteSlices, numGlobalInts, numGlobalByteSlices, extraPages, rejectVersion, note, lease, rekeyTo, suggestedParams, }: ApplicationCallTransactionParams & CommonTransactionParams & ApplicationCallReferenceParams): Transaction; /** * Make a transaction that will create an application. * * @param options - Application creation transaction parameters */ export declare function makeApplicationCreateTxnFromObject({ sender, onComplete, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, approvalProgram, clearProgram, numLocalInts, numLocalByteSlices, numGlobalInts, numGlobalByteSlices, extraPages, note, lease, rekeyTo, suggestedParams, }: Omit & Required> & CommonTransactionParams & ApplicationCallReferenceParams): Transaction; /** * Make a transaction that changes an application's approval and clear programs * * @param options - Application update transaction parameters */ export declare function makeApplicationUpdateTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, approvalProgram, clearProgram, note, lease, rekeyTo, suggestedParams, }: Omit & Required> & CommonTransactionParams & ApplicationCallReferenceParams): Transaction; /** * Make a transaction that deletes an application * * @param options - Application deletion transaction parameters */ export declare function makeApplicationDeleteTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, note, lease, rekeyTo, suggestedParams, }: Omit & CommonTransactionParams & ApplicationCallReferenceParams): Transaction; /** * Make a transaction that opts in to use an application * * @param options - Application opt-in transaction parameters */ export declare function makeApplicationOptInTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, note, lease, rekeyTo, suggestedParams, }: Omit & CommonTransactionParams & ApplicationCallReferenceParams): Transaction; /** * Make a transaction that closes out a user's state in an application * * @param options - Application close-out transaction parameters */ export declare function makeApplicationCloseOutTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, note, lease, rekeyTo, suggestedParams, }: Omit & CommonTransactionParams & ApplicationCallReferenceParams): Transaction; /** * Make a transaction that clears a user's state in an application * * @param options - Application clear state transaction parameters */ export declare function makeApplicationClearStateTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, note, lease, rekeyTo, suggestedParams, }: Omit & CommonTransactionParams & ApplicationCallReferenceParams): Transaction; /** * Make a transaction that just calls an application, doing nothing on completion * * @param options - Application no-op transaction parameters */ export declare function makeApplicationNoOpTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, convertToAccess, holdings, locals, access, note, lease, rekeyTo, suggestedParams, }: Omit & CommonTransactionParams & ApplicationCallReferenceParams): Transaction;