@algorandfoundation/algokit-utils 7.0.0-beta.5 → 7.0.0-beta.7

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 (324) hide show
  1. package/README.md +2 -24
  2. package/account/account.d.ts +1 -2
  3. package/account/account.js.map +1 -1
  4. package/account/account.mjs.map +1 -1
  5. package/account/get-account-config-from-environment.d.ts +0 -1
  6. package/account/get-account-config-from-environment.js.map +1 -1
  7. package/account/get-account-config-from-environment.mjs.map +1 -1
  8. package/account/get-account.d.ts +0 -1
  9. package/account/get-account.js.map +1 -1
  10. package/account/get-account.mjs.map +1 -1
  11. package/account/get-dispenser-account.d.ts +0 -1
  12. package/account/get-dispenser-account.js.map +1 -1
  13. package/account/get-dispenser-account.mjs.map +1 -1
  14. package/account/index.d.ts +0 -1
  15. package/account/mnemonic-account.d.ts +0 -1
  16. package/account/mnemonic-account.js.map +1 -1
  17. package/account/mnemonic-account.mjs.map +1 -1
  18. package/amount.d.ts +0 -1
  19. package/amount.js.map +1 -1
  20. package/amount.mjs.map +1 -1
  21. package/app-client.d.ts +0 -1
  22. package/app-client.js.map +1 -1
  23. package/app-client.mjs.map +1 -1
  24. package/app-deploy.d.ts +0 -1
  25. package/app-deploy.js.map +1 -1
  26. package/app-deploy.mjs.map +1 -1
  27. package/app.d.ts +6 -7
  28. package/app.js +6 -6
  29. package/app.js.map +1 -1
  30. package/app.mjs +6 -6
  31. package/app.mjs.map +1 -1
  32. package/asset.d.ts +3 -4
  33. package/asset.js +3 -3
  34. package/asset.js.map +1 -1
  35. package/asset.mjs +3 -3
  36. package/asset.mjs.map +1 -1
  37. package/config.d.ts +0 -1
  38. package/config.js.map +1 -1
  39. package/config.mjs.map +1 -1
  40. package/debugging/debugging.d.ts +3 -5
  41. package/debugging/debugging.js +4 -127
  42. package/debugging/debugging.js.map +1 -1
  43. package/debugging/debugging.mjs +4 -108
  44. package/debugging/debugging.mjs.map +1 -1
  45. package/debugging/index.d.ts +0 -2
  46. package/dispenser-client.d.ts +0 -1
  47. package/dispenser-client.js.map +1 -1
  48. package/dispenser-client.mjs.map +1 -1
  49. package/index.d.ts +1 -1
  50. package/index.js +6 -2
  51. package/index.js.map +1 -1
  52. package/index.mjs +1 -1
  53. package/indexer-lookup.d.ts +0 -1
  54. package/indexer-lookup.js.map +1 -1
  55. package/indexer-lookup.mjs.map +1 -1
  56. package/localnet/get-kmd-wallet-account.d.ts +0 -1
  57. package/localnet/get-kmd-wallet-account.js.map +1 -1
  58. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  59. package/localnet/get-localnet-dispenser-account.d.ts +0 -1
  60. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  61. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  62. package/localnet/get-or-create-kmd-wallet-account.d.ts +0 -1
  63. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  64. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  65. package/localnet/index.d.ts +0 -1
  66. package/localnet/is-localnet.d.ts +0 -1
  67. package/localnet/is-localnet.js.map +1 -1
  68. package/localnet/is-localnet.mjs.map +1 -1
  69. package/network-client.d.ts +0 -1
  70. package/network-client.js.map +1 -1
  71. package/network-client.mjs.map +1 -1
  72. package/package.json +1 -1
  73. package/testing/_asset.d.ts +0 -1
  74. package/testing/account.d.ts +0 -1
  75. package/testing/account.js.map +1 -1
  76. package/testing/account.mjs.map +1 -1
  77. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  78. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  79. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  80. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  81. package/testing/fixtures/algorand-fixture.js +1 -1
  82. package/testing/fixtures/algorand-fixture.js.map +1 -1
  83. package/testing/fixtures/algorand-fixture.mjs +1 -1
  84. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  85. package/testing/fixtures/index.d.ts +0 -1
  86. package/testing/index.d.ts +0 -1
  87. package/testing/indexer.d.ts +0 -1
  88. package/testing/indexer.js.map +1 -1
  89. package/testing/indexer.mjs.map +1 -1
  90. package/testing/test-logger.d.ts +0 -1
  91. package/testing/test-logger.js.map +1 -1
  92. package/testing/test-logger.mjs.map +1 -1
  93. package/testing/transaction-logger.d.ts +0 -1
  94. package/testing/transaction-logger.js.map +1 -1
  95. package/testing/transaction-logger.mjs.map +1 -1
  96. package/transaction/index.d.ts +0 -1
  97. package/transaction/legacy-bridge.d.ts +3 -4
  98. package/transaction/legacy-bridge.js.map +1 -1
  99. package/transaction/legacy-bridge.mjs.map +1 -1
  100. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
  101. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  102. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  103. package/transaction/transaction.d.ts +1 -4
  104. package/transaction/transaction.js +26 -31
  105. package/transaction/transaction.js.map +1 -1
  106. package/transaction/transaction.mjs +26 -31
  107. package/transaction/transaction.mjs.map +1 -1
  108. package/transfer/index.d.ts +0 -1
  109. package/transfer/transfer-algos.d.ts +1 -2
  110. package/transfer/transfer-algos.js +1 -1
  111. package/transfer/transfer-algos.js.map +1 -1
  112. package/transfer/transfer-algos.mjs +1 -1
  113. package/transfer/transfer-algos.mjs.map +1 -1
  114. package/transfer/transfer.d.ts +1 -2
  115. package/transfer/transfer.js +1 -1
  116. package/transfer/transfer.js.map +1 -1
  117. package/transfer/transfer.mjs +1 -1
  118. package/transfer/transfer.mjs.map +1 -1
  119. package/types/account-manager.d.ts +13 -5
  120. package/types/account-manager.js +17 -3
  121. package/types/account-manager.js.map +1 -1
  122. package/types/account-manager.mjs +17 -3
  123. package/types/account-manager.mjs.map +1 -1
  124. package/types/account.d.ts +0 -1
  125. package/types/account.js.map +1 -1
  126. package/types/account.mjs.map +1 -1
  127. package/types/algo-http-client-with-retry.d.ts +0 -1
  128. package/types/algo-http-client-with-retry.js.map +1 -1
  129. package/types/algo-http-client-with-retry.mjs.map +1 -1
  130. package/types/algorand-client-interface.d.ts +1 -2
  131. package/types/algorand-client-transaction-creator.d.ts +30 -31
  132. package/types/algorand-client-transaction-creator.js +30 -30
  133. package/types/algorand-client-transaction-creator.js.map +1 -1
  134. package/types/algorand-client-transaction-creator.mjs +30 -30
  135. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  136. package/types/algorand-client-transaction-sender.d.ts +19 -20
  137. package/types/algorand-client-transaction-sender.js +2 -2
  138. package/types/algorand-client-transaction-sender.js.map +1 -1
  139. package/types/algorand-client-transaction-sender.mjs +2 -2
  140. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  141. package/types/algorand-client.d.ts +8 -9
  142. package/types/algorand-client.js +8 -8
  143. package/types/algorand-client.js.map +1 -1
  144. package/types/algorand-client.mjs +8 -8
  145. package/types/algorand-client.mjs.map +1 -1
  146. package/types/amount.d.ts +0 -1
  147. package/types/amount.js.map +1 -1
  148. package/types/amount.mjs.map +1 -1
  149. package/types/app-arc56.d.ts +60 -38
  150. package/types/app-arc56.js +37 -16
  151. package/types/app-arc56.js.map +1 -1
  152. package/types/app-arc56.mjs +37 -16
  153. package/types/app-arc56.mjs.map +1 -1
  154. package/types/app-client.d.ts +100 -75
  155. package/types/app-client.js +154 -101
  156. package/types/app-client.js.map +1 -1
  157. package/types/app-client.mjs +154 -101
  158. package/types/app-client.mjs.map +1 -1
  159. package/types/app-deployer.d.ts +2 -3
  160. package/types/app-deployer.js +24 -24
  161. package/types/app-deployer.js.map +1 -1
  162. package/types/app-deployer.mjs +24 -24
  163. package/types/app-deployer.mjs.map +1 -1
  164. package/types/app-factory.d.ts +141 -87
  165. package/types/app-factory.js +106 -34
  166. package/types/app-factory.js.map +1 -1
  167. package/types/app-factory.mjs +107 -35
  168. package/types/app-factory.mjs.map +1 -1
  169. package/types/app-manager.d.ts +0 -1
  170. package/types/app-manager.js.map +1 -1
  171. package/types/app-manager.mjs.map +1 -1
  172. package/types/app-spec.d.ts +0 -1
  173. package/types/app-spec.js +15 -9
  174. package/types/app-spec.js.map +1 -1
  175. package/types/app-spec.mjs +15 -9
  176. package/types/app-spec.mjs.map +1 -1
  177. package/types/app.d.ts +0 -1
  178. package/types/app.js.map +1 -1
  179. package/types/app.mjs.map +1 -1
  180. package/types/asset-manager.d.ts +3 -4
  181. package/types/asset-manager.js +3 -3
  182. package/types/asset-manager.js.map +1 -1
  183. package/types/asset-manager.mjs +3 -3
  184. package/types/asset-manager.mjs.map +1 -1
  185. package/types/asset.d.ts +0 -1
  186. package/types/async-event-emitter.d.ts +23 -0
  187. package/types/async-event-emitter.js +55 -0
  188. package/types/async-event-emitter.js.map +1 -0
  189. package/types/async-event-emitter.mjs +53 -0
  190. package/types/async-event-emitter.mjs.map +1 -0
  191. package/types/client-manager.d.ts +30 -9
  192. package/types/client-manager.js +6 -0
  193. package/types/client-manager.js.map +1 -1
  194. package/types/client-manager.mjs +6 -0
  195. package/types/client-manager.mjs.map +1 -1
  196. package/types/composer.d.ts +57 -5
  197. package/types/composer.js +30 -14
  198. package/types/composer.js.map +1 -1
  199. package/types/composer.mjs +30 -14
  200. package/types/composer.mjs.map +1 -1
  201. package/types/config.d.ts +3 -6
  202. package/types/config.js +5 -44
  203. package/types/config.js.map +1 -1
  204. package/types/config.mjs +5 -27
  205. package/types/config.mjs.map +1 -1
  206. package/types/debugging.d.ts +29 -102
  207. package/types/debugging.js +16 -109
  208. package/types/debugging.js.map +1 -1
  209. package/types/debugging.mjs +12 -107
  210. package/types/debugging.mjs.map +1 -1
  211. package/types/dispenser-client.d.ts +0 -1
  212. package/types/dispenser-client.js +5 -4
  213. package/types/dispenser-client.js.map +1 -1
  214. package/types/dispenser-client.mjs +5 -4
  215. package/types/dispenser-client.mjs.map +1 -1
  216. package/types/expand.d.ts +0 -1
  217. package/types/indexer.d.ts +0 -1
  218. package/types/indexer.js.map +1 -1
  219. package/types/indexer.mjs.map +1 -1
  220. package/types/kmd-account-manager.d.ts +0 -1
  221. package/types/kmd-account-manager.js +2 -2
  222. package/types/kmd-account-manager.js.map +1 -1
  223. package/types/kmd-account-manager.mjs +2 -2
  224. package/types/kmd-account-manager.mjs.map +1 -1
  225. package/types/logging.d.ts +0 -1
  226. package/types/logging.js.map +1 -1
  227. package/types/logging.mjs.map +1 -1
  228. package/types/logic-error.d.ts +0 -1
  229. package/types/logic-error.js.map +1 -1
  230. package/types/logic-error.mjs.map +1 -1
  231. package/types/network-client.d.ts +0 -1
  232. package/types/network-client.js.map +1 -1
  233. package/types/network-client.mjs.map +1 -1
  234. package/types/testing.d.ts +0 -1
  235. package/types/transaction.d.ts +4 -7
  236. package/types/transfer.d.ts +0 -1
  237. package/types/urlTokenBaseHTTPClient.d.ts +0 -1
  238. package/types/urlTokenBaseHTTPClient.js +1 -1
  239. package/types/urlTokenBaseHTTPClient.js.map +1 -1
  240. package/types/urlTokenBaseHTTPClient.mjs +1 -1
  241. package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
  242. package/util.d.ts +0 -1
  243. package/util.js +0 -9
  244. package/util.js.map +1 -1
  245. package/util.mjs +1 -9
  246. package/util.mjs.map +1 -1
  247. package/account/account.d.ts.map +0 -1
  248. package/account/get-account-config-from-environment.d.ts.map +0 -1
  249. package/account/get-account.d.ts.map +0 -1
  250. package/account/get-dispenser-account.d.ts.map +0 -1
  251. package/account/index.d.ts.map +0 -1
  252. package/account/mnemonic-account.d.ts.map +0 -1
  253. package/amount.d.ts.map +0 -1
  254. package/app-client.d.ts.map +0 -1
  255. package/app-deploy.d.ts.map +0 -1
  256. package/app.d.ts.map +0 -1
  257. package/asset.d.ts.map +0 -1
  258. package/config.d.ts.map +0 -1
  259. package/debugging/debugging.d.ts.map +0 -1
  260. package/debugging/index.d.ts.map +0 -1
  261. package/debugging/simulate-and-persist-response.d.ts +0 -20
  262. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  263. package/debugging/simulate-and-persist-response.js +0 -108
  264. package/debugging/simulate-and-persist-response.js.map +0 -1
  265. package/debugging/simulate-and-persist-response.mjs +0 -89
  266. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  267. package/dispenser-client.d.ts.map +0 -1
  268. package/index.d.ts.map +0 -1
  269. package/indexer-lookup.d.ts.map +0 -1
  270. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  271. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  272. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  273. package/localnet/index.d.ts.map +0 -1
  274. package/localnet/is-localnet.d.ts.map +0 -1
  275. package/network-client.d.ts.map +0 -1
  276. package/testing/_asset.d.ts.map +0 -1
  277. package/testing/account.d.ts.map +0 -1
  278. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  279. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  280. package/testing/fixtures/index.d.ts.map +0 -1
  281. package/testing/index.d.ts.map +0 -1
  282. package/testing/indexer.d.ts.map +0 -1
  283. package/testing/test-logger.d.ts.map +0 -1
  284. package/testing/transaction-logger.d.ts.map +0 -1
  285. package/transaction/index.d.ts.map +0 -1
  286. package/transaction/legacy-bridge.d.ts.map +0 -1
  287. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  288. package/transaction/transaction.d.ts.map +0 -1
  289. package/transfer/index.d.ts.map +0 -1
  290. package/transfer/transfer-algos.d.ts.map +0 -1
  291. package/transfer/transfer.d.ts.map +0 -1
  292. package/types/account-manager.d.ts.map +0 -1
  293. package/types/account.d.ts.map +0 -1
  294. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  295. package/types/algorand-client-interface.d.ts.map +0 -1
  296. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  297. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  298. package/types/algorand-client.d.ts.map +0 -1
  299. package/types/amount.d.ts.map +0 -1
  300. package/types/app-arc56.d.ts.map +0 -1
  301. package/types/app-client.d.ts.map +0 -1
  302. package/types/app-deployer.d.ts.map +0 -1
  303. package/types/app-factory.d.ts.map +0 -1
  304. package/types/app-manager.d.ts.map +0 -1
  305. package/types/app-spec.d.ts.map +0 -1
  306. package/types/app.d.ts.map +0 -1
  307. package/types/asset-manager.d.ts.map +0 -1
  308. package/types/asset.d.ts.map +0 -1
  309. package/types/client-manager.d.ts.map +0 -1
  310. package/types/composer.d.ts.map +0 -1
  311. package/types/config.d.ts.map +0 -1
  312. package/types/debugging.d.ts.map +0 -1
  313. package/types/dispenser-client.d.ts.map +0 -1
  314. package/types/expand.d.ts.map +0 -1
  315. package/types/indexer.d.ts.map +0 -1
  316. package/types/kmd-account-manager.d.ts.map +0 -1
  317. package/types/logging.d.ts.map +0 -1
  318. package/types/logic-error.d.ts.map +0 -1
  319. package/types/network-client.d.ts.map +0 -1
  320. package/types/testing.d.ts.map +0 -1
  321. package/types/transaction.d.ts.map +0 -1
  322. package/types/transfer.d.ts.map +0 -1
  323. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  324. package/util.d.ts.map +0 -1
@@ -3,7 +3,7 @@ import { TransactionSignerAccount } from './account';
3
3
  import { AlgoAmount } from './amount';
4
4
  import { AppManager, BoxIdentifier, BoxReference } from './app-manager';
5
5
  import { Expand } from './expand';
6
- import { Arc2TransactionNote, ExecuteParams, SendAtomicTransactionComposerResults } from './transaction';
6
+ import { Arc2TransactionNote, SendAtomicTransactionComposerResults, SendParams } from './transaction';
7
7
  import Transaction = algosdk.Transaction;
8
8
  import TransactionSigner = algosdk.TransactionSigner;
9
9
  import TransactionWithSigner = algosdk.TransactionWithSigner;
@@ -305,6 +305,7 @@ export type CommonAppCallParams = CommonTransactionParams & {
305
305
  */
306
306
  boxReferences?: (BoxReference | BoxIdentifier)[];
307
307
  };
308
+ /** Parameters to define an app create transaction */
308
309
  export type AppCreateParams = Expand<Omit<CommonAppCallParams, 'appId'> & {
309
310
  onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.ClearStateOC>;
310
311
  /** The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
@@ -327,6 +328,7 @@ export type AppCreateParams = Expand<Omit<CommonAppCallParams, 'appId'> & {
327
328
  * This is immutable once the app is created. */
328
329
  extraProgramPages?: number;
329
330
  }>;
331
+ /** Parameters to define an app update transaction */
330
332
  export type AppUpdateParams = Expand<CommonAppCallParams & {
331
333
  onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC;
332
334
  /** The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
@@ -338,7 +340,7 @@ export type AppUpdateParams = Expand<CommonAppCallParams & {
338
340
  export type AppCallParams = CommonAppCallParams & {
339
341
  onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC>;
340
342
  };
341
- /** Parameters to define a method call transaction. */
343
+ /** Common parameters to define an ABI method call transaction. */
342
344
  export type AppMethodCallParams = CommonAppCallParams & {
343
345
  onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC>;
344
346
  };
@@ -346,11 +348,17 @@ export type AppMethodCallParams = CommonAppCallParams & {
346
348
  export type AppDeleteParams = CommonAppCallParams & {
347
349
  onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC;
348
350
  };
351
+ /** Parameters to define an ABI method call create transaction. */
349
352
  export type AppCreateMethodCall = AppMethodCall<AppCreateParams>;
353
+ /** Parameters to define an ABI method call update transaction. */
350
354
  export type AppUpdateMethodCall = AppMethodCall<AppUpdateParams>;
355
+ /** Parameters to define an ABI method call delete transaction. */
351
356
  export type AppDeleteMethodCall = AppMethodCall<AppDeleteParams>;
357
+ /** Parameters to define an ABI method call transaction. */
352
358
  export type AppCallMethodCall = AppMethodCall<AppMethodCallParams>;
359
+ /** Types that can be used to define a transaction argument for an ABI call transaction. */
353
360
  export type AppMethodCallTransactionArgument = TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>;
361
+ /** Parameters to define an ABI method call. */
354
362
  export type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {
355
363
  /** The ABI method to call */
356
364
  method: algosdk.ABIMethod;
@@ -358,11 +366,39 @@ export type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {
358
366
  * * An ABI value
359
367
  * * A transaction with explicit signer
360
368
  * * A transaction (where the signer will be automatically assigned)
361
- * * An unawaited transaction (e.g. from algorand.transactions.transactionType())
369
+ * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
362
370
  * * Another method call (via method call params object)
363
371
  */
364
372
  args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>)[];
365
373
  };
374
+ export type Txn = (PaymentParams & {
375
+ type: 'pay';
376
+ }) | (AssetCreateParams & {
377
+ type: 'assetCreate';
378
+ }) | (AssetConfigParams & {
379
+ type: 'assetConfig';
380
+ }) | (AssetFreezeParams & {
381
+ type: 'assetFreeze';
382
+ }) | (AssetDestroyParams & {
383
+ type: 'assetDestroy';
384
+ }) | (AssetTransferParams & {
385
+ type: 'assetTransfer';
386
+ }) | (AssetOptInParams & {
387
+ type: 'assetOptIn';
388
+ }) | (AssetOptOutParams & {
389
+ type: 'assetOptOut';
390
+ }) | ((AppCallParams | AppCreateParams | AppUpdateParams) & {
391
+ type: 'appCall';
392
+ }) | (OnlineKeyRegistrationParams & {
393
+ type: 'keyReg';
394
+ }) | (algosdk.TransactionWithSigner & {
395
+ type: 'txnWithSigner';
396
+ }) | {
397
+ atc: algosdk.AtomicTransactionComposer;
398
+ type: 'atc';
399
+ } | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & {
400
+ type: 'methodCall';
401
+ });
366
402
  /** Parameters to create an `AlgoKitComposer`. */
367
403
  export type AlgoKitComposerParams = {
368
404
  /** The algod client to use to get suggestedParams and send the transaction group */
@@ -604,11 +640,21 @@ export default class AlgoKitComposer {
604
640
  methodCalls: any;
605
641
  }>;
606
642
  /**
643
+ * Compose the atomic transaction group and send it to the network.
644
+ * @param params The parameters to control execution with
645
+ * @returns The execution result
646
+ */
647
+ send(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
648
+ /**
649
+ * @deprecated Use `send` instead.
650
+ *
607
651
  * Compose the atomic transaction group and send it to the network
652
+ *
653
+ * An alias for `composer.send(params)`.
608
654
  * @param params The parameters to control execution with
609
655
  * @returns The execution result
610
656
  */
611
- execute(params?: ExecuteParams): Promise<SendAtomicTransactionComposerResults>;
657
+ execute(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
612
658
  /**
613
659
  * Compose the atomic transaction group and simulate sending it to the network
614
660
  * @returns The simulation result
@@ -616,6 +662,12 @@ export default class AlgoKitComposer {
616
662
  simulate(options?: SimulateOptions): Promise<SendAtomicTransactionComposerResults & {
617
663
  simulateResponse: SimulateResponse;
618
664
  }>;
665
+ /**
666
+ * Create an encoded transaction note that follows the ARC-2 spec.
667
+ *
668
+ * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
669
+ * @param note The ARC-2 transaction note data
670
+ * @returns The binary encoded transaction note
671
+ */
619
672
  static arc2Note(note: Arc2TransactionNote): Uint8Array;
620
673
  }
621
- //# sourceMappingURL=composer.d.ts.map
package/types/composer.js CHANGED
@@ -4,11 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var algosdk = require('algosdk');
6
6
  var config = require('../config.js');
7
+ var performAtomicTransactionComposerSimulate = require('../transaction/perform-atomic-transaction-composer-simulate.js');
7
8
  var transaction = require('../transaction/transaction.js');
8
9
  var types_app = require('./app.js');
9
10
  var types_appManager = require('./app-manager.js');
11
+ var types_asyncEventEmitter = require('./async-event-emitter.js');
10
12
  var types_networkClient = require('./network-client.js');
11
- var simulateAndPersistResponse = require('../debugging/simulate-and-persist-response.js');
12
13
 
13
14
  var isTransactionWithSigner = algosdk.isTransactionWithSigner;
14
15
  var encodeAddress = algosdk.encodeAddress;
@@ -626,11 +627,11 @@ class AlgoKitComposer {
626
627
  return await this.build();
627
628
  }
628
629
  /**
629
- * Compose the atomic transaction group and send it to the network
630
+ * Compose the atomic transaction group and send it to the network.
630
631
  * @param params The parameters to control execution with
631
632
  * @returns The execution result
632
633
  */
633
- async execute(params) {
634
+ async send(params) {
634
635
  const group = (await this.build()).transactions;
635
636
  let waitRounds = params?.maxRoundsToWaitForConfirmation;
636
637
  if (waitRounds === undefined) {
@@ -640,28 +641,36 @@ class AlgoKitComposer {
640
641
  }
641
642
  return await transaction.sendAtomicTransactionComposer({
642
643
  atc: this.atc,
643
- executeParams: {
644
- suppressLog: params?.suppressLog,
645
- maxRoundsToWaitForConfirmation: waitRounds,
646
- populateAppCallResources: params?.populateAppCallResources,
647
- },
644
+ suppressLog: params?.suppressLog,
645
+ maxRoundsToWaitForConfirmation: waitRounds,
646
+ populateAppCallResources: params?.populateAppCallResources,
648
647
  }, this.algod);
649
648
  }
649
+ /**
650
+ * @deprecated Use `send` instead.
651
+ *
652
+ * Compose the atomic transaction group and send it to the network
653
+ *
654
+ * An alias for `composer.send(params)`.
655
+ * @param params The parameters to control execution with
656
+ * @returns The execution result
657
+ */
658
+ async execute(params) {
659
+ return this.send(params);
660
+ }
650
661
  /**
651
662
  * Compose the atomic transaction group and simulate sending it to the network
652
663
  * @returns The simulation result
653
664
  */
654
665
  async simulate(options) {
655
666
  await this.build();
656
- if (config.Config.debug && config.Config.projectRoot && !config.Config.traceAll) {
667
+ if (config.Config.debug && !config.Config.traceAll) {
657
668
  // Dump the traces to a file for use with AlgoKit AVM debugger
658
669
  // Checks for false on traceAll because it should have been already
659
670
  // executed above
660
- await simulateAndPersistResponse.simulateAndPersistResponse({
661
- atc: this.atc,
662
- projectRoot: config.Config.projectRoot,
663
- algod: this.algod,
664
- bufferSizeMb: config.Config.traceBufferSizeMb,
671
+ const simulateResponse = await performAtomicTransactionComposerSimulate.performAtomicTransactionComposerSimulate(this.atc, this.algod);
672
+ await config.Config.events.emitAsync(types_asyncEventEmitter.EventType.TxnGroupSimulated, {
673
+ simulateResponse,
665
674
  });
666
675
  }
667
676
  const { methodResults, simulateResponse } = await this.atc.simulate(this.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options }));
@@ -680,6 +689,13 @@ class AlgoKitComposer {
680
689
  returns: methodResults.map((m) => m),
681
690
  };
682
691
  }
692
+ /**
693
+ * Create an encoded transaction note that follows the ARC-2 spec.
694
+ *
695
+ * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
696
+ * @param note The ARC-2 transaction note data
697
+ * @returns The binary encoded transaction note
698
+ */
683
699
  static arc2Note(note) {
684
700
  const arc2Payload = `${note.dAppName}:${note.format}${typeof note.data === 'string' ? note.data : JSON.stringify(note.data)}`;
685
701
  const encoder = new TextEncoder();
@@ -1 +1 @@
1
- {"version":3,"file":"composer.js","sources":["../../src/types/composer.ts"],"sourcesContent":[null],"names":["AppManager","encodeLease","genesisIdIsLocalNet","APP_PAGE_MAX_SIZE","sendAtomicTransactionComposer","Config","simulateAndPersistResponse"],"mappings":";;;;;;;;;;;;AAcA,IAAO,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAA;AAChE,IAAO,aAAa,GAAG,OAAO,CAAC,aAAa,CAAA;AAE5C,IAAO,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;AAE3B,MAAM,0BAA0B,GAAG,GAAE;AA0c5C;AACA,MAAqB,eAAe,CAAA;AA8BlC;;;AAGG;AACH,IAAA,WAAA,CAAY,MAA6B,EAAA;;AA7BjC,QAAA,IAAA,CAAA,GAAG,GAAG,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAA;;AAG7C,QAAA,IAAA,CAAA,YAAY,GAAmC,IAAI,GAAG,EAAE,CAAA;;QA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,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;KACnC;;AA/yBD;AACe,eAAA,CAAA,WAAW,GAA8B,OAAO,CAAC,0BAA0B,EAAE;;;;;"}
1
+ {"version":3,"file":"composer.js","sources":["../../src/types/composer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Config } from '../config'\nimport { performAtomicTransactionComposerSimulate } from '../transaction/perform-atomic-transaction-composer-simulate'\nimport { encodeLease, sendAtomicTransactionComposer } from '../transaction/transaction'\nimport { TransactionSignerAccount } from './account'\nimport { AlgoAmount } from './amount'\nimport { ABIReturn, APP_PAGE_MAX_SIZE } from './app'\nimport { AppManager, BoxIdentifier, BoxReference } from './app-manager'\nimport { EventType } from './async-event-emitter'\nimport { Expand } from './expand'\nimport { genesisIdIsLocalNet } from './network-client'\nimport { Arc2TransactionNote, SendAtomicTransactionComposerResults, SendParams } from './transaction'\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\nimport TransactionWithSigner = algosdk.TransactionWithSigner\nimport isTransactionWithSigner = algosdk.isTransactionWithSigner\nimport encodeAddress = algosdk.encodeAddress\nimport SimulateResponse = algosdk.modelsv2.SimulateResponse\nimport modelsv2 = algosdk.modelsv2\n\nexport const MAX_TRANSACTION_GROUP_SIZE = 16\n\n/** Options to control a simulate request */\nexport type SimulateOptions = Expand<Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>>\n\n/** Common parameters for defining a transaction. */\nexport type CommonTransactionParams = {\n /** The address of the account sending the transaction. */\n sender: string\n /** The function used to sign transaction(s); if not specified then\n * an attempt will be made to find a registered signer for the\n * given `sender` or use a default signer (if configured).\n */\n signer?: algosdk.TransactionSigner | TransactionSignerAccount\n /** Change the signing key of the sender to the given address.\n *\n * **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/).\n */\n rekeyTo?: string\n /** Note to attach to the transaction. Max of 1000 bytes. */\n note?: Uint8Array | string\n /** Prevent multiple transactions with the same lease being included within the validity window.\n *\n * A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/)\n * enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).\n */\n lease?: Uint8Array | string\n /** The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction. */\n staticFee?: AlgoAmount\n /** The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees. */\n extraFee?: AlgoAmount\n /** Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. */\n maxFee?: AlgoAmount\n /** How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. */\n validityWindow?: number\n /**\n * Set the first round this transaction is valid.\n * If left undefined, the value from algod will be used.\n *\n * We recommend you only set this when you intentionally want this to be some time in the future.\n */\n firstValidRound?: bigint\n /** The last round this transaction is valid. It is recommended to use `validityWindow` instead. */\n lastValidRound?: bigint\n}\n\n/** Parameters to define a payment transaction. */\nexport type PaymentParams = CommonTransactionParams & {\n /** The address of the account that will receive the Algo */\n receiver: string\n /** Amount to send */\n amount: AlgoAmount\n /** If given, close the sender account and send the remaining balance to this address\n *\n * *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly.\n */\n closeRemainderTo?: string\n}\n\n/** Parameters to define an asset create transaction.\n *\n * The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.\n */\nexport type AssetCreateParams = CommonTransactionParams & {\n /** The total amount of the smallest divisible (decimal) unit to create.\n *\n * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.\n *\n * This field can only be specified upon asset creation.\n */\n total: bigint\n\n /** The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n *\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n * * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: string | Uint8Array\n\n /** Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.\n */\n manager?: string\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n reserve?: string\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n freeze?: string\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n clawback?: string\n}\n\n/** Parameters to define an asset reconfiguration transaction.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n */\nexport type AssetConfigParams = CommonTransactionParams & {\n /** ID of the asset to reconfigure */\n assetId: bigint\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) the asset will become permanently immutable.\n */\n manager: string | undefined\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n reserve?: string\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n freeze?: string\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n clawback?: string\n}\n\n/** Parameters to define an asset freeze transaction. */\nexport type AssetFreezeParams = CommonTransactionParams & {\n /** The ID of the asset to freeze/unfreeze */\n assetId: bigint\n /** The address of the account to freeze or unfreeze */\n account: string\n /** Whether the assets in the account should be frozen */\n frozen: boolean\n}\n\n/** Parameters to define an asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.\n */\nexport type AssetDestroyParams = CommonTransactionParams & {\n /** ID of the asset to destroy */\n assetId: bigint\n}\n\n/** Parameters to define an asset transfer transaction. */\nexport type AssetTransferParams = CommonTransactionParams & {\n /** ID of the asset to transfer. */\n assetId: bigint\n /** Amount of the asset to transfer (in smallest divisible (decimal) units). */\n amount: bigint\n /** The address of the account that will receive the asset unit(s). */\n receiver: string\n /** Optional address of an account to clawback the asset from.\n *\n * Requires the sender to be the clawback account.\n *\n * **Warning:** Be careful with this parameter as it can lead to unexpected loss of funds if not used correctly.\n */\n clawbackTarget?: string\n /** Optional address of an account to close the asset position to.\n *\n * **Warning:** Be careful with this parameter as it can lead to loss of funds if not used correctly.\n */\n closeAssetTo?: string\n}\n\n/** Parameters to define an asset opt-in transaction. */\nexport type AssetOptInParams = CommonTransactionParams & {\n /** ID of the asset that will be opted-in to. */\n assetId: bigint\n}\n\n/** Parameters to define an asset opt-out transaction. */\nexport type AssetOptOutParams = CommonTransactionParams & {\n /** ID of the asset that will be opted-out of. */\n assetId: bigint\n /**\n * The address of the asset creator account to close the asset\n * position to (any remaining asset units will be sent to this account).\n */\n creator: string\n}\n\n/** Parameters to define an online key registration transaction. */\nexport type OnlineKeyRegistrationParams = CommonTransactionParams & {\n /** The root participation public key */\n voteKey: Uint8Array\n /** The VRF public key */\n selectionKey: Uint8Array\n /** The first round that the participation key is valid. Not to be confused with the `firstValid` round of the keyreg transaction */\n voteFirst: bigint\n /** The last round that the participation key is valid. Not to be confused with the `lastValid` round of the keyreg transaction */\n voteLast: bigint\n /** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */\n voteKeyDilution: bigint\n /** The 64 byte state proof public key commitment */\n stateProofKey?: Uint8Array\n}\n\n// Not yet exposed because of bug in algosdk\n// export type OfflineKeyRegistrationParams = CommonTransactionParams & {\n// /** Prevent this account from ever participating again. On network with rewards enabled, also disable rewards for this account */\n// preventAddressFromEverParticipatingAgain?: boolean\n// }\n\n/** Common parameters for defining an application call transaction. */\nexport type CommonAppCallParams = CommonTransactionParams & {\n /** ID of the application; 0 if the application is being created. */\n appId: bigint\n /** The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. */\n onComplete?: algosdk.OnApplicationComplete\n /** Any [arguments to pass to the smart contract call](https://developer.algorand.org/docs/get-details/dapps/avm/teal/#argument-passing). */\n args?: Uint8Array[]\n /** Any account addresses to add to the [accounts array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */\n accountReferences?: string[]\n /** The ID of any apps to load to the [foreign apps array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */\n appReferences?: bigint[]\n /** The ID of any assets to load to the [foreign assets array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */\n assetReferences?: bigint[]\n /** Any boxes to load to the [boxes array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays).\n *\n * Either the name identifier (which will be set against app ID of `0` i.e.\n * the current app), or a box identifier with the name identifier and app ID.\n */\n boxReferences?: (BoxReference | BoxIdentifier)[]\n}\n\n/** Parameters to define an app create transaction */\nexport type AppCreateParams = Expand<\n Omit<CommonAppCallParams, 'appId'> & {\n onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.ClearStateOC>\n /** The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */\n approvalProgram: string | Uint8Array\n /** The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */\n clearStateProgram: string | Uint8Array\n /** The state schema for the app. This is immutable once the app is created. */\n schema?: {\n /** The number of integers saved in global state. */\n globalInts: number\n /** The number of byte slices saved in global state. */\n globalByteSlices: number\n /** The number of integers saved in local state. */\n localInts: number\n /** The number of byte slices saved in local state. */\n localByteSlices: number\n }\n /** Number of extra pages required for the programs.\n * Defaults to the number needed for the programs in this call if not specified.\n * This is immutable once the app is created. */\n extraProgramPages?: number\n }\n>\n\n/** Parameters to define an app update transaction */\nexport type AppUpdateParams = Expand<\n CommonAppCallParams & {\n onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC\n /** The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */\n approvalProgram: string | Uint8Array\n /** The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */\n clearStateProgram: string | Uint8Array\n }\n>\n\n/** Parameters to define an application call transaction. */\nexport type AppCallParams = CommonAppCallParams & {\n onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC>\n}\n\n/** Common parameters to define an ABI method call transaction. */\nexport type AppMethodCallParams = CommonAppCallParams & {\n onComplete?: Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC\n >\n}\n\n/** Parameters to define an application delete call transaction. */\nexport type AppDeleteParams = CommonAppCallParams & {\n onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC\n}\n\n/** Parameters to define an ABI method call create transaction. */\nexport type AppCreateMethodCall = AppMethodCall<AppCreateParams>\n/** Parameters to define an ABI method call update transaction. */\nexport type AppUpdateMethodCall = AppMethodCall<AppUpdateParams>\n/** Parameters to define an ABI method call delete transaction. */\nexport type AppDeleteMethodCall = AppMethodCall<AppDeleteParams>\n/** Parameters to define an ABI method call transaction. */\nexport type AppCallMethodCall = AppMethodCall<AppMethodCallParams>\n\n/** Types that can be used to define a transaction argument for an ABI call transaction. */\nexport type AppMethodCallTransactionArgument =\n // The following should match the partial `args` types from `AppMethodCall<T>` below\n | TransactionWithSigner\n | Transaction\n | Promise<Transaction>\n | AppMethodCall<AppCreateParams>\n | AppMethodCall<AppUpdateParams>\n | AppMethodCall<AppMethodCallParams>\n\n/** Parameters to define an ABI method call. */\nexport type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {\n /** The ABI method to call */\n method: algosdk.ABIMethod\n /** Arguments to the ABI method, either:\n * * An ABI value\n * * A transaction with explicit signer\n * * A transaction (where the signer will be automatically assigned)\n * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())\n * * Another method call (via method call params object)\n */\n args?: (\n | algosdk.ABIValue\n // The following should match the above `AppMethodCallTransactionArgument` type above\n | TransactionWithSigner\n | Transaction\n | Promise<Transaction>\n | AppMethodCall<AppCreateParams>\n | AppMethodCall<AppUpdateParams>\n | AppMethodCall<AppMethodCallParams>\n )[]\n}\n\nexport type Txn =\n | (PaymentParams & { type: 'pay' })\n | (AssetCreateParams & { type: 'assetCreate' })\n | (AssetConfigParams & { type: 'assetConfig' })\n | (AssetFreezeParams & { type: 'assetFreeze' })\n | (AssetDestroyParams & { type: 'assetDestroy' })\n | (AssetTransferParams & { type: 'assetTransfer' })\n | (AssetOptInParams & { type: 'assetOptIn' })\n | (AssetOptOutParams & { type: 'assetOptOut' })\n | ((AppCallParams | AppCreateParams | AppUpdateParams) & { type: 'appCall' })\n | (OnlineKeyRegistrationParams & { type: 'keyReg' })\n | (algosdk.TransactionWithSigner & { type: 'txnWithSigner' })\n | { atc: algosdk.AtomicTransactionComposer; type: 'atc' }\n | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & { type: 'methodCall' })\n\n/** Parameters to create an `AlgoKitComposer`. */\nexport type AlgoKitComposerParams = {\n /** The algod client to use to get suggestedParams and send the transaction group */\n algod: algosdk.Algodv2\n /** The function used to get the TransactionSigner for a given address */\n getSigner: (address: string) => algosdk.TransactionSigner\n /** The method used to get SuggestedParams for transactions in the group */\n getSuggestedParams?: () => Promise<algosdk.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?: number\n /** An existing `AppManager` to use to manage app compilation and cache compilation results.\n *\n * If not specified than an ephemeral one will be created.\n */\n appManager?: AppManager\n}\n\n/** Set of transactions built by `AlgoKitComposer`. */\nexport interface BuiltTransactions {\n /** The built transactions */\n transactions: algosdk.Transaction[]\n /** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */\n methodCalls: Map<number, algosdk.ABIMethod>\n /** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */\n signers: Map<number, algosdk.TransactionSigner>\n}\n\n/** AlgoKit Composer helps you compose and execute transactions as a transaction group. */\nexport default class AlgoKitComposer {\n /** Signer used to represent a lack of signer */\n private static NULL_SIGNER: algosdk.TransactionSigner = algosdk.makeEmptyTransactionSigner()\n\n /** The ATC used to compose the group */\n private atc = new algosdk.AtomicTransactionComposer()\n\n /** Map of txid to ABI method */\n private txnMethodMap: Map<string, algosdk.ABIMethod> = new Map()\n\n /** Transactions that have not yet been composed */\n private txns: Txn[] = []\n\n /** The algod client used by the composer. */\n private algod: algosdk.Algodv2\n\n /** An async function that will return suggested params for the transaction. */\n private getSuggestedParams: () => Promise<algosdk.SuggestedParams>\n\n /** A function that takes in an address and return a signer function for that address. */\n private getSigner: (address: string) => algosdk.TransactionSigner\n\n /** The default transaction validity window */\n private defaultValidityWindow = 10\n\n /** Whether the validity window was explicitly set on construction */\n private defaultValidityWindowIsExplicit = false\n\n private appManager: AppManager\n\n /**\n * Create an `AlgoKitComposer`.\n * @param params The configuration for this composer\n */\n constructor(params: AlgoKitComposerParams) {\n this.algod = params.algod\n const defaultGetSuggestedParams = () => params.algod.getTransactionParams().do()\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 }\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 */\n addTransaction(transaction: Transaction, signer?: TransactionSigner): AlgoKitComposer {\n this.txns.push({\n txn: transaction,\n signer: signer ?? this.getSigner(algosdk.encodeAddress(transaction.from.publicKey)),\n type: 'txnWithSigner',\n })\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 */\n addPayment(params: PaymentParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAssetCreate(params: AssetCreateParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAssetConfig(params: AssetConfigParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAssetFreeze(params: AssetFreezeParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAssetDestroy(params: AssetDestroyParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAssetTransfer(params: AssetTransferParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAssetOptIn(params: AssetOptInParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAssetOptOut(params: AssetOptOutParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAppCreate(params: AppCreateParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAppUpdate(params: AppUpdateParams): AlgoKitComposer {\n this.txns.push({ ...params, type: 'appCall', onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC })\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 */\n addAppDelete(params: AppDeleteParams): AlgoKitComposer {\n this.txns.push({ ...params, type: 'appCall', onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC })\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 */\n addAppCall(params: AppCallParams): AlgoKitComposer {\n this.txns.push({ ...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 */\n addAppCreateMethodCall(params: AppCreateMethodCall) {\n this.txns.push({ ...params, type: 'methodCall' })\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 */\n addAppUpdateMethodCall(params: AppUpdateMethodCall) {\n this.txns.push({ ...params, type: 'methodCall', onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC })\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 */\n addAppDeleteMethodCall(params: AppDeleteMethodCall) {\n this.txns.push({ ...params, type: 'methodCall', onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC })\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 */\n addAppCallMethodCall(params: AppCallMethodCall) {\n this.txns.push({ ...params, type: 'methodCall' })\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 */\n addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): AlgoKitComposer {\n this.txns.push({ ...params, type: 'keyReg' })\n\n return this\n }\n\n /**\n * Add the transactions within an `AtomicTransactionComposer` to the transaction group.\n * @param atc The `AtomicTransactionComposer` to build transactions from and add to the group\n * @returns The composer so you can chain method calls\n */\n addAtc(atc: algosdk.AtomicTransactionComposer): AlgoKitComposer {\n this.txns.push({ atc, type: 'atc' })\n return this\n }\n\n /** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */\n private buildAtc(\n atc: algosdk.AtomicTransactionComposer,\n processTransaction?: (txn: algosdk.Transaction, index: number) => algosdk.Transaction,\n ): algosdk.TransactionWithSigner[] {\n const group = atc.buildGroup()\n\n const txnWithSigners = group.map((ts, idx) => {\n // Remove underlying group ID from the transaction since it will be re-grouped when this AlgoKitComposer is built\n ts.txn.group = undefined\n // Process transaction if a function is provided\n ts.txn = processTransaction?.(ts.txn, idx) ?? ts.txn\n // If this was a method call stash the ABIMethod for later\n if (atc['methodCalls'].get(idx)) {\n this.txnMethodMap.set(ts.txn.txID(), atc['methodCalls'].get(idx))\n }\n return ts\n })\n\n return txnWithSigners\n }\n\n private commonTxnBuildStep(params: CommonTransactionParams, txn: algosdk.Transaction, suggestedParams: algosdk.SuggestedParams) {\n if (params.lease) txn.addLease(encodeLease(params.lease)!)\n if (params.rekeyTo) txn.addRekey(params.rekeyTo)\n const encoder = new TextEncoder()\n if (params.note) txn.note = typeof params.note === 'string' ? encoder.encode(params.note) : params.note\n\n if (params.firstValidRound) {\n txn.firstRound = Number(params.firstValidRound)\n }\n\n if (params.lastValidRound) {\n txn.lastRound = Number(params.lastValidRound)\n } else {\n // If the validity window isn't set in this transaction or by default and we are pointing at\n // LocalNet set a bigger window to avoid dead transactions\n const window =\n params.validityWindow ??\n (!this.defaultValidityWindowIsExplicit && genesisIdIsLocalNet(suggestedParams.genesisID) ? 1000 : this.defaultValidityWindow)\n txn.lastRound = txn.firstRound + window\n }\n\n if (params.staticFee !== undefined && params.extraFee !== undefined) {\n throw Error('Cannot set both staticFee and extraFee')\n }\n\n if (params.staticFee !== undefined) {\n txn.fee = Number(params.staticFee.microAlgo)\n } else {\n txn.fee = txn.estimateSize() * suggestedParams.fee || algosdk.ALGORAND_MIN_TX_FEE\n if (params.extraFee) txn.fee += Number(params.extraFee.microAlgo)\n }\n txn.flatFee = true\n\n if (params.maxFee !== undefined && txn.fee > params.maxFee.microAlgo) {\n throw Error(`Transaction fee ${txn.fee} µALGO is greater than maxFee ${params.maxFee}`)\n }\n\n return txn\n }\n\n /**\n * Builds an ABI method call transaction and any other associated transactions represented in the ABI args.\n * @param includeSigner Whether to include the actual signer for the transactions.\n * If you are just building transactions without signers yet then set this to `false`.\n */\n private async buildMethodCall(\n params: AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall,\n suggestedParams: algosdk.SuggestedParams,\n includeSigner: boolean,\n ): Promise<algosdk.TransactionWithSigner[]> {\n const methodArgs: algosdk.ABIArgument[] = []\n const isAbiValue = (x: unknown): x is algosdk.ABIValue => {\n if (Array.isArray(x)) return x.length == 0 || x.every(isAbiValue)\n\n return typeof x === 'bigint' || typeof x === 'boolean' || typeof x === 'number' || typeof x === 'string' || x instanceof Uint8Array\n }\n\n for (let i = 0; i < (params.args ?? []).length; i++) {\n const arg = params.args![i]\n if (arg === undefined) {\n throw Error(`No value provided for argument ${i + 1} within call to ${params.method.name}`)\n }\n\n if (isAbiValue(arg)) {\n methodArgs.push(arg)\n continue\n }\n\n if (isTransactionWithSigner(arg)) {\n methodArgs.push(arg)\n continue\n }\n\n if ('method' in arg) {\n const tempTxnWithSigners = await this.buildMethodCall(arg, suggestedParams, includeSigner)\n methodArgs.push(...tempTxnWithSigners)\n continue\n }\n\n const txn = await arg\n methodArgs.push({\n txn,\n signer: includeSigner\n ? params.signer\n ? 'signer' in params.signer\n ? params.signer.signer\n : params.signer\n : this.getSigner(encodeAddress(txn.from.publicKey))\n : AlgoKitComposer.NULL_SIGNER,\n })\n }\n\n const methodAtc = new algosdk.AtomicTransactionComposer()\n\n const appId = Number('appId' in params ? params.appId : 0n)\n const approvalProgram =\n 'approvalProgram' in params\n ? typeof params.approvalProgram === 'string'\n ? (await this.appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n : undefined\n const clearStateProgram =\n 'clearStateProgram' in params\n ? typeof params.clearStateProgram === 'string'\n ? (await this.appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n : undefined\n\n methodAtc.addMethodCall({\n appID: appId,\n sender: params.sender,\n suggestedParams,\n onComplete: params.onComplete ?? algosdk.OnApplicationComplete.NoOpOC,\n appAccounts: params.accountReferences,\n appForeignApps: params.appReferences?.map((x) => Number(x)),\n appForeignAssets: params.assetReferences?.map((x) => Number(x)),\n boxes: params.boxReferences?.map(AppManager.getBoxReference),\n approvalProgram,\n clearProgram: clearStateProgram,\n extraPages:\n appId === 0\n ? 'extraProgramPages' in params && params.extraProgramPages !== undefined\n ? params.extraProgramPages\n : approvalProgram\n ? Math.floor((approvalProgram.length + (clearStateProgram?.length ?? 0)) / APP_PAGE_MAX_SIZE)\n : 0\n : undefined,\n numLocalInts: appId === 0 ? ('schema' in params ? params.schema?.localInts ?? 0 : 0) : undefined,\n numLocalByteSlices: appId === 0 ? ('schema' in params ? params.schema?.localByteSlices ?? 0 : 0) : undefined,\n numGlobalInts: appId === 0 ? ('schema' in params ? params.schema?.globalInts ?? 0 : 0) : undefined,\n numGlobalByteSlices: appId === 0 ? ('schema' in params ? params.schema?.globalByteSlices ?? 0 : 0) : undefined,\n method: params.method,\n signer: includeSigner\n ? params.signer\n ? 'signer' in params.signer\n ? params.signer.signer\n : params.signer\n : this.getSigner(params.sender)\n : AlgoKitComposer.NULL_SIGNER,\n methodArgs: methodArgs,\n // note, lease, and rekeyTo are set in the common build step\n note: undefined,\n lease: undefined,\n rekeyTo: undefined,\n })\n\n // Process the ATC to get a set of transactions ready for broader grouping\n // and with the common build step to set fees and validity rounds\n return this.buildAtc(methodAtc, (txn, idx) =>\n idx === methodAtc.count() - 1 ? this.commonTxnBuildStep(params, txn, suggestedParams) : txn,\n )\n }\n\n private buildPayment(params: PaymentParams, suggestedParams: algosdk.SuggestedParams) {\n const txn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({\n from: params.sender,\n to: params.receiver,\n amount: params.amount.microAlgo,\n closeRemainderTo: params.closeRemainderTo,\n suggestedParams,\n })\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n private buildAssetCreate(params: AssetCreateParams, suggestedParams: algosdk.SuggestedParams) {\n const txn = algosdk.makeAssetCreateTxnWithSuggestedParamsFromObject({\n from: params.sender,\n total: params.total,\n decimals: params.decimals ?? 0,\n assetName: params.assetName,\n unitName: params.unitName,\n assetURL: params.url,\n defaultFrozen: params.defaultFrozen ?? false,\n assetMetadataHash: params.metadataHash,\n manager: params.manager,\n reserve: params.reserve,\n freeze: params.freeze,\n clawback: params.clawback,\n suggestedParams,\n })\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n private buildAssetConfig(params: AssetConfigParams, suggestedParams: algosdk.SuggestedParams) {\n const txn = algosdk.makeAssetConfigTxnWithSuggestedParamsFromObject({\n from: params.sender,\n assetIndex: Number(params.assetId),\n suggestedParams,\n manager: params.manager,\n reserve: params.reserve,\n freeze: params.freeze,\n clawback: params.clawback,\n strictEmptyAddressChecking: false,\n })\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n private buildAssetDestroy(params: AssetDestroyParams, suggestedParams: algosdk.SuggestedParams) {\n const txn = algosdk.makeAssetDestroyTxnWithSuggestedParamsFromObject({\n from: params.sender,\n assetIndex: Number(params.assetId),\n suggestedParams,\n })\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n private buildAssetFreeze(params: AssetFreezeParams, suggestedParams: algosdk.SuggestedParams) {\n const txn = algosdk.makeAssetFreezeTxnWithSuggestedParamsFromObject({\n from: params.sender,\n assetIndex: Number(params.assetId),\n freezeTarget: params.account,\n freezeState: params.frozen,\n suggestedParams,\n })\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n private buildAssetTransfer(params: AssetTransferParams, suggestedParams: algosdk.SuggestedParams) {\n const txn = algosdk.makeAssetTransferTxnWithSuggestedParamsFromObject({\n from: params.sender,\n to: params.receiver,\n assetIndex: Number(params.assetId),\n amount: params.amount,\n suggestedParams,\n closeRemainderTo: params.closeAssetTo,\n revocationTarget: params.clawbackTarget,\n })\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n private async buildAppCall(params: AppCallParams | AppUpdateParams | AppCreateParams, suggestedParams: algosdk.SuggestedParams) {\n const appId = Number('appId' in params ? params.appId : 0n)\n const approvalProgram =\n 'approvalProgram' in params\n ? typeof params.approvalProgram === 'string'\n ? (await this.appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n : undefined\n const clearStateProgram =\n 'clearStateProgram' in params\n ? typeof params.clearStateProgram === 'string'\n ? (await this.appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n : undefined\n\n const sdkParams = {\n from: params.sender,\n suggestedParams,\n appArgs: params.args,\n onComplete: params.onComplete ?? algosdk.OnApplicationComplete.NoOpOC,\n accounts: params.accountReferences,\n foreignApps: params.appReferences?.map((x) => Number(x)),\n foreignAssets: params.assetReferences?.map((x) => Number(x)),\n boxes: params.boxReferences?.map(AppManager.getBoxReference),\n approvalProgram,\n clearProgram: clearStateProgram,\n }\n\n let txn: algosdk.Transaction\n\n if (appId === 0) {\n if (sdkParams.approvalProgram === undefined || sdkParams.clearProgram === undefined) {\n throw new Error('approvalProgram and clearStateProgram are required for application creation')\n }\n\n txn = algosdk.makeApplicationCreateTxnFromObject({\n ...sdkParams,\n extraPages:\n 'extraProgramPages' in params\n ? params.extraProgramPages ?? Math.floor((approvalProgram!.length + clearStateProgram!.length) / APP_PAGE_MAX_SIZE)\n : 0,\n numLocalInts: 'schema' in params ? params.schema?.localInts ?? 0 : 0,\n numLocalByteSlices: 'schema' in params ? params.schema?.localByteSlices ?? 0 : 0,\n numGlobalInts: 'schema' in params ? params.schema?.globalInts ?? 0 : 0,\n numGlobalByteSlices: 'schema' in params ? params.schema?.globalByteSlices ?? 0 : 0,\n approvalProgram: approvalProgram!,\n clearProgram: clearStateProgram!,\n })\n } else {\n txn = algosdk.makeApplicationCallTxnFromObject({ ...sdkParams, appIndex: appId })\n }\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n private buildKeyReg(params: OnlineKeyRegistrationParams, suggestedParams: algosdk.SuggestedParams) {\n const txn = algosdk.makeKeyRegistrationTxnWithSuggestedParams(\n params.sender,\n undefined,\n params.voteKey,\n params.selectionKey,\n Number(params.voteFirst),\n Number(params.voteLast),\n Number(params.voteKeyDilution),\n suggestedParams,\n undefined,\n false,\n params.stateProofKey,\n )\n\n return this.commonTxnBuildStep(params, txn, suggestedParams)\n }\n\n /** Builds all transaction types apart from `txnWithSigner`, `atc` and `methodCall` since those ones can have custom signers that need to be retrieved. */\n private async buildTxn(txn: Txn, suggestedParams: algosdk.SuggestedParams): Promise<algosdk.Transaction[]> {\n switch (txn.type) {\n case 'pay':\n return [this.buildPayment(txn, suggestedParams)]\n case 'assetCreate':\n return [this.buildAssetCreate(txn, suggestedParams)]\n case 'appCall':\n return [await this.buildAppCall(txn, suggestedParams)]\n case 'assetConfig':\n return [this.buildAssetConfig(txn, suggestedParams)]\n case 'assetDestroy':\n return [this.buildAssetDestroy(txn, suggestedParams)]\n case 'assetFreeze':\n return [this.buildAssetFreeze(txn, suggestedParams)]\n case 'assetTransfer':\n return [this.buildAssetTransfer(txn, suggestedParams)]\n case 'assetOptIn':\n return [this.buildAssetTransfer({ ...txn, receiver: txn.sender, amount: 0n }, suggestedParams)]\n case 'assetOptOut':\n return [this.buildAssetTransfer({ ...txn, receiver: txn.sender, amount: 0n, closeAssetTo: txn.creator }, suggestedParams)]\n case 'keyReg':\n return [this.buildKeyReg(txn, suggestedParams)]\n default:\n throw Error(`Unsupported txn type`)\n }\n }\n\n private async buildTxnWithSigner(txn: Txn, suggestedParams: algosdk.SuggestedParams): Promise<algosdk.TransactionWithSigner[]> {\n if (txn.type === 'txnWithSigner') {\n return [txn]\n }\n\n if (txn.type === 'atc') {\n return this.buildAtc(txn.atc)\n }\n\n if (txn.type === 'methodCall') {\n return await this.buildMethodCall(txn, suggestedParams, true)\n }\n\n const signer = txn.signer ? ('signer' in txn.signer ? txn.signer.signer : txn.signer) : this.getSigner(txn.sender)\n\n return (await this.buildTxn(txn, suggestedParams)).map((txn) => ({ txn, signer }))\n }\n\n /**\n * Compose all of the transactions without signers and return the transaction objects directly along with any ABI method calls.\n *\n * @returns The array of built transactions and any corresponding method calls\n */\n async buildTransactions(): Promise<BuiltTransactions> {\n const suggestedParams = await this.getSuggestedParams()\n\n const transactions: algosdk.Transaction[] = []\n const methodCalls = new Map<number, algosdk.ABIMethod>()\n const signers = new Map<number, algosdk.TransactionSigner>()\n\n for (const txn of this.txns) {\n if (!['txnWithSigner', 'atc', 'methodCall'].includes(txn.type)) {\n transactions.push(...(await this.buildTxn(txn, suggestedParams)))\n } else {\n const transactionsWithSigner =\n txn.type === 'txnWithSigner'\n ? [txn]\n : txn.type === 'atc'\n ? this.buildAtc(txn.atc)\n : txn.type === 'methodCall'\n ? await this.buildMethodCall(txn, suggestedParams, false)\n : []\n\n transactions.push(...transactionsWithSigner.map((ts) => ts.txn))\n transactionsWithSigner.forEach((ts, idx) => {\n if (ts.signer && ts.signer !== AlgoKitComposer.NULL_SIGNER) {\n signers.set(idx, ts.signer)\n }\n })\n }\n }\n\n for (let i = 0; i < transactions.length; i++) {\n const method = this.txnMethodMap.get(transactions[i].txID())\n if (method) methodCalls.set(i, method)\n }\n\n return { transactions, methodCalls, signers }\n }\n\n /**\n * Get the number of transactions currently added to this composer.\n */\n async count() {\n return (await this.buildTransactions()).transactions.length\n }\n\n /**\n * Compose all of the transactions in a single atomic transaction group and an atomic transaction composer.\n *\n * You can then use the transactions standalone, or use the composer to execute or simulate the transactions.\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 atomic transaction composer and the transactions\n */\n async build() {\n if (this.atc.getStatus() === algosdk.AtomicTransactionComposerStatus.BUILDING) {\n const suggestedParams = await this.getSuggestedParams()\n\n // Build all of the transactions\n const txnWithSigners: algosdk.TransactionWithSigner[] = []\n for (const txn of this.txns) {\n txnWithSigners.push(...(await this.buildTxnWithSigner(txn, suggestedParams)))\n }\n\n // Add all of the transactions to the underlying ATC\n const methodCalls = new Map<number, algosdk.ABIMethod>()\n txnWithSigners.forEach((ts, idx) => {\n this.atc.addTransaction(ts)\n // Populate consolidated set of all ABI method calls\n const method = this.txnMethodMap.get(ts.txn.txID())\n if (method) methodCalls.set(idx, method)\n })\n this.atc['methodCalls'] = methodCalls\n }\n\n return { atc: this.atc, transactions: this.atc.buildGroup(), methodCalls: this.atc['methodCalls'] }\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 atomic transaction composer and the transactions\n */\n async rebuild() {\n this.atc = new algosdk.AtomicTransactionComposer()\n return await this.build()\n }\n\n /**\n * Compose the atomic transaction group and send it to the network.\n * @param params The parameters to control execution with\n * @returns The execution result\n */\n async send(params?: SendParams): Promise<SendAtomicTransactionComposerResults> {\n const group = (await this.build()).transactions\n\n let waitRounds = params?.maxRoundsToWaitForConfirmation\n if (waitRounds === undefined) {\n const lastRound = group.reduce((max, txn) => Math.max(txn.txn.lastRound, max), 0)\n const { firstRound } = await this.getSuggestedParams()\n waitRounds = lastRound - firstRound + 1\n }\n\n return await sendAtomicTransactionComposer(\n {\n atc: this.atc,\n suppressLog: params?.suppressLog,\n maxRoundsToWaitForConfirmation: waitRounds,\n populateAppCallResources: params?.populateAppCallResources,\n },\n this.algod,\n )\n }\n\n /**\n * @deprecated Use `send` instead.\n *\n * Compose the atomic transaction group and send it to the network\n *\n * An alias for `composer.send(params)`.\n * @param params The parameters to control execution with\n * @returns The execution result\n */\n async execute(params?: SendParams): Promise<SendAtomicTransactionComposerResults> {\n return this.send(params)\n }\n\n /**\n * Compose the atomic transaction group and simulate sending it to the network\n * @returns The simulation result\n */\n async simulate(options?: SimulateOptions): Promise<SendAtomicTransactionComposerResults & { simulateResponse: SimulateResponse }> {\n await this.build()\n\n if (Config.debug && !Config.traceAll) {\n // Dump the traces to a file for use with AlgoKit AVM debugger\n // Checks for false on traceAll because it should have been already\n // executed above\n const simulateResponse = await performAtomicTransactionComposerSimulate(this.atc, this.algod)\n await Config.events.emitAsync(EventType.TxnGroupSimulated, {\n simulateResponse,\n })\n }\n\n const { methodResults, simulateResponse } = await this.atc.simulate(\n this.algod,\n new modelsv2.SimulateRequest({ txnGroups: [], ...options }),\n )\n\n if (simulateResponse && simulateResponse.txnGroups[0].failedAt) {\n const error = new Error(\n `Transaction failed at transaction(s) ${simulateResponse.txnGroups[0].failedAt.join(', ')} in the group. ${simulateResponse.txnGroups.find((x) => x.failureMessage)?.failureMessage}`,\n )\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(error as any).simulateResponse = simulateResponse\n throw error\n }\n\n const transactions = this.atc.buildGroup().map((t) => t.txn)\n return {\n confirmations: simulateResponse.txnGroups[0].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: methodResults.map((m) => m as ABIReturn),\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 : JSON.stringify(note.data)}`\n const encoder = new TextEncoder()\n return encoder.encode(arc2Payload)\n }\n}\n"],"names":["AppManager","encodeLease","genesisIdIsLocalNet","APP_PAGE_MAX_SIZE","sendAtomicTransactionComposer","Config","performAtomicTransactionComposerSimulate","EventType"],"mappings":";;;;;;;;;;;;;AAeA,IAAO,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAA;AAChE,IAAO,aAAa,GAAG,OAAO,CAAC,aAAa,CAAA;AAE5C,IAAO,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;AAE3B,MAAM,0BAA0B,GAAG,GAAE;AAkd5C;AACA,MAAqB,eAAe,CAAA;AA8BlC;;;AAGG;AACH,IAAA,WAAA,CAAY,MAA6B,EAAA;;AA7BjC,QAAA,IAAA,CAAA,GAAG,GAAG,IAAI,OAAO,CAAC,yBAA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KAAK,QAAQ,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAC7H,QAAA,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAA;AACjC,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;KACnC;;AA/zBD;AACe,eAAA,CAAA,WAAW,GAA8B,OAAO,CAAC,0BAA0B,EAAE;;;;;"}
@@ -1,10 +1,11 @@
1
1
  import algosdk from 'algosdk';
2
2
  import { Config } from '../config.mjs';
3
+ import { performAtomicTransactionComposerSimulate } from '../transaction/perform-atomic-transaction-composer-simulate.mjs';
3
4
  import { encodeLease, sendAtomicTransactionComposer } from '../transaction/transaction.mjs';
4
5
  import { APP_PAGE_MAX_SIZE } from './app.mjs';
5
6
  import { AppManager } from './app-manager.mjs';
7
+ import { EventType } from './async-event-emitter.mjs';
6
8
  import { genesisIdIsLocalNet } from './network-client.mjs';
7
- import { simulateAndPersistResponse } from '../debugging/simulate-and-persist-response.mjs';
8
9
 
9
10
  var isTransactionWithSigner = algosdk.isTransactionWithSigner;
10
11
  var encodeAddress = algosdk.encodeAddress;
@@ -622,11 +623,11 @@ class AlgoKitComposer {
622
623
  return await this.build();
623
624
  }
624
625
  /**
625
- * Compose the atomic transaction group and send it to the network
626
+ * Compose the atomic transaction group and send it to the network.
626
627
  * @param params The parameters to control execution with
627
628
  * @returns The execution result
628
629
  */
629
- async execute(params) {
630
+ async send(params) {
630
631
  const group = (await this.build()).transactions;
631
632
  let waitRounds = params?.maxRoundsToWaitForConfirmation;
632
633
  if (waitRounds === undefined) {
@@ -636,28 +637,36 @@ class AlgoKitComposer {
636
637
  }
637
638
  return await sendAtomicTransactionComposer({
638
639
  atc: this.atc,
639
- executeParams: {
640
- suppressLog: params?.suppressLog,
641
- maxRoundsToWaitForConfirmation: waitRounds,
642
- populateAppCallResources: params?.populateAppCallResources,
643
- },
640
+ suppressLog: params?.suppressLog,
641
+ maxRoundsToWaitForConfirmation: waitRounds,
642
+ populateAppCallResources: params?.populateAppCallResources,
644
643
  }, this.algod);
645
644
  }
645
+ /**
646
+ * @deprecated Use `send` instead.
647
+ *
648
+ * Compose the atomic transaction group and send it to the network
649
+ *
650
+ * An alias for `composer.send(params)`.
651
+ * @param params The parameters to control execution with
652
+ * @returns The execution result
653
+ */
654
+ async execute(params) {
655
+ return this.send(params);
656
+ }
646
657
  /**
647
658
  * Compose the atomic transaction group and simulate sending it to the network
648
659
  * @returns The simulation result
649
660
  */
650
661
  async simulate(options) {
651
662
  await this.build();
652
- if (Config.debug && Config.projectRoot && !Config.traceAll) {
663
+ if (Config.debug && !Config.traceAll) {
653
664
  // Dump the traces to a file for use with AlgoKit AVM debugger
654
665
  // Checks for false on traceAll because it should have been already
655
666
  // executed above
656
- await simulateAndPersistResponse({
657
- atc: this.atc,
658
- projectRoot: Config.projectRoot,
659
- algod: this.algod,
660
- bufferSizeMb: Config.traceBufferSizeMb,
667
+ const simulateResponse = await performAtomicTransactionComposerSimulate(this.atc, this.algod);
668
+ await Config.events.emitAsync(EventType.TxnGroupSimulated, {
669
+ simulateResponse,
661
670
  });
662
671
  }
663
672
  const { methodResults, simulateResponse } = await this.atc.simulate(this.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options }));
@@ -676,6 +685,13 @@ class AlgoKitComposer {
676
685
  returns: methodResults.map((m) => m),
677
686
  };
678
687
  }
688
+ /**
689
+ * Create an encoded transaction note that follows the ARC-2 spec.
690
+ *
691
+ * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
692
+ * @param note The ARC-2 transaction note data
693
+ * @returns The binary encoded transaction note
694
+ */
679
695
  static arc2Note(note) {
680
696
  const arc2Payload = `${note.dAppName}:${note.format}${typeof note.data === 'string' ? note.data : JSON.stringify(note.data)}`;
681
697
  const encoder = new TextEncoder();