@algorandfoundation/algokit-utils 6.3.0-beta.1 → 7.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -26
  3. package/account/account.d.ts +12 -10
  4. package/account/get-account-config-from-environment.d.ts +0 -1
  5. package/account/get-account.d.ts +2 -3
  6. package/account/get-dispenser-account.d.ts +2 -3
  7. package/account/index.d.ts +0 -1
  8. package/account/mnemonic-account.d.ts +1 -2
  9. package/amount.d.ts +15 -5
  10. package/app-client.d.ts +19 -5
  11. package/app-deploy.d.ts +18 -2
  12. package/app.d.ts +39 -3
  13. package/asset.d.ts +5 -6
  14. package/config.d.ts +0 -1
  15. package/debugging/debugging.d.ts +3 -5
  16. package/debugging/index.d.ts +0 -2
  17. package/dispenser-client.d.ts +0 -1
  18. package/index.d.ts +5 -4
  19. package/index.js +56 -46
  20. package/index.js.map +1 -1
  21. package/index.mjs +26 -25
  22. package/index.mjs.map +1 -1
  23. package/indexer-lookup.d.ts +10 -9
  24. package/localnet/get-kmd-wallet-account.d.ts +1 -2
  25. package/localnet/get-localnet-dispenser-account.d.ts +1 -2
  26. package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -2
  27. package/localnet/index.d.ts +0 -1
  28. package/localnet/is-localnet.d.ts +1 -2
  29. package/network-client.d.ts +3 -10
  30. package/package.json +3 -4
  31. package/{account → src/account}/account.js +21 -18
  32. package/src/account/account.js.map +1 -0
  33. package/{account → src/account}/account.mjs +22 -19
  34. package/src/account/account.mjs.map +1 -0
  35. package/src/account/get-account-config-from-environment.js.map +1 -0
  36. package/src/account/get-account-config-from-environment.mjs.map +1 -0
  37. package/{account → src/account}/get-account.js +3 -3
  38. package/src/account/get-account.js.map +1 -0
  39. package/{account → src/account}/get-account.mjs +3 -3
  40. package/src/account/get-account.mjs.map +1 -0
  41. package/{account → src/account}/get-dispenser-account.js +3 -3
  42. package/src/account/get-dispenser-account.js.map +1 -0
  43. package/{account → src/account}/get-dispenser-account.mjs +3 -3
  44. package/src/account/get-dispenser-account.mjs.map +1 -0
  45. package/{account → src/account}/mnemonic-account.js +1 -1
  46. package/src/account/mnemonic-account.js.map +1 -0
  47. package/{account → src/account}/mnemonic-account.mjs +1 -1
  48. package/src/account/mnemonic-account.mjs.map +1 -0
  49. package/{amount.js → src/amount.js} +10 -3
  50. package/src/amount.js.map +1 -0
  51. package/{amount.mjs → src/amount.mjs} +10 -4
  52. package/src/amount.mjs.map +1 -0
  53. package/{app-client.js → src/app-client.js} +20 -5
  54. package/src/app-client.js.map +1 -0
  55. package/{app-client.mjs → src/app-client.mjs} +20 -5
  56. package/src/app-client.mjs.map +1 -0
  57. package/src/app-deploy.js +285 -0
  58. package/src/app-deploy.js.map +1 -0
  59. package/src/app-deploy.mjs +276 -0
  60. package/src/app-deploy.mjs.map +1 -0
  61. package/src/app.js +349 -0
  62. package/src/app.js.map +1 -0
  63. package/src/app.mjs +329 -0
  64. package/src/app.mjs.map +1 -0
  65. package/{asset.js → src/asset.js} +6 -9
  66. package/src/asset.js.map +1 -0
  67. package/{asset.mjs → src/asset.mjs} +6 -9
  68. package/src/asset.mjs.map +1 -0
  69. package/{config.js → src/config.js} +1 -1
  70. package/src/config.js.map +1 -0
  71. package/{config.mjs → src/config.mjs} +1 -1
  72. package/src/config.mjs.map +1 -0
  73. package/src/debugging/debugging.js +15 -0
  74. package/src/debugging/debugging.js.map +1 -0
  75. package/src/debugging/debugging.mjs +13 -0
  76. package/src/debugging/debugging.mjs.map +1 -0
  77. package/{dispenser-client.js → src/dispenser-client.js} +1 -1
  78. package/src/dispenser-client.js.map +1 -0
  79. package/{dispenser-client.mjs → src/dispenser-client.mjs} +1 -1
  80. package/src/dispenser-client.mjs.map +1 -0
  81. package/{indexer-lookup.js → src/indexer-lookup.js} +14 -10
  82. package/src/indexer-lookup.js.map +1 -0
  83. package/{indexer-lookup.mjs → src/indexer-lookup.mjs} +14 -10
  84. package/src/indexer-lookup.mjs.map +1 -0
  85. package/{localnet → src/localnet}/get-kmd-wallet-account.js +3 -3
  86. package/src/localnet/get-kmd-wallet-account.js.map +1 -0
  87. package/{localnet → src/localnet}/get-kmd-wallet-account.mjs +3 -3
  88. package/src/localnet/get-kmd-wallet-account.mjs.map +1 -0
  89. package/{localnet → src/localnet}/get-localnet-dispenser-account.js +3 -3
  90. package/src/localnet/get-localnet-dispenser-account.js.map +1 -0
  91. package/{localnet → src/localnet}/get-localnet-dispenser-account.mjs +3 -3
  92. package/src/localnet/get-localnet-dispenser-account.mjs.map +1 -0
  93. package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.js +3 -3
  94. package/src/localnet/get-or-create-kmd-wallet-account.js.map +1 -0
  95. package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.mjs +3 -3
  96. package/src/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -0
  97. package/{localnet → src/localnet}/is-localnet.js +2 -2
  98. package/src/localnet/is-localnet.js.map +1 -0
  99. package/{localnet → src/localnet}/is-localnet.mjs +2 -2
  100. package/src/localnet/is-localnet.mjs.map +1 -0
  101. package/{network-client.js → src/network-client.js} +5 -12
  102. package/src/network-client.js.map +1 -0
  103. package/{network-client.mjs → src/network-client.mjs} +5 -12
  104. package/src/network-client.mjs.map +1 -0
  105. package/{testing → src/testing}/account.js +9 -3
  106. package/src/testing/account.js.map +1 -0
  107. package/{testing → src/testing}/account.mjs +10 -4
  108. package/src/testing/account.mjs.map +1 -0
  109. package/src/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  110. package/src/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -0
  111. package/{testing → src/testing}/fixtures/algorand-fixture.js +15 -16
  112. package/src/testing/fixtures/algorand-fixture.js.map +1 -0
  113. package/{testing → src/testing}/fixtures/algorand-fixture.mjs +15 -16
  114. package/src/testing/fixtures/algorand-fixture.mjs.map +1 -0
  115. package/src/testing/indexer.js.map +1 -0
  116. package/src/testing/indexer.mjs.map +1 -0
  117. package/{testing → src/testing}/test-logger.js +7 -3
  118. package/src/testing/test-logger.js.map +1 -0
  119. package/{testing → src/testing}/test-logger.mjs +7 -3
  120. package/src/testing/test-logger.mjs.map +1 -0
  121. package/src/testing/transaction-logger.js.map +1 -0
  122. package/src/testing/transaction-logger.mjs.map +1 -0
  123. package/src/transaction/legacy-bridge.js +129 -0
  124. package/src/transaction/legacy-bridge.js.map +1 -0
  125. package/src/transaction/legacy-bridge.mjs +124 -0
  126. package/src/transaction/legacy-bridge.mjs.map +1 -0
  127. package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.js +14 -9
  128. package/src/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -0
  129. package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.mjs +15 -10
  130. package/src/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -0
  131. package/{transaction → src/transaction}/transaction.js +217 -137
  132. package/src/transaction/transaction.js.map +1 -0
  133. package/{transaction → src/transaction}/transaction.mjs +218 -138
  134. package/src/transaction/transaction.mjs.map +1 -0
  135. package/{transfer → src/transfer}/transfer-algos.js +1 -1
  136. package/src/transfer/transfer-algos.js.map +1 -0
  137. package/{transfer → src/transfer}/transfer-algos.mjs +1 -1
  138. package/src/transfer/transfer-algos.mjs.map +1 -0
  139. package/{transfer → src/transfer}/transfer.js +8 -6
  140. package/src/transfer/transfer.js.map +1 -0
  141. package/{transfer → src/transfer}/transfer.mjs +8 -6
  142. package/src/transfer/transfer.mjs.map +1 -0
  143. package/{util.js → src/util.js} +11 -10
  144. package/src/util.js.map +1 -0
  145. package/{util.mjs → src/util.mjs} +11 -10
  146. package/src/util.mjs.map +1 -0
  147. package/testing/_asset.d.ts +2 -2
  148. package/testing/account.d.ts +4 -4
  149. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  150. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  151. package/testing/fixtures/index.d.ts +0 -1
  152. package/testing/index.d.ts +0 -1
  153. package/testing/index.js +6 -6
  154. package/testing/index.mjs +6 -6
  155. package/testing/indexer.d.ts +0 -1
  156. package/testing/test-logger.d.ts +0 -1
  157. package/testing/transaction-logger.d.ts +0 -1
  158. package/transaction/index.d.ts +0 -1
  159. package/transaction/legacy-bridge.d.ts +31 -6
  160. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -2
  161. package/transaction/transaction.d.ts +38 -19
  162. package/transfer/index.d.ts +0 -1
  163. package/transfer/transfer-algos.d.ts +1 -2
  164. package/transfer/transfer.d.ts +1 -2
  165. package/types/account-manager.d.ts +33 -25
  166. package/types/account-manager.js +56 -33
  167. package/types/account-manager.js.map +1 -1
  168. package/types/account-manager.mjs +58 -35
  169. package/types/account-manager.mjs.map +1 -1
  170. package/types/account.d.ts +17 -9
  171. package/types/account.js +2 -2
  172. package/types/account.js.map +1 -1
  173. package/types/account.mjs +3 -3
  174. package/types/account.mjs.map +1 -1
  175. package/types/algo-http-client-with-retry.d.ts +1 -3
  176. package/types/algo-http-client-with-retry.js +34 -4
  177. package/types/algo-http-client-with-retry.js.map +1 -1
  178. package/types/algo-http-client-with-retry.mjs +33 -3
  179. package/types/algo-http-client-with-retry.mjs.map +1 -1
  180. package/types/algorand-client-interface.d.ts +28 -0
  181. package/types/algorand-client-interface.js +3 -0
  182. package/types/algorand-client-interface.js.map +1 -0
  183. package/types/algorand-client-interface.mjs +2 -0
  184. package/types/algorand-client-interface.mjs.map +1 -0
  185. package/types/algorand-client-transaction-creator.d.ts +452 -23
  186. package/types/algorand-client-transaction-creator.js +407 -23
  187. package/types/algorand-client-transaction-creator.js.map +1 -1
  188. package/types/algorand-client-transaction-creator.mjs +407 -23
  189. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  190. package/types/algorand-client-transaction-sender.d.ts +772 -47
  191. package/types/algorand-client-transaction-sender.js +446 -16
  192. package/types/algorand-client-transaction-sender.js.map +1 -1
  193. package/types/algorand-client-transaction-sender.mjs +446 -16
  194. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  195. package/types/algorand-client.d.ts +24 -17
  196. package/types/algorand-client.js +26 -16
  197. package/types/algorand-client.js.map +1 -1
  198. package/types/algorand-client.mjs +28 -15
  199. package/types/algorand-client.mjs.map +1 -1
  200. package/types/amount.d.ts +10 -11
  201. package/types/amount.js +7 -7
  202. package/types/amount.js.map +1 -1
  203. package/types/amount.mjs +7 -7
  204. package/types/amount.mjs.map +1 -1
  205. package/types/app-arc56.d.ts +359 -0
  206. package/types/app-arc56.js +184 -0
  207. package/types/app-arc56.js.map +1 -0
  208. package/types/app-arc56.mjs +175 -0
  209. package/types/app-arc56.mjs.map +1 -0
  210. package/types/app-client.d.ts +1508 -12
  211. package/types/app-client.js +1023 -34
  212. package/types/app-client.js.map +1 -1
  213. package/types/app-client.mjs +1024 -36
  214. package/types/app-client.mjs.map +1 -1
  215. package/types/app-deployer.d.ts +126 -0
  216. package/types/app-deployer.js +353 -0
  217. package/types/app-deployer.js.map +1 -0
  218. package/types/app-deployer.mjs +351 -0
  219. package/types/app-deployer.mjs.map +1 -0
  220. package/types/app-factory.d.ts +846 -0
  221. package/types/app-factory.js +410 -0
  222. package/types/app-factory.js.map +1 -0
  223. package/types/app-factory.mjs +408 -0
  224. package/types/app-factory.mjs.map +1 -0
  225. package/types/app-manager.d.ts +244 -0
  226. package/types/app-manager.js +423 -0
  227. package/types/app-manager.js.map +1 -0
  228. package/types/app-manager.mjs +421 -0
  229. package/types/app-manager.mjs.map +1 -0
  230. package/types/app-spec.d.ts +2 -1
  231. package/types/app-spec.js +127 -0
  232. package/types/app-spec.js.map +1 -1
  233. package/types/app-spec.mjs +126 -0
  234. package/types/app-spec.mjs.map +1 -1
  235. package/types/app.d.ts +57 -18
  236. package/types/app.js +1 -1
  237. package/types/app.js.map +1 -1
  238. package/types/app.mjs +1 -1
  239. package/types/app.mjs.map +1 -1
  240. package/types/asset-manager.d.ts +10 -10
  241. package/types/asset-manager.js +15 -19
  242. package/types/asset-manager.js.map +1 -1
  243. package/types/asset-manager.mjs +15 -19
  244. package/types/asset-manager.mjs.map +1 -1
  245. package/types/asset.d.ts +0 -1
  246. package/types/async-event-emitter.d.ts +14 -0
  247. package/types/async-event-emitter.js +50 -0
  248. package/types/async-event-emitter.js.map +1 -0
  249. package/types/async-event-emitter.mjs +48 -0
  250. package/types/async-event-emitter.mjs.map +1 -0
  251. package/types/client-manager.d.ts +135 -60
  252. package/types/client-manager.js +158 -44
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +159 -45
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +271 -87
  257. package/types/composer.js +406 -126
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +407 -125
  260. package/types/composer.mjs.map +1 -1
  261. package/types/config.d.ts +3 -6
  262. package/types/config.js +5 -44
  263. package/types/config.js.map +1 -1
  264. package/types/config.mjs +5 -27
  265. package/types/config.mjs.map +1 -1
  266. package/types/debugging.d.ts +29 -101
  267. package/types/debugging.js +16 -109
  268. package/types/debugging.js.map +1 -1
  269. package/types/debugging.mjs +12 -107
  270. package/types/debugging.mjs.map +1 -1
  271. package/types/dispenser-client.d.ts +2 -2
  272. package/types/dispenser-client.js +10 -5
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +10 -5
  275. package/types/dispenser-client.mjs.map +1 -1
  276. package/types/expand.d.ts +7 -0
  277. package/types/expand.js +3 -0
  278. package/types/expand.js.map +1 -0
  279. package/types/expand.mjs +2 -0
  280. package/types/expand.mjs.map +1 -0
  281. package/types/indexer.d.ts +74 -756
  282. package/types/indexer.js.map +1 -1
  283. package/types/indexer.mjs.map +1 -1
  284. package/types/kmd-account-manager.d.ts +2 -3
  285. package/types/kmd-account-manager.js +4 -4
  286. package/types/kmd-account-manager.js.map +1 -1
  287. package/types/kmd-account-manager.mjs +5 -5
  288. package/types/kmd-account-manager.mjs.map +1 -1
  289. package/types/lifecycle-events.d.ts +10 -0
  290. package/types/lifecycle-events.js +8 -0
  291. package/types/lifecycle-events.js.map +1 -0
  292. package/types/lifecycle-events.mjs +8 -0
  293. package/types/lifecycle-events.mjs.map +1 -0
  294. package/types/logging.d.ts +0 -1
  295. package/types/logging.js.map +1 -1
  296. package/types/logging.mjs.map +1 -1
  297. package/types/logic-error.d.ts +2 -4
  298. package/types/logic-error.js +3 -3
  299. package/types/logic-error.js.map +1 -1
  300. package/types/logic-error.mjs +3 -3
  301. package/types/logic-error.mjs.map +1 -1
  302. package/types/network-client.d.ts +14 -2
  303. package/types/network-client.js.map +1 -1
  304. package/types/network-client.mjs.map +1 -1
  305. package/types/testing.d.ts +8 -10
  306. package/types/transaction.d.ts +17 -4
  307. package/types/transfer.d.ts +0 -1
  308. package/util.d.ts +2 -2
  309. package/account/account.d.ts.map +0 -1
  310. package/account/account.js.map +0 -1
  311. package/account/account.mjs.map +0 -1
  312. package/account/get-account-config-from-environment.d.ts.map +0 -1
  313. package/account/get-account-config-from-environment.js.map +0 -1
  314. package/account/get-account-config-from-environment.mjs.map +0 -1
  315. package/account/get-account.d.ts.map +0 -1
  316. package/account/get-account.js.map +0 -1
  317. package/account/get-account.mjs.map +0 -1
  318. package/account/get-dispenser-account.d.ts.map +0 -1
  319. package/account/get-dispenser-account.js.map +0 -1
  320. package/account/get-dispenser-account.mjs.map +0 -1
  321. package/account/index.d.ts.map +0 -1
  322. package/account/mnemonic-account.d.ts.map +0 -1
  323. package/account/mnemonic-account.js.map +0 -1
  324. package/account/mnemonic-account.mjs.map +0 -1
  325. package/amount.d.ts.map +0 -1
  326. package/amount.js.map +0 -1
  327. package/amount.mjs.map +0 -1
  328. package/app-client.d.ts.map +0 -1
  329. package/app-client.js.map +0 -1
  330. package/app-client.mjs.map +0 -1
  331. package/app-deploy.d.ts.map +0 -1
  332. package/app-deploy.js +0 -468
  333. package/app-deploy.js.map +0 -1
  334. package/app-deploy.mjs +0 -459
  335. package/app-deploy.mjs.map +0 -1
  336. package/app.d.ts.map +0 -1
  337. package/app.js +0 -599
  338. package/app.js.map +0 -1
  339. package/app.mjs +0 -579
  340. package/app.mjs.map +0 -1
  341. package/asset.d.ts.map +0 -1
  342. package/asset.js.map +0 -1
  343. package/asset.mjs.map +0 -1
  344. package/config.d.ts.map +0 -1
  345. package/config.js.map +0 -1
  346. package/config.mjs.map +0 -1
  347. package/debugging/debugging.d.ts.map +0 -1
  348. package/debugging/debugging.js +0 -139
  349. package/debugging/debugging.js.map +0 -1
  350. package/debugging/debugging.mjs +0 -118
  351. package/debugging/debugging.mjs.map +0 -1
  352. package/debugging/index.d.ts.map +0 -1
  353. package/debugging/simulate-and-persist-response.d.ts +0 -20
  354. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  355. package/debugging/simulate-and-persist-response.js +0 -108
  356. package/debugging/simulate-and-persist-response.js.map +0 -1
  357. package/debugging/simulate-and-persist-response.mjs +0 -89
  358. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  359. package/dispenser-client.d.ts.map +0 -1
  360. package/dispenser-client.js.map +0 -1
  361. package/dispenser-client.mjs.map +0 -1
  362. package/index.d.ts.map +0 -1
  363. package/indexer-lookup.d.ts.map +0 -1
  364. package/indexer-lookup.js.map +0 -1
  365. package/indexer-lookup.mjs.map +0 -1
  366. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  367. package/localnet/get-kmd-wallet-account.js.map +0 -1
  368. package/localnet/get-kmd-wallet-account.mjs.map +0 -1
  369. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  370. package/localnet/get-localnet-dispenser-account.js.map +0 -1
  371. package/localnet/get-localnet-dispenser-account.mjs.map +0 -1
  372. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  373. package/localnet/get-or-create-kmd-wallet-account.js.map +0 -1
  374. package/localnet/get-or-create-kmd-wallet-account.mjs.map +0 -1
  375. package/localnet/index.d.ts.map +0 -1
  376. package/localnet/is-localnet.d.ts.map +0 -1
  377. package/localnet/is-localnet.js.map +0 -1
  378. package/localnet/is-localnet.mjs.map +0 -1
  379. package/network-client.d.ts.map +0 -1
  380. package/network-client.js.map +0 -1
  381. package/network-client.mjs.map +0 -1
  382. package/testing/_asset.d.ts.map +0 -1
  383. package/testing/account.d.ts.map +0 -1
  384. package/testing/account.js.map +0 -1
  385. package/testing/account.mjs.map +0 -1
  386. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  387. package/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
  388. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +0 -1
  389. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  390. package/testing/fixtures/algorand-fixture.js.map +0 -1
  391. package/testing/fixtures/algorand-fixture.mjs.map +0 -1
  392. package/testing/fixtures/index.d.ts.map +0 -1
  393. package/testing/index.d.ts.map +0 -1
  394. package/testing/indexer.d.ts.map +0 -1
  395. package/testing/indexer.js.map +0 -1
  396. package/testing/indexer.mjs.map +0 -1
  397. package/testing/test-logger.d.ts.map +0 -1
  398. package/testing/test-logger.js.map +0 -1
  399. package/testing/test-logger.mjs.map +0 -1
  400. package/testing/transaction-logger.d.ts.map +0 -1
  401. package/testing/transaction-logger.js.map +0 -1
  402. package/testing/transaction-logger.mjs.map +0 -1
  403. package/transaction/index.d.ts.map +0 -1
  404. package/transaction/legacy-bridge.d.ts.map +0 -1
  405. package/transaction/legacy-bridge.js +0 -35
  406. package/transaction/legacy-bridge.js.map +0 -1
  407. package/transaction/legacy-bridge.mjs +0 -33
  408. package/transaction/legacy-bridge.mjs.map +0 -1
  409. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  410. package/transaction/perform-atomic-transaction-composer-simulate.js.map +0 -1
  411. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +0 -1
  412. package/transaction/transaction.d.ts.map +0 -1
  413. package/transaction/transaction.js.map +0 -1
  414. package/transaction/transaction.mjs.map +0 -1
  415. package/transfer/index.d.ts.map +0 -1
  416. package/transfer/transfer-algos.d.ts.map +0 -1
  417. package/transfer/transfer-algos.js.map +0 -1
  418. package/transfer/transfer-algos.mjs.map +0 -1
  419. package/transfer/transfer.d.ts.map +0 -1
  420. package/transfer/transfer.js.map +0 -1
  421. package/transfer/transfer.mjs.map +0 -1
  422. package/types/account-manager.d.ts.map +0 -1
  423. package/types/account.d.ts.map +0 -1
  424. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  425. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  426. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  427. package/types/algorand-client.d.ts.map +0 -1
  428. package/types/amount.d.ts.map +0 -1
  429. package/types/app-client.d.ts.map +0 -1
  430. package/types/app-spec.d.ts.map +0 -1
  431. package/types/app.d.ts.map +0 -1
  432. package/types/asset-manager.d.ts.map +0 -1
  433. package/types/asset.d.ts.map +0 -1
  434. package/types/client-manager.d.ts.map +0 -1
  435. package/types/composer.d.ts.map +0 -1
  436. package/types/config.d.ts.map +0 -1
  437. package/types/debugging.d.ts.map +0 -1
  438. package/types/dispenser-client.d.ts.map +0 -1
  439. package/types/indexer.d.ts.map +0 -1
  440. package/types/kmd-account-manager.d.ts.map +0 -1
  441. package/types/logging.d.ts.map +0 -1
  442. package/types/logic-error.d.ts.map +0 -1
  443. package/types/network-client.d.ts.map +0 -1
  444. package/types/testing.d.ts.map +0 -1
  445. package/types/transaction.d.ts.map +0 -1
  446. package/types/transfer.d.ts.map +0 -1
  447. package/types/urlTokenBaseHTTPClient.d.ts +0 -41
  448. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  449. package/types/urlTokenBaseHTTPClient.js +0 -153
  450. package/types/urlTokenBaseHTTPClient.js.map +0 -1
  451. package/types/urlTokenBaseHTTPClient.mjs +0 -151
  452. package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
  453. package/util.d.ts.map +0 -1
  454. package/util.js.map +0 -1
  455. package/util.mjs.map +0 -1
  456. /package/{account → src/account}/get-account-config-from-environment.js +0 -0
  457. /package/{account → src/account}/get-account-config-from-environment.mjs +0 -0
  458. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.js +0 -0
  459. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.mjs +0 -0
  460. /package/{testing → src/testing}/indexer.js +0 -0
  461. /package/{testing → src/testing}/indexer.mjs +0 -0
  462. /package/{testing → src/testing}/transaction-logger.js +0 -0
  463. /package/{testing → src/testing}/transaction-logger.mjs +0 -0
@@ -1,19 +1,25 @@
1
- import { Config } from '../config.mjs';
1
+ import algosdk, { Address } from 'algosdk';
2
+ import { Buffer } from 'buffer';
3
+ import { Config } from '../src/config.mjs';
4
+ import { AppManager } from './app-manager.mjs';
2
5
 
6
+ const getMethodCallForLog = ({ method, args }) => {
7
+ return `${method.name}(${(args ?? []).map((a) => (a instanceof Address ? a.toString() : typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v instanceof Address ? v.toString() : v instanceof Uint8Array ? Buffer.from(v).toString('base64') : v)) : a))})`;
8
+ };
3
9
  /** Orchestrates sending transactions for `AlgorandClient`. */
4
10
  class AlgorandClientTransactionSender {
5
11
  /**
6
12
  * Creates a new `AlgorandClientSender`
7
- * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group
13
+ * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
8
14
  * @param assetManager An `AssetManager` instance
9
15
  */
10
- constructor(newGroup, assetManager) {
16
+ constructor(newGroup, assetManager, appManager) {
11
17
  /**
12
18
  * Send a payment transaction to transfer Algo between accounts.
13
19
  * @param params The parameters for the payment transaction
14
20
  * @example Basic example
15
21
  * ```typescript
16
- * const result = await algorandClient.send.payment({
22
+ * const result = await algorand.send.payment({
17
23
  * sender: 'SENDERADDRESS',
18
24
  * receiver: 'RECEIVERADDRESS',
19
25
  * amount: (4).algo(),
@@ -21,7 +27,7 @@ class AlgorandClientTransactionSender {
21
27
  * ```
22
28
  * @example Advanced example
23
29
  * ```typescript
24
- * const result = await algorandClient.send.payment({
30
+ * const result = await algorand.send.payment({
25
31
  * amount: (4).algo(),
26
32
  * receiver: 'RECEIVERADDRESS',
27
33
  * sender: 'SENDERADDRESS',
@@ -318,7 +324,7 @@ class AlgorandClientTransactionSender {
318
324
  *
319
325
  * @param params The parameters for the asset opt-out transaction
320
326
  *
321
- * @example Basic example (without creator)
327
+ * @example Basic example (without creator, will be retrieved from algod)
322
328
  * ```typescript
323
329
  * await algorand.send.assetOptOut({sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
324
330
  * ```
@@ -360,7 +366,7 @@ class AlgorandClientTransactionSender {
360
366
  const accountAssetInfo = await this._assetManager.getAccountInformation(params.sender, params.assetId);
361
367
  balance = accountAssetInfo.balance;
362
368
  }
363
- catch (e) {
369
+ catch {
364
370
  throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`);
365
371
  }
366
372
  if (balance !== 0n) {
@@ -372,24 +378,424 @@ class AlgorandClientTransactionSender {
372
378
  preLog: (params, transaction) => `Opting ${params.sender} out of asset with ID ${params.assetId} to creator ${params.creator} via transaction ${transaction.txID()}`,
373
379
  })(params);
374
380
  };
381
+ /**
382
+ * Create a smart contract.
383
+ *
384
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
385
+ *
386
+ * @param params The parameters for the app creation transaction
387
+ * @example Basic example
388
+ * ```typescript
389
+ * const result = await algorand.send.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
390
+ * const createdAppId = result.appId
391
+ * ```
392
+ * @example Advanced example
393
+ * ```typescript
394
+ * await algorand.send.appCreate({
395
+ * sender: 'CREATORADDRESS',
396
+ * approvalProgram: "TEALCODE",
397
+ * clearStateProgram: "TEALCODE",
398
+ * schema: {
399
+ * globalInts: 1,
400
+ * globalByteSlices: 2,
401
+ * localInts: 3,
402
+ * localByteSlices: 4
403
+ * },
404
+ * extraProgramPages: 1,
405
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
406
+ * args: [new Uint8Array(1, 2, 3, 4)]
407
+ * accountReferences: ["ACCOUNT_1"]
408
+ * appReferences: [123n, 1234n]
409
+ * assetReferences: [12345n]
410
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
411
+ * lease: 'lease',
412
+ * note: 'note',
413
+ * // You wouldn't normally set this field
414
+ * firstValidRound: 1000n,
415
+ * validityWindow: 10,
416
+ * extraFee: (1000).microAlgo(),
417
+ * staticFee: (1000).microAlgo(),
418
+ * // Max fee doesn't make sense with extraFee AND staticFee
419
+ * // already specified, but here for completeness
420
+ * maxFee: (3000).microAlgo(),
421
+ * // Signer only needed if you want to provide one,
422
+ * // generally you'd register it with AlgorandClient
423
+ * // against the sender and not need to pass it in
424
+ * signer: transactionSigner,
425
+ * maxRoundsToWaitForConfirmation: 5,
426
+ * suppressLog: true,
427
+ *})
428
+ * ```
429
+ */
430
+ this.appCreate = this._sendAppCreateCall((c) => c.addAppCreate, {
431
+ postLog: (params, result) => `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,
432
+ });
433
+ /**
434
+ * Update a smart contract.
435
+ *
436
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
437
+ *
438
+ * @param params The parameters for the app update transaction
439
+ * @example Basic example
440
+ * ```typescript
441
+ * await algorand.send.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
442
+ * ```
443
+ * @example Advanced example
444
+ * ```typescript
445
+ * await algorand.send.appUpdate({
446
+ * sender: 'CREATORADDRESS',
447
+ * approvalProgram: "TEALCODE",
448
+ * clearStateProgram: "TEALCODE",
449
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
450
+ * args: [new Uint8Array(1, 2, 3, 4)]
451
+ * accountReferences: ["ACCOUNT_1"]
452
+ * appReferences: [123n, 1234n]
453
+ * assetReferences: [12345n]
454
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
455
+ * lease: 'lease',
456
+ * note: 'note',
457
+ * // You wouldn't normally set this field
458
+ * firstValidRound: 1000n,
459
+ * validityWindow: 10,
460
+ * extraFee: (1000).microAlgo(),
461
+ * staticFee: (1000).microAlgo(),
462
+ * // Max fee doesn't make sense with extraFee AND staticFee
463
+ * // already specified, but here for completeness
464
+ * maxFee: (3000).microAlgo(),
465
+ * // Signer only needed if you want to provide one,
466
+ * // generally you'd register it with AlgorandClient
467
+ * // against the sender and not need to pass it in
468
+ * signer: transactionSigner,
469
+ * maxRoundsToWaitForConfirmation: 5,
470
+ * suppressLog: true,
471
+ *})
472
+ * ```
473
+ */
474
+ this.appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, {
475
+ postLog: (params, result) => `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
476
+ });
477
+ /**
478
+ * Delete a smart contract.
479
+ *
480
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
481
+ *
482
+ * @param params The parameters for the app deletion transaction
483
+ * @example Basic example
484
+ * ```typescript
485
+ * await algorand.send.appDelete({ sender: 'CREATORADDRESS' })
486
+ * ```
487
+ * @example Advanced example
488
+ * ```typescript
489
+ * await algorand.send.appDelete({
490
+ * sender: 'CREATORADDRESS',
491
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
492
+ * args: [new Uint8Array(1, 2, 3, 4)]
493
+ * accountReferences: ["ACCOUNT_1"]
494
+ * appReferences: [123n, 1234n]
495
+ * assetReferences: [12345n]
496
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
497
+ * lease: 'lease',
498
+ * note: 'note',
499
+ * // You wouldn't normally set this field
500
+ * firstValidRound: 1000n,
501
+ * validityWindow: 10,
502
+ * extraFee: (1000).microAlgo(),
503
+ * staticFee: (1000).microAlgo(),
504
+ * // Max fee doesn't make sense with extraFee AND staticFee
505
+ * // already specified, but here for completeness
506
+ * maxFee: (3000).microAlgo(),
507
+ * // Signer only needed if you want to provide one,
508
+ * // generally you'd register it with AlgorandClient
509
+ * // against the sender and not need to pass it in
510
+ * signer: transactionSigner,
511
+ * maxRoundsToWaitForConfirmation: 5,
512
+ * suppressLog: true,
513
+ *})
514
+ * ```
515
+ */
516
+ this.appDelete = this._sendAppCall((c) => c.addAppDelete, {
517
+ postLog: (params, result) => `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
518
+ });
375
519
  /**
376
520
  * Call a smart contract.
377
521
  *
378
- * Note: you may prefer to use `algorandClient.client` to get an app client for more advanced functionality.
522
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
523
+ *
524
+ * @param params The parameters for the app call transaction
525
+ * @example Basic example
526
+ * ```typescript
527
+ * await algorand.send.appCall({ sender: 'CREATORADDRESS' })
528
+ * ```
529
+ * @example Advanced example
530
+ * ```typescript
531
+ * await algorand.send.appCall({
532
+ * sender: 'CREATORADDRESS',
533
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
534
+ * args: [new Uint8Array(1, 2, 3, 4)]
535
+ * accountReferences: ["ACCOUNT_1"]
536
+ * appReferences: [123n, 1234n]
537
+ * assetReferences: [12345n]
538
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
539
+ * lease: 'lease',
540
+ * note: 'note',
541
+ * // You wouldn't normally set this field
542
+ * firstValidRound: 1000n,
543
+ * validityWindow: 10,
544
+ * extraFee: (1000).microAlgo(),
545
+ * staticFee: (1000).microAlgo(),
546
+ * // Max fee doesn't make sense with extraFee AND staticFee
547
+ * // already specified, but here for completeness
548
+ * maxFee: (3000).microAlgo(),
549
+ * // Signer only needed if you want to provide one,
550
+ * // generally you'd register it with AlgorandClient
551
+ * // against the sender and not need to pass it in
552
+ * signer: transactionSigner,
553
+ * maxRoundsToWaitForConfirmation: 5,
554
+ * suppressLog: true,
555
+ *})
556
+ * ```
379
557
  */
380
- this.appCall = this._send((c) => c.addAppCall);
558
+ this.appCall = this._sendAppCall((c) => c.addAppCall, {
559
+ postLog: (params, result) => `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
560
+ });
381
561
  /**
382
- * Call a smart contract ABI method.
562
+ * Create a smart contract via an ABI method.
563
+ *
564
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
383
565
  *
384
- * Note: you may prefer to use `algorandClient.client` to get an app client for more advanced functionality.
566
+ * @param params The parameters for the app creation transaction
567
+ * @example Basic example
568
+ * ```typescript
569
+ * const method = new ABIMethod({
570
+ * name: 'method',
571
+ * args: [{ name: 'arg1', type: 'string' }],
572
+ * returns: { type: 'string' },
573
+ * })
574
+ * const result = await algorand.send.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
575
+ * const createdAppId = result.appId
576
+ * ```
577
+ * @example Advanced example
578
+ * ```typescript
579
+ * const method = new ABIMethod({
580
+ * name: 'method',
581
+ * args: [{ name: 'arg1', type: 'string' }],
582
+ * returns: { type: 'string' },
583
+ * })
584
+ * await algorand.send.appCreate({
585
+ * sender: 'CREATORADDRESS',
586
+ * method: method,
587
+ * args: ["arg1_value"],
588
+ * approvalProgram: "TEALCODE",
589
+ * clearStateProgram: "TEALCODE",
590
+ * schema: {
591
+ * globalInts: 1,
592
+ * globalByteSlices: 2,
593
+ * localInts: 3,
594
+ * localByteSlices: 4
595
+ * },
596
+ * extraProgramPages: 1,
597
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
598
+ * args: [new Uint8Array(1, 2, 3, 4)]
599
+ * accountReferences: ["ACCOUNT_1"]
600
+ * appReferences: [123n, 1234n]
601
+ * assetReferences: [12345n]
602
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
603
+ * lease: 'lease',
604
+ * note: 'note',
605
+ * // You wouldn't normally set this field
606
+ * firstValidRound: 1000n,
607
+ * validityWindow: 10,
608
+ * extraFee: (1000).microAlgo(),
609
+ * staticFee: (1000).microAlgo(),
610
+ * // Max fee doesn't make sense with extraFee AND staticFee
611
+ * // already specified, but here for completeness
612
+ * maxFee: (3000).microAlgo(),
613
+ * // Signer only needed if you want to provide one,
614
+ * // generally you'd register it with AlgorandClient
615
+ * // against the sender and not need to pass it in
616
+ * signer: transactionSigner,
617
+ * maxRoundsToWaitForConfirmation: 5,
618
+ * suppressLog: true,
619
+ *})
620
+ * ```
385
621
  */
386
- this.methodCall = this._send((c) => c.addMethodCall);
622
+ this.appCreateMethodCall = this._sendAppCreateCall((c) => c.addAppCreateMethodCall, {
623
+ postLog: (params, result) => `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,
624
+ });
625
+ /**
626
+ * Update a smart contract via an ABI method.
627
+ *
628
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
629
+ *
630
+ * @param params The parameters for the app update transaction
631
+ * @example Basic example
632
+ * ```typescript
633
+ * const method = new ABIMethod({
634
+ * name: 'method',
635
+ * args: [{ name: 'arg1', type: 'string' }],
636
+ * returns: { type: 'string' },
637
+ * })
638
+ * await algorand.send.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
639
+ * ```
640
+ * @example Advanced example
641
+ * ```typescript
642
+ * const method = new ABIMethod({
643
+ * name: 'method',
644
+ * args: [{ name: 'arg1', type: 'string' }],
645
+ * returns: { type: 'string' },
646
+ * })
647
+ * await algorand.send.appUpdateMethodCall({
648
+ * sender: 'CREATORADDRESS',
649
+ * method: method,
650
+ * args: ["arg1_value"],
651
+ * approvalProgram: "TEALCODE",
652
+ * clearStateProgram: "TEALCODE",
653
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
654
+ * args: [new Uint8Array(1, 2, 3, 4)]
655
+ * accountReferences: ["ACCOUNT_1"]
656
+ * appReferences: [123n, 1234n]
657
+ * assetReferences: [12345n]
658
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
659
+ * lease: 'lease',
660
+ * note: 'note',
661
+ * // You wouldn't normally set this field
662
+ * firstValidRound: 1000n,
663
+ * validityWindow: 10,
664
+ * extraFee: (1000).microAlgo(),
665
+ * staticFee: (1000).microAlgo(),
666
+ * // Max fee doesn't make sense with extraFee AND staticFee
667
+ * // already specified, but here for completeness
668
+ * maxFee: (3000).microAlgo(),
669
+ * // Signer only needed if you want to provide one,
670
+ * // generally you'd register it with AlgorandClient
671
+ * // against the sender and not need to pass it in
672
+ * signer: transactionSigner,
673
+ * maxRoundsToWaitForConfirmation: 5,
674
+ * suppressLog: true,
675
+ *})
676
+ * ```
677
+ */
678
+ this.appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, {
679
+ postLog: (params, result) => `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
680
+ });
681
+ /**
682
+ * Delete a smart contract via an ABI method.
683
+ *
684
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
685
+ *
686
+ * @param params The parameters for the app deletion transaction
687
+ * @example Basic example
688
+ * ```typescript
689
+ * const method = new ABIMethod({
690
+ * name: 'method',
691
+ * args: [{ name: 'arg1', type: 'string' }],
692
+ * returns: { type: 'string' },
693
+ * })
694
+ * await algorand.send.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
695
+ * ```
696
+ * @example Advanced example
697
+ * ```typescript
698
+ * const method = new ABIMethod({
699
+ * name: 'method',
700
+ * args: [{ name: 'arg1', type: 'string' }],
701
+ * returns: { type: 'string' },
702
+ * })
703
+ * await algorand.send.appDeleteMethodCall({
704
+ * sender: 'CREATORADDRESS',
705
+ * method: method,
706
+ * args: ["arg1_value"],
707
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
708
+ * args: [new Uint8Array(1, 2, 3, 4)]
709
+ * accountReferences: ["ACCOUNT_1"]
710
+ * appReferences: [123n, 1234n]
711
+ * assetReferences: [12345n]
712
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
713
+ * lease: 'lease',
714
+ * note: 'note',
715
+ * // You wouldn't normally set this field
716
+ * firstValidRound: 1000n,
717
+ * validityWindow: 10,
718
+ * extraFee: (1000).microAlgo(),
719
+ * staticFee: (1000).microAlgo(),
720
+ * // Max fee doesn't make sense with extraFee AND staticFee
721
+ * // already specified, but here for completeness
722
+ * maxFee: (3000).microAlgo(),
723
+ * // Signer only needed if you want to provide one,
724
+ * // generally you'd register it with AlgorandClient
725
+ * // against the sender and not need to pass it in
726
+ * signer: transactionSigner,
727
+ * maxRoundsToWaitForConfirmation: 5,
728
+ * suppressLog: true,
729
+ *})
730
+ * ```
731
+ */
732
+ this.appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, {
733
+ postLog: (params, result) => `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
734
+ });
735
+ /**
736
+ * Call a smart contract via an ABI method.
737
+ *
738
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
739
+ *
740
+ * @param params The parameters for the app call transaction
741
+ * @example Basic example
742
+ * ```typescript
743
+ * const method = new ABIMethod({
744
+ * name: 'method',
745
+ * args: [{ name: 'arg1', type: 'string' }],
746
+ * returns: { type: 'string' },
747
+ * })
748
+ * await algorand.send.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
749
+ * ```
750
+ * @example Advanced example
751
+ * ```typescript
752
+ * const method = new ABIMethod({
753
+ * name: 'method',
754
+ * args: [{ name: 'arg1', type: 'string' }],
755
+ * returns: { type: 'string' },
756
+ * })
757
+ * await algorand.send.appCallMethodCall({
758
+ * sender: 'CREATORADDRESS',
759
+ * method: method,
760
+ * args: ["arg1_value"],
761
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
762
+ * args: [new Uint8Array(1, 2, 3, 4)]
763
+ * accountReferences: ["ACCOUNT_1"]
764
+ * appReferences: [123n, 1234n]
765
+ * assetReferences: [12345n]
766
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
767
+ * lease: 'lease',
768
+ * note: 'note',
769
+ * // You wouldn't normally set this field
770
+ * firstValidRound: 1000n,
771
+ * validityWindow: 10,
772
+ * extraFee: (1000).microAlgo(),
773
+ * staticFee: (1000).microAlgo(),
774
+ * // Max fee doesn't make sense with extraFee AND staticFee
775
+ * // already specified, but here for completeness
776
+ * maxFee: (3000).microAlgo(),
777
+ * // Signer only needed if you want to provide one,
778
+ * // generally you'd register it with AlgorandClient
779
+ * // against the sender and not need to pass it in
780
+ * signer: transactionSigner,
781
+ * maxRoundsToWaitForConfirmation: 5,
782
+ * suppressLog: true,
783
+ *})
784
+ * ```
785
+ */
786
+ this.appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, {
787
+ postLog: (params, result) => `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
788
+ });
387
789
  /** Register an online key. */
388
790
  this.onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, {
389
791
  preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txID()}`,
390
792
  });
391
793
  this._newGroup = newGroup;
392
794
  this._assetManager = assetManager;
795
+ this._appManager = appManager;
796
+ }
797
+ newGroup() {
798
+ return this._newGroup();
393
799
  }
394
800
  _send(c, log) {
395
801
  return async (params) => {
@@ -400,12 +806,12 @@ class AlgorandClientTransactionSender {
400
806
  const transaction = (await composer.build()).transactions.at(-1).txn;
401
807
  Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction));
402
808
  }
403
- const rawResult = await composer.execute(params);
809
+ const rawResult = await composer.send(params);
404
810
  const result = {
405
811
  // Last item covers when a group is created by an app call with ABI transaction parameters
406
- transaction: rawResult.transactions[rawResult.transactions.length - 1],
407
- confirmation: rawResult.confirmations[rawResult.confirmations.length - 1],
408
- txId: rawResult.txIds[0],
812
+ transaction: rawResult.transactions.at(-1),
813
+ confirmation: rawResult.confirmations.at(-1),
814
+ txId: rawResult.txIds.at(-1),
409
815
  ...rawResult,
410
816
  };
411
817
  if (log?.postLog) {
@@ -414,6 +820,30 @@ class AlgorandClientTransactionSender {
414
820
  return result;
415
821
  };
416
822
  }
823
+ _sendAppCall(c, log) {
824
+ return async (params) => {
825
+ const result = await this._send(c, log)(params);
826
+ return { ...result, return: AppManager.getABIReturn(result.confirmation, 'method' in params ? params.method : undefined) };
827
+ };
828
+ }
829
+ _sendAppUpdateCall(c, log) {
830
+ return async (params) => {
831
+ const result = await this._sendAppCall(c, log)(params);
832
+ const compiledApproval = typeof params.approvalProgram === 'string' ? this._appManager.getCompilationResult(params.approvalProgram) : undefined;
833
+ const compiledClear = typeof params.clearStateProgram === 'string' ? this._appManager.getCompilationResult(params.clearStateProgram) : undefined;
834
+ return { ...result, compiledApproval, compiledClear };
835
+ };
836
+ }
837
+ _sendAppCreateCall(c, log) {
838
+ return async (params) => {
839
+ const result = await this._sendAppUpdateCall(c, log)(params);
840
+ return {
841
+ ...result,
842
+ appId: BigInt(result.confirmation.applicationIndex),
843
+ appAddress: algosdk.getApplicationAddress(result.confirmation.applicationIndex),
844
+ };
845
+ };
846
+ }
417
847
  }
418
848
 
419
849
  export { AlgorandClientTransactionSender };