@algorandfoundation/algokit-utils 6.2.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 (465) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -26
  3. package/account/account.d.ts +21 -11
  4. package/account/get-account-config-from-environment.d.ts +0 -1
  5. package/account/get-account.d.ts +6 -7
  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 +41 -9
  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 +10 -1
  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 +1 -2
  18. package/index.d.ts +8 -6
  19. package/index.js +61 -48
  20. package/index.js.map +1 -1
  21. package/index.mjs +27 -24
  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 +2 -3
  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 +5 -5
  31. package/{account → src/account}/account.js +38 -15
  32. package/src/account/account.js.map +1 -0
  33. package/{account → src/account}/account.mjs +39 -16
  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 +5 -5
  38. package/src/account/get-account.js.map +1 -0
  39. package/{account → src/account}/get-account.mjs +5 -5
  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/src/amount.js +61 -0
  50. package/src/amount.js.map +1 -0
  51. package/src/amount.mjs +54 -0
  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/src/asset.js +142 -0
  66. package/src/asset.js.map +1 -0
  67. package/src/asset.mjs +136 -0
  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} +3 -3
  78. package/src/dispenser-client.js.map +1 -0
  79. package/{dispenser-client.mjs → src/dispenser-client.mjs} +3 -3
  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 +4 -4
  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 +4 -4
  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 +16 -4
  106. package/src/testing/account.js.map +1 -0
  107. package/{testing → src/testing}/account.mjs +17 -5
  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 +18 -14
  112. package/src/testing/fixtures/algorand-fixture.js.map +1 -0
  113. package/{testing → src/testing}/fixtures/algorand-fixture.mjs +18 -14
  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 +221 -141
  132. package/src/transaction/transaction.js.map +1 -0
  133. package/{transaction → src/transaction}/transaction.mjs +222 -142
  134. package/src/transaction/transaction.mjs.map +1 -0
  135. package/src/transfer/transfer-algos.js +31 -0
  136. package/src/transfer/transfer-algos.js.map +1 -0
  137. package/src/transfer/transfer-algos.mjs +29 -0
  138. package/src/transfer/transfer-algos.mjs.map +1 -0
  139. package/src/transfer/transfer.js +112 -0
  140. package/src/transfer/transfer.js.map +1 -0
  141. package/src/transfer/transfer.mjs +108 -0
  142. package/src/transfer/transfer.mjs.map +1 -0
  143. package/{util.js → src/util.js} +33 -7
  144. package/src/util.js.map +1 -0
  145. package/{util.mjs → src/util.mjs} +31 -7
  146. package/src/util.mjs.map +1 -0
  147. package/testing/_asset.d.ts +3 -5
  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 +1 -2
  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 +35 -0
  160. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -2
  161. package/transaction/transaction.d.ts +39 -20
  162. package/transfer/index.d.ts +0 -1
  163. package/transfer/transfer-algos.d.ts +4 -3
  164. package/transfer/transfer.d.ts +8 -2
  165. package/types/account-manager.d.ts +165 -40
  166. package/types/account-manager.js +255 -59
  167. package/types/account-manager.js.map +1 -1
  168. package/types/account-manager.mjs +255 -59
  169. package/types/account-manager.mjs.map +1 -1
  170. package/types/account.d.ts +137 -14
  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 +718 -0
  186. package/types/algorand-client-transaction-creator.js +683 -0
  187. package/types/algorand-client-transaction-creator.js.map +1 -0
  188. package/types/algorand-client-transaction-creator.mjs +681 -0
  189. package/types/algorand-client-transaction-creator.mjs.map +1 -0
  190. package/types/algorand-client-transaction-sender.d.ts +1158 -0
  191. package/types/algorand-client-transaction-sender.js +852 -0
  192. package/types/algorand-client-transaction-sender.js.map +1 -0
  193. package/types/algorand-client-transaction-sender.mjs +850 -0
  194. package/types/algorand-client-transaction-sender.mjs.map +1 -0
  195. package/types/algorand-client.d.ts +48 -91
  196. package/types/algorand-client.js +53 -132
  197. package/types/algorand-client.js.map +1 -1
  198. package/types/algorand-client.mjs +55 -131
  199. package/types/algorand-client.mjs.map +1 -1
  200. package/types/amount.d.ts +23 -12
  201. package/types/amount.js +33 -10
  202. package/types/amount.js.map +1 -1
  203. package/types/amount.mjs +33 -10
  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 +1511 -15
  211. package/types/app-client.js +1029 -43
  212. package/types/app-client.js.map +1 -1
  213. package/types/app-client.mjs +1030 -45
  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 +205 -0
  241. package/types/asset-manager.js +176 -0
  242. package/types/asset-manager.js.map +1 -0
  243. package/types/asset-manager.mjs +174 -0
  244. package/types/asset-manager.mjs.map +1 -0
  245. package/types/asset.d.ts +4 -5
  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 +171 -58
  252. package/types/client-manager.js +198 -43
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +199 -44
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +474 -132
  257. package/types/composer.js +461 -167
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +461 -168
  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 +14 -6
  272. package/types/dispenser-client.js +19 -14
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +19 -14
  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 +5 -6
  285. package/types/kmd-account-manager.js +9 -9
  286. package/types/kmd-account-manager.js.map +1 -1
  287. package/types/kmd-account-manager.mjs +10 -10
  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 +21 -3
  303. package/types/network-client.js +10 -0
  304. package/types/network-client.js.map +1 -1
  305. package/types/network-client.mjs +9 -0
  306. package/types/network-client.mjs.map +1 -1
  307. package/types/testing.d.ts +9 -11
  308. package/types/transaction.d.ts +17 -4
  309. package/types/transfer.d.ts +8 -8
  310. package/util.d.ts +15 -2
  311. package/account/account.d.ts.map +0 -1
  312. package/account/account.js.map +0 -1
  313. package/account/account.mjs.map +0 -1
  314. package/account/get-account-config-from-environment.d.ts.map +0 -1
  315. package/account/get-account-config-from-environment.js.map +0 -1
  316. package/account/get-account-config-from-environment.mjs.map +0 -1
  317. package/account/get-account.d.ts.map +0 -1
  318. package/account/get-account.js.map +0 -1
  319. package/account/get-account.mjs.map +0 -1
  320. package/account/get-dispenser-account.d.ts.map +0 -1
  321. package/account/get-dispenser-account.js.map +0 -1
  322. package/account/get-dispenser-account.mjs.map +0 -1
  323. package/account/index.d.ts.map +0 -1
  324. package/account/mnemonic-account.d.ts.map +0 -1
  325. package/account/mnemonic-account.js.map +0 -1
  326. package/account/mnemonic-account.mjs.map +0 -1
  327. package/amount.d.ts.map +0 -1
  328. package/amount.js +0 -34
  329. package/amount.js.map +0 -1
  330. package/amount.mjs +0 -30
  331. package/amount.mjs.map +0 -1
  332. package/app-client.d.ts.map +0 -1
  333. package/app-client.js.map +0 -1
  334. package/app-client.mjs.map +0 -1
  335. package/app-deploy.d.ts.map +0 -1
  336. package/app-deploy.js +0 -468
  337. package/app-deploy.js.map +0 -1
  338. package/app-deploy.mjs +0 -459
  339. package/app-deploy.mjs.map +0 -1
  340. package/app.d.ts.map +0 -1
  341. package/app.js +0 -599
  342. package/app.js.map +0 -1
  343. package/app.mjs +0 -579
  344. package/app.mjs.map +0 -1
  345. package/asset.d.ts.map +0 -1
  346. package/asset.js +0 -272
  347. package/asset.js.map +0 -1
  348. package/asset.mjs +0 -266
  349. package/asset.mjs.map +0 -1
  350. package/config.d.ts.map +0 -1
  351. package/config.js.map +0 -1
  352. package/config.mjs.map +0 -1
  353. package/debugging/debugging.d.ts.map +0 -1
  354. package/debugging/debugging.js +0 -139
  355. package/debugging/debugging.js.map +0 -1
  356. package/debugging/debugging.mjs +0 -118
  357. package/debugging/debugging.mjs.map +0 -1
  358. package/debugging/index.d.ts.map +0 -1
  359. package/debugging/simulate-and-persist-response.d.ts +0 -20
  360. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  361. package/debugging/simulate-and-persist-response.js +0 -108
  362. package/debugging/simulate-and-persist-response.js.map +0 -1
  363. package/debugging/simulate-and-persist-response.mjs +0 -89
  364. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  365. package/dispenser-client.d.ts.map +0 -1
  366. package/dispenser-client.js.map +0 -1
  367. package/dispenser-client.mjs.map +0 -1
  368. package/index.d.ts.map +0 -1
  369. package/indexer-lookup.d.ts.map +0 -1
  370. package/indexer-lookup.js.map +0 -1
  371. package/indexer-lookup.mjs.map +0 -1
  372. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  373. package/localnet/get-kmd-wallet-account.js.map +0 -1
  374. package/localnet/get-kmd-wallet-account.mjs.map +0 -1
  375. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  376. package/localnet/get-localnet-dispenser-account.js.map +0 -1
  377. package/localnet/get-localnet-dispenser-account.mjs.map +0 -1
  378. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  379. package/localnet/get-or-create-kmd-wallet-account.js.map +0 -1
  380. package/localnet/get-or-create-kmd-wallet-account.mjs.map +0 -1
  381. package/localnet/index.d.ts.map +0 -1
  382. package/localnet/is-localnet.d.ts.map +0 -1
  383. package/localnet/is-localnet.js.map +0 -1
  384. package/localnet/is-localnet.mjs.map +0 -1
  385. package/network-client.d.ts.map +0 -1
  386. package/network-client.js.map +0 -1
  387. package/network-client.mjs.map +0 -1
  388. package/testing/_asset.d.ts.map +0 -1
  389. package/testing/account.d.ts.map +0 -1
  390. package/testing/account.js.map +0 -1
  391. package/testing/account.mjs.map +0 -1
  392. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  393. package/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
  394. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +0 -1
  395. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  396. package/testing/fixtures/algorand-fixture.js.map +0 -1
  397. package/testing/fixtures/algorand-fixture.mjs.map +0 -1
  398. package/testing/fixtures/index.d.ts.map +0 -1
  399. package/testing/index.d.ts.map +0 -1
  400. package/testing/indexer.d.ts.map +0 -1
  401. package/testing/indexer.js.map +0 -1
  402. package/testing/indexer.mjs.map +0 -1
  403. package/testing/test-logger.d.ts.map +0 -1
  404. package/testing/test-logger.js.map +0 -1
  405. package/testing/test-logger.mjs.map +0 -1
  406. package/testing/transaction-logger.d.ts.map +0 -1
  407. package/testing/transaction-logger.js.map +0 -1
  408. package/testing/transaction-logger.mjs.map +0 -1
  409. package/transaction/index.d.ts.map +0 -1
  410. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  411. package/transaction/perform-atomic-transaction-composer-simulate.js.map +0 -1
  412. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +0 -1
  413. package/transaction/transaction.d.ts.map +0 -1
  414. package/transaction/transaction.js.map +0 -1
  415. package/transaction/transaction.mjs.map +0 -1
  416. package/transfer/index.d.ts.map +0 -1
  417. package/transfer/transfer-algos.d.ts.map +0 -1
  418. package/transfer/transfer-algos.js +0 -40
  419. package/transfer/transfer-algos.js.map +0 -1
  420. package/transfer/transfer-algos.mjs +0 -38
  421. package/transfer/transfer-algos.mjs.map +0 -1
  422. package/transfer/transfer.d.ts.map +0 -1
  423. package/transfer/transfer.js +0 -147
  424. package/transfer/transfer.js.map +0 -1
  425. package/transfer/transfer.mjs +0 -143
  426. package/transfer/transfer.mjs.map +0 -1
  427. package/types/account-manager.d.ts.map +0 -1
  428. package/types/account.d.ts.map +0 -1
  429. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  430. package/types/algorand-client.d.ts.map +0 -1
  431. package/types/amount.d.ts.map +0 -1
  432. package/types/app-client.d.ts.map +0 -1
  433. package/types/app-spec.d.ts.map +0 -1
  434. package/types/app.d.ts.map +0 -1
  435. package/types/asset.d.ts.map +0 -1
  436. package/types/client-manager.d.ts.map +0 -1
  437. package/types/composer.d.ts.map +0 -1
  438. package/types/config.d.ts.map +0 -1
  439. package/types/debugging.d.ts.map +0 -1
  440. package/types/dispenser-client.d.ts.map +0 -1
  441. package/types/indexer.d.ts.map +0 -1
  442. package/types/kmd-account-manager.d.ts.map +0 -1
  443. package/types/logging.d.ts.map +0 -1
  444. package/types/logic-error.d.ts.map +0 -1
  445. package/types/network-client.d.ts.map +0 -1
  446. package/types/testing.d.ts.map +0 -1
  447. package/types/transaction.d.ts.map +0 -1
  448. package/types/transfer.d.ts.map +0 -1
  449. package/types/urlTokenBaseHTTPClient.d.ts +0 -41
  450. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  451. package/types/urlTokenBaseHTTPClient.js +0 -153
  452. package/types/urlTokenBaseHTTPClient.js.map +0 -1
  453. package/types/urlTokenBaseHTTPClient.mjs +0 -151
  454. package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
  455. package/util.d.ts.map +0 -1
  456. package/util.js.map +0 -1
  457. package/util.mjs.map +0 -1
  458. /package/{account → src/account}/get-account-config-from-environment.js +0 -0
  459. /package/{account → src/account}/get-account-config-from-environment.mjs +0 -0
  460. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.js +0 -0
  461. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.mjs +0 -0
  462. /package/{testing → src/testing}/indexer.js +0 -0
  463. /package/{testing → src/testing}/indexer.mjs +0 -0
  464. /package/{testing → src/testing}/transaction-logger.js +0 -0
  465. /package/{testing → src/testing}/transaction-logger.mjs +0 -0
@@ -1,117 +1,277 @@
1
- import algosdk from 'algosdk';
1
+ import algosdk, { Address } from 'algosdk';
2
2
  import { TransactionSignerAccount } from './account';
3
3
  import { AlgoAmount } from './amount';
4
- import { SendAtomicTransactionComposerResults } from './transaction';
4
+ import { AppManager, BoxIdentifier, BoxReference } from './app-manager';
5
+ import { Expand } from './expand';
6
+ import { Arc2TransactionNote, SendAtomicTransactionComposerResults, SendParams } from './transaction';
5
7
  import Transaction = algosdk.Transaction;
8
+ import TransactionSigner = algosdk.TransactionSigner;
6
9
  import TransactionWithSigner = algosdk.TransactionWithSigner;
10
+ import SimulateResponse = algosdk.modelsv2.SimulateResponse;
11
+ import modelsv2 = algosdk.modelsv2;
12
+ export declare const MAX_TRANSACTION_GROUP_SIZE = 16;
13
+ /** Options to control a simulate request */
14
+ export type SimulateOptions = Expand<Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>> & {
15
+ /** Whether or not to skip signatures for all built transactions and use an empty signer instead. */
16
+ skipSignatures?: boolean;
17
+ };
7
18
  /** Common parameters for defining a transaction. */
8
19
  export type CommonTransactionParams = {
9
- /** The address sending the transaction */
10
- sender: string;
11
- /** The function used to sign transactions */
20
+ /** The address of the account sending the transaction. */
21
+ sender: string | Address;
22
+ /** The function used to sign transaction(s); if not specified then
23
+ * an attempt will be made to find a registered signer for the
24
+ * given `sender` or use a default signer (if configured).
25
+ */
12
26
  signer?: algosdk.TransactionSigner | TransactionSignerAccount;
13
- /** Change the signing key of the sender to the given address */
14
- rekeyTo?: string;
15
- /** Note to attach to the transaction*/
27
+ /** Change the signing key of the sender to the given address.
28
+ *
29
+ * **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/).
30
+ */
31
+ rekeyTo?: string | Address;
32
+ /** Note to attach to the transaction. Max of 1000 bytes. */
16
33
  note?: Uint8Array | string;
17
- /** Prevent multiple transactions with the same lease being included within the validity window */
34
+ /** Prevent multiple transactions with the same lease being included within the validity window.
35
+ *
36
+ * A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/)
37
+ * enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
38
+ */
18
39
  lease?: Uint8Array | string;
19
- /** The transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction */
40
+ /** The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction. */
20
41
  staticFee?: AlgoAmount;
21
- /** The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees */
42
+ /** The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees. */
22
43
  extraFee?: AlgoAmount;
23
- /** Throw an error if the fee for the transaction is more than this amount */
44
+ /** Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. */
24
45
  maxFee?: AlgoAmount;
25
- /** How many rounds the transaction should be valid for */
26
- validityWindow?: number;
46
+ /** How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. */
47
+ validityWindow?: number | bigint;
27
48
  /**
28
49
  * Set the first round this transaction is valid.
29
50
  * If left undefined, the value from algod will be used.
30
- * Only set this when you intentionally want this to be some time in the future
51
+ *
52
+ * We recommend you only set this when you intentionally want this to be some time in the future.
31
53
  */
32
54
  firstValidRound?: bigint;
33
- /** The last round this transaction is valid. It is recommended to use validityWindow instead */
55
+ /** The last round this transaction is valid. It is recommended to use `validityWindow` instead. */
34
56
  lastValidRound?: bigint;
35
57
  };
36
58
  /** Parameters to define a payment transaction. */
37
59
  export type PaymentParams = CommonTransactionParams & {
38
- /** That account that will receive the ALGO */
39
- receiver: string;
60
+ /** The address of the account that will receive the Algo */
61
+ receiver: string | Address;
40
62
  /** Amount to send */
41
63
  amount: AlgoAmount;
42
- /** If given, close the sender account and send the remaining balance to this address */
43
- closeRemainderTo?: string;
64
+ /** If given, close the sender account and send the remaining balance to this address
65
+ *
66
+ * *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly.
67
+ */
68
+ closeRemainderTo?: string | Address;
44
69
  };
45
- /** Parameters to define an asset create transaction. */
70
+ /** Parameters to define an asset create transaction.
71
+ *
72
+ * The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.
73
+ */
46
74
  export type AssetCreateParams = CommonTransactionParams & {
47
- /** The total amount of the smallest divisible unit to create */
75
+ /** The total amount of the smallest divisible (decimal) unit to create.
76
+ *
77
+ * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.
78
+ *
79
+ * This field can only be specified upon asset creation.
80
+ */
48
81
  total: bigint;
49
- /** The amount of decimal places the asset should have */
82
+ /** The amount of decimal places the asset should have.
83
+ *
84
+ * If unspecified then the asset will be in whole units (i.e. `0`).
85
+ *
86
+ * * If 0, the asset is not divisible;
87
+ * * If 1, the base unit of the asset is in tenths;
88
+ * * If 2, the base unit of the asset is in hundredths;
89
+ * * If 3, the base unit of the asset is in thousandths;
90
+ * * and so on up to 19 decimal places.
91
+ *
92
+ * This field can only be specified upon asset creation.
93
+ */
50
94
  decimals?: number;
51
- /** Whether the asset is frozen by default in the creator address */
52
- defaultFrozen?: boolean;
53
- /** The address that can change the manager, reserve, clawback, and freeze addresses. There will permanently be no manager if undefined or an empty string */
54
- manager?: string;
55
- /** The address that holds the uncirculated supply */
56
- reserve?: string;
57
- /** The address that can freeze the asset in any account. Freezing will be permanently disabled if undefined or an empty string. */
58
- freeze?: string;
59
- /** The address that can clawback the asset from any account. Clawback will be permanently disabled if undefined or an empty string. */
60
- clawback?: string;
61
- /** The short ticker name for the asset */
62
- unitName?: string;
63
- /** The full name of the asset */
95
+ /** The optional name of the asset.
96
+ *
97
+ * Max size is 32 bytes.
98
+ *
99
+ * This field can only be specified upon asset creation.
100
+ */
64
101
  assetName?: string;
65
- /** The metadata URL for the asset */
102
+ /** The optional name of the unit of this asset (e.g. ticker name).
103
+ *
104
+ * Max size is 8 bytes.
105
+ *
106
+ * This field can only be specified upon asset creation.
107
+ */
108
+ unitName?: string;
109
+ /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).
110
+ *
111
+ * Max size is 96 bytes.
112
+ *
113
+ * This field can only be specified upon asset creation.
114
+ */
66
115
  url?: string;
67
- /** Hash of the metadata contained in the metadata URL */
68
- metadataHash?: Uint8Array;
116
+ /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.
117
+ *
118
+ * The format of this metadata is up to the application.
119
+ *
120
+ * This field can only be specified upon asset creation.
121
+ */
122
+ metadataHash?: string | Uint8Array;
123
+ /** Whether the asset is frozen by default for all accounts.
124
+ * Defaults to `false`.
125
+ *
126
+ * If `true` then for anyone apart from the creator to hold the
127
+ * asset it needs to be unfrozen per account using an asset freeze
128
+ * transaction from the `freeze` account, which must be set on creation.
129
+ *
130
+ * This field can only be specified upon asset creation.
131
+ */
132
+ defaultFrozen?: boolean;
133
+ /** The address of the optional account that can manage the configuration of the asset and destroy it.
134
+ *
135
+ * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
136
+ *
137
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.
138
+ */
139
+ manager?: string | Address;
140
+ /**
141
+ * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
142
+ *
143
+ * This address has no specific authority in the protocol itself and is informational only.
144
+ *
145
+ * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
146
+ * rely on this field to hold meaningful data.
147
+ *
148
+ * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
149
+ * of the asset reside in an account that is different from the default creator account.
150
+ *
151
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
152
+ */
153
+ reserve?: string | Address;
154
+ /**
155
+ * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
156
+ *
157
+ * If empty, freezing is not permitted.
158
+ *
159
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
160
+ */
161
+ freeze?: string | Address;
162
+ /**
163
+ * The address of the optional account that can clawback holdings of this asset from any account.
164
+ *
165
+ * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
166
+ *
167
+ * If empty, clawback is not permitted.
168
+ *
169
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
170
+ */
171
+ clawback?: string | Address;
69
172
  };
70
- /** Parameters to define an asset config transaction. */
173
+ /** Parameters to define an asset reconfiguration transaction.
174
+ *
175
+ * **Note:** The manager, reserve, freeze, and clawback addresses
176
+ * are immutably empty if they are not set. If manager is not set then
177
+ * all fields are immutable from that point forward.
178
+ */
71
179
  export type AssetConfigParams = CommonTransactionParams & {
72
- /** ID of the asset */
180
+ /** ID of the asset to reconfigure */
73
181
  assetId: bigint;
74
- /** The address that can change the manager, reserve, clawback, and freeze addresses. There will permanently be no manager if undefined or an empty string */
75
- manager?: string;
76
- /** The address that holds the uncirculated supply */
77
- reserve?: string;
78
- /** The address that can freeze the asset in any account. Freezing will be permanently disabled if undefined or an empty string. */
79
- freeze?: string;
80
- /** The address that can clawback the asset from any account. Clawback will be permanently disabled if undefined or an empty string. */
81
- clawback?: string;
182
+ /** The address of the optional account that can manage the configuration of the asset and destroy it.
183
+ *
184
+ * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
185
+ *
186
+ * If not set (`undefined` or `""`) the asset will become permanently immutable.
187
+ */
188
+ manager: string | Address | undefined;
189
+ /**
190
+ * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
191
+ *
192
+ * This address has no specific authority in the protocol itself and is informational only.
193
+ *
194
+ * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
195
+ * rely on this field to hold meaningful data.
196
+ *
197
+ * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
198
+ * of the asset reside in an account that is different from the default creator account.
199
+ *
200
+ * If not set (`undefined` or `""`) the field will become permanently empty.
201
+ */
202
+ reserve?: string | Address;
203
+ /**
204
+ * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
205
+ *
206
+ * If empty, freezing is not permitted.
207
+ *
208
+ * If not set (`undefined` or `""`) the field will become permanently empty.
209
+ */
210
+ freeze?: string | Address;
211
+ /**
212
+ * The address of the optional account that can clawback holdings of this asset from any account.
213
+ *
214
+ * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
215
+ *
216
+ * If empty, clawback is not permitted.
217
+ *
218
+ * If not set (`undefined` or `""`) the field will become permanently empty.
219
+ */
220
+ clawback?: string | Address;
82
221
  };
83
222
  /** Parameters to define an asset freeze transaction. */
84
223
  export type AssetFreezeParams = CommonTransactionParams & {
85
- /** The ID of the asset */
224
+ /** The ID of the asset to freeze/unfreeze */
86
225
  assetId: bigint;
87
- /** The account to freeze or unfreeze */
88
- account: string;
226
+ /** The address of the account to freeze or unfreeze */
227
+ account: string | Address;
89
228
  /** Whether the assets in the account should be frozen */
90
229
  frozen: boolean;
91
230
  };
92
- /** Parameters to define an asset destroy transaction. */
231
+ /** Parameters to define an asset destroy transaction.
232
+ *
233
+ * 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.
234
+ */
93
235
  export type AssetDestroyParams = CommonTransactionParams & {
94
- /** ID of the asset */
236
+ /** ID of the asset to destroy */
95
237
  assetId: bigint;
96
238
  };
97
239
  /** Parameters to define an asset transfer transaction. */
98
240
  export type AssetTransferParams = CommonTransactionParams & {
99
- /** ID of the asset */
241
+ /** ID of the asset to transfer. */
100
242
  assetId: bigint;
101
- /** Amount of the asset to transfer (smallest divisible unit) */
243
+ /** Amount of the asset to transfer (in smallest divisible (decimal) units). */
102
244
  amount: bigint;
103
- /** The account to send the asset to */
104
- receiver: string;
105
- /** The account to take the asset from */
106
- clawbackTarget?: string;
107
- /** The account to close the asset to */
108
- closeAssetTo?: string;
245
+ /** The address of the account that will receive the asset unit(s). */
246
+ receiver: string | Address;
247
+ /** Optional address of an account to clawback the asset from.
248
+ *
249
+ * Requires the sender to be the clawback account.
250
+ *
251
+ * **Warning:** Be careful with this parameter as it can lead to unexpected loss of funds if not used correctly.
252
+ */
253
+ clawbackTarget?: string | Address;
254
+ /** Optional address of an account to close the asset position to.
255
+ *
256
+ * **Warning:** Be careful with this parameter as it can lead to loss of funds if not used correctly.
257
+ */
258
+ closeAssetTo?: string | Address;
109
259
  };
110
260
  /** Parameters to define an asset opt-in transaction. */
111
261
  export type AssetOptInParams = CommonTransactionParams & {
112
- /** ID of the asset */
262
+ /** ID of the asset that will be opted-in to. */
113
263
  assetId: bigint;
114
264
  };
265
+ /** Parameters to define an asset opt-out transaction. */
266
+ export type AssetOptOutParams = CommonTransactionParams & {
267
+ /** ID of the asset that will be opted-out of. */
268
+ assetId: bigint;
269
+ /**
270
+ * The address of the asset creator account to close the asset
271
+ * position to (any remaining asset units will be sent to this account).
272
+ */
273
+ creator: string | Address;
274
+ };
115
275
  /** Parameters to define an online key registration transaction. */
116
276
  export type OnlineKeyRegistrationParams = CommonTransactionParams & {
117
277
  /** The root participation public key */
@@ -127,82 +287,153 @@ export type OnlineKeyRegistrationParams = CommonTransactionParams & {
127
287
  /** The 64 byte state proof public key commitment */
128
288
  stateProofKey?: Uint8Array;
129
289
  };
130
- /** Parameters to define an application call transaction. */
131
- export type AppCallParams = CommonTransactionParams & {
132
- /** The [OnComplete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) */
290
+ /** Common parameters for defining an application call transaction. */
291
+ export type CommonAppCallParams = CommonTransactionParams & {
292
+ /** ID of the application; 0 if the application is being created. */
293
+ appId: bigint;
294
+ /** The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. */
133
295
  onComplete?: algosdk.OnApplicationComplete;
134
- /** ID of the application */
135
- appId?: bigint;
136
- /** The program to execute for all OnCompletes other than ClearState */
137
- approvalProgram?: Uint8Array;
138
- /** The program to execute for ClearState OnComplete */
139
- clearProgram?: Uint8Array;
140
- /** The state schema for the app. This is immutable. */
296
+ /** Any [arguments to pass to the smart contract call](https://developer.algorand.org/docs/get-details/dapps/avm/teal/#argument-passing). */
297
+ args?: Uint8Array[];
298
+ /** Any account addresses to add to the [accounts array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
299
+ accountReferences?: (string | Address)[];
300
+ /** 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). */
301
+ appReferences?: bigint[];
302
+ /** 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). */
303
+ assetReferences?: bigint[];
304
+ /** Any boxes to load to the [boxes array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays).
305
+ *
306
+ * Either the name identifier (which will be set against app ID of `0` i.e.
307
+ * the current app), or a box identifier with the name identifier and app ID.
308
+ */
309
+ boxReferences?: (BoxReference | BoxIdentifier)[];
310
+ };
311
+ /** Parameters to define an app create transaction */
312
+ export type AppCreateParams = Expand<Omit<CommonAppCallParams, 'appId'> & {
313
+ onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.ClearStateOC>;
314
+ /** 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)). */
315
+ approvalProgram: string | Uint8Array;
316
+ /** The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
317
+ clearStateProgram: string | Uint8Array;
318
+ /** The state schema for the app. This is immutable once the app is created. */
141
319
  schema?: {
142
- /** The number of integers saved in global state */
143
- globalUints: number;
144
- /** The number of byte slices saved in global state */
320
+ /** The number of integers saved in global state. */
321
+ globalInts: number;
322
+ /** The number of byte slices saved in global state. */
145
323
  globalByteSlices: number;
146
- /** The number of integers saved in local state */
147
- localUints: number;
148
- /** The number of byte slices saved in local state */
324
+ /** The number of integers saved in local state. */
325
+ localInts: number;
326
+ /** The number of byte slices saved in local state. */
149
327
  localByteSlices: number;
150
328
  };
151
- /** Application arguments */
152
- args?: Uint8Array[];
153
- /** Account references */
154
- accountReferences?: string[];
155
- /** App references */
156
- appReferences?: bigint[];
157
- /** Asset references */
158
- assetReferences?: bigint[];
159
- /** Number of extra pages required for the programs */
160
- extraPages?: number;
161
- /** Box references */
162
- boxReferences?: algosdk.BoxReference[];
329
+ /** Number of extra pages required for the programs.
330
+ * Defaults to the number needed for the programs in this call if not specified.
331
+ * This is immutable once the app is created. */
332
+ extraProgramPages?: number;
333
+ }>;
334
+ /** Parameters to define an app update transaction */
335
+ export type AppUpdateParams = Expand<CommonAppCallParams & {
336
+ onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC;
337
+ /** 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
+ approvalProgram: string | Uint8Array;
339
+ /** The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
340
+ clearStateProgram: string | Uint8Array;
341
+ }>;
342
+ /** Parameters to define an application call transaction. */
343
+ export type AppCallParams = CommonAppCallParams & {
344
+ onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC>;
163
345
  };
164
- /** Parameters to define an ABI method application call transaction. */
165
- export type MethodCallParams = CommonTransactionParams & Omit<AppCallParams, 'args'> & {
166
- /** ID of the application */
167
- appId: bigint;
346
+ /** Common parameters to define an ABI method call transaction. */
347
+ export type AppMethodCallParams = CommonAppCallParams & {
348
+ onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC>;
349
+ };
350
+ /** Parameters to define an application delete call transaction. */
351
+ export type AppDeleteParams = CommonAppCallParams & {
352
+ onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC;
353
+ };
354
+ /** Parameters to define an ABI method call create transaction. */
355
+ export type AppCreateMethodCall = AppMethodCall<AppCreateParams>;
356
+ /** Parameters to define an ABI method call update transaction. */
357
+ export type AppUpdateMethodCall = AppMethodCall<AppUpdateParams>;
358
+ /** Parameters to define an ABI method call delete transaction. */
359
+ export type AppDeleteMethodCall = AppMethodCall<AppDeleteParams>;
360
+ /** Parameters to define an ABI method call transaction. */
361
+ export type AppCallMethodCall = AppMethodCall<AppMethodCallParams>;
362
+ /** Types that can be used to define a transaction argument for an ABI call transaction. */
363
+ export type AppMethodCallTransactionArgument = TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>;
364
+ /** Parameters to define an ABI method call. */
365
+ export type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {
168
366
  /** The ABI method to call */
169
367
  method: algosdk.ABIMethod;
170
368
  /** Arguments to the ABI method, either:
171
369
  * * An ABI value
172
370
  * * A transaction with explicit signer
173
371
  * * A transaction (where the signer will be automatically assigned)
174
- * * An unawaited transaction (e.g. from algorand.transactions.transactionType())
372
+ * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
175
373
  * * Another method call (via method call params object)
374
+ * * undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
176
375
  */
177
- args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | MethodCallParams)[];
376
+ args?: (algosdk.ABIValue | Address | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> | undefined)[];
178
377
  };
179
- /** Parameters to configure transaction execution. */
180
- export interface ExecuteParams {
181
- /** The number of rounds to wait for confirmation. By default until the latest lastValid has past. */
182
- maxRoundsToWaitForConfirmation?: number;
183
- /** Whether to suppress log messages from transaction send, default: do not suppress */
184
- suppressLog?: boolean;
185
- }
186
- /** Parameters to create an `AlgokitComposer`. */
187
- export type AlgokitComposerParams = {
378
+ export type Txn = (PaymentParams & {
379
+ type: 'pay';
380
+ }) | (AssetCreateParams & {
381
+ type: 'assetCreate';
382
+ }) | (AssetConfigParams & {
383
+ type: 'assetConfig';
384
+ }) | (AssetFreezeParams & {
385
+ type: 'assetFreeze';
386
+ }) | (AssetDestroyParams & {
387
+ type: 'assetDestroy';
388
+ }) | (AssetTransferParams & {
389
+ type: 'assetTransfer';
390
+ }) | (AssetOptInParams & {
391
+ type: 'assetOptIn';
392
+ }) | (AssetOptOutParams & {
393
+ type: 'assetOptOut';
394
+ }) | ((AppCallParams | AppCreateParams | AppUpdateParams) & {
395
+ type: 'appCall';
396
+ }) | (OnlineKeyRegistrationParams & {
397
+ type: 'keyReg';
398
+ }) | (algosdk.TransactionWithSigner & {
399
+ type: 'txnWithSigner';
400
+ }) | {
401
+ atc: algosdk.AtomicTransactionComposer;
402
+ type: 'atc';
403
+ } | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & {
404
+ type: 'methodCall';
405
+ });
406
+ /** Parameters to create an `TransactionComposer`. */
407
+ export type TransactionComposerParams = {
188
408
  /** The algod client to use to get suggestedParams and send the transaction group */
189
409
  algod: algosdk.Algodv2;
190
410
  /** The function used to get the TransactionSigner for a given address */
191
- getSigner: (address: string) => algosdk.TransactionSigner;
411
+ getSigner: (address: string | Address) => algosdk.TransactionSigner;
192
412
  /** The method used to get SuggestedParams for transactions in the group */
193
413
  getSuggestedParams?: () => Promise<algosdk.SuggestedParams>;
194
414
  /** How many rounds a transaction should be valid for by default; if not specified
195
415
  * then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).
196
416
  */
197
- defaultValidityWindow?: number;
417
+ defaultValidityWindow?: bigint;
418
+ /** An existing `AppManager` to use to manage app compilation and cache compilation results.
419
+ *
420
+ * If not specified than an ephemeral one will be created.
421
+ */
422
+ appManager?: AppManager;
198
423
  };
199
- /** AlgoKit Composer helps you compose and execute transactions as a transaction group.
200
- *
201
- * Note: this class is a new Beta feature and may be subject to change.
202
- *
203
- * @beta
204
- */
205
- export default class AlgokitComposer {
424
+ /** Set of transactions built by `TransactionComposer`. */
425
+ export interface BuiltTransactions {
426
+ /** The built transactions */
427
+ transactions: algosdk.Transaction[];
428
+ /** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */
429
+ methodCalls: Map<number, algosdk.ABIMethod>;
430
+ /** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */
431
+ signers: Map<number, algosdk.TransactionSigner>;
432
+ }
433
+ /** TransactionComposer helps you compose and execute transactions as a transaction group. */
434
+ export declare class TransactionComposer {
435
+ /** Signer used to represent a lack of signer */
436
+ private static NULL_SIGNER;
206
437
  /** The ATC used to compose the group */
207
438
  private atc;
208
439
  /** Map of txid to ABI method */
@@ -211,7 +442,7 @@ export default class AlgokitComposer {
211
442
  private txns;
212
443
  /** The algod client used by the composer. */
213
444
  private algod;
214
- /** An async function that will return suggestedParams. */
445
+ /** An async function that will return suggested params for the transaction. */
215
446
  private getSuggestedParams;
216
447
  /** A function that takes in an address and return a signer function for that address. */
217
448
  private getSigner;
@@ -219,83 +450,153 @@ export default class AlgokitComposer {
219
450
  private defaultValidityWindow;
220
451
  /** Whether the validity window was explicitly set on construction */
221
452
  private defaultValidityWindowIsExplicit;
453
+ private appManager;
222
454
  /**
223
- * Create an `AlgoKitComposer`.
455
+ * Create a `TransactionComposer`.
224
456
  * @param params The configuration for this composer
225
457
  */
226
- constructor(params: AlgokitComposerParams);
458
+ constructor(params: TransactionComposerParams);
459
+ /**
460
+ * Add a pre-built transaction to the transaction group.
461
+ * @param transaction The pre-built transaction
462
+ * @param signer Optional signer override for the transaction
463
+ * @returns The composer so you can chain method calls
464
+ */
465
+ addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer;
227
466
  /**
228
467
  * Add a payment transaction to the transaction group.
229
468
  * @param params The payment transaction parameters
230
469
  * @returns The composer so you can chain method calls
231
470
  */
232
- addPayment(params: PaymentParams): AlgokitComposer;
471
+ addPayment(params: PaymentParams): TransactionComposer;
233
472
  /**
234
473
  * Add an asset create transaction to the transaction group.
235
474
  * @param params The asset create transaction parameters
236
475
  * @returns The composer so you can chain method calls
237
476
  */
238
- addAssetCreate(params: AssetCreateParams): AlgokitComposer;
477
+ addAssetCreate(params: AssetCreateParams): TransactionComposer;
239
478
  /**
240
479
  * Add an asset config transaction to the transaction group.
241
480
  * @param params The asset config transaction parameters
242
481
  * @returns The composer so you can chain method calls
243
482
  */
244
- addAssetConfig(params: AssetConfigParams): AlgokitComposer;
483
+ addAssetConfig(params: AssetConfigParams): TransactionComposer;
245
484
  /**
246
485
  * Add an asset freeze transaction to the transaction group.
247
486
  * @param params The asset freeze transaction parameters
248
487
  * @returns The composer so you can chain method calls
249
488
  */
250
- addAssetFreeze(params: AssetFreezeParams): AlgokitComposer;
489
+ addAssetFreeze(params: AssetFreezeParams): TransactionComposer;
251
490
  /**
252
491
  * Add an asset destroy transaction to the transaction group.
253
492
  * @param params The asset destroy transaction parameters
254
493
  * @returns The composer so you can chain method calls
255
494
  */
256
- addAssetDestroy(params: AssetDestroyParams): AlgokitComposer;
495
+ addAssetDestroy(params: AssetDestroyParams): TransactionComposer;
257
496
  /**
258
497
  * Add an asset transfer transaction to the transaction group.
259
498
  * @param params The asset transfer transaction parameters
260
499
  * @returns The composer so you can chain method calls
261
500
  */
262
- addAssetTransfer(params: AssetTransferParams): AlgokitComposer;
501
+ addAssetTransfer(params: AssetTransferParams): TransactionComposer;
263
502
  /**
264
503
  * Add an asset opt-in transaction to the transaction group.
265
504
  * @param params The asset opt-in transaction parameters
266
505
  * @returns The composer so you can chain method calls
267
506
  */
268
- addAssetOptIn(params: AssetOptInParams): AlgokitComposer;
507
+ addAssetOptIn(params: AssetOptInParams): TransactionComposer;
508
+ /**
509
+ * Add an asset opt-out transaction to the transaction group.
510
+ * @param params The asset opt-out transaction parameters
511
+ * @returns The composer so you can chain method calls
512
+ */
513
+ addAssetOptOut(params: AssetOptOutParams): TransactionComposer;
514
+ /**
515
+ * Add an application create transaction to the transaction group.
516
+ *
517
+ * Note: we recommend using app clients to make it easier to make app calls.
518
+ * @param params The application create transaction parameters
519
+ * @returns The composer so you can chain method calls
520
+ */
521
+ addAppCreate(params: AppCreateParams): TransactionComposer;
522
+ /**
523
+ * Add an application update transaction to the transaction group.
524
+ *
525
+ * Note: we recommend using app clients to make it easier to make app calls.
526
+ * @param params The application update transaction parameters
527
+ * @returns The composer so you can chain method calls
528
+ */
529
+ addAppUpdate(params: AppUpdateParams): TransactionComposer;
530
+ /**
531
+ * Add an application delete transaction to the transaction group.
532
+ *
533
+ * Note: we recommend using app clients to make it easier to make app calls.
534
+ * @param params The application delete transaction parameters
535
+ * @returns The composer so you can chain method calls
536
+ */
537
+ addAppDelete(params: AppDeleteParams): TransactionComposer;
269
538
  /**
270
539
  * Add an application call transaction to the transaction group.
271
540
  *
541
+ * If you want to create or update an app use `addAppCreate` or `addAppUpdate`.
542
+ *
272
543
  * Note: we recommend using app clients to make it easier to make app calls.
273
544
  * @param params The application call transaction parameters
274
545
  * @returns The composer so you can chain method calls
275
546
  */
276
- addAppCall(params: AppCallParams): AlgokitComposer;
547
+ addAppCall(params: AppCallParams): TransactionComposer;
548
+ /**
549
+ * Add an ABI method create application call transaction to the transaction group.
550
+ *
551
+ * Note: we recommend using app clients to make it easier to make app calls.
552
+ * @param params The ABI create method application call transaction parameters
553
+ * @returns The composer so you can chain method calls
554
+ */
555
+ addAppCreateMethodCall(params: AppCreateMethodCall): this;
556
+ /**
557
+ * Add an ABI method update application call transaction to the transaction group.
558
+ *
559
+ * Note: we recommend using app clients to make it easier to make app calls.
560
+ * @param params The ABI update method application call transaction parameters
561
+ * @returns The composer so you can chain method calls
562
+ */
563
+ addAppUpdateMethodCall(params: AppUpdateMethodCall): this;
564
+ /**
565
+ * Add an ABI method delete application call transaction to the transaction group.
566
+ *
567
+ * Note: we recommend using app clients to make it easier to make app calls.
568
+ * @param params The ABI delete method application call transaction parameters
569
+ * @returns The composer so you can chain method calls
570
+ */
571
+ addAppDeleteMethodCall(params: AppDeleteMethodCall): this;
277
572
  /**
278
- * Add an ABI method application call transaction to the transaction group.
573
+ * Add a non-create/non-update ABI method application call transaction to the transaction group.
279
574
  *
280
575
  * Note: we recommend using app clients to make it easier to make app calls.
281
576
  * @param params The ABI method application call transaction parameters
282
577
  * @returns The composer so you can chain method calls
283
578
  */
284
- addMethodCall(params: MethodCallParams): this;
579
+ addAppCallMethodCall(params: AppCallMethodCall): this;
285
580
  /**
286
581
  * Add an online key registration transaction to the transaction group.
287
582
  * @param params The online key registration transaction parameters
288
583
  * @returns The composer so you can chain method calls
289
584
  */
290
- addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): AlgokitComposer;
585
+ addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer;
291
586
  /**
292
587
  * Add the transactions within an `AtomicTransactionComposer` to the transaction group.
293
588
  * @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
294
589
  * @returns The composer so you can chain method calls
295
590
  */
296
- addAtc(atc: algosdk.AtomicTransactionComposer): AlgokitComposer;
591
+ addAtc(atc: algosdk.AtomicTransactionComposer): TransactionComposer;
592
+ /** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */
297
593
  private buildAtc;
298
594
  private commonTxnBuildStep;
595
+ /**
596
+ * Builds an ABI method call transaction and any other associated transactions represented in the ABI args.
597
+ * @param includeSigner Whether to include the actual signer for the transactions.
598
+ * If you are just building transactions without signers yet then set this to `false`.
599
+ */
299
600
  private buildMethodCall;
300
601
  private buildPayment;
301
602
  private buildAssetCreate;
@@ -305,16 +606,32 @@ export default class AlgokitComposer {
305
606
  private buildAssetTransfer;
306
607
  private buildAppCall;
307
608
  private buildKeyReg;
609
+ /** Builds all transaction types apart from `txnWithSigner`, `atc` and `methodCall` since those ones can have custom signers that need to be retrieved. */
308
610
  private buildTxn;
611
+ private buildTxnWithSigner;
612
+ /**
613
+ * Compose all of the transactions without signers and return the transaction objects directly along with any ABI method calls.
614
+ *
615
+ * @returns The array of built transactions and any corresponding method calls
616
+ */
617
+ buildTransactions(): Promise<BuiltTransactions>;
618
+ /**
619
+ * Get the number of transactions currently added to this composer.
620
+ */
621
+ count(): Promise<number>;
309
622
  /**
310
623
  * Compose all of the transactions in a single atomic transaction group and an atomic transaction composer.
311
624
  *
312
625
  * You can then use the transactions standalone, or use the composer to execute or simulate the transactions.
626
+ *
627
+ * Once this method is called, no further transactions will be able to be added.
628
+ * You can safely call this method multiple times to get the same result.
313
629
  * @returns The built atomic transaction composer and the transactions
314
630
  */
315
631
  build(): Promise<{
316
632
  atc: algosdk.AtomicTransactionComposer;
317
633
  transactions: algosdk.TransactionWithSigner[];
634
+ methodCalls: any;
318
635
  }>;
319
636
  /**
320
637
  * Rebuild the group, discarding any previously built transactions.
@@ -324,12 +641,37 @@ export default class AlgokitComposer {
324
641
  rebuild(): Promise<{
325
642
  atc: algosdk.AtomicTransactionComposer;
326
643
  transactions: algosdk.TransactionWithSigner[];
644
+ methodCalls: any;
327
645
  }>;
328
646
  /**
647
+ * Compose the atomic transaction group and send it to the network.
648
+ * @param params The parameters to control execution with
649
+ * @returns The execution result
650
+ */
651
+ send(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
652
+ /**
653
+ * @deprecated Use `send` instead.
654
+ *
329
655
  * Compose the atomic transaction group and send it to the network
656
+ *
657
+ * An alias for `composer.send(params)`.
330
658
  * @param params The parameters to control execution with
331
659
  * @returns The execution result
332
660
  */
333
- execute(params?: ExecuteParams): Promise<SendAtomicTransactionComposerResults>;
661
+ execute(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
662
+ /**
663
+ * Compose the atomic transaction group and simulate sending it to the network
664
+ * @returns The simulation result
665
+ */
666
+ simulate(options?: SimulateOptions): Promise<SendAtomicTransactionComposerResults & {
667
+ simulateResponse: SimulateResponse;
668
+ }>;
669
+ /**
670
+ * Create an encoded transaction note that follows the ARC-2 spec.
671
+ *
672
+ * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
673
+ * @param note The ARC-2 transaction note data
674
+ * @returns The binary encoded transaction note
675
+ */
676
+ static arc2Note(note: Arc2TransactionNote): Uint8Array;
334
677
  }
335
- //# sourceMappingURL=composer.d.ts.map