@algorandfoundation/algokit-utils 8.0.2-beta.1 → 8.0.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/testing/test-logger.js +7 -5
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +7 -5
- package/testing/test-logger.mjs.map +1 -1
- package/transaction/transaction.js +2 -2
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +3 -3
- package/transaction/transaction.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.js +8 -1
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +8 -1
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/app-client.d.ts +0 -2
- package/types/app-client.js +3 -3
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +4 -4
- package/types/app-client.mjs.map +1 -1
- package/types/app-manager.d.ts +2 -2
- package/types/app-manager.js +2 -1
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +2 -1
- package/types/app-manager.mjs.map +1 -1
- package/types/composer.js +2 -1
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +2 -1
- package/types/composer.mjs.map +1 -1
- package/types/dispenser-client.js +3 -1
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +3 -1
- package/types/dispenser-client.mjs.map +1 -1
- package/util.d.ts +2 -0
- package/util.js +16 -0
- package/util.js.map +1 -1
- package/util.mjs +15 -1
- package/util.mjs.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.mjs","sources":["../../src/transaction/transaction.ts"],"sourcesContent":["import algosdk, { Address, ApplicationTransactionFields, TransactionBoxReference, TransactionType, stringifyJSON } from 'algosdk'\nimport { Buffer } from 'buffer'\nimport { Config } from '../config'\nimport { AlgoAmount } from '../types/amount'\nimport { ABIReturn } from '../types/app'\nimport { EventType } from '../types/lifecycle-events'\nimport {\n AtomicTransactionComposerToSend,\n SendAtomicTransactionComposerResults,\n SendTransactionFrom,\n SendTransactionParams,\n SendTransactionResult,\n TransactionGroupToSend,\n TransactionNote,\n TransactionToSign,\n} from '../types/transaction'\nimport { toNumber } from '../util'\nimport { performAtomicTransactionComposerSimulate } from './perform-atomic-transaction-composer-simulate'\nimport Algodv2 = algosdk.Algodv2\nimport AtomicTransactionComposer = algosdk.AtomicTransactionComposer\nimport modelsv2 = algosdk.modelsv2\nimport SuggestedParams = algosdk.SuggestedParams\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\nimport TransactionWithSigner = algosdk.TransactionWithSigner\nimport ABIValue = algosdk.ABIValue\nimport ABIType = algosdk.ABIType\n\nexport const MAX_TRANSACTION_GROUP_SIZE = 16\nexport const MAX_APP_CALL_FOREIGN_REFERENCES = 8\nexport const MAX_APP_CALL_ACCOUNT_REFERENCES = 4\n\n/**\n * @deprecated Convert your data to a `string` or `Uint8Array`, if using ARC-2 use `TransactionComposer.arc2Note`.\n *\n * Encodes a transaction note into a byte array ready to be included in an Algorand transaction.\n *\n * @param note The transaction note\n * @returns the transaction note ready for inclusion in a transaction\n *\n * Case on the value of `data` this either be:\n * * `null` | `undefined`: `undefined`\n * * `string`: The string value\n * * Uint8Array: passthrough\n * * Arc2TransactionNote object: ARC-0002 compatible transaction note\n * * Else: The object/value converted into a JSON string representation\n */\nexport function encodeTransactionNote(note?: TransactionNote): Uint8Array | undefined {\n if (note == null || typeof note === 'undefined') {\n return undefined\n } else if (typeof note === 'object' && note.constructor === Uint8Array) {\n return note\n } else if (typeof note === 'object' && 'dAppName' in note) {\n const arc2Payload = `${note.dAppName}:${note.format}${typeof note.data === 'string' ? note.data : JSON.stringify(note.data)}`\n const encoder = new TextEncoder()\n return encoder.encode(arc2Payload)\n } else {\n const n = typeof note === 'string' ? note : JSON.stringify(note)\n const encoder = new TextEncoder()\n return encoder.encode(n)\n }\n}\n\n/** Encodes a transaction lease into a 32-byte array ready to be included in an Algorand transaction.\n *\n * @param lease The transaction lease as a string or binary array or null/undefined if there is no lease\n * @returns the transaction lease ready for inclusion in a transaction or `undefined` if there is no lease\n * @throws if the length of the data is > 32 bytes or empty\n * @example algokit.encodeLease('UNIQUE_ID')\n * @example algokit.encodeLease(new Uint8Array([1, 2, 3]))\n */\nexport function encodeLease(lease?: string | Uint8Array): Uint8Array | undefined {\n if (lease === null || typeof lease === 'undefined') {\n return undefined\n } else if (typeof lease === 'object' && lease.constructor === Uint8Array) {\n if (lease.length === 0 || lease.length > 32) {\n throw new Error(\n `Received invalid lease; expected something with length between 1 and 32, but received bytes with length ${lease.length}`,\n )\n }\n if (lease.length === 32) return lease\n const lease32 = new Uint8Array(32)\n lease32.set(lease, 0)\n return lease32\n } else if (typeof lease === 'string') {\n if (lease.length === 0 || lease.length > 32) {\n throw new Error(\n `Received invalid lease; expected something with length between 1 and 32, but received '${lease}' with length ${lease.length}`,\n )\n }\n const encoder = new TextEncoder()\n const lease32 = new Uint8Array(32)\n lease32.set(encoder.encode(lease), 0)\n return lease32\n } else {\n throw new Error(`Unknown lease type received of ${typeof lease}`)\n }\n}\n\n/**\n * @deprecated Use `algorand.client` to interact with accounts, and use `.addr` to get the address\n * and/or move from using `SendTransactionFrom` to `TransactionSignerAccount` and use `.addr` instead.\n *\n * Returns the public address of the given transaction sender.\n * @param sender A transaction sender\n * @returns The public address\n */\nexport const getSenderAddress = function (sender: string | SendTransactionFrom): string {\n return typeof sender === 'string' ? sender : 'addr' in sender ? sender.addr.toString() : sender.address().toString()\n}\n\n/**\n * @deprecated Use `AlgorandClient` / `TransactionComposer` to construct transactions instead or\n * construct an `algosdk.TransactionWithSigner` manually instead.\n *\n * Given a transaction in a variety of supported formats, returns a TransactionWithSigner object ready to be passed to an\n * AtomicTransactionComposer's addTransaction method.\n * @param transaction One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the\n * signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by\n * one of algokit utils' helpers (signer is obtained from the defaultSender parameter)\n * @param defaultSender The default sender to be used to obtain a signer where the object provided to the transaction parameter does not\n * include a signer.\n * @returns A TransactionWithSigner object.\n */\nexport const getTransactionWithSigner = async (\n transaction: TransactionWithSigner | TransactionToSign | Transaction | Promise<SendTransactionResult>,\n defaultSender?: SendTransactionFrom,\n): Promise<TransactionWithSigner> => {\n if ('txn' in transaction) return transaction\n if (defaultSender === undefined)\n throw new Error('Default sender must be provided when passing in a transaction object that does not contain its own signer')\n return transaction instanceof Promise\n ? {\n txn: (await transaction).transaction,\n signer: getSenderTransactionSigner(defaultSender),\n }\n : 'transaction' in transaction\n ? {\n txn: transaction.transaction,\n signer: getSenderTransactionSigner(transaction.signer),\n }\n : {\n txn: transaction,\n signer: getSenderTransactionSigner(defaultSender),\n }\n}\n\nconst memoize = <T = unknown, R = unknown>(fn: (val: T) => R) => {\n const cache = new Map()\n const cached = function (this: unknown, val: T) {\n return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && cache.get(val)\n }\n cached.cache = cache\n return cached as (val: T) => R\n}\n\n/**\n * @deprecated Use `TransactionSignerAccount` instead of `SendTransactionFrom` or use\n * `algosdk.makeBasicAccountTransactionSigner` / `algosdk.makeLogicSigAccountTransactionSigner`.\n *\n * Returns a `TransactionSigner` for the given transaction sender.\n * This function has memoization, so will return the same transaction signer for a given sender.\n * @param sender A transaction sender\n * @returns A transaction signer\n */\nexport const getSenderTransactionSigner = memoize(function (sender: SendTransactionFrom): TransactionSigner {\n return 'signer' in sender\n ? sender.signer\n : 'lsig' in sender\n ? algosdk.makeLogicSigAccountTransactionSigner(sender)\n : algosdk.makeBasicAccountTransactionSigner(sender)\n})\n\n/**\n * @deprecated Use `AlgorandClient` / `TransactionComposer` to sign transactions\n * or use the relevant underlying `account.signTxn` / `algosdk.signLogicSigTransactionObject`\n * / `multiSigAccount.sign` / `TransactionSigner` methods directly.\n *\n * Signs a single transaction by the given signer.\n * @param transaction The transaction to sign\n * @param signer The signer to sign\n * @returns The signed transaction as a `Uint8Array`\n */\nexport const signTransaction = async (transaction: Transaction, signer: SendTransactionFrom) => {\n return 'sk' in signer\n ? transaction.signTxn(signer.sk)\n : 'lsig' in signer\n ? algosdk.signLogicSigTransactionObject(transaction, signer).blob\n : 'sign' in signer\n ? signer.sign(transaction)\n : (await signer.signer([transaction], [0]))[0]\n}\n\n/**\n * @deprecated Use `AlgorandClient` / `TransactionComposer` to send transactions.\n *\n * Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain.\n *\n * @param send The details for the transaction to prepare/send, including:\n * * `transaction`: The unsigned transaction\n * * `from`: The account to sign the transaction with: either an account with private key loaded or a logic signature account\n * * `config`: The sending configuration for this transaction\n * @param algod An algod client\n *\n * @returns An object with transaction (`transaction`) and (if `skipWaiting` is `false` or `undefined`) confirmation (`confirmation`)\n */\nexport const sendTransaction = async function (\n send: {\n transaction: Transaction\n from: SendTransactionFrom\n sendParams?: SendTransactionParams\n },\n algod: Algodv2,\n): Promise<SendTransactionResult> {\n const { transaction, from, sendParams } = send\n const { skipSending, skipWaiting, fee, maxFee, suppressLog, maxRoundsToWaitForConfirmation, atc } = sendParams ?? {}\n\n controlFees(transaction, { fee, maxFee })\n\n if (atc) {\n atc.addTransaction({ txn: transaction, signer: getSenderTransactionSigner(from) })\n return { transaction }\n }\n\n if (skipSending) {\n return { transaction }\n }\n\n let txnToSend = transaction\n\n const populateResources = sendParams?.populateAppCallResources ?? Config.populateAppCallResources\n\n // Populate resources if the transaction is an appcall and populateAppCallResources wasn't explicitly set to false\n // NOTE: Temporary false by default until this algod bug is fixed: https://github.com/algorand/go-algorand/issues/5914\n if (txnToSend.type === algosdk.TransactionType.appl && populateResources) {\n const newAtc = new AtomicTransactionComposer()\n newAtc.addTransaction({ txn: txnToSend, signer: getSenderTransactionSigner(from) })\n const packed = await populateAppCallResources(newAtc, algod)\n txnToSend = packed.buildGroup()[0].txn\n }\n\n const signedTransaction = await signTransaction(txnToSend, from)\n\n await algod.sendRawTransaction(signedTransaction).do()\n\n Config.getLogger(suppressLog).verbose(`Sent transaction ID ${txnToSend.txID()} ${txnToSend.type} from ${getSenderAddress(from)}`)\n\n let confirmation: modelsv2.PendingTransactionResponse | undefined = undefined\n if (!skipWaiting) {\n confirmation = await waitForConfirmation(txnToSend.txID(), maxRoundsToWaitForConfirmation ?? 5, algod)\n }\n\n return { transaction: txnToSend, confirmation }\n}\n\n/**\n * Get all of the unamed resources used by the group in the given ATC\n *\n * @param algod The algod client to use for the simulation\n * @param atc The ATC containing the txn group\n * @returns The unnamed resources accessed by the group and by each transaction in the group\n */\nasync function getUnnamedAppCallResourcesAccessed(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2) {\n const simulateRequest = new algosdk.modelsv2.SimulateRequest({\n txnGroups: [],\n allowUnnamedResources: true,\n allowEmptySignatures: true,\n fixSigners: true,\n })\n\n const nullSigner = algosdk.makeEmptyTransactionSigner()\n\n const emptySignerAtc = atc.clone()\n emptySignerAtc['transactions'].forEach((t: algosdk.TransactionWithSigner) => {\n t.signer = nullSigner\n })\n\n const result = await emptySignerAtc.simulate(algod, simulateRequest)\n\n const groupResponse = result.simulateResponse.txnGroups[0]\n\n if (groupResponse.failureMessage) {\n throw Error(`Error during resource population simulation in transaction ${groupResponse.failedAt}: ${groupResponse.failureMessage}`)\n }\n\n return {\n group: groupResponse.unnamedResourcesAccessed,\n txns: groupResponse.txnResults.map(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (t: any) => t.unnamedResourcesAccessed,\n ) as algosdk.modelsv2.SimulateUnnamedResourcesAccessed[],\n }\n}\n\n/**\n * Take an existing Atomic Transaction Composer and return a new one with the required\n * app call resources packed into it\n *\n * @param algod The algod client to use for the simulation\n * @param atc The ATC containing the txn group\n * @returns A new ATC with the resources packed into the transactions\n *\n * @privateRemarks\n *\n * This entire function will eventually be implemented in simulate upstream in algod. The simulate endpoint will return\n * an array of refference arrays for each transaction, so this eventually will eventually just call simulate and set the\n * reference arrays in the transactions to the reference arrays returned by simulate.\n *\n * See https://github.com/algorand/go-algorand/pull/5684\n *\n */\nexport async function populateAppCallResources(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2) {\n const unnamedResourcesAccessed = await getUnnamedAppCallResourcesAccessed(atc, algod)\n const group = atc.buildGroup()\n\n unnamedResourcesAccessed.txns.forEach((r, i) => {\n if (r === undefined || group[i].txn.type !== TransactionType.appl) return\n\n if (r.boxes || r.extraBoxRefs) throw Error('Unexpected boxes at the transaction level')\n if (r.appLocals) throw Error('Unexpected app local at the transaction level')\n if (r.assetHoldings)\n throw Error('Unexpected asset holding at the transaction level')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(group[i].txn as any)['applicationCall'] = {\n ...group[i].txn.applicationCall,\n accounts: [...(group[i].txn?.applicationCall?.accounts ?? []), ...(r.accounts ?? [])],\n foreignApps: [...(group[i].txn?.applicationCall?.foreignApps ?? []), ...(r.apps ?? [])],\n foreignAssets: [...(group[i].txn?.applicationCall?.foreignAssets ?? []), ...(r.assets ?? [])],\n boxes: [...(group[i].txn?.applicationCall?.boxes ?? []), ...(r.boxes ?? [])],\n } satisfies Partial<ApplicationTransactionFields>\n\n const accounts = group[i].txn.applicationCall?.accounts?.length ?? 0\n if (accounts > MAX_APP_CALL_ACCOUNT_REFERENCES)\n throw Error(`Account reference limit of ${MAX_APP_CALL_ACCOUNT_REFERENCES} exceeded in transaction ${i}`)\n const assets = group[i].txn.applicationCall?.foreignAssets?.length ?? 0\n const apps = group[i].txn.applicationCall?.foreignApps?.length ?? 0\n const boxes = group[i].txn.applicationCall?.boxes?.length ?? 0\n if (accounts + assets + apps + boxes > MAX_APP_CALL_FOREIGN_REFERENCES) {\n throw Error(`Resource reference limit of ${MAX_APP_CALL_FOREIGN_REFERENCES} exceeded in transaction ${i}`)\n }\n })\n\n const populateGroupResource = (\n txns: algosdk.TransactionWithSigner[],\n reference:\n | string\n | algosdk.modelsv2.BoxReference\n | algosdk.modelsv2.ApplicationLocalReference\n | algosdk.modelsv2.AssetHoldingReference\n | bigint\n | number\n | Address,\n type: 'account' | 'assetHolding' | 'appLocal' | 'app' | 'box' | 'asset',\n ): void => {\n const isApplBelowLimit = (t: algosdk.TransactionWithSigner) => {\n if (t.txn.type !== algosdk.TransactionType.appl) return false\n\n const accounts = t.txn.applicationCall?.accounts?.length ?? 0\n const assets = t.txn.applicationCall?.foreignAssets?.length ?? 0\n const apps = t.txn.applicationCall?.foreignApps?.length ?? 0\n const boxes = t.txn.applicationCall?.boxes?.length ?? 0\n\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES\n }\n\n // If this is a asset holding or app local, first try to find a transaction that already has the account available\n if (type === 'assetHolding' || type === 'appLocal') {\n const { account } = reference as algosdk.modelsv2.ApplicationLocalReference | algosdk.modelsv2.AssetHoldingReference\n\n let txnIndex = txns.findIndex((t) => {\n if (!isApplBelowLimit(t)) return false\n\n return (\n // account is in the foreign accounts array\n t.txn.applicationCall?.accounts?.map((a) => a.toString()).includes(account.toString()) ||\n // account is available as an app account\n t.txn.applicationCall?.foreignApps?.map((a) => algosdk.getApplicationAddress(a).toString()).includes(account.toString()) ||\n // account is available since it's in one of the fields\n Object.values(t.txn).some((f) =>\n stringifyJSON(f, (_, v) => (v instanceof Address ? v.toString() : v))?.includes(account.toString()),\n )\n )\n })\n\n if (txnIndex > -1) {\n if (type === 'assetHolding') {\n const { asset } = reference as algosdk.modelsv2.AssetHoldingReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignAssets: [...(txns[txnIndex].txn?.applicationCall?.foreignAssets ?? []), ...[asset]],\n } satisfies Partial<ApplicationTransactionFields>\n } else {\n const { app } = reference as algosdk.modelsv2.ApplicationLocalReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []), ...[app]],\n } satisfies Partial<ApplicationTransactionFields>\n }\n return\n }\n\n // Now try to find a txn that already has that app or asset available\n txnIndex = txns.findIndex((t) => {\n if (!isApplBelowLimit(t)) return false\n\n // check if there is space in the accounts array\n if ((t.txn.applicationCall?.accounts?.length ?? 0) >= MAX_APP_CALL_ACCOUNT_REFERENCES) return false\n\n if (type === 'assetHolding') {\n const { asset } = reference as algosdk.modelsv2.AssetHoldingReference\n return t.txn.applicationCall?.foreignAssets?.includes(asset)\n } else {\n const { app } = reference as algosdk.modelsv2.ApplicationLocalReference\n return t.txn.applicationCall?.foreignApps?.includes(app) || t.txn.applicationCall?.appIndex === app\n }\n })\n\n if (txnIndex > -1) {\n const { account } = reference as algosdk.modelsv2.AssetHoldingReference | algosdk.modelsv2.ApplicationLocalReference\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[account]],\n } satisfies Partial<ApplicationTransactionFields>\n\n return\n }\n }\n\n // If this is a box, first try to find a transaction that already has the app available\n if (type === 'box') {\n const { app, name } = reference as algosdk.modelsv2.BoxReference\n\n const txnIndex = txns.findIndex((t) => {\n if (!isApplBelowLimit(t)) return false\n\n // If the app is in the foreign array OR the app being called, then we know it's available\n return t.txn.applicationCall?.foreignApps?.includes(app) || t.txn.applicationCall?.appIndex === app\n })\n\n if (txnIndex > -1) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n boxes: [...(txns[txnIndex].txn?.applicationCall?.boxes ?? []), ...[{ appIndex: app, name } satisfies TransactionBoxReference]],\n } satisfies Partial<ApplicationTransactionFields>\n\n return\n }\n }\n\n // Find the txn index to put the reference(s)\n const txnIndex = txns.findIndex((t) => {\n if (t.txn.type !== algosdk.TransactionType.appl) return false\n\n const accounts = t.txn.applicationCall?.accounts?.length ?? 0\n if (type === 'account') return accounts < MAX_APP_CALL_ACCOUNT_REFERENCES\n\n const assets = t.txn.applicationCall?.foreignAssets?.length ?? 0\n const apps = t.txn.applicationCall?.foreignApps?.length ?? 0\n const boxes = t.txn.applicationCall?.boxes?.length ?? 0\n\n // If we're adding local state or asset holding, we need space for the acocunt and the other reference\n if (type === 'assetHolding' || type === 'appLocal') {\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES - 1 && accounts < MAX_APP_CALL_ACCOUNT_REFERENCES\n }\n\n // If we're adding a box, we need space for both the box ref and the app ref\n if (type === 'box' && BigInt((reference as algosdk.modelsv2.BoxReference).app) !== BigInt(0)) {\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES - 1\n }\n\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES\n })\n\n if (txnIndex === -1) {\n throw Error('No more transactions below reference limit. Add another app call to the group.')\n }\n\n if (type === 'account') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[reference as Address]],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'app') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [\n ...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []),\n ...[typeof reference === 'bigint' ? reference : BigInt(reference as number)],\n ],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'box') {\n const { app, name } = reference as algosdk.modelsv2.BoxReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n boxes: [...(txns[txnIndex].txn?.applicationCall?.boxes ?? []), ...[{ appIndex: app, name } satisfies TransactionBoxReference]],\n } satisfies Partial<ApplicationTransactionFields>\n\n if (app.toString() !== '0') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []), ...[app]],\n } satisfies Partial<ApplicationTransactionFields>\n }\n } else if (type === 'assetHolding') {\n const { asset, account } = reference as algosdk.modelsv2.AssetHoldingReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignAssets: [...(txns[txnIndex].txn?.applicationCall?.foreignAssets ?? []), ...[asset]],\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[account]],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'appLocal') {\n const { app, account } = reference as algosdk.modelsv2.ApplicationLocalReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []), ...[app]],\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[account]],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'asset') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignAssets: [\n ...(txns[txnIndex].txn?.applicationCall?.foreignAssets ?? []),\n ...[typeof reference === 'bigint' ? reference : BigInt(reference as number)],\n ],\n } satisfies Partial<ApplicationTransactionFields>\n }\n }\n\n const g = unnamedResourcesAccessed.group\n\n if (g) {\n // Do cross-reference resources first because they are the most restrictive in terms\n // of which transactions can be used\n g.appLocals?.forEach((a) => {\n populateGroupResource(group, a, 'appLocal')\n\n // Remove resources from the group if we're adding them here\n g.accounts = g.accounts?.filter((acc) => acc !== a.account)\n g.apps = g.apps?.filter((app) => BigInt(app) !== BigInt(a.app))\n })\n\n g.assetHoldings?.forEach((a) => {\n populateGroupResource(group, a, 'assetHolding')\n\n // Remove resources from the group if we're adding them here\n g.accounts = g.accounts?.filter((acc) => acc !== a.account)\n g.assets = g.assets?.filter((asset) => BigInt(asset) !== BigInt(a.asset))\n })\n\n // Do accounts next because the account limit is 4\n g.accounts?.forEach((a) => {\n populateGroupResource(group, a, 'account')\n })\n\n g.boxes?.forEach((b) => {\n populateGroupResource(group, b, 'box')\n\n // Remove apps as resource from the group if we're adding it here\n g.apps = g.apps?.filter((app) => BigInt(app) !== BigInt(b.app))\n })\n\n g.assets?.forEach((a) => {\n populateGroupResource(group, a, 'asset')\n })\n\n g.apps?.forEach((a) => {\n populateGroupResource(group, a, 'app')\n })\n\n if (g.extraBoxRefs) {\n for (let i = 0; i < g.extraBoxRefs; i += 1) {\n const ref = new algosdk.modelsv2.BoxReference({ app: 0, name: new Uint8Array(0) })\n populateGroupResource(group, ref, 'box')\n }\n }\n }\n\n const newAtc = new algosdk.AtomicTransactionComposer()\n\n group.forEach((t) => {\n t.txn.group = undefined\n newAtc.addTransaction(t)\n })\n\n newAtc['methodCalls'] = atc['methodCalls']\n return newAtc\n}\n\n/**\n * Signs and sends transactions that have been collected by an `AtomicTransactionComposer`.\n * @param atcSend The parameters controlling the send, including `atc` The `AtomicTransactionComposer` and params to control send behaviour\n * @param algod An algod client\n * @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)\n */\nexport const sendAtomicTransactionComposer = async function (atcSend: AtomicTransactionComposerToSend, algod: Algodv2) {\n const { atc: givenAtc, sendParams, ...executeParams } = atcSend\n\n let atc: AtomicTransactionComposer\n\n atc = givenAtc\n try {\n const transactionsWithSigner = atc.buildGroup()\n\n // If populateAppCallResources is true OR if populateAppCallResources is undefined and there are app calls, then populate resources\n const populateResources =\n executeParams?.populateAppCallResources ?? sendParams?.populateAppCallResources ?? Config.populateAppCallResources\n if (populateResources && transactionsWithSigner.map((t) => t.txn.type).includes(algosdk.TransactionType.appl)) {\n atc = await populateAppCallResources(givenAtc, algod)\n }\n\n const transactionsToSend = transactionsWithSigner.map((t) => {\n return t.txn\n })\n let groupId: string | undefined = undefined\n if (transactionsToSend.length > 1) {\n groupId = transactionsToSend[0].group ? Buffer.from(transactionsToSend[0].group).toString('base64') : ''\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose(\n `Sending group of ${transactionsToSend.length} transactions (${groupId})`,\n {\n transactionsToSend,\n },\n )\n\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).debug(\n `Transaction IDs (${groupId})`,\n transactionsToSend.map((t) => t.txID()),\n )\n }\n\n if (Config.debug && Config.traceAll) {\n // Dump the traces to a file for use with AlgoKit AVM debugger\n const simulateResponse = await performAtomicTransactionComposerSimulate(atc, algod)\n await Config.events.emitAsync(EventType.TxnGroupSimulated, {\n simulateResponse,\n })\n }\n const result = await atc.execute(\n algod,\n executeParams?.maxRoundsToWaitForConfirmation ?? sendParams?.maxRoundsToWaitForConfirmation ?? 5,\n )\n\n if (transactionsToSend.length > 1) {\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose(\n `Group transaction (${groupId}) sent with ${transactionsToSend.length} transactions`,\n )\n } else {\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose(\n `Sent transaction ID ${transactionsToSend[0].txID()} ${transactionsToSend[0].type} from ${transactionsToSend[0].sender.toString()}`,\n )\n }\n\n let confirmations: modelsv2.PendingTransactionResponse[] | undefined = undefined\n if (!sendParams?.skipWaiting) {\n confirmations = await Promise.all(transactionsToSend.map(async (t) => await algod.pendingTransactionInformation(t.txID()).do()))\n }\n\n return {\n groupId,\n confirmations,\n txIds: transactionsToSend.map((t) => t.txID()),\n transactions: transactionsToSend,\n returns: result.methodResults.map(getABIReturnValue),\n } as SendAtomicTransactionComposerResults\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n // Create a new error object so the stack trace is correct (algosdk throws an error with a more limited stack trace)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const err = new Error(typeof e === 'object' ? e?.message : 'Received error executing Atomic Transaction Composer') as any as any\n err.cause = e\n if (typeof e === 'object') {\n // Remove headers as it doesn't have anything useful.\n delete e.response?.headers\n err.response = e.response\n // body property very noisy\n if (e.response && 'body' in e.response) delete err.response.body\n err.name = e.name\n }\n\n if (Config.debug && typeof e === 'object') {\n err.traces = []\n Config.logger.error(\n 'Received error executing Atomic Transaction Composer and debug flag enabled; attempting simulation to get more information',\n err,\n )\n const simulate = await performAtomicTransactionComposerSimulate(atc, algod)\n if (Config.debug && !Config.traceAll) {\n // Emit the event only if traceAll: false, as it should have already been emitted above\n await Config.events.emitAsync(EventType.TxnGroupSimulated, {\n simulateResponse: simulate,\n })\n }\n\n if (simulate && simulate.txnGroups[0].failedAt) {\n for (const txn of simulate.txnGroups[0].txnResults) {\n err.traces.push({\n trace: txn.execTrace?.toEncodingData(),\n appBudget: txn.appBudgetConsumed,\n logicSigBudget: txn.logicSigBudgetConsumed,\n logs: txn.txnResult.logs,\n message: simulate.txnGroups[0].failureMessage,\n })\n }\n }\n } else {\n Config.logger.error('Received error executing Atomic Transaction Composer, for more information enable the debug flag', err)\n }\n throw err\n }\n}\n\nconst convertABIDecodedBigIntToNumber = (value: ABIValue, type: ABIType): ABIValue => {\n if (typeof value === 'bigint') {\n if (type instanceof algosdk.ABIUintType) {\n return type.bitSize < 53 ? Number(value) : value\n } else {\n return value\n }\n } else if (Array.isArray(value) && (type instanceof algosdk.ABIArrayStaticType || type instanceof algosdk.ABIArrayDynamicType)) {\n return value.map((v) => convertABIDecodedBigIntToNumber(v, type.childType))\n } else if (Array.isArray(value) && type instanceof algosdk.ABITupleType) {\n return value.map((v, i) => convertABIDecodedBigIntToNumber(v, type.childTypes[i]))\n } else {\n return value\n }\n}\n\n/**\n * Takes an algosdk `ABIResult` and converts it to an `ABIReturn`.\n * Converts `bigint`'s for Uint's < 64 to `number` for easier use.\n * @param result The `ABIReturn`\n */\nexport function getABIReturnValue(result: algosdk.ABIResult): ABIReturn {\n if (result.decodeError) {\n return {\n decodeError: result.decodeError,\n }\n }\n\n return {\n method: result.method,\n rawReturnValue: result.rawReturnValue,\n decodeError: undefined,\n returnValue:\n result.returnValue !== undefined && result.method.returns.type !== 'void'\n ? convertABIDecodedBigIntToNumber(result.returnValue, result.method.returns.type)\n : result.returnValue!,\n }\n}\n\n/**\n * @deprecated Use `TransactionComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead.\n *\n * Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain\n *\n * @param groupSend The group details to send, with:\n * * `transactions`: The array of transactions to send along with their signing account\n * * `sendParams`: The parameters to dictate how the group is sent\n * @param algod An algod client\n * @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)\n */\nexport const sendGroupOfTransactions = async function (groupSend: TransactionGroupToSend, algod: Algodv2) {\n const { transactions, signer, sendParams } = groupSend\n\n const defaultTransactionSigner = signer ? getSenderTransactionSigner(signer) : undefined\n\n const transactionsWithSigner = await Promise.all(\n transactions.map(async (t) => {\n if ('signer' in t)\n return {\n txn: t.transaction,\n signer: getSenderTransactionSigner(t.signer),\n sender: t.signer,\n }\n\n const txn = 'then' in t ? (await t).transaction : t\n if (!signer) {\n throw new Error(`Attempt to send transaction ${txn.txID()} as part of a group transaction, but no signer parameter was provided.`)\n }\n\n return {\n txn,\n signer: defaultTransactionSigner!,\n sender: signer,\n }\n }),\n )\n\n const atc = new AtomicTransactionComposer()\n transactionsWithSigner.forEach((txn) => atc.addTransaction(txn))\n\n return (await sendAtomicTransactionComposer({ atc, sendParams }, algod)) as Omit<SendAtomicTransactionComposerResults, 'returns'>\n}\n\n/**\n * Wait until the transaction is confirmed or rejected, or until `timeout`\n * number of rounds have passed.\n *\n * @param algod An algod client\n * @param transactionId The transaction ID to wait for\n * @param maxRoundsToWait Maximum number of rounds to wait\n *\n * @return Pending transaction information\n * @throws Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds\n */\nexport const waitForConfirmation = async function (\n transactionId: string,\n maxRoundsToWait: number | bigint,\n algod: Algodv2,\n): Promise<modelsv2.PendingTransactionResponse> {\n if (maxRoundsToWait < 0) {\n throw new Error(`Invalid timeout, received ${maxRoundsToWait}, expected > 0`)\n }\n\n // Get current round\n const status = await algod.status().do()\n if (status === undefined) {\n throw new Error('Unable to get node status')\n }\n\n // Loop for up to `timeout` rounds looking for a confirmed transaction\n const startRound = BigInt(status.lastRound) + 1n\n let currentRound = startRound\n while (currentRound < startRound + BigInt(maxRoundsToWait)) {\n try {\n const pendingInfo = await algod.pendingTransactionInformation(transactionId).do()\n\n if (pendingInfo !== undefined) {\n const confirmedRound = pendingInfo.confirmedRound\n if (confirmedRound && confirmedRound > 0) {\n return pendingInfo\n } else {\n const poolError = pendingInfo.poolError\n if (poolError != null && poolError.length > 0) {\n // If there was a pool error, then the transaction has been rejected!\n throw new Error(`Transaction ${transactionId} was rejected; pool error: ${poolError}`)\n }\n }\n }\n } catch (e: unknown) {\n if ((e as Error).name === 'URLTokenBaseHTTPError') {\n currentRound++\n continue\n }\n }\n\n await algod.statusAfterBlock(toNumber(currentRound)).do()\n currentRound++\n }\n\n throw new Error(`Transaction ${transactionId} not confirmed after ${maxRoundsToWait} rounds`)\n}\n\n/**\n * @deprecated Use `TransactionComposer` and the `maxFee` field in the transaction params instead.\n *\n * Limit the acceptable fee to a defined amount of µAlgo.\n * This also sets the transaction to be flatFee to ensure the transaction only succeeds at\n * the estimated rate.\n * @param transaction The transaction to cap or suggested params object about to be used to create a transaction\n * @param maxAcceptableFee The maximum acceptable fee to pay\n */\nexport function capTransactionFee(transaction: algosdk.Transaction | SuggestedParams, maxAcceptableFee: AlgoAmount) {\n // If a flat fee hasn't already been defined\n if (!('flatFee' in transaction) || !transaction.flatFee) {\n // Once a transaction has been constructed by algosdk, transaction.fee indicates what the total transaction fee\n // Will be based on the current suggested fee-per-byte value.\n if (transaction.fee > maxAcceptableFee.microAlgo) {\n throw new Error(\n `Cancelled transaction due to high network congestion fees. Algorand suggested fees would cause this transaction to cost ${transaction.fee} µALGO. Cap for this transaction is ${maxAcceptableFee.microAlgo} µALGO.`,\n )\n } else if (transaction.fee > 1_000_000) {\n Config.logger.warn(`Algorand network congestion fees are in effect. This transaction will incur a fee of ${transaction.fee} µALGO.`)\n }\n\n // Now set the flat on the transaction. Otherwise the network may increase the fee above our cap and perform the transaction.\n if ('flatFee' in transaction) {\n transaction.flatFee = true\n }\n }\n}\n\n/**\n * @deprecated Use `TransactionComposer` and the `maxFee` and `staticFee` fields in the transaction params instead.\n *\n * Allows for control of fees on a `Transaction` or `SuggestedParams` object\n * @param transaction The transaction or suggested params\n * @param feeControl The fee control parameters\n */\nexport function controlFees<T extends SuggestedParams | Transaction>(\n transaction: T,\n feeControl: { fee?: AlgoAmount; maxFee?: AlgoAmount },\n) {\n const { fee, maxFee } = feeControl\n if (fee) {\n transaction.fee = Number(fee.microAlgo)\n if ('flatFee' in transaction) {\n transaction.flatFee = true\n }\n }\n\n if (maxFee !== undefined) {\n capTransactionFee(transaction, maxFee)\n }\n\n return transaction\n}\n\n/**\n * @deprecated Use `suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()` instead\n *\n * Returns suggested transaction parameters from algod unless some are already provided.\n * @param params Optionally provide parameters to use\n * @param algod Algod algod\n * @returns The suggested transaction parameters\n */\nexport async function getTransactionParams(params: SuggestedParams | undefined, algod: Algodv2): Promise<SuggestedParams> {\n if (params) {\n return { ...params }\n }\n const p = await algod.getTransactionParams().do()\n return {\n fee: p.fee,\n firstValid: p.firstValid,\n lastValid: p.lastValid,\n genesisID: p.genesisID,\n genesisHash: p.genesisHash,\n minFee: p.minFee,\n }\n}\n\n/**\n * @deprecated Use `atc.clone().buildGroup()` instead.\n *\n * Returns the array of transactions currently present in the given `AtomicTransactionComposer`\n * @param atc The atomic transaction composer\n * @returns The array of transactions with signers\n */\nexport function getAtomicTransactionComposerTransactions(atc: AtomicTransactionComposer) {\n try {\n return atc.clone().buildGroup()\n } catch {\n return []\n }\n}\n"],"names":[],"mappings":";;;;;;;AAmBA,IAAO,yBAAyB,GAAG,OAAO,CAAC,yBAAyB;AAS7D,MAAM,0BAA0B,GAAG;AACnC,MAAM,+BAA+B,GAAG;AACxC,MAAM,+BAA+B,GAAG;AAE/C;;;;;;;;;;;;;;AAcG;AACG,SAAU,qBAAqB,CAAC,IAAsB,EAAA;IAC1D,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AAC/C,QAAA,OAAO,SAAS;;SACX,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,KAAK,UAAU,EAAE;AACtE,QAAA,OAAO,IAAI;;SACN,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,UAAU,IAAI,IAAI,EAAE;AACzD,QAAA,MAAM,WAAW,GAAG,CAAG,EAAA,IAAI,CAAC,QAAQ,CAAA,CAAA,EAAI,IAAI,CAAC,MAAM,CAAG,EAAA,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC7H,QAAA,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE;AACjC,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;;SAC7B;AACL,QAAA,MAAM,CAAC,GAAG,OAAO,IAAI,KAAK,QAAQ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EAAE,GAAG,UAAU;IAClC,IAAI,GAAG,EAAE;QACP,WAAW,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;AACvC,QAAA,IAAI,SAAS,IAAI,WAAW,EAAE;AAC5B,YAAA,WAAW,CAAC,OAAO,GAAG,IAAI;;;AAI9B,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;AACxB,QAAA,iBAAiB,CAAC,WAAW,EAAE,MAAM,CAAC;;AAGxC,IAAA,OAAO,WAAW;AACpB;AAEA;;;;;;;AAOG;AACI,eAAe,oBAAoB,CAAC,MAAmC,EAAE,KAAc,EAAA;IAC5F,IAAI,MAAM,EAAE;AACV,QAAA,OAAO,EAAE,GAAG,MAAM,EAAE;;IAEtB,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE;IACjD,OAAO;QACL,GAAG,EAAE,CAAC,CAAC,GAAG;QACV,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM;KACjB;AACH;AAEA;;;;;;AAMG;AACG,SAAU,wCAAwC,CAAC,GAA8B,EAAA;AACrF,IAAA,IAAI;AACF,QAAA,OAAO,GAAG,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE;;AAC/B,IAAA,MAAM;AACN,QAAA,OAAO,EAAE;;AAEb;;;;"}
|
|
1
|
+
{"version":3,"file":"transaction.mjs","sources":["../../src/transaction/transaction.ts"],"sourcesContent":["import algosdk, { Address, ApplicationTransactionFields, TransactionBoxReference, TransactionType, stringifyJSON } from 'algosdk'\nimport { Buffer } from 'buffer'\nimport { Config } from '../config'\nimport { AlgoAmount } from '../types/amount'\nimport { ABIReturn } from '../types/app'\nimport { EventType } from '../types/lifecycle-events'\nimport {\n AtomicTransactionComposerToSend,\n SendAtomicTransactionComposerResults,\n SendTransactionFrom,\n SendTransactionParams,\n SendTransactionResult,\n TransactionGroupToSend,\n TransactionNote,\n TransactionToSign,\n} from '../types/transaction'\nimport { asJson, toNumber } from '../util'\nimport { performAtomicTransactionComposerSimulate } from './perform-atomic-transaction-composer-simulate'\nimport Algodv2 = algosdk.Algodv2\nimport AtomicTransactionComposer = algosdk.AtomicTransactionComposer\nimport modelsv2 = algosdk.modelsv2\nimport SuggestedParams = algosdk.SuggestedParams\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\nimport TransactionWithSigner = algosdk.TransactionWithSigner\nimport ABIValue = algosdk.ABIValue\nimport ABIType = algosdk.ABIType\n\nexport const MAX_TRANSACTION_GROUP_SIZE = 16\nexport const MAX_APP_CALL_FOREIGN_REFERENCES = 8\nexport const MAX_APP_CALL_ACCOUNT_REFERENCES = 4\n\n/**\n * @deprecated Convert your data to a `string` or `Uint8Array`, if using ARC-2 use `TransactionComposer.arc2Note`.\n *\n * Encodes a transaction note into a byte array ready to be included in an Algorand transaction.\n *\n * @param note The transaction note\n * @returns the transaction note ready for inclusion in a transaction\n *\n * Case on the value of `data` this either be:\n * * `null` | `undefined`: `undefined`\n * * `string`: The string value\n * * Uint8Array: passthrough\n * * Arc2TransactionNote object: ARC-0002 compatible transaction note\n * * Else: The object/value converted into a JSON string representation\n */\nexport function encodeTransactionNote(note?: TransactionNote): Uint8Array | undefined {\n if (note == null || typeof note === 'undefined') {\n return undefined\n } else if (typeof note === 'object' && note.constructor === Uint8Array) {\n return note\n } else if (typeof note === 'object' && 'dAppName' in note) {\n const arc2Payload = `${note.dAppName}:${note.format}${typeof note.data === 'string' ? note.data : asJson(note.data)}`\n const encoder = new TextEncoder()\n return encoder.encode(arc2Payload)\n } else {\n const n = typeof note === 'string' ? note : asJson(note)\n const encoder = new TextEncoder()\n return encoder.encode(n)\n }\n}\n\n/** Encodes a transaction lease into a 32-byte array ready to be included in an Algorand transaction.\n *\n * @param lease The transaction lease as a string or binary array or null/undefined if there is no lease\n * @returns the transaction lease ready for inclusion in a transaction or `undefined` if there is no lease\n * @throws if the length of the data is > 32 bytes or empty\n * @example algokit.encodeLease('UNIQUE_ID')\n * @example algokit.encodeLease(new Uint8Array([1, 2, 3]))\n */\nexport function encodeLease(lease?: string | Uint8Array): Uint8Array | undefined {\n if (lease === null || typeof lease === 'undefined') {\n return undefined\n } else if (typeof lease === 'object' && lease.constructor === Uint8Array) {\n if (lease.length === 0 || lease.length > 32) {\n throw new Error(\n `Received invalid lease; expected something with length between 1 and 32, but received bytes with length ${lease.length}`,\n )\n }\n if (lease.length === 32) return lease\n const lease32 = new Uint8Array(32)\n lease32.set(lease, 0)\n return lease32\n } else if (typeof lease === 'string') {\n if (lease.length === 0 || lease.length > 32) {\n throw new Error(\n `Received invalid lease; expected something with length between 1 and 32, but received '${lease}' with length ${lease.length}`,\n )\n }\n const encoder = new TextEncoder()\n const lease32 = new Uint8Array(32)\n lease32.set(encoder.encode(lease), 0)\n return lease32\n } else {\n throw new Error(`Unknown lease type received of ${typeof lease}`)\n }\n}\n\n/**\n * @deprecated Use `algorand.client` to interact with accounts, and use `.addr` to get the address\n * and/or move from using `SendTransactionFrom` to `TransactionSignerAccount` and use `.addr` instead.\n *\n * Returns the public address of the given transaction sender.\n * @param sender A transaction sender\n * @returns The public address\n */\nexport const getSenderAddress = function (sender: string | SendTransactionFrom): string {\n return typeof sender === 'string' ? sender : 'addr' in sender ? sender.addr.toString() : sender.address().toString()\n}\n\n/**\n * @deprecated Use `AlgorandClient` / `TransactionComposer` to construct transactions instead or\n * construct an `algosdk.TransactionWithSigner` manually instead.\n *\n * Given a transaction in a variety of supported formats, returns a TransactionWithSigner object ready to be passed to an\n * AtomicTransactionComposer's addTransaction method.\n * @param transaction One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the\n * signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by\n * one of algokit utils' helpers (signer is obtained from the defaultSender parameter)\n * @param defaultSender The default sender to be used to obtain a signer where the object provided to the transaction parameter does not\n * include a signer.\n * @returns A TransactionWithSigner object.\n */\nexport const getTransactionWithSigner = async (\n transaction: TransactionWithSigner | TransactionToSign | Transaction | Promise<SendTransactionResult>,\n defaultSender?: SendTransactionFrom,\n): Promise<TransactionWithSigner> => {\n if ('txn' in transaction) return transaction\n if (defaultSender === undefined)\n throw new Error('Default sender must be provided when passing in a transaction object that does not contain its own signer')\n return transaction instanceof Promise\n ? {\n txn: (await transaction).transaction,\n signer: getSenderTransactionSigner(defaultSender),\n }\n : 'transaction' in transaction\n ? {\n txn: transaction.transaction,\n signer: getSenderTransactionSigner(transaction.signer),\n }\n : {\n txn: transaction,\n signer: getSenderTransactionSigner(defaultSender),\n }\n}\n\nconst memoize = <T = unknown, R = unknown>(fn: (val: T) => R) => {\n const cache = new Map()\n const cached = function (this: unknown, val: T) {\n return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && cache.get(val)\n }\n cached.cache = cache\n return cached as (val: T) => R\n}\n\n/**\n * @deprecated Use `TransactionSignerAccount` instead of `SendTransactionFrom` or use\n * `algosdk.makeBasicAccountTransactionSigner` / `algosdk.makeLogicSigAccountTransactionSigner`.\n *\n * Returns a `TransactionSigner` for the given transaction sender.\n * This function has memoization, so will return the same transaction signer for a given sender.\n * @param sender A transaction sender\n * @returns A transaction signer\n */\nexport const getSenderTransactionSigner = memoize(function (sender: SendTransactionFrom): TransactionSigner {\n return 'signer' in sender\n ? sender.signer\n : 'lsig' in sender\n ? algosdk.makeLogicSigAccountTransactionSigner(sender)\n : algosdk.makeBasicAccountTransactionSigner(sender)\n})\n\n/**\n * @deprecated Use `AlgorandClient` / `TransactionComposer` to sign transactions\n * or use the relevant underlying `account.signTxn` / `algosdk.signLogicSigTransactionObject`\n * / `multiSigAccount.sign` / `TransactionSigner` methods directly.\n *\n * Signs a single transaction by the given signer.\n * @param transaction The transaction to sign\n * @param signer The signer to sign\n * @returns The signed transaction as a `Uint8Array`\n */\nexport const signTransaction = async (transaction: Transaction, signer: SendTransactionFrom) => {\n return 'sk' in signer\n ? transaction.signTxn(signer.sk)\n : 'lsig' in signer\n ? algosdk.signLogicSigTransactionObject(transaction, signer).blob\n : 'sign' in signer\n ? signer.sign(transaction)\n : (await signer.signer([transaction], [0]))[0]\n}\n\n/**\n * @deprecated Use `AlgorandClient` / `TransactionComposer` to send transactions.\n *\n * Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain.\n *\n * @param send The details for the transaction to prepare/send, including:\n * * `transaction`: The unsigned transaction\n * * `from`: The account to sign the transaction with: either an account with private key loaded or a logic signature account\n * * `config`: The sending configuration for this transaction\n * @param algod An algod client\n *\n * @returns An object with transaction (`transaction`) and (if `skipWaiting` is `false` or `undefined`) confirmation (`confirmation`)\n */\nexport const sendTransaction = async function (\n send: {\n transaction: Transaction\n from: SendTransactionFrom\n sendParams?: SendTransactionParams\n },\n algod: Algodv2,\n): Promise<SendTransactionResult> {\n const { transaction, from, sendParams } = send\n const { skipSending, skipWaiting, fee, maxFee, suppressLog, maxRoundsToWaitForConfirmation, atc } = sendParams ?? {}\n\n controlFees(transaction, { fee, maxFee })\n\n if (atc) {\n atc.addTransaction({ txn: transaction, signer: getSenderTransactionSigner(from) })\n return { transaction }\n }\n\n if (skipSending) {\n return { transaction }\n }\n\n let txnToSend = transaction\n\n const populateResources = sendParams?.populateAppCallResources ?? Config.populateAppCallResources\n\n // Populate resources if the transaction is an appcall and populateAppCallResources wasn't explicitly set to false\n // NOTE: Temporary false by default until this algod bug is fixed: https://github.com/algorand/go-algorand/issues/5914\n if (txnToSend.type === algosdk.TransactionType.appl && populateResources) {\n const newAtc = new AtomicTransactionComposer()\n newAtc.addTransaction({ txn: txnToSend, signer: getSenderTransactionSigner(from) })\n const packed = await populateAppCallResources(newAtc, algod)\n txnToSend = packed.buildGroup()[0].txn\n }\n\n const signedTransaction = await signTransaction(txnToSend, from)\n\n await algod.sendRawTransaction(signedTransaction).do()\n\n Config.getLogger(suppressLog).verbose(`Sent transaction ID ${txnToSend.txID()} ${txnToSend.type} from ${getSenderAddress(from)}`)\n\n let confirmation: modelsv2.PendingTransactionResponse | undefined = undefined\n if (!skipWaiting) {\n confirmation = await waitForConfirmation(txnToSend.txID(), maxRoundsToWaitForConfirmation ?? 5, algod)\n }\n\n return { transaction: txnToSend, confirmation }\n}\n\n/**\n * Get all of the unamed resources used by the group in the given ATC\n *\n * @param algod The algod client to use for the simulation\n * @param atc The ATC containing the txn group\n * @returns The unnamed resources accessed by the group and by each transaction in the group\n */\nasync function getUnnamedAppCallResourcesAccessed(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2) {\n const simulateRequest = new algosdk.modelsv2.SimulateRequest({\n txnGroups: [],\n allowUnnamedResources: true,\n allowEmptySignatures: true,\n fixSigners: true,\n })\n\n const nullSigner = algosdk.makeEmptyTransactionSigner()\n\n const emptySignerAtc = atc.clone()\n emptySignerAtc['transactions'].forEach((t: algosdk.TransactionWithSigner) => {\n t.signer = nullSigner\n })\n\n const result = await emptySignerAtc.simulate(algod, simulateRequest)\n\n const groupResponse = result.simulateResponse.txnGroups[0]\n\n if (groupResponse.failureMessage) {\n throw Error(`Error during resource population simulation in transaction ${groupResponse.failedAt}: ${groupResponse.failureMessage}`)\n }\n\n return {\n group: groupResponse.unnamedResourcesAccessed,\n txns: groupResponse.txnResults.map(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (t: any) => t.unnamedResourcesAccessed,\n ) as algosdk.modelsv2.SimulateUnnamedResourcesAccessed[],\n }\n}\n\n/**\n * Take an existing Atomic Transaction Composer and return a new one with the required\n * app call resources packed into it\n *\n * @param algod The algod client to use for the simulation\n * @param atc The ATC containing the txn group\n * @returns A new ATC with the resources packed into the transactions\n *\n * @privateRemarks\n *\n * This entire function will eventually be implemented in simulate upstream in algod. The simulate endpoint will return\n * an array of refference arrays for each transaction, so this eventually will eventually just call simulate and set the\n * reference arrays in the transactions to the reference arrays returned by simulate.\n *\n * See https://github.com/algorand/go-algorand/pull/5684\n *\n */\nexport async function populateAppCallResources(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2) {\n const unnamedResourcesAccessed = await getUnnamedAppCallResourcesAccessed(atc, algod)\n const group = atc.buildGroup()\n\n unnamedResourcesAccessed.txns.forEach((r, i) => {\n if (r === undefined || group[i].txn.type !== TransactionType.appl) return\n\n if (r.boxes || r.extraBoxRefs) throw Error('Unexpected boxes at the transaction level')\n if (r.appLocals) throw Error('Unexpected app local at the transaction level')\n if (r.assetHoldings)\n throw Error('Unexpected asset holding at the transaction level')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(group[i].txn as any)['applicationCall'] = {\n ...group[i].txn.applicationCall,\n accounts: [...(group[i].txn?.applicationCall?.accounts ?? []), ...(r.accounts ?? [])],\n foreignApps: [...(group[i].txn?.applicationCall?.foreignApps ?? []), ...(r.apps ?? [])],\n foreignAssets: [...(group[i].txn?.applicationCall?.foreignAssets ?? []), ...(r.assets ?? [])],\n boxes: [...(group[i].txn?.applicationCall?.boxes ?? []), ...(r.boxes ?? [])],\n } satisfies Partial<ApplicationTransactionFields>\n\n const accounts = group[i].txn.applicationCall?.accounts?.length ?? 0\n if (accounts > MAX_APP_CALL_ACCOUNT_REFERENCES)\n throw Error(`Account reference limit of ${MAX_APP_CALL_ACCOUNT_REFERENCES} exceeded in transaction ${i}`)\n const assets = group[i].txn.applicationCall?.foreignAssets?.length ?? 0\n const apps = group[i].txn.applicationCall?.foreignApps?.length ?? 0\n const boxes = group[i].txn.applicationCall?.boxes?.length ?? 0\n if (accounts + assets + apps + boxes > MAX_APP_CALL_FOREIGN_REFERENCES) {\n throw Error(`Resource reference limit of ${MAX_APP_CALL_FOREIGN_REFERENCES} exceeded in transaction ${i}`)\n }\n })\n\n const populateGroupResource = (\n txns: algosdk.TransactionWithSigner[],\n reference:\n | string\n | algosdk.modelsv2.BoxReference\n | algosdk.modelsv2.ApplicationLocalReference\n | algosdk.modelsv2.AssetHoldingReference\n | bigint\n | number\n | Address,\n type: 'account' | 'assetHolding' | 'appLocal' | 'app' | 'box' | 'asset',\n ): void => {\n const isApplBelowLimit = (t: algosdk.TransactionWithSigner) => {\n if (t.txn.type !== algosdk.TransactionType.appl) return false\n\n const accounts = t.txn.applicationCall?.accounts?.length ?? 0\n const assets = t.txn.applicationCall?.foreignAssets?.length ?? 0\n const apps = t.txn.applicationCall?.foreignApps?.length ?? 0\n const boxes = t.txn.applicationCall?.boxes?.length ?? 0\n\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES\n }\n\n // If this is a asset holding or app local, first try to find a transaction that already has the account available\n if (type === 'assetHolding' || type === 'appLocal') {\n const { account } = reference as algosdk.modelsv2.ApplicationLocalReference | algosdk.modelsv2.AssetHoldingReference\n\n let txnIndex = txns.findIndex((t) => {\n if (!isApplBelowLimit(t)) return false\n\n return (\n // account is in the foreign accounts array\n t.txn.applicationCall?.accounts?.map((a) => a.toString()).includes(account.toString()) ||\n // account is available as an app account\n t.txn.applicationCall?.foreignApps?.map((a) => algosdk.getApplicationAddress(a).toString()).includes(account.toString()) ||\n // account is available since it's in one of the fields\n Object.values(t.txn).some((f) =>\n stringifyJSON(f, (_, v) => (v instanceof Address ? v.toString() : v))?.includes(account.toString()),\n )\n )\n })\n\n if (txnIndex > -1) {\n if (type === 'assetHolding') {\n const { asset } = reference as algosdk.modelsv2.AssetHoldingReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignAssets: [...(txns[txnIndex].txn?.applicationCall?.foreignAssets ?? []), ...[asset]],\n } satisfies Partial<ApplicationTransactionFields>\n } else {\n const { app } = reference as algosdk.modelsv2.ApplicationLocalReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []), ...[app]],\n } satisfies Partial<ApplicationTransactionFields>\n }\n return\n }\n\n // Now try to find a txn that already has that app or asset available\n txnIndex = txns.findIndex((t) => {\n if (!isApplBelowLimit(t)) return false\n\n // check if there is space in the accounts array\n if ((t.txn.applicationCall?.accounts?.length ?? 0) >= MAX_APP_CALL_ACCOUNT_REFERENCES) return false\n\n if (type === 'assetHolding') {\n const { asset } = reference as algosdk.modelsv2.AssetHoldingReference\n return t.txn.applicationCall?.foreignAssets?.includes(asset)\n } else {\n const { app } = reference as algosdk.modelsv2.ApplicationLocalReference\n return t.txn.applicationCall?.foreignApps?.includes(app) || t.txn.applicationCall?.appIndex === app\n }\n })\n\n if (txnIndex > -1) {\n const { account } = reference as algosdk.modelsv2.AssetHoldingReference | algosdk.modelsv2.ApplicationLocalReference\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[account]],\n } satisfies Partial<ApplicationTransactionFields>\n\n return\n }\n }\n\n // If this is a box, first try to find a transaction that already has the app available\n if (type === 'box') {\n const { app, name } = reference as algosdk.modelsv2.BoxReference\n\n const txnIndex = txns.findIndex((t) => {\n if (!isApplBelowLimit(t)) return false\n\n // If the app is in the foreign array OR the app being called, then we know it's available\n return t.txn.applicationCall?.foreignApps?.includes(app) || t.txn.applicationCall?.appIndex === app\n })\n\n if (txnIndex > -1) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n boxes: [...(txns[txnIndex].txn?.applicationCall?.boxes ?? []), ...[{ appIndex: app, name } satisfies TransactionBoxReference]],\n } satisfies Partial<ApplicationTransactionFields>\n\n return\n }\n }\n\n // Find the txn index to put the reference(s)\n const txnIndex = txns.findIndex((t) => {\n if (t.txn.type !== algosdk.TransactionType.appl) return false\n\n const accounts = t.txn.applicationCall?.accounts?.length ?? 0\n if (type === 'account') return accounts < MAX_APP_CALL_ACCOUNT_REFERENCES\n\n const assets = t.txn.applicationCall?.foreignAssets?.length ?? 0\n const apps = t.txn.applicationCall?.foreignApps?.length ?? 0\n const boxes = t.txn.applicationCall?.boxes?.length ?? 0\n\n // If we're adding local state or asset holding, we need space for the acocunt and the other reference\n if (type === 'assetHolding' || type === 'appLocal') {\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES - 1 && accounts < MAX_APP_CALL_ACCOUNT_REFERENCES\n }\n\n // If we're adding a box, we need space for both the box ref and the app ref\n if (type === 'box' && BigInt((reference as algosdk.modelsv2.BoxReference).app) !== BigInt(0)) {\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES - 1\n }\n\n return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES\n })\n\n if (txnIndex === -1) {\n throw Error('No more transactions below reference limit. Add another app call to the group.')\n }\n\n if (type === 'account') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[reference as Address]],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'app') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [\n ...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []),\n ...[typeof reference === 'bigint' ? reference : BigInt(reference as number)],\n ],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'box') {\n const { app, name } = reference as algosdk.modelsv2.BoxReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n boxes: [...(txns[txnIndex].txn?.applicationCall?.boxes ?? []), ...[{ appIndex: app, name } satisfies TransactionBoxReference]],\n } satisfies Partial<ApplicationTransactionFields>\n\n if (app.toString() !== '0') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []), ...[app]],\n } satisfies Partial<ApplicationTransactionFields>\n }\n } else if (type === 'assetHolding') {\n const { asset, account } = reference as algosdk.modelsv2.AssetHoldingReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignAssets: [...(txns[txnIndex].txn?.applicationCall?.foreignAssets ?? []), ...[asset]],\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[account]],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'appLocal') {\n const { app, account } = reference as algosdk.modelsv2.ApplicationLocalReference\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignApps: [...(txns[txnIndex].txn?.applicationCall?.foreignApps ?? []), ...[app]],\n accounts: [...(txns[txnIndex].txn?.applicationCall?.accounts ?? []), ...[account]],\n } satisfies Partial<ApplicationTransactionFields>\n } else if (type === 'asset') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(txns[txnIndex].txn as any)['applicationCall'] = {\n ...txns[txnIndex].txn.applicationCall,\n foreignAssets: [\n ...(txns[txnIndex].txn?.applicationCall?.foreignAssets ?? []),\n ...[typeof reference === 'bigint' ? reference : BigInt(reference as number)],\n ],\n } satisfies Partial<ApplicationTransactionFields>\n }\n }\n\n const g = unnamedResourcesAccessed.group\n\n if (g) {\n // Do cross-reference resources first because they are the most restrictive in terms\n // of which transactions can be used\n g.appLocals?.forEach((a) => {\n populateGroupResource(group, a, 'appLocal')\n\n // Remove resources from the group if we're adding them here\n g.accounts = g.accounts?.filter((acc) => acc !== a.account)\n g.apps = g.apps?.filter((app) => BigInt(app) !== BigInt(a.app))\n })\n\n g.assetHoldings?.forEach((a) => {\n populateGroupResource(group, a, 'assetHolding')\n\n // Remove resources from the group if we're adding them here\n g.accounts = g.accounts?.filter((acc) => acc !== a.account)\n g.assets = g.assets?.filter((asset) => BigInt(asset) !== BigInt(a.asset))\n })\n\n // Do accounts next because the account limit is 4\n g.accounts?.forEach((a) => {\n populateGroupResource(group, a, 'account')\n })\n\n g.boxes?.forEach((b) => {\n populateGroupResource(group, b, 'box')\n\n // Remove apps as resource from the group if we're adding it here\n g.apps = g.apps?.filter((app) => BigInt(app) !== BigInt(b.app))\n })\n\n g.assets?.forEach((a) => {\n populateGroupResource(group, a, 'asset')\n })\n\n g.apps?.forEach((a) => {\n populateGroupResource(group, a, 'app')\n })\n\n if (g.extraBoxRefs) {\n for (let i = 0; i < g.extraBoxRefs; i += 1) {\n const ref = new algosdk.modelsv2.BoxReference({ app: 0, name: new Uint8Array(0) })\n populateGroupResource(group, ref, 'box')\n }\n }\n }\n\n const newAtc = new algosdk.AtomicTransactionComposer()\n\n group.forEach((t) => {\n t.txn.group = undefined\n newAtc.addTransaction(t)\n })\n\n newAtc['methodCalls'] = atc['methodCalls']\n return newAtc\n}\n\n/**\n * Signs and sends transactions that have been collected by an `AtomicTransactionComposer`.\n * @param atcSend The parameters controlling the send, including `atc` The `AtomicTransactionComposer` and params to control send behaviour\n * @param algod An algod client\n * @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)\n */\nexport const sendAtomicTransactionComposer = async function (atcSend: AtomicTransactionComposerToSend, algod: Algodv2) {\n const { atc: givenAtc, sendParams, ...executeParams } = atcSend\n\n let atc: AtomicTransactionComposer\n\n atc = givenAtc\n try {\n const transactionsWithSigner = atc.buildGroup()\n\n // If populateAppCallResources is true OR if populateAppCallResources is undefined and there are app calls, then populate resources\n const populateResources =\n executeParams?.populateAppCallResources ?? sendParams?.populateAppCallResources ?? Config.populateAppCallResources\n if (populateResources && transactionsWithSigner.map((t) => t.txn.type).includes(algosdk.TransactionType.appl)) {\n atc = await populateAppCallResources(givenAtc, algod)\n }\n\n const transactionsToSend = transactionsWithSigner.map((t) => {\n return t.txn\n })\n let groupId: string | undefined = undefined\n if (transactionsToSend.length > 1) {\n groupId = transactionsToSend[0].group ? Buffer.from(transactionsToSend[0].group).toString('base64') : ''\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose(\n `Sending group of ${transactionsToSend.length} transactions (${groupId})`,\n {\n transactionsToSend,\n },\n )\n\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).debug(\n `Transaction IDs (${groupId})`,\n transactionsToSend.map((t) => t.txID()),\n )\n }\n\n if (Config.debug && Config.traceAll) {\n // Dump the traces to a file for use with AlgoKit AVM debugger\n const simulateResponse = await performAtomicTransactionComposerSimulate(atc, algod)\n await Config.events.emitAsync(EventType.TxnGroupSimulated, {\n simulateResponse,\n })\n }\n const result = await atc.execute(\n algod,\n executeParams?.maxRoundsToWaitForConfirmation ?? sendParams?.maxRoundsToWaitForConfirmation ?? 5,\n )\n\n if (transactionsToSend.length > 1) {\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose(\n `Group transaction (${groupId}) sent with ${transactionsToSend.length} transactions`,\n )\n } else {\n Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose(\n `Sent transaction ID ${transactionsToSend[0].txID()} ${transactionsToSend[0].type} from ${transactionsToSend[0].sender.toString()}`,\n )\n }\n\n let confirmations: modelsv2.PendingTransactionResponse[] | undefined = undefined\n if (!sendParams?.skipWaiting) {\n confirmations = await Promise.all(transactionsToSend.map(async (t) => await algod.pendingTransactionInformation(t.txID()).do()))\n }\n\n return {\n groupId,\n confirmations,\n txIds: transactionsToSend.map((t) => t.txID()),\n transactions: transactionsToSend,\n returns: result.methodResults.map(getABIReturnValue),\n } as SendAtomicTransactionComposerResults\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n // Create a new error object so the stack trace is correct (algosdk throws an error with a more limited stack trace)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const err = new Error(typeof e === 'object' ? e?.message : 'Received error executing Atomic Transaction Composer') as any as any\n err.cause = e\n if (typeof e === 'object') {\n // Remove headers as it doesn't have anything useful.\n delete e.response?.headers\n err.response = e.response\n // body property very noisy\n if (e.response && 'body' in e.response) delete err.response.body\n err.name = e.name\n }\n\n if (Config.debug && typeof e === 'object') {\n err.traces = []\n Config.logger.error(\n 'Received error executing Atomic Transaction Composer and debug flag enabled; attempting simulation to get more information',\n err,\n )\n const simulate = await performAtomicTransactionComposerSimulate(atc, algod)\n if (Config.debug && !Config.traceAll) {\n // Emit the event only if traceAll: false, as it should have already been emitted above\n await Config.events.emitAsync(EventType.TxnGroupSimulated, {\n simulateResponse: simulate,\n })\n }\n\n if (simulate && simulate.txnGroups[0].failedAt) {\n for (const txn of simulate.txnGroups[0].txnResults) {\n err.traces.push({\n trace: txn.execTrace?.toEncodingData(),\n appBudget: txn.appBudgetConsumed,\n logicSigBudget: txn.logicSigBudgetConsumed,\n logs: txn.txnResult.logs,\n message: simulate.txnGroups[0].failureMessage,\n })\n }\n }\n } else {\n Config.logger.error('Received error executing Atomic Transaction Composer, for more information enable the debug flag', err)\n }\n throw err\n }\n}\n\nconst convertABIDecodedBigIntToNumber = (value: ABIValue, type: ABIType): ABIValue => {\n if (typeof value === 'bigint') {\n if (type instanceof algosdk.ABIUintType) {\n return type.bitSize < 53 ? Number(value) : value\n } else {\n return value\n }\n } else if (Array.isArray(value) && (type instanceof algosdk.ABIArrayStaticType || type instanceof algosdk.ABIArrayDynamicType)) {\n return value.map((v) => convertABIDecodedBigIntToNumber(v, type.childType))\n } else if (Array.isArray(value) && type instanceof algosdk.ABITupleType) {\n return value.map((v, i) => convertABIDecodedBigIntToNumber(v, type.childTypes[i]))\n } else {\n return value\n }\n}\n\n/**\n * Takes an algosdk `ABIResult` and converts it to an `ABIReturn`.\n * Converts `bigint`'s for Uint's < 64 to `number` for easier use.\n * @param result The `ABIReturn`\n */\nexport function getABIReturnValue(result: algosdk.ABIResult): ABIReturn {\n if (result.decodeError) {\n return {\n decodeError: result.decodeError,\n }\n }\n\n return {\n method: result.method,\n rawReturnValue: result.rawReturnValue,\n decodeError: undefined,\n returnValue:\n result.returnValue !== undefined && result.method.returns.type !== 'void'\n ? convertABIDecodedBigIntToNumber(result.returnValue, result.method.returns.type)\n : result.returnValue!,\n }\n}\n\n/**\n * @deprecated Use `TransactionComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead.\n *\n * Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain\n *\n * @param groupSend The group details to send, with:\n * * `transactions`: The array of transactions to send along with their signing account\n * * `sendParams`: The parameters to dictate how the group is sent\n * @param algod An algod client\n * @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)\n */\nexport const sendGroupOfTransactions = async function (groupSend: TransactionGroupToSend, algod: Algodv2) {\n const { transactions, signer, sendParams } = groupSend\n\n const defaultTransactionSigner = signer ? getSenderTransactionSigner(signer) : undefined\n\n const transactionsWithSigner = await Promise.all(\n transactions.map(async (t) => {\n if ('signer' in t)\n return {\n txn: t.transaction,\n signer: getSenderTransactionSigner(t.signer),\n sender: t.signer,\n }\n\n const txn = 'then' in t ? (await t).transaction : t\n if (!signer) {\n throw new Error(`Attempt to send transaction ${txn.txID()} as part of a group transaction, but no signer parameter was provided.`)\n }\n\n return {\n txn,\n signer: defaultTransactionSigner!,\n sender: signer,\n }\n }),\n )\n\n const atc = new AtomicTransactionComposer()\n transactionsWithSigner.forEach((txn) => atc.addTransaction(txn))\n\n return (await sendAtomicTransactionComposer({ atc, sendParams }, algod)) as Omit<SendAtomicTransactionComposerResults, 'returns'>\n}\n\n/**\n * Wait until the transaction is confirmed or rejected, or until `timeout`\n * number of rounds have passed.\n *\n * @param algod An algod client\n * @param transactionId The transaction ID to wait for\n * @param maxRoundsToWait Maximum number of rounds to wait\n *\n * @return Pending transaction information\n * @throws Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds\n */\nexport const waitForConfirmation = async function (\n transactionId: string,\n maxRoundsToWait: number | bigint,\n algod: Algodv2,\n): Promise<modelsv2.PendingTransactionResponse> {\n if (maxRoundsToWait < 0) {\n throw new Error(`Invalid timeout, received ${maxRoundsToWait}, expected > 0`)\n }\n\n // Get current round\n const status = await algod.status().do()\n if (status === undefined) {\n throw new Error('Unable to get node status')\n }\n\n // Loop for up to `timeout` rounds looking for a confirmed transaction\n const startRound = BigInt(status.lastRound) + 1n\n let currentRound = startRound\n while (currentRound < startRound + BigInt(maxRoundsToWait)) {\n try {\n const pendingInfo = await algod.pendingTransactionInformation(transactionId).do()\n\n if (pendingInfo !== undefined) {\n const confirmedRound = pendingInfo.confirmedRound\n if (confirmedRound && confirmedRound > 0) {\n return pendingInfo\n } else {\n const poolError = pendingInfo.poolError\n if (poolError != null && poolError.length > 0) {\n // If there was a pool error, then the transaction has been rejected!\n throw new Error(`Transaction ${transactionId} was rejected; pool error: ${poolError}`)\n }\n }\n }\n } catch (e: unknown) {\n if ((e as Error).name === 'URLTokenBaseHTTPError') {\n currentRound++\n continue\n }\n }\n\n await algod.statusAfterBlock(toNumber(currentRound)).do()\n currentRound++\n }\n\n throw new Error(`Transaction ${transactionId} not confirmed after ${maxRoundsToWait} rounds`)\n}\n\n/**\n * @deprecated Use `TransactionComposer` and the `maxFee` field in the transaction params instead.\n *\n * Limit the acceptable fee to a defined amount of µAlgo.\n * This also sets the transaction to be flatFee to ensure the transaction only succeeds at\n * the estimated rate.\n * @param transaction The transaction to cap or suggested params object about to be used to create a transaction\n * @param maxAcceptableFee The maximum acceptable fee to pay\n */\nexport function capTransactionFee(transaction: algosdk.Transaction | SuggestedParams, maxAcceptableFee: AlgoAmount) {\n // If a flat fee hasn't already been defined\n if (!('flatFee' in transaction) || !transaction.flatFee) {\n // Once a transaction has been constructed by algosdk, transaction.fee indicates what the total transaction fee\n // Will be based on the current suggested fee-per-byte value.\n if (transaction.fee > maxAcceptableFee.microAlgo) {\n throw new Error(\n `Cancelled transaction due to high network congestion fees. Algorand suggested fees would cause this transaction to cost ${transaction.fee} µALGO. Cap for this transaction is ${maxAcceptableFee.microAlgo} µALGO.`,\n )\n } else if (transaction.fee > 1_000_000) {\n Config.logger.warn(`Algorand network congestion fees are in effect. This transaction will incur a fee of ${transaction.fee} µALGO.`)\n }\n\n // Now set the flat on the transaction. Otherwise the network may increase the fee above our cap and perform the transaction.\n if ('flatFee' in transaction) {\n transaction.flatFee = true\n }\n }\n}\n\n/**\n * @deprecated Use `TransactionComposer` and the `maxFee` and `staticFee` fields in the transaction params instead.\n *\n * Allows for control of fees on a `Transaction` or `SuggestedParams` object\n * @param transaction The transaction or suggested params\n * @param feeControl The fee control parameters\n */\nexport function controlFees<T extends SuggestedParams | Transaction>(\n transaction: T,\n feeControl: { fee?: AlgoAmount; maxFee?: AlgoAmount },\n) {\n const { fee, maxFee } = feeControl\n if (fee) {\n transaction.fee = Number(fee.microAlgo)\n if ('flatFee' in transaction) {\n transaction.flatFee = true\n }\n }\n\n if (maxFee !== undefined) {\n capTransactionFee(transaction, maxFee)\n }\n\n return transaction\n}\n\n/**\n * @deprecated Use `suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()` instead\n *\n * Returns suggested transaction parameters from algod unless some are already provided.\n * @param params Optionally provide parameters to use\n * @param algod Algod algod\n * @returns The suggested transaction parameters\n */\nexport async function getTransactionParams(params: SuggestedParams | undefined, algod: Algodv2): Promise<SuggestedParams> {\n if (params) {\n return { ...params }\n }\n const p = await algod.getTransactionParams().do()\n return {\n fee: p.fee,\n firstValid: p.firstValid,\n lastValid: p.lastValid,\n genesisID: p.genesisID,\n genesisHash: p.genesisHash,\n minFee: p.minFee,\n }\n}\n\n/**\n * @deprecated Use `atc.clone().buildGroup()` instead.\n *\n * Returns the array of transactions currently present in the given `AtomicTransactionComposer`\n * @param atc The atomic transaction composer\n * @returns The array of transactions with signers\n */\nexport function getAtomicTransactionComposerTransactions(atc: AtomicTransactionComposer) {\n try {\n return atc.clone().buildGroup()\n } catch {\n return []\n }\n}\n"],"names":[],"mappings":";;;;;;;AAmBA,IAAO,yBAAyB,GAAG,OAAO,CAAC,yBAAyB;AAS7D,MAAM,0BAA0B,GAAG;AACnC,MAAM,+BAA+B,GAAG;AACxC,MAAM,+BAA+B,GAAG;AAE/C;;;;;;;;;;;;;;AAcG;AACG,SAAU,qBAAqB,CAAC,IAAsB,EAAA;IAC1D,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AAC/C,QAAA,OAAO,SAAS;;SACX,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,KAAK,UAAU,EAAE;AACtE,QAAA,OAAO,IAAI;;SACN,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,UAAU,IAAI,IAAI,EAAE;AACzD,QAAA,MAAM,WAAW,GAAG,CAAG,EAAA,IAAI,CAAC,QAAQ,CAAA,CAAA,EAAI,IAAI,CAAC,MAAM,CAAA,EAAG,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AACrH,QAAA,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE;AACjC,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;;SAC7B;AACL,QAAA,MAAM,CAAC,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,IAA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WAAW,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;AACvC,QAAA,IAAI,SAAS,IAAI,WAAW,EAAE;AAC5B,YAAA,WAAW,CAAC,OAAO,GAAG,IAAI;;;AAI9B,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;AACxB,QAAA,iBAAiB,CAAC,WAAW,EAAE,MAAM,CAAC;;AAGxC,IAAA,OAAO,WAAW;AACpB;AAEA;;;;;;;AAOG;AACI,eAAe,oBAAoB,CAAC,MAAmC,EAAE,KAAc,EAAA;IAC5F,IAAI,MAAM,EAAE;AACV,QAAA,OAAO,EAAE,GAAG,MAAM,EAAE;;IAEtB,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE;IACjD,OAAO;QACL,GAAG,EAAE,CAAC,CAAC,GAAG;QACV,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM;KACjB;AACH;AAEA;;;;;;AAMG;AACG,SAAU,wCAAwC,CAAC,GAA8B,EAAA;AACrF,IAAA,IAAI;AACF,QAAA,OAAO,GAAG,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE;;AAC/B,IAAA,MAAM;AACN,QAAA,OAAO,EAAE;;AAEb;;;;"}
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
var algosdk = require('algosdk');
|
|
4
4
|
var buffer = require('buffer');
|
|
5
5
|
var config = require('../config.js');
|
|
6
|
+
var util = require('../util.js');
|
|
6
7
|
var types_appManager = require('./app-manager.js');
|
|
7
8
|
|
|
9
|
+
//
|
|
8
10
|
const getMethodCallForLog = ({ method, args }) => {
|
|
9
|
-
return `${method.name}(${(args ?? []).map((a) =>
|
|
11
|
+
return `${method.name}(${(args ?? []).map((a) => typeof a === 'object'
|
|
12
|
+
? util.asJson(a, (k, v) => {
|
|
13
|
+
const newV = util.defaultJsonValueReplacer(k, v);
|
|
14
|
+
return newV instanceof Uint8Array ? buffer.Buffer.from(newV).toString('base64') : newV;
|
|
15
|
+
})
|
|
16
|
+
: a)})`;
|
|
10
17
|
};
|
|
11
18
|
/** Orchestrates sending transactions for `AlgorandClient`. */
|
|
12
19
|
class AlgorandClientTransactionSender {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algorand-client-transaction-sender.js","sources":["../../src/types/algorand-client-transaction-sender.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { Buffer } from 'buffer'\nimport { Config } from '../config'\nimport { SendAppCreateTransactionResult, SendAppTransactionResult, SendAppUpdateTransactionResult } from './app'\nimport { AppManager } from './app-manager'\nimport { AssetManager } from './asset-manager'\nimport {\n AppCallMethodCall,\n AppCallParams,\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n AssetCreateParams,\n AssetOptOutParams,\n TransactionComposer,\n} from './composer'\nimport { SendParams, SendSingleTransactionResult } from './transaction'\nimport Transaction = algosdk.Transaction\n\nconst getMethodCallForLog = ({ method, args }: { method: algosdk.ABIMethod; args?: unknown[] }) => {\n return `${method.name}(${(args ?? []).map((a) => (typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v instanceof Uint8Array ? Buffer.from(v).toString('base64') : v)) : a))})`\n}\n\n/** Orchestrates sending transactions for `AlgorandClient`. */\nexport class AlgorandClientTransactionSender {\n private _newGroup: () => TransactionComposer\n private _assetManager: AssetManager\n private _appManager: AppManager\n\n /**\n * Creates a new `AlgorandClientSender`\n * @param newGroup A lambda that starts a new `TransactionComposer` transaction group\n * @param assetManager An `AssetManager` instance\n */\n constructor(newGroup: () => TransactionComposer, assetManager: AssetManager, appManager: AppManager) {\n this._newGroup = newGroup\n this._assetManager = assetManager\n this._appManager = appManager\n }\n\n newGroup() {\n return this._newGroup()\n }\n\n private _send<T>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendSingleTransactionResult> {\n return async (params) => {\n const composer = this._newGroup()\n\n // Ensure `this` is properly populated\n c(composer).apply(composer, [params])\n\n if (log?.preLog) {\n const transaction = (await composer.build()).transactions.at(-1)!.txn\n Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction))\n }\n\n const rawResult = await composer.send(params)\n const result = {\n // Last item covers when a group is created by an app call with ABI transaction parameters\n transaction: rawResult.transactions.at(-1)!,\n confirmation: rawResult.confirmations.at(-1)!,\n txId: rawResult.txIds.at(-1)!,\n ...rawResult,\n }\n\n if (log?.postLog) {\n Config.getLogger(params?.suppressLog).debug(log.postLog(params, result))\n }\n\n return result\n }\n }\n\n private _sendAppCall<\n T extends\n | AppCreateParams\n | AppUpdateParams\n | AppCallParams\n | AppDeleteParams\n | AppCreateMethodCall\n | AppUpdateMethodCall\n | AppCallMethodCall\n | AppDeleteMethodCall,\n >(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppTransactionResult> {\n return async (params) => {\n const result = await this._send(c, log)(params)\n\n return { ...result, return: AppManager.getABIReturn(result.confirmation, 'method' in params ? params.method : undefined) }\n }\n }\n\n private _sendAppUpdateCall<T extends AppCreateParams | AppUpdateParams | AppCreateMethodCall | AppUpdateMethodCall>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppUpdateTransactionResult> {\n return async (params) => {\n const result = await this._sendAppCall(c, log)(params)\n\n const compiledApproval =\n typeof params.approvalProgram === 'string' ? this._appManager.getCompilationResult(params.approvalProgram) : undefined\n const compiledClear =\n typeof params.clearStateProgram === 'string' ? this._appManager.getCompilationResult(params.clearStateProgram) : undefined\n\n return { ...result, compiledApproval, compiledClear }\n }\n }\n\n private _sendAppCreateCall<T extends AppCreateParams | AppCreateMethodCall>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppCreateTransactionResult> {\n return async (params) => {\n const result = await this._sendAppUpdateCall(c, log)(params)\n\n return {\n ...result,\n appId: BigInt(result.confirmation.applicationIndex!),\n appAddress: algosdk.getApplicationAddress(result.confirmation.applicationIndex!),\n }\n }\n }\n\n /**\n * Send a payment transaction to transfer Algo between accounts.\n * @param params The parameters for the payment transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.payment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const result = await algorand.send.payment({\n * amount: (4).algo(),\n * receiver: 'RECEIVERADDRESS',\n * sender: 'SENDERADDRESS',\n * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // Use this with caution, it's generally better to use algorand.account.rekeyAccount\n * rekeyTo: 'REKEYTOADDRESS',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n *\n * @returns The result of the transaction and the transaction that was sent\n */\n payment = this._send((c) => c.addPayment, {\n preLog: (params, transaction) =>\n `Sending ${params.amount.microAlgo} µALGO from ${params.sender} to ${params.receiver} via transaction ${transaction.txID()}`,\n })\n /**\n * Create a new Algorand Standard Asset.\n *\n * The account that sends this transaction will automatically be\n * opted in to the asset and will hold all units after creation.\n *\n * @param params The parameters for the asset creation transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetCreate({sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetCreate({\n * sender: 'CREATORADDRESS',\n * total: 100n,\n * decimals: 2,\n * assetName: 'asset',\n * unitName: 'unit',\n * url: 'url',\n * metadataHash: 'metadataHash',\n * defaultFrozen: false,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetCreate = async (params: AssetCreateParams & SendParams) => {\n const result = await this._send((c) => c.addAssetCreate, {\n postLog: (params, result) =>\n `Created asset${params.assetName ? ` ${params.assetName}` : ''}${params.unitName ? ` (${params.unitName})` : ''} with ${params.total} units and ${params.decimals ?? 0} decimals created by ${params.sender} with ID ${result.confirmation.assetIndex} via transaction ${result.txIds.at(-1)}`,\n })(params)\n return { ...result, assetId: BigInt(result.confirmation.assetIndex ?? 0) }\n }\n /**\n * Configure an existing Algorand Standard Asset.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n *\n * @param params The parameters for the asset config transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetConfig({sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetConfig({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetConfig = this._send((c) => c.addAssetConfig, {\n preLog: (params, transaction) => `Configuring asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Freeze or unfreeze an Algorand Standard Asset for an account.\n *\n * @param params The parameters for the asset freeze transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetFreeze({sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetFreeze({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * account: 'ACCOUNTADDRESS',\n * frozen: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetFreeze = this._send((c) => c.addAssetFreeze, {\n preLog: (params, transaction) => `Freezing asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Destroys an Algorand Standard Asset.\n *\n * Created assets can be destroyed only by the asset manager account.\n * All of the assets must be owned by the creator of the asset before\n * the asset can be deleted.\n *\n * @param params The parameters for the asset destroy transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetDestroy({sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetDestroy({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetDestroy = this._send((c) => c.addAssetDestroy, {\n preLog: (params, transaction) => `Destroying asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Transfer an Algorand Standard Asset.\n *\n * @param params The parameters for the asset transfer transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetTransfer({sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * await algorand.send.assetTransfer({\n * sender: 'CLAWBACKADDRESS',\n * assetId: 123456n,\n * amount: 1n,\n * receiver: 'RECEIVERADDRESS',\n * clawbackTarget: 'HOLDERADDRESS',\n * // This field needs to be used with caution\n * closeAssetTo: 'ADDRESSTOCLOSETO'\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetTransfer = this._send((c) => c.addAssetTransfer, {\n preLog: (params, transaction) =>\n `Transferring ${params.amount} units of asset with ID ${params.assetId} from ${params.sender} to ${params.receiver} via transaction ${transaction.txID()}`,\n })\n /**\n * Opt an account into an Algorand Standard Asset.\n *\n * @param params The parameters for the asset opt-in transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetOptIn({sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetOptIn = this._send((c) => c.addAssetOptIn, {\n preLog: (params, transaction) => `Opting in ${params.sender} to asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Opt an account out of an Algorand Standard Asset.\n *\n * *Note:* If the account has a balance of the asset,\n * it will not be able to opt-out unless `ensureZeroBalance`\n * is set to `false` (but then the account will lose the assets).\n *\n * @param params The parameters for the asset opt-out transaction\n *\n * @example Basic example (without creator, will be retrieved from algod)\n * ```typescript\n * await algorand.send.assetOptOut({sender: \"SENDERADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Basic example (with creator)\n * ```typescript\n * await algorand.send.assetOptOut({sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetOptOut({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * creator: 'CREATORADDRESS',\n * ensureZeroBalance: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetOptOut = async (\n params: Omit<AssetOptOutParams, 'creator'> & {\n /** Optional asset creator account address; if not specified it will be retrieved from algod */\n creator?: string | Address\n /** Whether or not to check if the account has a zero balance first or not.\n *\n * If this is set to `true` and the account has an asset balance it will throw an error.\n *\n * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.\n */\n ensureZeroBalance: boolean\n } & SendParams,\n ) => {\n if (params.ensureZeroBalance) {\n let balance = 0n\n try {\n const accountAssetInfo = await this._assetManager.getAccountInformation(params.sender, params.assetId)\n balance = accountAssetInfo.balance\n } catch {\n throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`)\n }\n if (balance !== 0n) {\n throw new Error(`Account ${params.sender} does not have a zero balance for Asset ${params.assetId}; can't opt-out.`)\n }\n }\n\n params.creator = params.creator ?? (await this._assetManager.getById(params.assetId)).creator\n\n return await this._send((c) => c.addAssetOptOut, {\n preLog: (params, transaction) =>\n `Opting ${params.sender} out of asset with ID ${params.assetId} to creator ${params.creator} via transaction ${transaction.txID()}`,\n })(params as AssetOptOutParams & SendParams)\n }\n /**\n * Create a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appCreate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreate = this._sendAppCreateCall((c) => c.addAppCreate, {\n postLog: (params, result) =>\n `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Update a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, {\n postLog: (params, result) =>\n `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Delete a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDelete = this._sendAppCall((c) => c.addAppDelete, {\n postLog: (params, result) =>\n `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Call a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appCall({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCall = this._sendAppCall((c) => c.addAppCall, {\n postLog: (params, result) =>\n `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Create a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * const result = await algorand.send.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCreate({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreateMethodCall = this._sendAppCreateCall((c) => c.addAppCreateMethodCall, {\n postLog: (params, result) =>\n `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Update a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Delete a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Call a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /** Register an online key. */\n onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, {\n preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txID()}`,\n })\n\n /** Register an offline key. */\n offlineKeyRegistration = this._send((c) => c.addOfflineKeyRegistration, {\n preLog: (params, transaction) => `Registering offline key for ${params.sender} via transaction ${transaction.txID()}`,\n })\n}\n"],"names":["Buffer","Config","AppManager"],"mappings":";;;;;;;AAsBA,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAmD,KAAI;AAChG,IAAA,OAAO,GAAG,MAAM,CAAC,IAAI,CAAI,CAAA,EAAA,CAAC,IAAI,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,KAAK,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,UAAU,GAAGA,aAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;AACvN,CAAC;AAED;MACa,+BAA+B,CAAA;AAK1C;;;;AAIG;AACH,IAAA,WAAA,CAAY,QAAmC,EAAE,YAA0B,EAAE,UAAsB,EAAA;AA0GnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE;YACxC,MAAM,E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,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAiB,CAAC;gBACpD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAiB,CAAC;aACjF;AACH,SAAC;;AAizBJ;;;;"}
|
|
1
|
+
{"version":3,"file":"algorand-client-transaction-sender.js","sources":["../../src/types/algorand-client-transaction-sender.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { Buffer } from 'buffer'\nimport { Config } from '../config'\nimport { asJson, defaultJsonValueReplacer } from '../util'\nimport { SendAppCreateTransactionResult, SendAppTransactionResult, SendAppUpdateTransactionResult } from './app'\nimport { AppManager } from './app-manager'\nimport { AssetManager } from './asset-manager'\nimport {\n AppCallMethodCall,\n AppCallParams,\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n AssetCreateParams,\n AssetOptOutParams,\n TransactionComposer,\n} from './composer'\nimport { SendParams, SendSingleTransactionResult } from './transaction'\nimport Transaction = algosdk.Transaction\n\n//\n\nconst getMethodCallForLog = ({ method, args }: { method: algosdk.ABIMethod; args?: unknown[] }) => {\n return `${method.name}(${(args ?? []).map((a) =>\n typeof a === 'object'\n ? asJson(a, (k, v) => {\n const newV = defaultJsonValueReplacer(k, v)\n return newV instanceof Uint8Array ? Buffer.from(newV).toString('base64') : newV\n })\n : a,\n )})`\n}\n\n/** Orchestrates sending transactions for `AlgorandClient`. */\nexport class AlgorandClientTransactionSender {\n private _newGroup: () => TransactionComposer\n private _assetManager: AssetManager\n private _appManager: AppManager\n\n /**\n * Creates a new `AlgorandClientSender`\n * @param newGroup A lambda that starts a new `TransactionComposer` transaction group\n * @param assetManager An `AssetManager` instance\n */\n constructor(newGroup: () => TransactionComposer, assetManager: AssetManager, appManager: AppManager) {\n this._newGroup = newGroup\n this._assetManager = assetManager\n this._appManager = appManager\n }\n\n newGroup() {\n return this._newGroup()\n }\n\n private _send<T>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendSingleTransactionResult> {\n return async (params) => {\n const composer = this._newGroup()\n\n // Ensure `this` is properly populated\n c(composer).apply(composer, [params])\n\n if (log?.preLog) {\n const transaction = (await composer.build()).transactions.at(-1)!.txn\n Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction))\n }\n\n const rawResult = await composer.send(params)\n const result = {\n // Last item covers when a group is created by an app call with ABI transaction parameters\n transaction: rawResult.transactions.at(-1)!,\n confirmation: rawResult.confirmations.at(-1)!,\n txId: rawResult.txIds.at(-1)!,\n ...rawResult,\n }\n\n if (log?.postLog) {\n Config.getLogger(params?.suppressLog).debug(log.postLog(params, result))\n }\n\n return result\n }\n }\n\n private _sendAppCall<\n T extends\n | AppCreateParams\n | AppUpdateParams\n | AppCallParams\n | AppDeleteParams\n | AppCreateMethodCall\n | AppUpdateMethodCall\n | AppCallMethodCall\n | AppDeleteMethodCall,\n >(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppTransactionResult> {\n return async (params) => {\n const result = await this._send(c, log)(params)\n\n return { ...result, return: AppManager.getABIReturn(result.confirmation, 'method' in params ? params.method : undefined) }\n }\n }\n\n private _sendAppUpdateCall<T extends AppCreateParams | AppUpdateParams | AppCreateMethodCall | AppUpdateMethodCall>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppUpdateTransactionResult> {\n return async (params) => {\n const result = await this._sendAppCall(c, log)(params)\n\n const compiledApproval =\n typeof params.approvalProgram === 'string' ? this._appManager.getCompilationResult(params.approvalProgram) : undefined\n const compiledClear =\n typeof params.clearStateProgram === 'string' ? this._appManager.getCompilationResult(params.clearStateProgram) : undefined\n\n return { ...result, compiledApproval, compiledClear }\n }\n }\n\n private _sendAppCreateCall<T extends AppCreateParams | AppCreateMethodCall>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppCreateTransactionResult> {\n return async (params) => {\n const result = await this._sendAppUpdateCall(c, log)(params)\n\n return {\n ...result,\n appId: BigInt(result.confirmation.applicationIndex!),\n appAddress: algosdk.getApplicationAddress(result.confirmation.applicationIndex!),\n }\n }\n }\n\n /**\n * Send a payment transaction to transfer Algo between accounts.\n * @param params The parameters for the payment transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.payment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const result = await algorand.send.payment({\n * amount: (4).algo(),\n * receiver: 'RECEIVERADDRESS',\n * sender: 'SENDERADDRESS',\n * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // Use this with caution, it's generally better to use algorand.account.rekeyAccount\n * rekeyTo: 'REKEYTOADDRESS',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n *\n * @returns The result of the transaction and the transaction that was sent\n */\n payment = this._send((c) => c.addPayment, {\n preLog: (params, transaction) =>\n `Sending ${params.amount.microAlgo} µALGO from ${params.sender} to ${params.receiver} via transaction ${transaction.txID()}`,\n })\n /**\n * Create a new Algorand Standard Asset.\n *\n * The account that sends this transaction will automatically be\n * opted in to the asset and will hold all units after creation.\n *\n * @param params The parameters for the asset creation transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetCreate({sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetCreate({\n * sender: 'CREATORADDRESS',\n * total: 100n,\n * decimals: 2,\n * assetName: 'asset',\n * unitName: 'unit',\n * url: 'url',\n * metadataHash: 'metadataHash',\n * defaultFrozen: false,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetCreate = async (params: AssetCreateParams & SendParams) => {\n const result = await this._send((c) => c.addAssetCreate, {\n postLog: (params, result) =>\n `Created asset${params.assetName ? ` ${params.assetName}` : ''}${params.unitName ? ` (${params.unitName})` : ''} with ${params.total} units and ${params.decimals ?? 0} decimals created by ${params.sender} with ID ${result.confirmation.assetIndex} via transaction ${result.txIds.at(-1)}`,\n })(params)\n return { ...result, assetId: BigInt(result.confirmation.assetIndex ?? 0) }\n }\n /**\n * Configure an existing Algorand Standard Asset.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n *\n * @param params The parameters for the asset config transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetConfig({sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetConfig({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetConfig = this._send((c) => c.addAssetConfig, {\n preLog: (params, transaction) => `Configuring asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Freeze or unfreeze an Algorand Standard Asset for an account.\n *\n * @param params The parameters for the asset freeze transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetFreeze({sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetFreeze({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * account: 'ACCOUNTADDRESS',\n * frozen: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetFreeze = this._send((c) => c.addAssetFreeze, {\n preLog: (params, transaction) => `Freezing asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Destroys an Algorand Standard Asset.\n *\n * Created assets can be destroyed only by the asset manager account.\n * All of the assets must be owned by the creator of the asset before\n * the asset can be deleted.\n *\n * @param params The parameters for the asset destroy transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetDestroy({sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetDestroy({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetDestroy = this._send((c) => c.addAssetDestroy, {\n preLog: (params, transaction) => `Destroying asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Transfer an Algorand Standard Asset.\n *\n * @param params The parameters for the asset transfer transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetTransfer({sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * await algorand.send.assetTransfer({\n * sender: 'CLAWBACKADDRESS',\n * assetId: 123456n,\n * amount: 1n,\n * receiver: 'RECEIVERADDRESS',\n * clawbackTarget: 'HOLDERADDRESS',\n * // This field needs to be used with caution\n * closeAssetTo: 'ADDRESSTOCLOSETO'\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetTransfer = this._send((c) => c.addAssetTransfer, {\n preLog: (params, transaction) =>\n `Transferring ${params.amount} units of asset with ID ${params.assetId} from ${params.sender} to ${params.receiver} via transaction ${transaction.txID()}`,\n })\n /**\n * Opt an account into an Algorand Standard Asset.\n *\n * @param params The parameters for the asset opt-in transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetOptIn({sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetOptIn = this._send((c) => c.addAssetOptIn, {\n preLog: (params, transaction) => `Opting in ${params.sender} to asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Opt an account out of an Algorand Standard Asset.\n *\n * *Note:* If the account has a balance of the asset,\n * it will not be able to opt-out unless `ensureZeroBalance`\n * is set to `false` (but then the account will lose the assets).\n *\n * @param params The parameters for the asset opt-out transaction\n *\n * @example Basic example (without creator, will be retrieved from algod)\n * ```typescript\n * await algorand.send.assetOptOut({sender: \"SENDERADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Basic example (with creator)\n * ```typescript\n * await algorand.send.assetOptOut({sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetOptOut({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * creator: 'CREATORADDRESS',\n * ensureZeroBalance: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetOptOut = async (\n params: Omit<AssetOptOutParams, 'creator'> & {\n /** Optional asset creator account address; if not specified it will be retrieved from algod */\n creator?: string | Address\n /** Whether or not to check if the account has a zero balance first or not.\n *\n * If this is set to `true` and the account has an asset balance it will throw an error.\n *\n * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.\n */\n ensureZeroBalance: boolean\n } & SendParams,\n ) => {\n if (params.ensureZeroBalance) {\n let balance = 0n\n try {\n const accountAssetInfo = await this._assetManager.getAccountInformation(params.sender, params.assetId)\n balance = accountAssetInfo.balance\n } catch {\n throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`)\n }\n if (balance !== 0n) {\n throw new Error(`Account ${params.sender} does not have a zero balance for Asset ${params.assetId}; can't opt-out.`)\n }\n }\n\n params.creator = params.creator ?? (await this._assetManager.getById(params.assetId)).creator\n\n return await this._send((c) => c.addAssetOptOut, {\n preLog: (params, transaction) =>\n `Opting ${params.sender} out of asset with ID ${params.assetId} to creator ${params.creator} via transaction ${transaction.txID()}`,\n })(params as AssetOptOutParams & SendParams)\n }\n /**\n * Create a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appCreate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreate = this._sendAppCreateCall((c) => c.addAppCreate, {\n postLog: (params, result) =>\n `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Update a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, {\n postLog: (params, result) =>\n `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Delete a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDelete = this._sendAppCall((c) => c.addAppDelete, {\n postLog: (params, result) =>\n `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Call a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appCall({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCall = this._sendAppCall((c) => c.addAppCall, {\n postLog: (params, result) =>\n `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Create a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * const result = await algorand.send.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCreate({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreateMethodCall = this._sendAppCreateCall((c) => c.addAppCreateMethodCall, {\n postLog: (params, result) =>\n `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Update a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Delete a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Call a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /** Register an online key. */\n onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, {\n preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txID()}`,\n })\n\n /** Register an offline key. */\n offlineKeyRegistration = this._send((c) => c.addOfflineKeyRegistration, {\n preLog: (params, transaction) => `Registering offline key for ${params.sender} via transaction ${transaction.txID()}`,\n })\n}\n"],"names":["asJson","defaultJsonValueReplacer","Buffer","Config","AppManager"],"mappings":";;;;;;;;AAuBA;AAEA,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAmD,KAAI;IAChG,OAAO,CAAA,EAAG,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,KAC1C,OAAO,CAAC,KAAK;UACTA,WAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAI;YACjB,MAAM,IAAI,GAAGC,6BAAwB,CAAC,CAAC,EAAE,CAAC,CAAC;YAC3C,OAAO,IAAI,YAAY,UAAU,GAAGC,aAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI;AACjF,SAAC;AACH,UAAE,CAAC,CACN,CAAA,CAAA,CAAG;AACN,CAAC;AAED;MACa,+BAA+B,CAAA;AAK1C;;;;AAIG;AACH,IAAA,WAAA,CAAY,QAAmC,EAAE,YAA0B,EAAE,UAAsB,EAAA;AA0GnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE;YACxC,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,KAC1B,CAAA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