@algorandfoundation/algokit-utils 10.0.0-alpha.31 → 10.0.0-alpha.32

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.
Files changed (318) hide show
  1. package/account-manager.d.ts +448 -0
  2. package/account-manager.js +623 -0
  3. package/account-manager.js.map +1 -0
  4. package/account-manager.mjs +620 -0
  5. package/account-manager.mjs.map +1 -0
  6. package/account.d.ts +156 -0
  7. package/account.js +10 -0
  8. package/account.js.map +1 -0
  9. package/account.mjs +9 -0
  10. package/account.mjs.map +1 -0
  11. package/algorand-client-transaction-creator.d.ts +1103 -0
  12. package/algorand-client-transaction-creator.js +735 -0
  13. package/algorand-client-transaction-creator.js.map +1 -0
  14. package/algorand-client-transaction-creator.mjs +734 -0
  15. package/algorand-client-transaction-creator.mjs.map +1 -0
  16. package/algorand-client-transaction-sender.d.ts +1317 -0
  17. package/algorand-client-transaction-sender.js +933 -0
  18. package/algorand-client-transaction-sender.js.map +1 -0
  19. package/algorand-client-transaction-sender.mjs +932 -0
  20. package/algorand-client-transaction-sender.mjs.map +1 -0
  21. package/algorand-client.d.ts +246 -0
  22. package/algorand-client.js +325 -0
  23. package/algorand-client.js.map +1 -0
  24. package/algorand-client.mjs +325 -0
  25. package/algorand-client.mjs.map +1 -0
  26. package/amount.d.ts +46 -3
  27. package/amount.js +92 -13
  28. package/amount.js.map +1 -1
  29. package/amount.mjs +80 -3
  30. package/amount.mjs.map +1 -1
  31. package/app-client.d.ts +2130 -0
  32. package/app-client.js +909 -0
  33. package/app-client.js.map +1 -0
  34. package/app-client.mjs +908 -0
  35. package/app-client.mjs.map +1 -0
  36. package/app-deployer.d.ts +166 -0
  37. package/app-deployer.js +353 -0
  38. package/app-deployer.js.map +1 -0
  39. package/app-deployer.mjs +353 -0
  40. package/app-deployer.mjs.map +1 -0
  41. package/app-factory.d.ts +965 -0
  42. package/app-factory.js +448 -0
  43. package/app-factory.js.map +1 -0
  44. package/app-factory.mjs +448 -0
  45. package/app-factory.mjs.map +1 -0
  46. package/app-manager.d.ts +323 -0
  47. package/app-manager.js +468 -0
  48. package/app-manager.js.map +1 -0
  49. package/app-manager.mjs +468 -0
  50. package/app-manager.mjs.map +1 -0
  51. package/app-spec.d.ts +203 -0
  52. package/app-spec.js +137 -0
  53. package/app-spec.js.map +1 -0
  54. package/app-spec.mjs +137 -0
  55. package/app-spec.mjs.map +1 -0
  56. package/app.d.ts +257 -0
  57. package/app.js +49 -0
  58. package/app.js.map +1 -0
  59. package/app.mjs +42 -0
  60. package/app.mjs.map +1 -0
  61. package/asset-manager.d.ts +212 -0
  62. package/asset-manager.js +166 -0
  63. package/asset-manager.js.map +1 -0
  64. package/asset-manager.mjs +166 -0
  65. package/asset-manager.mjs.map +1 -0
  66. package/async-event-emitter.d.ts +16 -0
  67. package/async-event-emitter.js +38 -0
  68. package/async-event-emitter.js.map +1 -0
  69. package/async-event-emitter.mjs +37 -0
  70. package/async-event-emitter.mjs.map +1 -0
  71. package/client-manager.d.ts +475 -0
  72. package/client-manager.js +616 -0
  73. package/client-manager.js.map +1 -0
  74. package/client-manager.mjs +616 -0
  75. package/client-manager.mjs.map +1 -0
  76. package/composer.d.ts +947 -0
  77. package/composer.js +1584 -0
  78. package/composer.js.map +1 -0
  79. package/composer.mjs +1583 -0
  80. package/composer.mjs.map +1 -0
  81. package/config.d.ts +1 -1
  82. package/config.js +2 -2
  83. package/config.js.map +1 -1
  84. package/config.mjs +1 -1
  85. package/config.mjs.map +1 -1
  86. package/debugging.d.ts +47 -0
  87. package/debugging.js +20 -0
  88. package/debugging.js.map +1 -0
  89. package/debugging.mjs +15 -0
  90. package/debugging.mjs.map +1 -0
  91. package/dispenser-client.d.ts +90 -0
  92. package/dispenser-client.js +127 -0
  93. package/dispenser-client.js.map +1 -0
  94. package/dispenser-client.mjs +127 -0
  95. package/dispenser-client.mjs.map +1 -0
  96. package/expand.d.ts +2 -0
  97. package/expand.js +0 -0
  98. package/expand.mjs +0 -0
  99. package/index.d.ts +6 -5
  100. package/index.js +4 -3
  101. package/index.mjs +5 -5
  102. package/indexer-client/indexer-lookup.d.ts +1 -1
  103. package/indexer-client/indexer-lookup.js.map +1 -1
  104. package/indexer-client/indexer-lookup.mjs.map +1 -1
  105. package/indexer.d.ts +40 -0
  106. package/indexer.js +38 -0
  107. package/indexer.js.map +1 -0
  108. package/indexer.mjs +35 -0
  109. package/indexer.mjs.map +1 -0
  110. package/instance-of.d.ts +8 -0
  111. package/kmd-account-manager.d.ts +74 -0
  112. package/kmd-account-manager.js +167 -0
  113. package/kmd-account-manager.js.map +1 -0
  114. package/kmd-account-manager.mjs +165 -0
  115. package/kmd-account-manager.mjs.map +1 -0
  116. package/lifecycle-events.d.ts +14 -0
  117. package/lifecycle-events.js +11 -0
  118. package/lifecycle-events.js.map +1 -0
  119. package/lifecycle-events.mjs +10 -0
  120. package/lifecycle-events.mjs.map +1 -0
  121. package/logging.d.ts +13 -0
  122. package/logging.js +47 -0
  123. package/logging.js.map +1 -0
  124. package/logging.mjs +42 -0
  125. package/logging.mjs.map +1 -0
  126. package/logic-error.d.ts +39 -0
  127. package/logic-error.js +54 -0
  128. package/logic-error.js.map +1 -0
  129. package/logic-error.mjs +53 -0
  130. package/logic-error.mjs.map +1 -0
  131. package/network-client.d.ts +43 -0
  132. package/network-client.js +14 -0
  133. package/network-client.js.map +1 -0
  134. package/network-client.mjs +13 -0
  135. package/network-client.mjs.map +1 -0
  136. package/package.json +11 -1
  137. package/testing/account.d.ts +2 -2
  138. package/testing/account.js +1 -1
  139. package/testing/account.js.map +1 -1
  140. package/testing/account.mjs +1 -1
  141. package/testing/account.mjs.map +1 -1
  142. package/testing/fixtures/algokit-log-capture-fixture.d.ts +1 -1
  143. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  144. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  145. package/testing/fixtures/algorand-fixture.d.ts +2 -2
  146. package/testing/fixtures/algorand-fixture.js +2 -2
  147. package/testing/fixtures/algorand-fixture.js.map +1 -1
  148. package/testing/fixtures/algorand-fixture.mjs +2 -2
  149. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  150. package/testing/index.d.ts +2 -1
  151. package/testing/test-logger.d.ts +1 -1
  152. package/testing/test-logger.js.map +1 -1
  153. package/testing/test-logger.mjs.map +1 -1
  154. package/testing/types.d.ts +156 -0
  155. package/transaction/index.d.ts +4 -0
  156. package/transaction/index.js +9 -0
  157. package/transaction/index.mjs +4 -0
  158. package/transaction/perform-transaction-composer-simulate.d.ts +1 -1
  159. package/transaction/perform-transaction-composer-simulate.js.map +1 -1
  160. package/transaction/perform-transaction-composer-simulate.mjs.map +1 -1
  161. package/transaction/transaction.d.ts +2 -2
  162. package/transaction/transaction.js.map +1 -1
  163. package/transaction/transaction.mjs.map +1 -1
  164. package/transaction/types.d.ts +133 -0
  165. package/transactions/app-call.d.ts +1 -1
  166. package/transactions/app-call.js +1 -1
  167. package/transactions/app-call.js.map +1 -1
  168. package/transactions/app-call.mjs +1 -1
  169. package/transactions/app-call.mjs.map +1 -1
  170. package/transactions/common.d.ts +1 -1
  171. package/transactions/common.js.map +1 -1
  172. package/transactions/common.mjs.map +1 -1
  173. package/transactions/method-call.d.ts +1 -1
  174. package/transactions/method-call.js +1 -1
  175. package/transactions/method-call.js.map +1 -1
  176. package/transactions/method-call.mjs +1 -1
  177. package/transactions/method-call.mjs.map +1 -1
  178. package/transactions/payment.d.ts +1 -1
  179. package/transactions/payment.js.map +1 -1
  180. package/transactions/payment.mjs.map +1 -1
  181. package/types/account-manager.d.ts +11 -442
  182. package/types/account-manager.js +5 -616
  183. package/types/account-manager.js.map +1 -1
  184. package/types/account-manager.mjs +5 -614
  185. package/types/account-manager.mjs.map +1 -1
  186. package/types/account.d.ts +8 -150
  187. package/types/account.js +3 -4
  188. package/types/account.js.map +1 -1
  189. package/types/account.mjs +4 -4
  190. package/types/account.mjs.map +1 -1
  191. package/types/algorand-client-transaction-creator.d.ts +5 -1098
  192. package/types/algorand-client-transaction-creator.js +3 -729
  193. package/types/algorand-client-transaction-creator.js.map +1 -1
  194. package/types/algorand-client-transaction-creator.mjs +4 -729
  195. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  196. package/types/algorand-client-transaction-sender.d.ts +5 -1312
  197. package/types/algorand-client-transaction-sender.js +3 -927
  198. package/types/algorand-client-transaction-sender.js.map +1 -1
  199. package/types/algorand-client-transaction-sender.mjs +3 -926
  200. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  201. package/types/algorand-client.d.ts +5 -241
  202. package/types/algorand-client.js +3 -319
  203. package/types/algorand-client.js.map +1 -1
  204. package/types/algorand-client.mjs +3 -319
  205. package/types/algorand-client.mjs.map +1 -1
  206. package/types/amount.d.ts +6 -45
  207. package/types/amount.js +3 -79
  208. package/types/amount.js.map +1 -1
  209. package/types/amount.mjs +4 -79
  210. package/types/amount.mjs.map +1 -1
  211. package/types/app-client.d.ts +75 -2125
  212. package/types/app-client.js +3 -903
  213. package/types/app-client.js.map +1 -1
  214. package/types/app-client.mjs +3 -902
  215. package/types/app-client.mjs.map +1 -1
  216. package/types/app-deployer.d.ts +21 -161
  217. package/types/app-deployer.js +3 -347
  218. package/types/app-deployer.js.map +1 -1
  219. package/types/app-deployer.mjs +3 -347
  220. package/types/app-deployer.mjs.map +1 -1
  221. package/types/app-factory.d.ts +21 -960
  222. package/types/app-factory.js +3 -442
  223. package/types/app-factory.js.map +1 -1
  224. package/types/app-factory.mjs +3 -442
  225. package/types/app-factory.mjs.map +1 -1
  226. package/types/app-manager.d.ts +15 -318
  227. package/types/app-manager.js +3 -462
  228. package/types/app-manager.js.map +1 -1
  229. package/types/app-manager.mjs +3 -462
  230. package/types/app-manager.mjs.map +1 -1
  231. package/types/app-spec.d.ts +39 -198
  232. package/types/app-spec.js +3 -131
  233. package/types/app-spec.js.map +1 -1
  234. package/types/app-spec.mjs +3 -131
  235. package/types/app-spec.mjs.map +1 -1
  236. package/types/app.d.ts +62 -247
  237. package/types/app.js +15 -37
  238. package/types/app.js.map +1 -1
  239. package/types/app.mjs +16 -37
  240. package/types/app.mjs.map +1 -1
  241. package/types/asset-manager.d.ts +9 -207
  242. package/types/asset-manager.js +3 -160
  243. package/types/asset-manager.js.map +1 -1
  244. package/types/asset-manager.mjs +3 -160
  245. package/types/asset-manager.mjs.map +1 -1
  246. package/types/async-event-emitter.d.ts +7 -11
  247. package/types/async-event-emitter.js +3 -32
  248. package/types/async-event-emitter.js.map +1 -1
  249. package/types/async-event-emitter.mjs +4 -32
  250. package/types/async-event-emitter.mjs.map +1 -1
  251. package/types/client-manager.d.ts +27 -470
  252. package/types/client-manager.js +3 -610
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +3 -610
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +79 -943
  257. package/types/composer.js +3 -1578
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +3 -1577
  260. package/types/composer.mjs.map +1 -1
  261. package/types/config.d.ts +7 -52
  262. package/types/config.js +3 -74
  263. package/types/config.js.map +1 -1
  264. package/types/config.mjs +3 -74
  265. package/types/config.mjs.map +1 -1
  266. package/types/debugging.d.ts +12 -37
  267. package/types/debugging.js +11 -10
  268. package/types/debugging.js.map +1 -1
  269. package/types/debugging.mjs +12 -10
  270. package/types/debugging.mjs.map +1 -1
  271. package/types/dispenser-client.d.ts +11 -85
  272. package/types/dispenser-client.js +3 -121
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +3 -121
  275. package/types/dispenser-client.mjs.map +1 -1
  276. package/types/expand.d.ts +8 -2
  277. package/types/indexer.d.ts +16 -36
  278. package/types/indexer.js +7 -30
  279. package/types/indexer.js.map +1 -1
  280. package/types/indexer.mjs +8 -30
  281. package/types/indexer.mjs.map +1 -1
  282. package/types/instance-of.d.ts +4 -4
  283. package/types/kmd-account-manager.d.ts +5 -69
  284. package/types/kmd-account-manager.js +3 -161
  285. package/types/kmd-account-manager.js.map +1 -1
  286. package/types/kmd-account-manager.mjs +3 -159
  287. package/types/kmd-account-manager.mjs.map +1 -1
  288. package/types/lifecycle-events.d.ts +7 -9
  289. package/types/lifecycle-events.js +3 -5
  290. package/types/lifecycle-events.js.map +1 -1
  291. package/types/lifecycle-events.mjs +4 -5
  292. package/types/lifecycle-events.mjs.map +1 -1
  293. package/types/logging.d.ts +14 -9
  294. package/types/logging.js +11 -37
  295. package/types/logging.js.map +1 -1
  296. package/types/logging.mjs +12 -37
  297. package/types/logging.mjs.map +1 -1
  298. package/types/logic-error.d.ts +8 -35
  299. package/types/logic-error.js +3 -48
  300. package/types/logic-error.js.map +1 -1
  301. package/types/logic-error.mjs +4 -48
  302. package/types/logic-error.mjs.map +1 -1
  303. package/types/network-client.d.ts +10 -39
  304. package/types/network-client.js +3 -8
  305. package/types/network-client.js.map +1 -1
  306. package/types/network-client.mjs +4 -8
  307. package/types/network-client.mjs.map +1 -1
  308. package/types/testing.d.ts +13 -151
  309. package/types/transaction.d.ts +33 -128
  310. package/updatable-config.d.ts +57 -0
  311. package/updatable-config.js +80 -0
  312. package/updatable-config.js.map +1 -0
  313. package/updatable-config.mjs +80 -0
  314. package/updatable-config.mjs.map +1 -0
  315. package/util.js +1 -1
  316. package/util.js.map +1 -1
  317. package/util.mjs +1 -1
  318. package/util.mjs.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer.mjs","names":["transaction: Transaction","transactionAnalysis: Array<{\n groupIndex: number\n requiredFeeDelta?: FeeDelta\n priority: FeePriority\n unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed\n }>","indexesWithAccessReferences: number[]","additionalFeeDelta: FeeDelta | undefined","appCallIndexesWithoutMaxFees: number[]","simulateRequest: SimulateRequest","txnAnalysisResults: TransactionAnalysis[]","requiredFeeDelta: FeeDelta | undefined","originalError: any","sentTransactions: Transaction[] | undefined","transactionsWithEmptySigners: TransactionWithSigner[]","transactionsWithSigner: TransactionWithSigner[]","encodedSignedTransactions: (Uint8Array | null)[]"],"sources":["../src/composer.ts"],"sourcesContent":["import { ABIMethod, ABIReturn } from '@algorandfoundation/algokit-abi'\nimport {\n AlgodClient,\n PendingTransactionResponse,\n SimulateRequest,\n SimulateResponse,\n SimulateUnnamedResourcesAccessed,\n SuggestedParams,\n} from '@algorandfoundation/algokit-algod-client'\nimport { EMPTY_SIGNATURE, Expand } from '@algorandfoundation/algokit-common'\nimport {\n OnApplicationComplete,\n SignedTransaction,\n Transaction,\n TransactionSigner,\n TransactionType,\n assignFee,\n calculateFee,\n decodeSignedTransactions,\n decodeTransaction,\n encodeTransactionRaw,\n groupTransactions,\n makeEmptyTransactionSigner,\n validateTransaction,\n} from '@algorandfoundation/algokit-transact'\nimport { Buffer } from 'buffer'\nimport { Config } from './config'\nimport { TransactionWithSigner, waitForConfirmation } from './transaction'\nimport {\n buildAppCall,\n buildAppCreate,\n buildAppUpdate,\n populateGroupResources,\n populateTransactionResources,\n type AppCallParams,\n type AppCreateParams,\n type AppDeleteParams,\n type AppUpdateParams,\n type CommonAppCallParams,\n} from './transactions/app-call'\nimport {\n buildAssetOptIn,\n buildAssetOptOut,\n buildAssetTransfer,\n type AssetOptInParams,\n type AssetOptOutParams,\n type AssetTransferParams,\n} from './transactions/asset-transfer'\n\nimport { MAX_TRANSACTION_GROUP_SIZE, ReadableAddress } from '@algorandfoundation/algokit-common'\nimport { AlgoAmount } from './amount'\nimport { AppManager } from './app-manager'\nimport { EventType } from './lifecycle-events'\nimport { genesisIdIsLocalNet } from './network-client'\nimport { Arc2TransactionNote, SendParams, SendTransactionComposerResults } from './transaction/types'\nimport {\n buildAssetConfig,\n buildAssetCreate,\n buildAssetDestroy,\n buildAssetFreeze,\n type AssetConfigParams,\n type AssetCreateParams,\n type AssetDestroyParams,\n type AssetFreezeParams,\n} from './transactions/asset-config'\nimport { FeeDelta, FeePriority, calculateInnerFeeDelta } from './transactions/fee-coverage'\nimport { buildKeyReg, type OfflineKeyRegistrationParams, type OnlineKeyRegistrationParams } from './transactions/key-registration'\nimport {\n AsyncTransactionParams,\n ProcessedAppCallMethodCall,\n ProcessedAppCreateMethodCall,\n ProcessedAppUpdateMethodCall,\n TransactionParams,\n buildAppCallMethodCall,\n buildAppCreateMethodCall,\n buildAppUpdateMethodCall,\n extractComposerTransactionsFromAppMethodCallParams,\n processAppMethodCallArgs,\n type AppCallMethodCall,\n type AppCreateMethodCall,\n type AppDeleteMethodCall,\n type AppUpdateMethodCall,\n} from './transactions/method-call'\nimport { buildPayment, type PaymentParams } from './transactions/payment'\nimport { asJson } from './util'\n\n// Re-export transaction parameter types\nexport type {\n AppCallParams,\n AppCreateParams,\n AppDeleteParams,\n AppMethodCallParams,\n AppUpdateParams,\n CommonAppCallParams,\n} from './transactions/app-call'\nexport type { AssetConfigParams, AssetCreateParams, AssetDestroyParams, AssetFreezeParams } from './transactions/asset-config'\nexport type { AssetOptInParams, AssetOptOutParams, AssetTransferParams } from './transactions/asset-transfer'\nexport type { CommonTransactionParams } from './transactions/common'\nexport type { OfflineKeyRegistrationParams, OnlineKeyRegistrationParams } from './transactions/key-registration'\nexport type {\n AppCallMethodCall,\n AppCreateMethodCall,\n AppDeleteMethodCall,\n AppMethodCall,\n AppMethodCallTransactionArgument,\n AppUpdateMethodCall,\n ProcessedAppCallMethodCall,\n ProcessedAppCreateMethodCall,\n ProcessedAppUpdateMethodCall,\n} from './transactions/method-call'\nexport type { PaymentParams } from './transactions/payment'\n\n/** Options to control a simulate request, that does not require transaction signing */\nexport type SkipSignaturesSimulateOptions = Expand<\n Omit<RawSimulateOptions, 'fixSigners' | 'allowEmptySignatures'> & {\n /** Whether or not to skip signatures for all built transactions and use an empty signer instead.\n * This will set `fixSigners` and `allowEmptySignatures` when sending the request to the algod API.\n */\n skipSignatures: boolean\n }\n>\n\n/** The raw API options to control a simulate request.\n * See algod API docs for more information: https://dev.algorand.co/reference/rest-apis/algod/#simulatetransaction\n */\nexport type RawSimulateOptions = Expand<Omit<SimulateRequest, 'txnGroups'>> & {\n /** Whether or not to return the result on simulation failure instead of throwing an error */\n resultOnFailure?: boolean\n}\n\n/** All options to control a simulate request */\nexport type SimulateOptions = Expand<Partial<SkipSignaturesSimulateOptions> & RawSimulateOptions>\n\ntype Txn =\n | { data: PaymentParams; type: 'pay' }\n | { data: AssetCreateParams; type: 'assetCreate' }\n | { data: AssetConfigParams; type: 'assetConfig' }\n | { data: AssetFreezeParams; type: 'assetFreeze' }\n | { data: AssetDestroyParams; type: 'assetDestroy' }\n | { data: AssetTransferParams; type: 'assetTransfer' }\n | { data: AssetOptInParams; type: 'assetOptIn' }\n | { data: AssetOptOutParams; type: 'assetOptOut' }\n | { data: AppCallParams | AppCreateParams | AppUpdateParams; type: 'appCall' }\n | { data: OnlineKeyRegistrationParams | OfflineKeyRegistrationParams; type: 'keyReg' }\n | { data: TransactionParams; type: 'txn' }\n | { data: AsyncTransactionParams; type: 'asyncTxn' }\n | { data: ProcessedAppCallMethodCall | ProcessedAppCreateMethodCall | ProcessedAppUpdateMethodCall; type: 'methodCall' }\n\n/**\n * A function that transforms an error into a new error.\n *\n * In most cases, an ErrorTransformer should first check if it can or should transform the error\n * and return the input error if it cannot or should not transform it.\n */\nexport type ErrorTransformer = (error: Error) => Promise<Error>\n\nclass InvalidErrorTransformerValue extends Error {\n constructor(originalError: unknown, value: unknown) {\n super(`An error transformer returned a non-error value: ${value}. The original error before any transformation: ${originalError}`)\n }\n}\n\nclass ErrorTransformerError extends Error {\n constructor(originalError: Error, cause: unknown) {\n super(`An error transformer threw an error: ${cause}. The original error before any transformation: ${originalError} `, { cause })\n }\n}\n\nexport type TransactionComposerConfig = {\n coverAppCallInnerTransactionFees: boolean\n populateAppCallResources: boolean\n}\n\ntype TransactionAnalysis = {\n /** The fee difference required for this transaction */\n requiredFeeDelta?: FeeDelta\n /** Resources accessed by this transaction but not declared */\n unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed\n}\n\ntype GroupAnalysis = {\n /** Analysis of each transaction in the group */\n transactions: TransactionAnalysis[]\n /** Resources accessed by the group that qualify for group resource sharing */\n unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed\n}\n\n/** Parameters to create an `TransactionComposer`. */\nexport type TransactionComposerParams = {\n /** The algod client to use to get suggestedParams and send the transaction group */\n algod: AlgodClient\n /** The function used to get the TransactionSigner for a given address */\n getSigner: (address: ReadableAddress) => TransactionSigner\n /** The method used to get SuggestedParams for transactions in the group */\n getSuggestedParams?: () => Promise<SuggestedParams>\n /** How many rounds a transaction should be valid for by default; if not specified\n * then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).\n */\n defaultValidityWindow?: bigint\n /** An existing `AppManager` to use to manage app compilation and cache compilation results.\n *\n * If not specified then an ephemeral one will be created.\n */\n appManager?: AppManager\n /**\n * An array of error transformers to use when an error is caught in simulate or execute\n * callbacks can later be registered with `registerErrorTransformer`\n */\n errorTransformers?: ErrorTransformer[]\n composerConfig?: TransactionComposerConfig\n}\n\n/** Set of transactions built by `TransactionComposer`. */\nexport interface BuiltTransactions {\n /** The built transactions */\n transactions: Transaction[]\n /** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */\n methodCalls: Map<number, ABIMethod>\n /** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */\n signers: Map<number, TransactionSigner>\n}\n\n/** TransactionComposer helps you compose and execute transactions as a transaction group. */\nexport class TransactionComposer {\n /** Transactions that have not yet been composed */\n private txns: Txn[] = []\n\n /** The algod client used by the composer. */\n private algod: AlgodClient\n\n /** An async function that will return suggested params for the transaction. */\n private getSuggestedParams: () => Promise<SuggestedParams>\n\n /** A function that takes in an address and return a signer function for that address. */\n private getSigner: (address: ReadableAddress) => TransactionSigner\n\n /** The default transaction validity window */\n private defaultValidityWindow = 10n\n\n /** Whether the validity window was explicitly set on construction */\n private defaultValidityWindowIsExplicit = false\n\n private appManager: AppManager\n\n private errorTransformers: ErrorTransformer[]\n\n private composerConfig: TransactionComposerConfig\n\n private transactionsWithSigners?: TransactionWithSigner[]\n\n private signedTransactions?: Uint8Array[]\n\n // Cache the raw transactions before resource population for error handling\n private rawBuildTransactions?: Transaction[]\n\n private async transformError(originalError: unknown): Promise<unknown> {\n // Transformers only work with Error instances, so immediately return anything else\n if (!(originalError instanceof Error)) {\n return originalError\n }\n\n let transformedError = originalError\n\n for (const transformer of this.errorTransformers) {\n try {\n transformedError = await transformer(transformedError)\n if (!(transformedError instanceof Error)) {\n return new InvalidErrorTransformerValue(originalError, transformedError)\n }\n } catch (errorFromTransformer) {\n return new ErrorTransformerError(originalError, errorFromTransformer)\n }\n }\n\n return transformedError\n }\n\n private validateReferenceParams(\n params: Pick<CommonAppCallParams, 'accessReferences' | 'appReferences' | 'assetReferences' | 'boxReferences'>,\n ) {\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n const hasLegacyReferences =\n (params.appReferences && params.appReferences.length > 0) ||\n (params.assetReferences && params.assetReferences.length > 0) ||\n (params.boxReferences && params.boxReferences.length > 0)\n\n if (hasAccessReferences && hasLegacyReferences) {\n throw new Error('Cannot specify both `accessReferences` and reference arrays (`appReferences`, `assetReferences`, `boxReferences`).')\n }\n }\n\n /**\n * Create a `TransactionComposer`.\n * @param params The configuration for this composer\n * @returns The `TransactionComposer` instance\n */\n constructor(params: TransactionComposerParams) {\n this.algod = params.algod\n const defaultGetSuggestedParams = () => params.algod.suggestedParams()\n this.getSuggestedParams = params.getSuggestedParams ?? defaultGetSuggestedParams\n this.getSigner = params.getSigner\n this.defaultValidityWindow = params.defaultValidityWindow ?? this.defaultValidityWindow\n this.defaultValidityWindowIsExplicit = params.defaultValidityWindow !== undefined\n this.appManager = params.appManager ?? new AppManager(params.algod)\n this.errorTransformers = params.errorTransformers ?? []\n this.composerConfig = params.composerConfig ?? {\n coverAppCallInnerTransactionFees: false,\n populateAppCallResources: true,\n }\n }\n\n private cloneTransaction(txn: Txn): Txn {\n // The transaction params aren't meant to be mutated therefore a shallow clone is ok here\n // Only exceptions are txn and asyncTxn where they are encoded, then decoded\n switch (txn.type) {\n case 'pay':\n return {\n type: 'pay',\n data: { ...txn.data },\n }\n case 'assetCreate':\n return {\n type: 'assetCreate',\n data: { ...txn.data },\n }\n case 'assetConfig':\n return {\n type: 'assetConfig',\n data: { ...txn.data },\n }\n case 'assetFreeze':\n return {\n type: 'assetFreeze',\n data: { ...txn.data },\n }\n case 'assetDestroy':\n return {\n type: 'assetDestroy',\n data: { ...txn.data },\n }\n case 'assetTransfer':\n return {\n type: 'assetTransfer',\n data: { ...txn.data },\n }\n case 'assetOptIn':\n return {\n type: 'assetOptIn',\n data: { ...txn.data },\n }\n case 'assetOptOut':\n return {\n type: 'assetOptOut',\n data: { ...txn.data },\n }\n case 'appCall':\n return {\n type: 'appCall',\n data: { ...txn.data },\n }\n case 'keyReg':\n return {\n type: 'keyReg',\n data: { ...txn.data },\n }\n case 'txn': {\n const { txn: transaction, signer, maxFee } = txn.data\n const encoded = encodeTransactionRaw(transaction)\n const clonedTxn = decodeTransaction(encoded)\n delete clonedTxn.group\n return {\n type: 'txn',\n data: {\n txn: clonedTxn,\n signer,\n maxFee,\n },\n }\n }\n case 'asyncTxn': {\n const { txn: txnPromise, signer, maxFee } = txn.data\n // Create a new promise that resolves to a deep cloned transaction without the group field\n const newTxnPromise = txnPromise.then((resolvedTxn) => {\n const encoded = encodeTransactionRaw(resolvedTxn)\n const clonedTxn = decodeTransaction(encoded)\n delete clonedTxn.group\n return clonedTxn\n })\n return {\n type: 'asyncTxn',\n data: {\n txn: newTxnPromise,\n signer,\n maxFee: maxFee,\n },\n }\n }\n case 'methodCall':\n return {\n type: 'methodCall',\n data: { ...txn.data },\n }\n }\n }\n\n private push(...txns: Txn[]): void {\n if (this.transactionsWithSigners) {\n throw new Error('Cannot add new transactions after building')\n }\n const newSize = this.txns.length + txns.length\n if (newSize > MAX_TRANSACTION_GROUP_SIZE) {\n throw new Error(\n `Adding ${txns.length} transaction(s) would exceed the maximum group size. Current: ${this.txns.length}, Maximum: ${MAX_TRANSACTION_GROUP_SIZE}`,\n )\n }\n this.txns.push(...txns)\n }\n\n public clone(composerConfig?: TransactionComposerConfig) {\n const newComposer = new TransactionComposer({\n algod: this.algod,\n getSuggestedParams: this.getSuggestedParams,\n getSigner: this.getSigner,\n defaultValidityWindow: this.defaultValidityWindow,\n appManager: this.appManager,\n errorTransformers: this.errorTransformers,\n composerConfig: {\n ...this.composerConfig,\n ...composerConfig,\n },\n })\n\n this.txns.forEach((txn) => {\n newComposer.txns.push(this.cloneTransaction(txn))\n })\n\n newComposer.defaultValidityWindowIsExplicit = this.defaultValidityWindowIsExplicit\n\n return newComposer\n }\n\n /**\n * Register a function that will be used to transform an error caught when simulating or executing\n *\n * @returns The composer so you can chain method calls\n */\n registerErrorTransformer(transformer: ErrorTransformer) {\n this.errorTransformers.push(transformer)\n return this\n }\n\n /**\n * Add a pre-built transaction to the transaction group.\n * @param transaction The pre-built transaction\n * @param signer Optional signer override for the transaction\n * @returns The composer so you can chain method calls\n * @example\n * ```typescript\n * composer.addTransaction(txn)\n * ```\n */\n addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer {\n if (transaction.group) {\n throw new Error('Cannot add a transaction to the composer because it is already in a group')\n }\n validateTransaction(transaction)\n this.push({\n data: {\n txn: transaction,\n signer: signer ?? this.getSigner(transaction.sender),\n },\n type: 'txn',\n })\n\n return this\n }\n\n /**\n * Add another transaction composer to the current transaction composer.\n * The transaction params of the input transaction composer will be added.\n * If the input transaction composer is updated, it won't affect the current transaction composer.\n * @param composer The transaction composer to add\n * @returns The composer so you can chain method calls\n * @example\n * ```typescript\n * const innerComposer = algorand.newGroup()\n * .addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (1).algo() })\n * .addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (2).algo() })\n *\n * composer.addTransactionComposer(innerComposer)\n * ```\n */\n public addTransactionComposer(composer: TransactionComposer): TransactionComposer {\n const clonedTxns = composer.txns.map((txn) => this.cloneTransaction(txn))\n this.push(...clonedTxns)\n\n return this\n }\n\n /**\n * Add a payment transaction to the transaction group.\n * @param params The payment transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addPayment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addPayment({\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 * })\n */\n addPayment(params: PaymentParams): TransactionComposer {\n this.push({ data: params, type: 'pay' })\n\n return this\n }\n\n /**\n * Add an asset create transaction to the transaction group.\n * @param params The asset create transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAssetCreate({ sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAssetCreate({\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 * })\n */\n addAssetCreate(params: AssetCreateParams): TransactionComposer {\n this.push({ data: params, type: 'assetCreate' })\n\n return this\n }\n\n /**\n * Add an asset config transaction to the transaction group.\n * @param params The asset config transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAssetConfig({ sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAssetConfig({\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 * })\n */\n addAssetConfig(params: AssetConfigParams): TransactionComposer {\n this.push({ data: params, type: 'assetConfig' })\n\n return this\n }\n\n /**\n * Add an asset freeze transaction to the transaction group.\n * @param params The asset freeze transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAssetFreeze({ sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAssetFreeze({\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 * })\n * ```\n */\n addAssetFreeze(params: AssetFreezeParams): TransactionComposer {\n this.push({ data: params, type: 'assetFreeze' })\n\n return this\n }\n\n /**\n * Add an asset destroy transaction to the transaction group.\n * @param params The asset destroy transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAssetDestroy({ sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAssetDestroy({\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 * })\n * ```\n */\n addAssetDestroy(params: AssetDestroyParams): TransactionComposer {\n this.push({ data: params, type: 'assetDestroy' })\n\n return this\n }\n\n /**\n * Add an asset transfer transaction to the transaction group.\n * @param params The asset transfer transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAssetTransfer({ sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * composer.addAssetTransfer({\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 * })\n * ```\n */\n addAssetTransfer(params: AssetTransferParams): TransactionComposer {\n this.push({ data: params, type: 'assetTransfer' })\n\n return this\n }\n\n /**\n * Add an asset opt-in transaction to the transaction group.\n * @param params The asset opt-in transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAssetOptIn({ sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAssetOptIn({\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 * })\n * ```\n */\n addAssetOptIn(params: AssetOptInParams): TransactionComposer {\n this.push({ data: params, type: 'assetOptIn' })\n\n return this\n }\n\n /**\n * Add an asset opt-out transaction to the transaction group.\n * @param params The asset opt-out transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example (without creator, will be retrieved from algod)\n * ```typescript\n * composer.addAssetOptOut({ sender: \"SENDERADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Basic example (with creator)\n * ```typescript\n * composer.addAssetOptOut({ sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAssetOptOut({\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 * })\n * ```\n */\n addAssetOptOut(params: AssetOptOutParams): TransactionComposer {\n this.push({ data: params, type: 'assetOptOut' })\n\n return this\n }\n\n /**\n * Add an application create transaction to the transaction group.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The application create transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAppCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAppCreate({\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: OnApplicationComplete.OptIn,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\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 addAppCreate(params: AppCreateParams): TransactionComposer {\n this.validateReferenceParams(params)\n this.push({ data: params, type: 'appCall' })\n\n return this\n }\n\n /**\n * Add an application update transaction to the transaction group.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The application update transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAppUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAppUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: OnApplicationComplete.UpdateApplication,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\n *})\n * ```\n */\n addAppUpdate(params: AppUpdateParams): TransactionComposer {\n this.validateReferenceParams(params)\n this.push({ data: { ...params, onComplete: OnApplicationComplete.UpdateApplication }, type: 'appCall' })\n\n return this\n }\n\n /**\n * Add an application delete transaction to the transaction group.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The application delete transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAppDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAppDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: OnApplicationComplete.DeleteApplication,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\n *})\n * ```\n */\n addAppDelete(params: AppDeleteParams): TransactionComposer {\n this.validateReferenceParams(params)\n this.push({ data: { ...params, onComplete: OnApplicationComplete.DeleteApplication }, type: 'appCall' })\n\n return this\n }\n\n /**\n * Add an application call transaction to the transaction group.\n *\n * If you want to create or update an app use `addAppCreate` or `addAppUpdate`.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The application call transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addAppCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addAppCall({\n * sender: 'CREATORADDRESS',\n * onComplete: OnApplicationComplete.OptIn,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\n *})\n * ```\n */\n addAppCall(params: AppCallParams): TransactionComposer {\n this.validateReferenceParams(params)\n this.push({ data: params, type: 'appCall' })\n\n return this\n }\n\n /**\n * Add an ABI method create application call transaction to the transaction group.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The ABI create method application call transaction parameters\n * @returns The composer so you can chain method calls\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 * composer.addAppCreateMethodCall({ 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 * composer.addAppCreateMethodCall({\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: OnApplicationComplete.OptIn,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\n *})\n * ```\n */\n addAppCreateMethodCall(params: AppCreateMethodCall) {\n this.validateReferenceParams(params)\n const txnArgs = extractComposerTransactionsFromAppMethodCallParams(params)\n\n // Push all transaction arguments and the method call itself\n this.push(...txnArgs, {\n data: { ...params, args: processAppMethodCallArgs(params.args) },\n type: 'methodCall',\n })\n\n return this\n }\n\n /**\n * Add an ABI method update application call transaction to the transaction group.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The ABI update method application call transaction parameters\n * @returns The composer so you can chain method calls\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 * composer.addAppUpdateMethodCall({ 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 * composer.addAppUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: OnApplicationComplete.UpdateApplication,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\n *})\n * ```\n */\n addAppUpdateMethodCall(params: AppUpdateMethodCall) {\n this.validateReferenceParams(params)\n const txnArgs = extractComposerTransactionsFromAppMethodCallParams(params)\n\n // Push all transaction arguments and the method call itself\n this.push(...txnArgs, {\n data: { ...params, args: processAppMethodCallArgs(params.args), onComplete: OnApplicationComplete.UpdateApplication },\n type: 'methodCall',\n })\n\n return this\n }\n\n /**\n * Add an ABI method delete application call transaction to the transaction group.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The ABI delete method application call transaction parameters\n * @returns The composer so you can chain method calls\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 * composer.addAppDeleteMethodCall({ 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 * composer.addAppDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: OnApplicationComplete.DeleteApplication,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\n *})\n * ```\n */\n addAppDeleteMethodCall(params: AppDeleteMethodCall) {\n this.validateReferenceParams(params)\n const txnArgs = extractComposerTransactionsFromAppMethodCallParams(params)\n\n // Push all transaction arguments and the method call itself\n this.push(...txnArgs, {\n data: { ...params, args: processAppMethodCallArgs(params.args), onComplete: OnApplicationComplete.DeleteApplication },\n type: 'methodCall',\n })\n\n return this\n }\n\n /**\n * Add a non-create/non-update ABI method application call transaction to the transaction group.\n *\n * Note: we recommend using app clients to make it easier to make app calls.\n * @param params The ABI method application call transaction parameters\n * @returns The composer so you can chain method calls\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 * composer.addAppCallMethodCall({ 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 * composer.addAppCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: OnApplicationComplete.OptIn,\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 * accessReferences: [{ appId: 1234n }]\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 * rejectVersion: 1,\n *})\n * ```\n */\n addAppCallMethodCall(params: AppCallMethodCall) {\n this.validateReferenceParams(params)\n const txnArgs = extractComposerTransactionsFromAppMethodCallParams(params)\n\n // Push all transaction arguments and the method call itself\n this.push(...txnArgs, {\n data: { ...params, args: processAppMethodCallArgs(params.args) },\n type: 'methodCall',\n })\n\n return this\n }\n\n /**\n * Add an online key registration transaction to the transaction group.\n * @param params The online key registration transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addOnlineKeyRegistration({\n * sender: 'SENDERADDRESS',\n * voteKey: Uint8Array.from(Buffer.from(\"voteKeyBase64\", 'base64')),\n * selectionKey: Uint8Array.from(Buffer.from(\"selectionKeyBase64\", 'base64')),\n * stateProofKey: Uint8Array.from(Buffer.from(\"stateProofKeyBase64\", 'base64')),\n * voteFirst: 1n,\n * voteLast: 1000n,\n * voteKeyDilution: 1n,\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addOnlineKeyRegistration({\n * sender: 'SENDERADDRESS',\n * voteKey: Uint8Array.from(Buffer.from(\"voteKeyBase64\", 'base64')),\n * selectionKey: Uint8Array.from(Buffer.from(\"selectionKeyBase64\", 'base64')),\n * stateProofKey: Uint8Array.from(Buffer.from(\"stateProofKeyBase64\", 'base64')),\n * voteFirst: 1n,\n * voteLast: 1000n,\n * voteKeyDilution: 1n,\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 * })\n * ```\n */\n addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer {\n this.push({ data: params, type: 'keyReg' })\n\n return this\n }\n\n /**\n * Add an offline key registration transaction to the transaction group.\n * @param params The offline key registration transaction parameters\n * @returns The composer so you can chain method calls\n * @example Basic example\n * ```typescript\n * composer.addOfflineKeyRegistration({\n * sender: 'SENDERADDRESS',\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * composer.addOfflineKeyRegistration({\n * sender: 'SENDERADDRESS',\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 * })\n * ```\n */\n addOfflineKeyRegistration(params: OfflineKeyRegistrationParams): TransactionComposer {\n this.push({ data: params, type: 'keyReg' })\n\n return this\n }\n\n /**\n * Get the number of transactions currently added to this composer.\n * @returns The number of transactions currently added to this composer\n */\n count() {\n return this.txns.length\n }\n\n /**\n * Build the transaction composer.\n *\n * This method performs resource population and inner transaction fee coverage if these options are set in the composer.\n *\n * Once this method is called, no further transactions will be able to be added.\n * You can safely call this method multiple times to get the same result.\n * @returns The built transaction composer, the transactions and any corresponding method calls\n * @example\n * ```typescript\n * const { transactions, methodCalls } = await composer.build()\n * ```\n */\n public async build() {\n if (!this.transactionsWithSigners) {\n const suggestedParams = await this.getSuggestedParams()\n const builtTransactions = await this._buildTransactions(suggestedParams)\n\n // Cache copies of the raw transactions before resource population for error handling.\n // We need copies because populateTransactionAndGroupResources mutates the transactions (sets .group).\n this.rawBuildTransactions = builtTransactions.transactions.map((txn) => new Transaction({ ...txn }))\n\n const groupAnalysis =\n (this.composerConfig.coverAppCallInnerTransactionFees || this.composerConfig.populateAppCallResources) &&\n builtTransactions.transactions.some((txn) => txn.type === TransactionType.AppCall)\n ? await this.analyzeGroupRequirements(builtTransactions.transactions, suggestedParams, this.composerConfig)\n : undefined\n\n this.populateTransactionAndGroupResources(builtTransactions.transactions, groupAnalysis)\n\n this.transactionsWithSigners = builtTransactions.transactions.map((txn, index) => {\n return {\n txn,\n signer: builtTransactions.signers.get(index) ?? this.getSigner(txn.sender),\n }\n })\n }\n\n const methodCalls = new Map<number, ABIMethod>()\n this.txns.forEach((txn, index) => {\n if (txn.type === 'methodCall') {\n methodCalls.set(index, txn.data.method)\n }\n })\n\n return {\n transactions: this.transactionsWithSigners,\n methodCalls,\n }\n }\n\n private async _buildTransactions(suggestedParams: SuggestedParams) {\n const defaultValidityWindow =\n !this.defaultValidityWindowIsExplicit && genesisIdIsLocalNet(suggestedParams.genesisId ?? 'unknown')\n ? 1000n\n : this.defaultValidityWindow\n const signers = new Map<number, TransactionSigner>()\n const transactions = new Array<Transaction>()\n\n let transactionIndex = 0\n for (const ctxn of this.txns) {\n if (ctxn.type === 'txn') {\n validateTransaction(ctxn.data.txn)\n transactions.push(ctxn.data.txn)\n if (ctxn.data.signer) {\n signers.set(transactionIndex, ctxn.data.signer)\n }\n transactionIndex++\n } else if (ctxn.type === 'asyncTxn') {\n const transaction = await ctxn.data.txn\n validateTransaction(transaction)\n transactions.push(transaction)\n if (ctxn.data.signer) {\n signers.set(transactionIndex, ctxn.data.signer)\n }\n transactionIndex++\n } else {\n let transaction: Transaction\n\n switch (ctxn.type) {\n case 'pay':\n transaction = buildPayment(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'assetCreate':\n transaction = buildAssetCreate(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'assetConfig':\n transaction = buildAssetConfig(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'assetFreeze':\n transaction = buildAssetFreeze(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'assetDestroy':\n transaction = buildAssetDestroy(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'assetTransfer':\n transaction = buildAssetTransfer(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'assetOptIn':\n transaction = buildAssetOptIn(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'assetOptOut':\n transaction = buildAssetOptOut(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'appCall':\n if (ctxn.data.appId === undefined || ctxn.data.appId === 0) {\n transaction = await buildAppCreate(ctxn.data as AppCreateParams, this.appManager, suggestedParams, defaultValidityWindow)\n } else if ('approvalProgram' in ctxn.data && 'clearStateProgram' in ctxn.data) {\n transaction = await buildAppUpdate(ctxn.data as AppUpdateParams, this.appManager, suggestedParams, defaultValidityWindow)\n } else {\n transaction = buildAppCall(ctxn.data as AppCallParams, suggestedParams, defaultValidityWindow)\n }\n break\n case 'keyReg':\n transaction = buildKeyReg(ctxn.data, suggestedParams, defaultValidityWindow)\n break\n case 'methodCall':\n if (ctxn.data.appId === undefined || ctxn.data.appId === 0) {\n transaction = await buildAppCreateMethodCall(\n ctxn.data as ProcessedAppCreateMethodCall,\n this.appManager,\n suggestedParams,\n defaultValidityWindow,\n )\n } else if ('approvalProgram' in ctxn.data && 'clearStateProgram' in ctxn.data) {\n transaction = await buildAppUpdateMethodCall(\n ctxn.data as ProcessedAppUpdateMethodCall,\n this.appManager,\n suggestedParams,\n defaultValidityWindow,\n )\n } else {\n transaction = await buildAppCallMethodCall(ctxn.data as ProcessedAppCallMethodCall, suggestedParams, defaultValidityWindow)\n }\n break\n default:\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n throw new Error(`Unsupported transaction type: ${(ctxn as any).type}`)\n }\n\n if (transaction.fee === undefined) {\n transaction = assignFee(transaction, {\n feePerByte: suggestedParams.fee,\n minFee: suggestedParams.minFee,\n extraFee: ctxn.data.extraFee?.microAlgos,\n maxFee: ctxn.data.maxFee?.microAlgos,\n })\n }\n\n validateTransaction(transaction)\n transactions.push(transaction)\n\n if (ctxn.data.signer) {\n const signer = 'signer' in ctxn.data.signer ? ctxn.data.signer.signer : ctxn.data.signer\n signers.set(transactionIndex, signer)\n }\n transactionIndex++\n }\n }\n\n // Validate that the total group size doesn't exceed the maximum\n if (transactions.length > MAX_TRANSACTION_GROUP_SIZE) {\n throw new Error(`Transaction group size ${transactions.length} exceeds the maximum limit of ${MAX_TRANSACTION_GROUP_SIZE}`)\n }\n\n const methodCalls = new Map<number, ABIMethod>()\n this.txns.forEach((txn, index) => {\n if (txn.type === 'methodCall') {\n methodCalls.set(index, txn.data.method)\n }\n })\n\n return { transactions, methodCalls, signers }\n }\n\n /**\n * Builds all transactions in the composer and returns them along with method calls and signers.\n *\n * Note: This method only builds the transactions as-is without resource population or automatic grouping.\n * Use this when you need the raw transactions.\n * @returns An object containing the array of built transactions, method calls, and signers\n * @example\n * ```typescript\n * const { transactions, methodCalls, signers } = await composer.buildTransactions()\n * ```\n */\n public async buildTransactions(): Promise<BuiltTransactions> {\n const suggestedParams = await this.getSuggestedParams()\n const buildResult = await this._buildTransactions(suggestedParams)\n return {\n ...buildResult,\n transactions: buildResult.transactions,\n }\n }\n\n private populateTransactionAndGroupResources(transactions: Transaction[], groupAnalysis?: GroupAnalysis): Transaction[] {\n if (groupAnalysis) {\n // Process fee adjustments\n let surplusGroupFees = 0n\n const transactionAnalysis: Array<{\n groupIndex: number\n requiredFeeDelta?: FeeDelta\n priority: FeePriority\n unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed\n }> = []\n\n // Process fee adjustments\n groupAnalysis.transactions.forEach((txnAnalysis, groupIndex) => {\n // Accumulate surplus fees\n if (txnAnalysis.requiredFeeDelta && FeeDelta.isSurplus(txnAnalysis.requiredFeeDelta)) {\n surplusGroupFees += FeeDelta.amount(txnAnalysis.requiredFeeDelta)\n }\n\n // Calculate priority and add to transaction info\n const ctxn = this.txns[groupIndex]\n const txn = transactions[groupIndex]\n const logicalMaxFee = getLogicalMaxFee(ctxn)\n const isImmutableFee = logicalMaxFee !== undefined && logicalMaxFee === (txn.fee || 0n)\n\n let priority = FeePriority.Covered\n if (txnAnalysis.requiredFeeDelta && FeeDelta.isDeficit(txnAnalysis.requiredFeeDelta)) {\n const deficitAmount = FeeDelta.amount(txnAnalysis.requiredFeeDelta)\n if (isImmutableFee || txn.type !== TransactionType.AppCall) {\n // High priority: transactions that can't be modified\n priority = FeePriority.ImmutableDeficit(deficitAmount)\n } else {\n // Normal priority: app call transactions that can be modified\n priority = FeePriority.ModifiableDeficit(deficitAmount)\n }\n }\n\n transactionAnalysis.push({\n groupIndex,\n requiredFeeDelta: txnAnalysis.requiredFeeDelta,\n priority,\n unnamedResourcesAccessed: txnAnalysis.unnamedResourcesAccessed,\n })\n })\n\n // Sort transactions by priority (highest first)\n transactionAnalysis.sort((a, b) => b.priority.compare(a.priority))\n\n const indexesWithAccessReferences: number[] = []\n\n for (const { groupIndex, requiredFeeDelta, unnamedResourcesAccessed } of transactionAnalysis) {\n // Cover any additional fees required for the transactions\n if (requiredFeeDelta && FeeDelta.isDeficit(requiredFeeDelta)) {\n const deficitAmount = FeeDelta.amount(requiredFeeDelta)\n let additionalFeeDelta: FeeDelta | undefined\n\n if (surplusGroupFees === 0n) {\n // No surplus group fees, the transaction must cover its own deficit\n additionalFeeDelta = requiredFeeDelta\n } else if (surplusGroupFees >= deficitAmount) {\n // Surplus fully covers the deficit\n surplusGroupFees -= deficitAmount\n } else {\n // Surplus partially covers the deficit\n additionalFeeDelta = FeeDelta.fromBigInt(deficitAmount - surplusGroupFees)\n surplusGroupFees = 0n\n }\n\n // If there is any additional fee deficit, the transaction must cover it by modifying the fee\n if (additionalFeeDelta && FeeDelta.isDeficit(additionalFeeDelta)) {\n const additionalDeficitAmount = FeeDelta.amount(additionalFeeDelta)\n\n if (transactions[groupIndex].type === TransactionType.AppCall) {\n const currentFee = transactions[groupIndex].fee || 0n\n const transactionFee = currentFee + additionalDeficitAmount\n\n const logicalMaxFee = getLogicalMaxFee(this.txns[groupIndex])\n if (!logicalMaxFee || transactionFee > logicalMaxFee) {\n throw new Error(\n `Calculated transaction fee ${transactionFee} µALGO is greater than max of ${logicalMaxFee ?? 0n} for transaction ${groupIndex}`,\n )\n }\n\n transactions[groupIndex].fee = transactionFee\n } else {\n throw new Error(\n `An additional fee of ${additionalDeficitAmount} µALGO is required for non app call transaction ${groupIndex}`,\n )\n }\n }\n }\n\n // Apply transaction-level resource population\n if (unnamedResourcesAccessed && transactions[groupIndex].type === TransactionType.AppCall) {\n const hasAccessReferences =\n transactions[groupIndex].appCall?.accessReferences && transactions[groupIndex].appCall?.accessReferences?.length\n if (!hasAccessReferences) {\n populateTransactionResources(transactions[groupIndex], unnamedResourcesAccessed, groupIndex)\n } else {\n indexesWithAccessReferences.push(groupIndex)\n }\n }\n }\n\n if (indexesWithAccessReferences.length > 0) {\n Config.logger.warn(\n `Resource population will be skipped for transaction indexes ${indexesWithAccessReferences.join(', ')} as they use access references.`,\n )\n }\n\n // Apply group-level resource population\n if (groupAnalysis.unnamedResourcesAccessed) {\n populateGroupResources(transactions, groupAnalysis.unnamedResourcesAccessed)\n }\n }\n\n if (transactions.length > 1) {\n const groupedTransactions = groupTransactions(transactions)\n // Mutate the input transactions so that the group is updated for any transaction passed into the composer\n transactions.forEach((t) => (t.group = groupedTransactions[0].group))\n return transactions\n } else {\n return transactions\n }\n }\n\n private async analyzeGroupRequirements(\n transactions: Transaction[],\n suggestedParams: SuggestedParams,\n analysisParams: TransactionComposerConfig,\n ): Promise<GroupAnalysis> {\n const appCallIndexesWithoutMaxFees: number[] = []\n\n let transactionsToSimulate = transactions.map((txn, groupIndex) => {\n const ctxn = this.txns[groupIndex]\n const params = { ...txn }\n delete params.group\n if (analysisParams.coverAppCallInnerTransactionFees && txn.type === TransactionType.AppCall) {\n const logicalMaxFee = getLogicalMaxFee(ctxn)\n if (logicalMaxFee !== undefined) {\n params.fee = logicalMaxFee\n } else {\n appCallIndexesWithoutMaxFees.push(groupIndex)\n }\n }\n\n return new Transaction(params)\n })\n\n // Regroup the transactions, as the transactions have likely been adjusted\n if (transactionsToSimulate.length > 1) {\n transactionsToSimulate = groupTransactions(transactionsToSimulate)\n }\n\n // Check for required max fees on app calls when fee coverage is enabled\n if (analysisParams.coverAppCallInnerTransactionFees && appCallIndexesWithoutMaxFees.length > 0) {\n throw new Error(\n `Please provide a maxFee for each app call transaction when coverAppCallInnerTransactionFees is enabled. Required for transaction ${appCallIndexesWithoutMaxFees.join(', ')}`,\n )\n }\n\n const signedTransactions = transactionsToSimulate.map(\n (txn) =>\n ({\n txn: txn,\n sig: EMPTY_SIGNATURE,\n }) satisfies SignedTransaction,\n )\n\n const simulateRequest: SimulateRequest = {\n txnGroups: [\n {\n txns: signedTransactions,\n },\n ],\n allowUnnamedResources: true,\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: {\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n },\n }\n\n const response = await this.algod.simulateTransactions(simulateRequest)\n const groupResponse = response.txnGroups[0]\n\n // Handle any simulation failures\n if (groupResponse.failureMessage) {\n if (analysisParams.coverAppCallInnerTransactionFees && groupResponse.failureMessage.includes('fee too small')) {\n throw new Error(\n 'Fees were too small to resolve execution info via simulate. You may need to increase an app call transaction maxFee.',\n )\n }\n\n throw new Error(\n `Error resolving execution info via simulate in transaction ${groupResponse.failedAt?.join(', ')}: ${groupResponse.failureMessage}`,\n )\n }\n\n const txnAnalysisResults: TransactionAnalysis[] = groupResponse.txnResults.map((simulateTxnResult, groupIndex) => {\n const btxn = transactions[groupIndex]\n\n let requiredFeeDelta: FeeDelta | undefined\n\n if (analysisParams.coverAppCallInnerTransactionFees) {\n const minTxnFee = calculateFee(btxn, {\n feePerByte: suggestedParams.fee,\n minFee: suggestedParams.minFee,\n })\n const txnFee = btxn.fee ?? 0n\n const txnFeeDelta = FeeDelta.fromBigInt(minTxnFee - txnFee)\n\n if (btxn.type === TransactionType.AppCall) {\n // Calculate inner transaction fee delta\n const innerTxnsFeeDelta = calculateInnerFeeDelta(simulateTxnResult.txnResult.innerTxns, suggestedParams.minFee)\n requiredFeeDelta = FeeDelta.fromBigInt(\n (innerTxnsFeeDelta ? FeeDelta.toBigInt(innerTxnsFeeDelta) : 0n) + (txnFeeDelta ? FeeDelta.toBigInt(txnFeeDelta) : 0n),\n )\n } else {\n requiredFeeDelta = txnFeeDelta\n }\n }\n\n return {\n requiredFeeDelta,\n unnamedResourcesAccessed: analysisParams.populateAppCallResources ? simulateTxnResult.unnamedResourcesAccessed : undefined,\n }\n })\n\n const sortedResources = groupResponse.unnamedResourcesAccessed\n\n // NOTE: We explicitly want to avoid localeCompare as that can lead to different results in different environments\n const compare = (a: string | bigint, b: string | bigint) => (a < b ? -1 : a > b ? 1 : 0)\n\n if (sortedResources) {\n sortedResources.accounts?.sort((a, b) => compare(a.toString(), b.toString()))\n sortedResources.assets?.sort(compare)\n sortedResources.apps?.sort(compare)\n sortedResources.boxes?.sort((a, b) => {\n const aStr = `${a.appId}-${a.name}`\n const bStr = `${b.appId}-${b.name}`\n return compare(aStr, bStr)\n })\n sortedResources.appLocals?.sort((a, b) => {\n const aStr = `${a.appId}-${a.address}`\n const bStr = `${b.appId}-${b.address}`\n return compare(aStr, bStr)\n })\n sortedResources.assetHoldings?.sort((a, b) => {\n const aStr = `${a.assetId}-${a.address}`\n const bStr = `${b.assetId}-${b.address}`\n return compare(aStr, bStr)\n })\n }\n\n return {\n transactions: txnAnalysisResults,\n unnamedResourcesAccessed: analysisParams.populateAppCallResources ? sortedResources : undefined,\n }\n }\n\n /**\n * Rebuild the group, discarding any previously built transactions.\n * This will potentially cause new signers and suggested params to be used if the callbacks return a new value compared to the first build.\n * @returns The newly built transaction composer and the transactions\n * @example\n * ```typescript\n * const { atc, transactions, methodCalls } = await composer.rebuild()\n * ```\n */\n async rebuild() {\n this.reset()\n return await this.build()\n }\n\n private reset() {\n this.signedTransactions = undefined\n this.transactionsWithSigners = undefined\n }\n\n /**\n * Compose the transaction group and send it to the network.\n * @param params The parameters to control execution with\n * @returns The execution result\n * @example\n * ```typescript\n * const result = await composer.send()\n * ```\n */\n async send(params?: SendParams): Promise<SendTransactionComposerResults> {\n const effectiveConfig = {\n coverAppCallInnerTransactionFees: params?.coverAppCallInnerTransactionFees ?? this.composerConfig.coverAppCallInnerTransactionFees,\n populateAppCallResources: params?.populateAppCallResources ?? this.composerConfig.populateAppCallResources,\n }\n\n if (\n this.composerConfig.coverAppCallInnerTransactionFees !== effectiveConfig.coverAppCallInnerTransactionFees ||\n this.composerConfig.populateAppCallResources !== effectiveConfig.populateAppCallResources\n ) {\n // If the params are different to the composer config, reset the builtGroup\n // to ensure that the SendParams overwrites the composer config\n this.composerConfig = effectiveConfig\n\n this.reset()\n }\n\n try {\n await this.gatherSignatures()\n\n if (\n !this.transactionsWithSigners ||\n this.transactionsWithSigners.length === 0 ||\n !this.signedTransactions ||\n this.signedTransactions.length === 0\n ) {\n throw new Error('No transactions available')\n }\n\n const transactionsToSend = this.transactionsWithSigners.map((stxn) => stxn.txn)\n const transactionIds = transactionsToSend.map((txn) => txn.txId())\n\n if (transactionsToSend.length > 1) {\n const groupId = transactionsToSend[0].group ? Buffer.from(transactionsToSend[0].group).toString('base64') : ''\n Config.getLogger(params?.suppressLog).verbose(`Sending group of ${transactionsToSend.length} transactions (${groupId})`, {\n transactionsToSend,\n })\n\n Config.getLogger(params?.suppressLog).debug(`Transaction IDs (${groupId})`, transactionIds)\n }\n\n if (Config.debug && Config.traceAll) {\n await this.simulate({\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: {\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n },\n resultOnFailure: true,\n })\n }\n\n const group = this.transactionsWithSigners[0].txn.group\n\n let waitRounds = params?.maxRoundsToWaitForConfirmation\n\n if (waitRounds === undefined) {\n const suggestedParams = await this.getSuggestedParams()\n const firstRound = suggestedParams.firstValid\n const lastRound = this.transactionsWithSigners.reduce((max, txn) => (txn.txn.lastValid > max ? txn.txn.lastValid : max), 0n)\n waitRounds = Number(lastRound - firstRound) + 1\n }\n\n await this.algod.sendRawTransaction(this.signedTransactions)\n\n if (transactionsToSend.length > 1 && group) {\n Config.getLogger(params?.suppressLog).verbose(\n `Group transaction (${Buffer.from(group).toString('base64')}) sent with ${transactionsToSend.length} transactions`,\n )\n } else {\n Config.getLogger(params?.suppressLog).verbose(\n `Sent transaction ID ${transactionsToSend[0].txId()} ${transactionsToSend[0].type} from ${transactionsToSend[0].sender}`,\n )\n }\n\n let confirmations = new Array<PendingTransactionResponse>()\n if (params?.maxRoundsToWaitForConfirmation !== 0) {\n confirmations = await Promise.all(transactionIds.map(async (id) => await waitForConfirmation(id, waitRounds, this.algod)))\n }\n\n const abiReturns = this.parseAbiReturnValues(confirmations)\n\n return {\n groupId: group ? Buffer.from(group).toString('base64') : undefined,\n transactions: transactionsToSend,\n txIds: transactionIds,\n returns: abiReturns,\n confirmations: confirmations,\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (originalError: any) {\n const errorMessage = originalError.body?.message ?? originalError.message ?? 'Received error executing Transaction Composer'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const err = new Error(errorMessage) as any\n err.cause = originalError\n\n if (typeof originalError === 'object') {\n err.name = originalError.name\n }\n\n // Resolve transactions for error handling - use transactionsWithSigners if available,\n // otherwise fall back to rawBuildTransactions\n let sentTransactions: Transaction[] | undefined\n if (this.transactionsWithSigners) {\n sentTransactions = this.transactionsWithSigners.map((t) => t.txn)\n } else if (this.rawBuildTransactions) {\n sentTransactions = this.rawBuildTransactions.length > 1 ? groupTransactions(this.rawBuildTransactions) : this.rawBuildTransactions\n }\n\n if (Config.debug && typeof originalError === 'object' && sentTransactions) {\n err.traces = []\n Config.getLogger(params?.suppressLog).error(\n 'Received error executing Transaction Composer and debug flag enabled; attempting simulation to get more information',\n err,\n )\n\n const transactionsWithEmptySigners: TransactionWithSigner[] = sentTransactions.map((txn) => ({\n txn,\n signer: makeEmptyTransactionSigner(),\n }))\n const encodedSignedTransactions = await this.signTransactions(transactionsWithEmptySigners)\n const signedTransactions = decodeSignedTransactions(encodedSignedTransactions)\n\n const simulateResponse = await this.algod.simulateTransactions({\n txnGroups: [{ txns: signedTransactions }],\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: {\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n },\n })\n\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,\n })\n }\n\n if (simulateResponse && simulateResponse.txnGroups[0].failedAt) {\n for (const txn of simulateResponse.txnGroups[0].txnResults) {\n err.traces.push({\n trace: txn.execTrace,\n appBudget: txn.appBudgetConsumed,\n logicSigBudget: txn.logicSigBudgetConsumed,\n logs: txn.txnResult.logs,\n message: simulateResponse.txnGroups[0].failureMessage,\n })\n }\n }\n } else {\n Config.getLogger(params?.suppressLog).error(\n 'Received error executing Transaction Composer, for more information enable the debug flag',\n err,\n )\n }\n\n // Attach the sent transactions so we can use them in error transformers\n err.sentTransactions = sentTransactions ?? []\n\n throw await this.transformError(err)\n }\n }\n\n /**\n * Compose the transaction group and simulate sending it to the network\n * @returns The simulation result\n * @example\n * ```typescript\n * const result = await composer.simulate()\n * ```\n */\n async simulate(): Promise<SendTransactionComposerResults & { simulateResponse: SimulateResponse }>\n /**\n * Compose the transaction group and simulate sending it to the network\n * @returns The simulation result\n * @example\n * ```typescript\n * const result = await composer.simulate({\n * skipSignatures: true,\n * })\n * ```\n */\n async simulate(options: SkipSignaturesSimulateOptions): Promise<SendTransactionComposerResults & { simulateResponse: SimulateResponse }>\n /**\n * Compose the transaction group and simulate sending it to the network\n * @returns The simulation result\n * @example\n * ```typescript\n * const result = await composer.simulate({\n * extraOpcodeBudget: 1000,\n * })\n * ```\n */\n async simulate(options: RawSimulateOptions): Promise<SendTransactionComposerResults & { simulateResponse: SimulateResponse }>\n async simulate(options?: SimulateOptions): Promise<SendTransactionComposerResults & { simulateResponse: SimulateResponse }> {\n const { skipSignatures = false, resultOnFailure = false, ...rawOptions } = options ?? {}\n\n if (skipSignatures) {\n rawOptions.allowEmptySignatures = true\n rawOptions.fixSigners = true\n }\n\n let transactionsWithSigner: TransactionWithSigner[]\n if (!this.transactionsWithSigners) {\n const builtTransactions = await this.buildTransactions()\n const transactions =\n builtTransactions.transactions.length > 1 ? groupTransactions(builtTransactions.transactions) : builtTransactions.transactions\n\n transactionsWithSigner = transactions.map((txn, index) => ({\n txn: txn,\n signer: skipSignatures ? makeEmptyTransactionSigner() : (builtTransactions.signers.get(index) ?? makeEmptyTransactionSigner()),\n }))\n } else {\n transactionsWithSigner = this.transactionsWithSigners.map((e) => ({\n txn: e.txn,\n signer: skipSignatures ? makeEmptyTransactionSigner() : e.signer,\n }))\n }\n\n const transactions = transactionsWithSigner.map((e) => e.txn)\n const encodedSignedTransactions = await this.signTransactions(transactionsWithSigner)\n const signedTransactions = decodeSignedTransactions(encodedSignedTransactions)\n\n const simulateRequest = {\n txnGroups: [\n {\n txns: signedTransactions,\n },\n ],\n ...rawOptions,\n ...(Config.debug\n ? {\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: {\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n },\n }\n : undefined),\n } satisfies SimulateRequest\n\n const simulateResponse = await this.algod.simulateTransactions(simulateRequest)\n const simulateResult = simulateResponse.txnGroups[0]\n\n if (simulateResult?.failureMessage && !resultOnFailure) {\n const errorMessage = `Transaction failed at transaction(s) ${simulateResult.failedAt?.join(', ') || 'unknown'} in the group. ${simulateResult.failureMessage}`\n const error = new Error(errorMessage)\n\n if (Config.debug) {\n await Config.events.emitAsync(EventType.TxnGroupSimulated, { simulateResponse })\n }\n\n throw await this.transformError(error)\n }\n\n if (Config.debug && Config.traceAll) {\n await Config.events.emitAsync(EventType.TxnGroupSimulated, { simulateResponse })\n }\n\n const abiReturns = this.parseAbiReturnValues(simulateResult.txnResults.map((t) => t.txnResult))\n\n return {\n confirmations: simulateResult.txnResults.map((t) => t.txnResult),\n transactions: transactions,\n txIds: transactions.map((t) => t.txId()),\n groupId: Buffer.from(transactions[0].group ?? new Uint8Array()).toString('base64'),\n simulateResponse,\n returns: abiReturns,\n }\n }\n\n /**\n * Create an encoded transaction note that follows the ARC-2 spec.\n *\n * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md\n * @param note The ARC-2 transaction note data\n * @returns The binary encoded transaction note\n */\n static arc2Note(note: Arc2TransactionNote): Uint8Array {\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 }\n\n public async gatherSignatures(): Promise<Uint8Array[]> {\n if (this.signedTransactions) {\n return this.signedTransactions\n }\n\n await this.build()\n\n if (!this.transactionsWithSigners || this.transactionsWithSigners.length === 0) {\n throw new Error('No transactions available to sign')\n }\n\n this.signedTransactions = await this.signTransactions(this.transactionsWithSigners)\n return this.signedTransactions\n }\n\n private async signTransactions(transactionsWithSigners: TransactionWithSigner[]): Promise<Uint8Array[]> {\n if (transactionsWithSigners.length === 0) {\n throw new Error('No transactions available to sign')\n }\n\n const transactions = transactionsWithSigners.map((txnWithSigner) => txnWithSigner.txn)\n\n // Group transactions by signer\n const signerGroups = new Map<TransactionSigner, number[]>()\n transactionsWithSigners.forEach(({ signer }, index) => {\n const indexes = signerGroups.get(signer) ?? []\n indexes.push(index)\n signerGroups.set(signer, indexes)\n })\n\n // Sign transactions in parallel for each signer\n const signerEntries = Array.from(signerGroups)\n const signedGroups = await Promise.all(signerEntries.map(([signer, indexes]) => signer(transactions, indexes)))\n\n // Reconstruct signed transactions in original order\n const encodedSignedTransactions: (Uint8Array | null)[] = new Array(transactionsWithSigners.length).fill(null)\n signerEntries.forEach(([, indexes], signerIndex) => {\n const stxs = signedGroups[signerIndex]\n indexes.forEach((txIndex, stxIndex) => {\n encodedSignedTransactions[txIndex] = stxs[stxIndex] ?? null\n })\n })\n\n // Verify all transactions were signed\n const unsignedIndexes = encodedSignedTransactions\n .map((stxn, index) => (stxn == null ? index : null))\n .filter((index): index is number => index !== null)\n\n if (unsignedIndexes.length > 0) {\n throw new Error(`Transactions at indexes [${unsignedIndexes.join(', ')}] were not signed`)\n }\n\n return encodedSignedTransactions as Uint8Array[] // The guard above ensures no nulls\n }\n\n private parseAbiReturnValues(confirmations: PendingTransactionResponse[]): ABIReturn[] {\n const abiReturns = new Array<ABIReturn>()\n\n for (let i = 0; i < confirmations.length; i++) {\n const confirmation = confirmations[i]\n const txn = this.txns[i]\n if (txn?.type !== 'methodCall') continue\n\n const method = txn.data.method\n const abiReturn = AppManager.getABIReturn(confirmation, method)\n if (abiReturn !== undefined) {\n abiReturns.push(abiReturn)\n }\n }\n\n return abiReturns\n }\n\n public setMaxFees(maxFees: Map<number, AlgoAmount>) {\n maxFees.forEach((_, index) => {\n if (index > this.txns.length - 1) {\n throw new Error(`Index ${index} is out of range. The composer only contains ${this.txns.length} transactions`)\n }\n })\n\n maxFees.forEach((maxFee, index) => {\n this.txns[index].data.maxFee = new AlgoAmount({ microAlgos: maxFee.microAlgos })\n })\n }\n}\n\n/** Get the logical maximum fee based on staticFee and maxFee */\nfunction getLogicalMaxFee(ctxn: Txn): bigint | undefined {\n if (ctxn.type === 'txn' || ctxn.type === 'asyncTxn') {\n return undefined\n }\n\n const maxFee = ctxn.data.maxFee\n const staticFee = ctxn.data.staticFee\n\n if (maxFee !== undefined && (staticFee === undefined || maxFee.microAlgos > staticFee.microAlgos)) {\n return maxFee.micro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fig } from "./updatable-config.js";
2
2
 
3
3
  //#region src/config.d.ts
4
4
  /** The AlgoKit config. To update it use the configure method. */
package/config.js CHANGED
@@ -1,8 +1,8 @@
1
- const require_config = require('./types/config.js');
1
+ const require_updatable_config = require('./updatable-config.js');
2
2
 
3
3
  //#region src/config.ts
4
4
  /** The AlgoKit config. To update it use the configure method. */
5
- const Config = new require_config.UpdatableConfig();
5
+ const Config = new require_updatable_config.UpdatableConfig();
6
6
 
7
7
  //#endregion
8
8
  exports.Config = Config;
package/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["UpdatableConfig"],"sources":["../src/config.ts"],"sourcesContent":["import { UpdatableConfig } from './types/config'\n\n/** The AlgoKit config. To update it use the configure method. */\nexport const Config = new UpdatableConfig()\n"],"mappings":";;;;AAGA,MAAa,SAAS,IAAIA,gCAAiB"}
1
+ {"version":3,"file":"config.js","names":["UpdatableConfig"],"sources":["../src/config.ts"],"sourcesContent":["import { UpdatableConfig } from './updatable-config'\n\n/** The AlgoKit config. To update it use the configure method. */\nexport const Config = new UpdatableConfig()\n"],"mappings":";;;;AAGA,MAAa,SAAS,IAAIA,0CAAiB"}
package/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { UpdatableConfig } from "./types/config.mjs";
1
+ import { UpdatableConfig } from "./updatable-config.mjs";
2
2
 
3
3
  //#region src/config.ts
4
4
  /** The AlgoKit config. To update it use the configure method. */
package/config.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import { UpdatableConfig } from './types/config'\n\n/** The AlgoKit config. To update it use the configure method. */\nexport const Config = new UpdatableConfig()\n"],"mappings":";;;;AAGA,MAAa,SAAS,IAAI,iBAAiB"}
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import { UpdatableConfig } from './updatable-config'\n\n/** The AlgoKit config. To update it use the configure method. */\nexport const Config = new UpdatableConfig()\n"],"mappings":";;;;AAGA,MAAa,SAAS,IAAI,iBAAiB"}
package/debugging.d.ts ADDED
@@ -0,0 +1,47 @@
1
+ import { Expand } from "./packages/common/src/expand.js";
2
+ import { SimulateResponse } from "./packages/algod_client/src/models/simulate-response.js";
3
+ import { SourceMap } from "./packages/algod_client/src/models/source-map.js";
4
+ import { CompiledTeal } from "./app.js";
5
+
6
+ //#region src/debugging.d.ts
7
+
8
+ /** The directory name for AlgoKit project related files */
9
+ declare const ALGOKIT_DIR = ".algokit";
10
+ /** The directory name for debug source files */
11
+ declare const SOURCES_DIR = "sources";
12
+ /** The file extension for TEAL files */
13
+ declare const TEAL_FILE_EXT = ".teal";
14
+ /** The file extension for TEAL source map files */
15
+ declare const TEAL_SOURCEMAP_EXT = ".teal.map";
16
+ /** The default maximum search depth for file operations */
17
+ declare const DEFAULT_MAX_SEARCH_DEPTH = 10;
18
+ /**
19
+ * Represents the data for a single TEAL source
20
+ */
21
+ type TealSourceDebugEventData = {
22
+ /** The name of the application */
23
+ appName: string;
24
+ /** The name of the file */
25
+ fileName: string;
26
+ /** The compiled TEAL code */
27
+ compiledTeal: Expand<Omit<CompiledTeal, 'sourceMap'> & {
28
+ sourceMap: SourceMap;
29
+ }>;
30
+ };
31
+ /**
32
+ * Represents the data for multiple TEAL sources debug events emitted whenever an app is compiled as part of a deploy in debug mode
33
+ */
34
+ type TealSourcesDebugEventData = {
35
+ /** An array of TEAL source debug event data */
36
+ sources: TealSourceDebugEventData[];
37
+ };
38
+ /**
39
+ * Represents the data for AVM traces debug events emitted whenever a transaction is simulated in debug mode
40
+ */
41
+ type AVMTracesEventData = {
42
+ /** The simulation response from Algod */
43
+ simulateResponse: SimulateResponse;
44
+ };
45
+ //#endregion
46
+ export { ALGOKIT_DIR, AVMTracesEventData, DEFAULT_MAX_SEARCH_DEPTH, SOURCES_DIR, TEAL_FILE_EXT, TEAL_SOURCEMAP_EXT, TealSourceDebugEventData, TealSourcesDebugEventData };
47
+ //# sourceMappingURL=debugging.d.ts.map
package/debugging.js ADDED
@@ -0,0 +1,20 @@
1
+
2
+ //#region src/debugging.ts
3
+ /** The directory name for AlgoKit project related files */
4
+ const ALGOKIT_DIR = ".algokit";
5
+ /** The directory name for debug source files */
6
+ const SOURCES_DIR = "sources";
7
+ /** The file extension for TEAL files */
8
+ const TEAL_FILE_EXT = ".teal";
9
+ /** The file extension for TEAL source map files */
10
+ const TEAL_SOURCEMAP_EXT = ".teal.map";
11
+ /** The default maximum search depth for file operations */
12
+ const DEFAULT_MAX_SEARCH_DEPTH = 10;
13
+
14
+ //#endregion
15
+ exports.ALGOKIT_DIR = ALGOKIT_DIR;
16
+ exports.DEFAULT_MAX_SEARCH_DEPTH = DEFAULT_MAX_SEARCH_DEPTH;
17
+ exports.SOURCES_DIR = SOURCES_DIR;
18
+ exports.TEAL_FILE_EXT = TEAL_FILE_EXT;
19
+ exports.TEAL_SOURCEMAP_EXT = TEAL_SOURCEMAP_EXT;
20
+ //# sourceMappingURL=debugging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugging.js","names":[],"sources":["../src/debugging.ts"],"sourcesContent":["/**\n * An asynchronous event listener\n */\n\nimport { SimulateResponse, SourceMap } from '@algorandfoundation/algokit-algod-client'\nimport { Expand } from '@algorandfoundation/algokit-common'\nimport { CompiledTeal } from './app'\n\n/** The directory name for AlgoKit project related files */\nexport const ALGOKIT_DIR = '.algokit'\n\n/** The directory name for debug source files */\nexport const SOURCES_DIR = 'sources'\n\n/** The file extension for TEAL files */\nexport const TEAL_FILE_EXT = '.teal'\n\n/** The file extension for TEAL source map files */\nexport const TEAL_SOURCEMAP_EXT = '.teal.map'\n\n/** The default maximum search depth for file operations */\nexport const DEFAULT_MAX_SEARCH_DEPTH = 10\n\n/**\n * Represents the data for a single TEAL source\n */\nexport type TealSourceDebugEventData = {\n /** The name of the application */\n appName: string\n /** The name of the file */\n fileName: string\n /** The compiled TEAL code */\n compiledTeal: Expand<Omit<CompiledTeal, 'sourceMap'> & { sourceMap: SourceMap }>\n}\n\n/**\n * Represents the data for multiple TEAL sources debug events emitted whenever an app is compiled as part of a deploy in debug mode\n */\nexport type TealSourcesDebugEventData = {\n /** An array of TEAL source debug event data */\n sources: TealSourceDebugEventData[]\n}\n\n/**\n * Represents the data for AVM traces debug events emitted whenever a transaction is simulated in debug mode\n */\nexport type AVMTracesEventData = {\n /** The simulation response from Algod */\n simulateResponse: SimulateResponse\n}\n"],"mappings":";;;AASA,MAAa,cAAc;;AAG3B,MAAa,cAAc;;AAG3B,MAAa,gBAAgB;;AAG7B,MAAa,qBAAqB;;AAGlC,MAAa,2BAA2B"}
package/debugging.mjs ADDED
@@ -0,0 +1,15 @@
1
+ //#region src/debugging.ts
2
+ /** The directory name for AlgoKit project related files */
3
+ const ALGOKIT_DIR = ".algokit";
4
+ /** The directory name for debug source files */
5
+ const SOURCES_DIR = "sources";
6
+ /** The file extension for TEAL files */
7
+ const TEAL_FILE_EXT = ".teal";
8
+ /** The file extension for TEAL source map files */
9
+ const TEAL_SOURCEMAP_EXT = ".teal.map";
10
+ /** The default maximum search depth for file operations */
11
+ const DEFAULT_MAX_SEARCH_DEPTH = 10;
12
+
13
+ //#endregion
14
+ export { ALGOKIT_DIR, DEFAULT_MAX_SEARCH_DEPTH, SOURCES_DIR, TEAL_FILE_EXT, TEAL_SOURCEMAP_EXT };
15
+ //# sourceMappingURL=debugging.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugging.mjs","names":[],"sources":["../src/debugging.ts"],"sourcesContent":["/**\n * An asynchronous event listener\n */\n\nimport { SimulateResponse, SourceMap } from '@algorandfoundation/algokit-algod-client'\nimport { Expand } from '@algorandfoundation/algokit-common'\nimport { CompiledTeal } from './app'\n\n/** The directory name for AlgoKit project related files */\nexport const ALGOKIT_DIR = '.algokit'\n\n/** The directory name for debug source files */\nexport const SOURCES_DIR = 'sources'\n\n/** The file extension for TEAL files */\nexport const TEAL_FILE_EXT = '.teal'\n\n/** The file extension for TEAL source map files */\nexport const TEAL_SOURCEMAP_EXT = '.teal.map'\n\n/** The default maximum search depth for file operations */\nexport const DEFAULT_MAX_SEARCH_DEPTH = 10\n\n/**\n * Represents the data for a single TEAL source\n */\nexport type TealSourceDebugEventData = {\n /** The name of the application */\n appName: string\n /** The name of the file */\n fileName: string\n /** The compiled TEAL code */\n compiledTeal: Expand<Omit<CompiledTeal, 'sourceMap'> & { sourceMap: SourceMap }>\n}\n\n/**\n * Represents the data for multiple TEAL sources debug events emitted whenever an app is compiled as part of a deploy in debug mode\n */\nexport type TealSourcesDebugEventData = {\n /** An array of TEAL source debug event data */\n sources: TealSourceDebugEventData[]\n}\n\n/**\n * Represents the data for AVM traces debug events emitted whenever a transaction is simulated in debug mode\n */\nexport type AVMTracesEventData = {\n /** The simulation response from Algod */\n simulateResponse: SimulateResponse\n}\n"],"mappings":";;AASA,MAAa,cAAc;;AAG3B,MAAa,cAAc;;AAG3B,MAAa,gBAAgB;;AAG7B,MAAa,qBAAqB;;AAGlC,MAAa,2BAA2B"}
@@ -0,0 +1,90 @@
1
+ import { Address } from "./packages/common/src/address.js";
2
+
3
+ //#region src/dispenser-client.d.ts
4
+ /** The TestNet Dispenser API response when funding. */
5
+ interface DispenserFundResponse {
6
+ /** The ID of the transaction that was issued to fund the account. */
7
+ txId: string;
8
+ /** The number of µAlgo that was funded. */
9
+ amount: number;
10
+ }
11
+ /** The TestNet Dispenser API response when getting the current limit. */
12
+ interface DispenserLimitResponse {
13
+ /** The limit, in µAlgo, that you can currently fund. */
14
+ amount: number;
15
+ }
16
+ /** The parameters to construct a TestNet Dispenser API client. */
17
+ interface TestNetDispenserApiClientParams {
18
+ /** The API auth token */
19
+ authToken: string;
20
+ /** The request timeout in seconds */
21
+ requestTimeout?: number;
22
+ }
23
+ /**
24
+ * `TestNetDispenserApiClient` is a class that provides methods to interact with the [Algorand TestNet Dispenser API](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md).
25
+ * It allows you to fund an address with Algo, refund a transaction, and get the funding limit for the Algo asset.
26
+ *
27
+ * The class requires an authentication token and a request timeout to be initialized. The authentication token can be provided
28
+ * either directly as a parameter or through an `ALGOKIT_DISPENSER_ACCESS_TOKEN` environment variable. If neither is provided, an error is thrown.
29
+ *
30
+ * The request timeout can be provided as a parameter. If not provided, a default value is used.
31
+ *
32
+ * @property {string} authToken - The authentication token used for API requests.
33
+ * @property {number} requestTimeout - The timeout for API requests, in seconds.
34
+ *
35
+ * @method fund - Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
36
+ * @method refund - Sends a refund request to the dispenser API for the specified refundTxnId.
37
+ * @method limit - Sends a request to the dispenser API to get the funding limit for the Algo asset.
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const client = new TestNetDispenserApiClient({ authToken: 'your_auth_token', requestTimeout: 30 });
42
+ * const fundResponse = await client.fund('your_address', 100);
43
+ * const limitResponse = await client.getLimit();
44
+ * await client.refund('your_transaction_id');
45
+ * ```
46
+ *
47
+ * @throws {Error} If neither the environment variable 'ALGOKIT_DISPENSER_ACCESS_TOKEN' nor the authToken parameter were provided.
48
+ */
49
+ declare class TestNetDispenserApiClient {
50
+ private _authToken;
51
+ private _requestTimeout;
52
+ constructor(params?: TestNetDispenserApiClientParams);
53
+ get authToken(): string;
54
+ get requestTimeout(): number;
55
+ /**
56
+ * Processes a dispenser API request.
57
+ *
58
+ * @param authToken - The authentication token.
59
+ * @param urlSuffix - The URL suffix for the API request.
60
+ * @param body - The request body.
61
+ * @param method - The HTTP method.
62
+ *
63
+ * @returns The API response.
64
+ */
65
+ private processDispenserRequest;
66
+ /**
67
+ * Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
68
+ *
69
+ * @param address - The address to fund.
70
+ * @param amount - The amount of µAlgo to fund.
71
+ *
72
+ * @returns DispenserFundResponse: An object containing the transaction ID and funded amount.
73
+ */
74
+ fund(address: string | Address, amount: number | bigint): Promise<DispenserFundResponse>;
75
+ /**
76
+ * Sends a refund request to the dispenser API for the specified refundTxnId.
77
+ *
78
+ * @param refundTxnId - The transaction ID to refund.
79
+ */
80
+ refund(refundTxnId: string): Promise<void>;
81
+ /**
82
+ * Sends a request to the dispenser API to get the funding limit for the Algo asset.
83
+ *
84
+ * @returns DispenserLimitResponse: An object containing the funding limit amount.
85
+ */
86
+ getLimit(): Promise<DispenserLimitResponse>;
87
+ }
88
+ //#endregion
89
+ export { DispenserFundResponse, DispenserLimitResponse, TestNetDispenserApiClient, TestNetDispenserApiClientParams };
90
+ //# sourceMappingURL=dispenser-client.d.ts.map
@@ -0,0 +1,127 @@
1
+ const require_util = require('./util.js');
2
+
3
+ //#region src/dispenser-client.ts
4
+ const DISPENSER_BASE_URL = "https://api.dispenser.algorandfoundation.tools";
5
+ const DEFAULT_DISPENSER_REQUEST_TIMEOUT = 15;
6
+ const DISPENSER_ACCESS_TOKEN_KEY = "ALGOKIT_DISPENSER_ACCESS_TOKEN";
7
+ var DispenserAssetName = /* @__PURE__ */ function(DispenserAssetName$1) {
8
+ DispenserAssetName$1[DispenserAssetName$1["Algo"] = 0] = "Algo";
9
+ return DispenserAssetName$1;
10
+ }(DispenserAssetName || {});
11
+ const dispenserAssets = { [DispenserAssetName.Algo]: {
12
+ assetId: 0,
13
+ decimals: 6,
14
+ description: "Algo"
15
+ } };
16
+ /**
17
+ * `TestNetDispenserApiClient` is a class that provides methods to interact with the [Algorand TestNet Dispenser API](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md).
18
+ * It allows you to fund an address with Algo, refund a transaction, and get the funding limit for the Algo asset.
19
+ *
20
+ * The class requires an authentication token and a request timeout to be initialized. The authentication token can be provided
21
+ * either directly as a parameter or through an `ALGOKIT_DISPENSER_ACCESS_TOKEN` environment variable. If neither is provided, an error is thrown.
22
+ *
23
+ * The request timeout can be provided as a parameter. If not provided, a default value is used.
24
+ *
25
+ * @property {string} authToken - The authentication token used for API requests.
26
+ * @property {number} requestTimeout - The timeout for API requests, in seconds.
27
+ *
28
+ * @method fund - Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
29
+ * @method refund - Sends a refund request to the dispenser API for the specified refundTxnId.
30
+ * @method limit - Sends a request to the dispenser API to get the funding limit for the Algo asset.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const client = new TestNetDispenserApiClient({ authToken: 'your_auth_token', requestTimeout: 30 });
35
+ * const fundResponse = await client.fund('your_address', 100);
36
+ * const limitResponse = await client.getLimit();
37
+ * await client.refund('your_transaction_id');
38
+ * ```
39
+ *
40
+ * @throws {Error} If neither the environment variable 'ALGOKIT_DISPENSER_ACCESS_TOKEN' nor the authToken parameter were provided.
41
+ */
42
+ var TestNetDispenserApiClient = class {
43
+ _authToken;
44
+ _requestTimeout;
45
+ constructor(params) {
46
+ const authTokenFromEnv = process?.env?.[DISPENSER_ACCESS_TOKEN_KEY];
47
+ if (params?.authToken) this._authToken = params.authToken;
48
+ else if (authTokenFromEnv) this._authToken = authTokenFromEnv;
49
+ else throw new Error(`Can't init AlgoKit TestNet Dispenser API client because neither environment variable ${DISPENSER_ACCESS_TOKEN_KEY} or the authToken were provided.`);
50
+ this._requestTimeout = params?.requestTimeout || DEFAULT_DISPENSER_REQUEST_TIMEOUT;
51
+ }
52
+ get authToken() {
53
+ return this._authToken;
54
+ }
55
+ get requestTimeout() {
56
+ return this._requestTimeout;
57
+ }
58
+ /**
59
+ * Processes a dispenser API request.
60
+ *
61
+ * @param authToken - The authentication token.
62
+ * @param urlSuffix - The URL suffix for the API request.
63
+ * @param body - The request body.
64
+ * @param method - The HTTP method.
65
+ *
66
+ * @returns The API response.
67
+ */
68
+ async processDispenserRequest(authToken, urlSuffix, body = null, method = "POST") {
69
+ const requestArgs = {
70
+ method,
71
+ headers: { Authorization: `Bearer ${authToken}` },
72
+ signal: AbortSignal.timeout(this.requestTimeout * 1e3)
73
+ };
74
+ if (body) requestArgs.body = require_util.asJson(body);
75
+ const response = await fetch(`${DISPENSER_BASE_URL}/${urlSuffix}`, requestArgs);
76
+ if (!response.ok) {
77
+ let error_message = `Error processing dispenser API request: ${response.status}`;
78
+ let error_response = null;
79
+ try {
80
+ error_response = await response.json();
81
+ } catch {}
82
+ if (error_response && error_response.code) error_message = error_response.code;
83
+ else if (response.status === 400) error_message = (await response.json()).message;
84
+ throw new Error(error_message);
85
+ }
86
+ return response;
87
+ }
88
+ /**
89
+ * Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.
90
+ *
91
+ * @param address - The address to fund.
92
+ * @param amount - The amount of µAlgo to fund.
93
+ *
94
+ * @returns DispenserFundResponse: An object containing the transaction ID and funded amount.
95
+ */
96
+ async fund(address, amount) {
97
+ const content = await (await this.processDispenserRequest(this.authToken, `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}`, {
98
+ receiver: typeof address === "string" ? address : address.toString(),
99
+ amount: Number(amount),
100
+ assetID: dispenserAssets[DispenserAssetName.Algo].assetId
101
+ }, "POST")).json();
102
+ return {
103
+ txId: content.txID,
104
+ amount: content.amount
105
+ };
106
+ }
107
+ /**
108
+ * Sends a refund request to the dispenser API for the specified refundTxnId.
109
+ *
110
+ * @param refundTxnId - The transaction ID to refund.
111
+ */
112
+ async refund(refundTxnId) {
113
+ await this.processDispenserRequest(this.authToken, "refund", { refundTransactionID: refundTxnId }, "POST");
114
+ }
115
+ /**
116
+ * Sends a request to the dispenser API to get the funding limit for the Algo asset.
117
+ *
118
+ * @returns DispenserLimitResponse: An object containing the funding limit amount.
119
+ */
120
+ async getLimit() {
121
+ return { amount: (await (await this.processDispenserRequest(this.authToken, `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}/limit`, null, "GET")).json()).amount };
122
+ }
123
+ };
124
+
125
+ //#endregion
126
+ exports.TestNetDispenserApiClient = TestNetDispenserApiClient;
127
+ //# sourceMappingURL=dispenser-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispenser-client.js","names":["requestArgs: RequestInit","asJson"],"sources":["../src/dispenser-client.ts"],"sourcesContent":["import { Address } from '@algorandfoundation/algokit-common'\nimport { asJson } from './util'\n\nconst DISPENSER_BASE_URL = 'https://api.dispenser.algorandfoundation.tools'\nconst DEFAULT_DISPENSER_REQUEST_TIMEOUT = 15\nconst DISPENSER_ACCESS_TOKEN_KEY = 'ALGOKIT_DISPENSER_ACCESS_TOKEN'\n\ninterface ErrorResponse {\n code?: string\n}\n\nenum DispenserAssetName {\n Algo = 0,\n}\n\nconst dispenserAssets = {\n [DispenserAssetName.Algo]: {\n assetId: 0,\n decimals: 6,\n description: 'Algo',\n },\n}\n\n/** The TestNet Dispenser API response when funding. */\nexport interface DispenserFundResponse {\n /** The ID of the transaction that was issued to fund the account. */\n txId: string\n /** The number of µAlgo that was funded. */\n amount: number\n}\n\n/** The TestNet Dispenser API response when getting the current limit. */\nexport interface DispenserLimitResponse {\n /** The limit, in µAlgo, that you can currently fund. */\n amount: number\n}\n\n/** The parameters to construct a TestNet Dispenser API client. */\nexport interface TestNetDispenserApiClientParams {\n /** The API auth token */\n authToken: string\n /** The request timeout in seconds */\n requestTimeout?: number\n}\n\n/**\n * `TestNetDispenserApiClient` is a class that provides methods to interact with the [Algorand TestNet Dispenser API](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md).\n * It allows you to fund an address with Algo, refund a transaction, and get the funding limit for the Algo asset.\n *\n * The class requires an authentication token and a request timeout to be initialized. The authentication token can be provided\n * either directly as a parameter or through an `ALGOKIT_DISPENSER_ACCESS_TOKEN` environment variable. If neither is provided, an error is thrown.\n *\n * The request timeout can be provided as a parameter. If not provided, a default value is used.\n *\n * @property {string} authToken - The authentication token used for API requests.\n * @property {number} requestTimeout - The timeout for API requests, in seconds.\n *\n * @method fund - Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.\n * @method refund - Sends a refund request to the dispenser API for the specified refundTxnId.\n * @method limit - Sends a request to the dispenser API to get the funding limit for the Algo asset.\n *\n * @example\n * ```typescript\n * const client = new TestNetDispenserApiClient({ authToken: 'your_auth_token', requestTimeout: 30 });\n * const fundResponse = await client.fund('your_address', 100);\n * const limitResponse = await client.getLimit();\n * await client.refund('your_transaction_id');\n * ```\n *\n * @throws {Error} If neither the environment variable 'ALGOKIT_DISPENSER_ACCESS_TOKEN' nor the authToken parameter were provided.\n */\nexport class TestNetDispenserApiClient {\n private _authToken: string\n private _requestTimeout: number\n\n constructor(params?: TestNetDispenserApiClientParams) {\n const authTokenFromEnv = process?.env?.[DISPENSER_ACCESS_TOKEN_KEY]\n\n if (params?.authToken) {\n this._authToken = params.authToken\n } else if (authTokenFromEnv) {\n this._authToken = authTokenFromEnv\n } else {\n throw new Error(\n `Can't init AlgoKit TestNet Dispenser API client because neither environment variable ${DISPENSER_ACCESS_TOKEN_KEY} or the authToken were provided.`,\n )\n }\n\n this._requestTimeout = params?.requestTimeout || DEFAULT_DISPENSER_REQUEST_TIMEOUT\n }\n\n get authToken(): string {\n return this._authToken\n }\n\n get requestTimeout(): number {\n return this._requestTimeout\n }\n\n /**\n * Processes a dispenser API request.\n *\n * @param authToken - The authentication token.\n * @param urlSuffix - The URL suffix for the API request.\n * @param body - The request body.\n * @param method - The HTTP method.\n *\n * @returns The API response.\n */\n private async processDispenserRequest(\n authToken: string,\n urlSuffix: string,\n body: Record<string, string | number> | null = null,\n method = 'POST',\n ): Promise<Response> {\n const headers = { Authorization: `Bearer ${authToken}` }\n\n const requestArgs: RequestInit = {\n method: method,\n headers: headers,\n signal: AbortSignal.timeout(this.requestTimeout * 1000),\n }\n\n if (body) {\n requestArgs.body = asJson(body)\n }\n\n const response = await fetch(`${DISPENSER_BASE_URL}/${urlSuffix}`, requestArgs)\n if (!response.ok) {\n let error_message = `Error processing dispenser API request: ${response.status}`\n let error_response = null\n try {\n error_response = await response.json()\n } catch {\n // suppress exception\n }\n\n if (error_response && (error_response as ErrorResponse).code) {\n error_message = (error_response as ErrorResponse).code!\n } else if (response.status === 400) {\n const errorResponse = (await response.json()) as { message: string }\n error_message = errorResponse.message\n }\n\n throw new Error(error_message)\n }\n return response\n }\n\n /**\n * Sends a funding request to the dispenser API to fund the specified address with the given amount of Algo.\n *\n * @param address - The address to fund.\n * @param amount - The amount of µAlgo to fund.\n *\n * @returns DispenserFundResponse: An object containing the transaction ID and funded amount.\n */\n async fund(address: string | Address, amount: number | bigint): Promise<DispenserFundResponse> {\n const response = await this.processDispenserRequest(\n this.authToken,\n `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}`,\n {\n receiver: typeof address === 'string' ? address : address.toString(),\n amount: Number(amount),\n assetID: dispenserAssets[DispenserAssetName.Algo].assetId,\n },\n 'POST',\n )\n\n const content = (await response.json()) as { txID: string; amount: number }\n return { txId: content.txID, amount: content.amount }\n }\n\n /**\n * Sends a refund request to the dispenser API for the specified refundTxnId.\n *\n * @param refundTxnId - The transaction ID to refund.\n */\n async refund(refundTxnId: string): Promise<void> {\n await this.processDispenserRequest(this.authToken, 'refund', { refundTransactionID: refundTxnId }, 'POST')\n }\n\n /**\n * Sends a request to the dispenser API to get the funding limit for the Algo asset.\n *\n * @returns DispenserLimitResponse: An object containing the funding limit amount.\n */\n async getLimit(): Promise<DispenserLimitResponse> {\n const response = await this.processDispenserRequest(\n this.authToken,\n `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}/limit`,\n null,\n 'GET',\n )\n const content = (await response.json()) as { amount: number }\n\n return { amount: content.amount }\n }\n}\n"],"mappings":";;;AAGA,MAAM,qBAAqB;AAC3B,MAAM,oCAAoC;AAC1C,MAAM,6BAA6B;AAMnC,IAAK,oEAAL;AACE;;EADG;AAIL,MAAM,kBAAkB,GACrB,mBAAmB,OAAO;CACzB,SAAS;CACT,UAAU;CACV,aAAa;CACd,EACF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDD,IAAa,4BAAb,MAAuC;CACrC,AAAQ;CACR,AAAQ;CAER,YAAY,QAA0C;EACpD,MAAM,mBAAmB,SAAS,MAAM;AAExC,MAAI,QAAQ,UACV,MAAK,aAAa,OAAO;WAChB,iBACT,MAAK,aAAa;MAElB,OAAM,IAAI,MACR,wFAAwF,2BAA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