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

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 (360) hide show
  1. package/README.md +3 -25
  2. package/account/account.d.ts +8 -9
  3. package/account/account.js +7 -7
  4. package/account/account.js.map +1 -1
  5. package/account/account.mjs +7 -7
  6. package/account/account.mjs.map +1 -1
  7. package/account/get-account-config-from-environment.d.ts +0 -1
  8. package/account/get-account-config-from-environment.js.map +1 -1
  9. package/account/get-account-config-from-environment.mjs.map +1 -1
  10. package/account/get-account.d.ts +2 -3
  11. package/account/get-account.js +1 -1
  12. package/account/get-account.js.map +1 -1
  13. package/account/get-account.mjs +1 -1
  14. package/account/get-account.mjs.map +1 -1
  15. package/account/get-dispenser-account.d.ts +1 -2
  16. package/account/get-dispenser-account.js +1 -1
  17. package/account/get-dispenser-account.js.map +1 -1
  18. package/account/get-dispenser-account.mjs +1 -1
  19. package/account/get-dispenser-account.mjs.map +1 -1
  20. package/account/index.d.ts +0 -1
  21. package/account/mnemonic-account.d.ts +1 -2
  22. package/account/mnemonic-account.js +1 -1
  23. package/account/mnemonic-account.js.map +1 -1
  24. package/account/mnemonic-account.mjs +1 -1
  25. package/account/mnemonic-account.mjs.map +1 -1
  26. package/amount.d.ts +14 -5
  27. package/amount.js +6 -0
  28. package/amount.js.map +1 -1
  29. package/amount.mjs +6 -0
  30. package/amount.mjs.map +1 -1
  31. package/app-client.d.ts +15 -1
  32. package/app-client.js +15 -0
  33. package/app-client.js.map +1 -1
  34. package/app-client.mjs +15 -0
  35. package/app-client.mjs.map +1 -1
  36. package/app-deploy.d.ts +18 -2
  37. package/app-deploy.js +140 -333
  38. package/app-deploy.js.map +1 -1
  39. package/app-deploy.mjs +143 -336
  40. package/app-deploy.mjs.map +1 -1
  41. package/app.d.ts +39 -3
  42. package/app.js +116 -369
  43. package/app.js.map +1 -1
  44. package/app.mjs +117 -370
  45. package/app.mjs.map +1 -1
  46. package/asset.d.ts +5 -6
  47. package/asset.js +5 -8
  48. package/asset.js.map +1 -1
  49. package/asset.mjs +5 -8
  50. package/asset.mjs.map +1 -1
  51. package/config.d.ts +0 -1
  52. package/config.js.map +1 -1
  53. package/config.mjs.map +1 -1
  54. package/debugging/debugging.d.ts +3 -5
  55. package/debugging/debugging.js +4 -128
  56. package/debugging/debugging.js.map +1 -1
  57. package/debugging/debugging.mjs +4 -109
  58. package/debugging/debugging.mjs.map +1 -1
  59. package/debugging/index.d.ts +0 -2
  60. package/dispenser-client.d.ts +0 -1
  61. package/dispenser-client.js.map +1 -1
  62. package/dispenser-client.mjs.map +1 -1
  63. package/index.d.ts +4 -4
  64. package/index.js +31 -26
  65. package/index.js.map +1 -1
  66. package/index.mjs +4 -4
  67. package/indexer-lookup.d.ts +0 -1
  68. package/indexer-lookup.js.map +1 -1
  69. package/indexer-lookup.mjs.map +1 -1
  70. package/localnet/get-kmd-wallet-account.d.ts +1 -2
  71. package/localnet/get-kmd-wallet-account.js +1 -1
  72. package/localnet/get-kmd-wallet-account.js.map +1 -1
  73. package/localnet/get-kmd-wallet-account.mjs +1 -1
  74. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  75. package/localnet/get-localnet-dispenser-account.d.ts +1 -2
  76. package/localnet/get-localnet-dispenser-account.js +1 -1
  77. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  78. package/localnet/get-localnet-dispenser-account.mjs +1 -1
  79. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  80. package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -2
  81. package/localnet/get-or-create-kmd-wallet-account.js +1 -1
  82. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  83. package/localnet/get-or-create-kmd-wallet-account.mjs +1 -1
  84. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  85. package/localnet/index.d.ts +0 -1
  86. package/localnet/is-localnet.d.ts +1 -2
  87. package/localnet/is-localnet.js +1 -1
  88. package/localnet/is-localnet.js.map +1 -1
  89. package/localnet/is-localnet.mjs +1 -1
  90. package/localnet/is-localnet.mjs.map +1 -1
  91. package/network-client.d.ts +2 -3
  92. package/network-client.js +2 -2
  93. package/network-client.js.map +1 -1
  94. package/network-client.mjs +2 -2
  95. package/network-client.mjs.map +1 -1
  96. package/package.json +1 -1
  97. package/testing/_asset.d.ts +0 -1
  98. package/testing/account.d.ts +0 -1
  99. package/testing/account.js.map +1 -1
  100. package/testing/account.mjs.map +1 -1
  101. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  102. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  103. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  104. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  105. package/testing/fixtures/algorand-fixture.js +12 -12
  106. package/testing/fixtures/algorand-fixture.js.map +1 -1
  107. package/testing/fixtures/algorand-fixture.mjs +12 -12
  108. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  109. package/testing/fixtures/index.d.ts +0 -1
  110. package/testing/index.d.ts +0 -1
  111. package/testing/indexer.d.ts +0 -1
  112. package/testing/indexer.js.map +1 -1
  113. package/testing/indexer.mjs.map +1 -1
  114. package/testing/test-logger.d.ts +0 -1
  115. package/testing/test-logger.js +1 -3
  116. package/testing/test-logger.js.map +1 -1
  117. package/testing/test-logger.mjs +1 -3
  118. package/testing/test-logger.mjs.map +1 -1
  119. package/testing/transaction-logger.d.ts +0 -1
  120. package/testing/transaction-logger.js.map +1 -1
  121. package/testing/transaction-logger.mjs.map +1 -1
  122. package/transaction/index.d.ts +0 -1
  123. package/transaction/legacy-bridge.d.ts +31 -6
  124. package/transaction/legacy-bridge.js +100 -6
  125. package/transaction/legacy-bridge.js.map +1 -1
  126. package/transaction/legacy-bridge.mjs +99 -8
  127. package/transaction/legacy-bridge.mjs.map +1 -1
  128. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
  129. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  130. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  131. package/transaction/transaction.d.ts +41 -6
  132. package/transaction/transaction.js +107 -45
  133. package/transaction/transaction.js.map +1 -1
  134. package/transaction/transaction.mjs +107 -46
  135. package/transaction/transaction.mjs.map +1 -1
  136. package/transfer/index.d.ts +0 -1
  137. package/transfer/transfer-algos.d.ts +1 -2
  138. package/transfer/transfer-algos.js +1 -1
  139. package/transfer/transfer-algos.js.map +1 -1
  140. package/transfer/transfer-algos.mjs +1 -1
  141. package/transfer/transfer-algos.mjs.map +1 -1
  142. package/transfer/transfer.d.ts +1 -2
  143. package/transfer/transfer.js +3 -3
  144. package/transfer/transfer.js.map +1 -1
  145. package/transfer/transfer.mjs +3 -3
  146. package/transfer/transfer.mjs.map +1 -1
  147. package/types/account-manager.d.ts +14 -6
  148. package/types/account-manager.js +18 -4
  149. package/types/account-manager.js.map +1 -1
  150. package/types/account-manager.mjs +18 -4
  151. package/types/account-manager.mjs.map +1 -1
  152. package/types/account.d.ts +0 -1
  153. package/types/account.js.map +1 -1
  154. package/types/account.mjs.map +1 -1
  155. package/types/algo-http-client-with-retry.d.ts +0 -1
  156. package/types/algo-http-client-with-retry.js.map +1 -1
  157. package/types/algo-http-client-with-retry.mjs.map +1 -1
  158. package/types/algorand-client-interface.d.ts +28 -0
  159. package/types/algorand-client-interface.js +3 -0
  160. package/types/algorand-client-interface.js.map +1 -0
  161. package/types/algorand-client-interface.mjs +2 -0
  162. package/types/algorand-client-interface.mjs.map +1 -0
  163. package/types/algorand-client-transaction-creator.d.ts +450 -21
  164. package/types/algorand-client-transaction-creator.js +406 -22
  165. package/types/algorand-client-transaction-creator.js.map +1 -1
  166. package/types/algorand-client-transaction-creator.mjs +406 -22
  167. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  168. package/types/algorand-client-transaction-sender.d.ts +758 -33
  169. package/types/algorand-client-transaction-sender.js +444 -14
  170. package/types/algorand-client-transaction-sender.js.map +1 -1
  171. package/types/algorand-client-transaction-sender.mjs +444 -14
  172. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  173. package/types/algorand-client.d.ts +18 -10
  174. package/types/algorand-client.js +23 -10
  175. package/types/algorand-client.js.map +1 -1
  176. package/types/algorand-client.mjs +23 -10
  177. package/types/algorand-client.mjs.map +1 -1
  178. package/types/amount.d.ts +10 -11
  179. package/types/amount.js +7 -7
  180. package/types/amount.js.map +1 -1
  181. package/types/amount.mjs +7 -7
  182. package/types/amount.mjs.map +1 -1
  183. package/types/app-arc56.d.ts +348 -0
  184. package/types/app-arc56.js +184 -0
  185. package/types/app-arc56.js.map +1 -0
  186. package/types/app-arc56.mjs +175 -0
  187. package/types/app-arc56.mjs.map +1 -0
  188. package/types/app-client.d.ts +1496 -9
  189. package/types/app-client.js +903 -21
  190. package/types/app-client.js.map +1 -1
  191. package/types/app-client.mjs +904 -23
  192. package/types/app-client.mjs.map +1 -1
  193. package/types/app-deployer.d.ts +126 -0
  194. package/types/app-deployer.js +354 -0
  195. package/types/app-deployer.js.map +1 -0
  196. package/types/app-deployer.mjs +352 -0
  197. package/types/app-deployer.mjs.map +1 -0
  198. package/types/app-factory.d.ts +846 -0
  199. package/types/app-factory.js +411 -0
  200. package/types/app-factory.js.map +1 -0
  201. package/types/app-factory.mjs +409 -0
  202. package/types/app-factory.mjs.map +1 -0
  203. package/types/app-manager.d.ts +244 -0
  204. package/types/app-manager.js +334 -0
  205. package/types/app-manager.js.map +1 -0
  206. package/types/app-manager.mjs +332 -0
  207. package/types/app-manager.mjs.map +1 -0
  208. package/types/app-spec.d.ts +2 -1
  209. package/types/app-spec.js +121 -0
  210. package/types/app-spec.js.map +1 -1
  211. package/types/app-spec.mjs +120 -0
  212. package/types/app-spec.mjs.map +1 -1
  213. package/types/app.d.ts +53 -13
  214. package/types/app.js +1 -1
  215. package/types/app.js.map +1 -1
  216. package/types/app.mjs +1 -1
  217. package/types/app.mjs.map +1 -1
  218. package/types/asset-manager.d.ts +4 -4
  219. package/types/asset-manager.js +3 -4
  220. package/types/asset-manager.js.map +1 -1
  221. package/types/asset-manager.mjs +3 -4
  222. package/types/asset-manager.mjs.map +1 -1
  223. package/types/asset.d.ts +0 -1
  224. package/types/async-event-emitter.d.ts +23 -0
  225. package/types/async-event-emitter.js +55 -0
  226. package/types/async-event-emitter.js.map +1 -0
  227. package/types/async-event-emitter.mjs +53 -0
  228. package/types/async-event-emitter.mjs.map +1 -0
  229. package/types/client-manager.d.ts +133 -51
  230. package/types/client-manager.js +147 -23
  231. package/types/client-manager.js.map +1 -1
  232. package/types/client-manager.mjs +148 -24
  233. package/types/client-manager.mjs.map +1 -1
  234. package/types/composer.d.ts +232 -49
  235. package/types/composer.js +307 -65
  236. package/types/composer.js.map +1 -1
  237. package/types/composer.mjs +308 -66
  238. package/types/composer.mjs.map +1 -1
  239. package/types/config.d.ts +3 -6
  240. package/types/config.js +5 -44
  241. package/types/config.js.map +1 -1
  242. package/types/config.mjs +5 -27
  243. package/types/config.mjs.map +1 -1
  244. package/types/debugging.d.ts +29 -101
  245. package/types/debugging.js +16 -109
  246. package/types/debugging.js.map +1 -1
  247. package/types/debugging.mjs +12 -107
  248. package/types/debugging.mjs.map +1 -1
  249. package/types/dispenser-client.d.ts +1 -2
  250. package/types/dispenser-client.js +6 -5
  251. package/types/dispenser-client.js.map +1 -1
  252. package/types/dispenser-client.mjs +6 -5
  253. package/types/dispenser-client.mjs.map +1 -1
  254. package/types/expand.d.ts +7 -0
  255. package/types/expand.js +3 -0
  256. package/types/expand.js.map +1 -0
  257. package/types/expand.mjs +2 -0
  258. package/types/expand.mjs.map +1 -0
  259. package/types/indexer.d.ts +0 -1
  260. package/types/indexer.js.map +1 -1
  261. package/types/indexer.mjs.map +1 -1
  262. package/types/kmd-account-manager.d.ts +0 -1
  263. package/types/kmd-account-manager.js +2 -2
  264. package/types/kmd-account-manager.js.map +1 -1
  265. package/types/kmd-account-manager.mjs +2 -2
  266. package/types/kmd-account-manager.mjs.map +1 -1
  267. package/types/logging.d.ts +0 -1
  268. package/types/logging.js.map +1 -1
  269. package/types/logging.mjs.map +1 -1
  270. package/types/logic-error.d.ts +0 -1
  271. package/types/logic-error.js.map +1 -1
  272. package/types/logic-error.mjs.map +1 -1
  273. package/types/network-client.d.ts +13 -1
  274. package/types/network-client.js.map +1 -1
  275. package/types/network-client.mjs.map +1 -1
  276. package/types/testing.d.ts +3 -4
  277. package/types/transaction.d.ts +17 -4
  278. package/types/transfer.d.ts +0 -1
  279. package/types/urlTokenBaseHTTPClient.d.ts +0 -1
  280. package/types/urlTokenBaseHTTPClient.js +1 -1
  281. package/types/urlTokenBaseHTTPClient.js.map +1 -1
  282. package/types/urlTokenBaseHTTPClient.mjs +1 -1
  283. package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
  284. package/util.d.ts +2 -2
  285. package/util.js +11 -10
  286. package/util.js.map +1 -1
  287. package/util.mjs +11 -10
  288. package/util.mjs.map +1 -1
  289. package/account/account.d.ts.map +0 -1
  290. package/account/get-account-config-from-environment.d.ts.map +0 -1
  291. package/account/get-account.d.ts.map +0 -1
  292. package/account/get-dispenser-account.d.ts.map +0 -1
  293. package/account/index.d.ts.map +0 -1
  294. package/account/mnemonic-account.d.ts.map +0 -1
  295. package/amount.d.ts.map +0 -1
  296. package/app-client.d.ts.map +0 -1
  297. package/app-deploy.d.ts.map +0 -1
  298. package/app.d.ts.map +0 -1
  299. package/asset.d.ts.map +0 -1
  300. package/config.d.ts.map +0 -1
  301. package/debugging/debugging.d.ts.map +0 -1
  302. package/debugging/index.d.ts.map +0 -1
  303. package/debugging/simulate-and-persist-response.d.ts +0 -20
  304. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  305. package/debugging/simulate-and-persist-response.js +0 -108
  306. package/debugging/simulate-and-persist-response.js.map +0 -1
  307. package/debugging/simulate-and-persist-response.mjs +0 -89
  308. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  309. package/dispenser-client.d.ts.map +0 -1
  310. package/index.d.ts.map +0 -1
  311. package/indexer-lookup.d.ts.map +0 -1
  312. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  313. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  314. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  315. package/localnet/index.d.ts.map +0 -1
  316. package/localnet/is-localnet.d.ts.map +0 -1
  317. package/network-client.d.ts.map +0 -1
  318. package/testing/_asset.d.ts.map +0 -1
  319. package/testing/account.d.ts.map +0 -1
  320. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  321. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  322. package/testing/fixtures/index.d.ts.map +0 -1
  323. package/testing/index.d.ts.map +0 -1
  324. package/testing/indexer.d.ts.map +0 -1
  325. package/testing/test-logger.d.ts.map +0 -1
  326. package/testing/transaction-logger.d.ts.map +0 -1
  327. package/transaction/index.d.ts.map +0 -1
  328. package/transaction/legacy-bridge.d.ts.map +0 -1
  329. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  330. package/transaction/transaction.d.ts.map +0 -1
  331. package/transfer/index.d.ts.map +0 -1
  332. package/transfer/transfer-algos.d.ts.map +0 -1
  333. package/transfer/transfer.d.ts.map +0 -1
  334. package/types/account-manager.d.ts.map +0 -1
  335. package/types/account.d.ts.map +0 -1
  336. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  337. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  338. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  339. package/types/algorand-client.d.ts.map +0 -1
  340. package/types/amount.d.ts.map +0 -1
  341. package/types/app-client.d.ts.map +0 -1
  342. package/types/app-spec.d.ts.map +0 -1
  343. package/types/app.d.ts.map +0 -1
  344. package/types/asset-manager.d.ts.map +0 -1
  345. package/types/asset.d.ts.map +0 -1
  346. package/types/client-manager.d.ts.map +0 -1
  347. package/types/composer.d.ts.map +0 -1
  348. package/types/config.d.ts.map +0 -1
  349. package/types/debugging.d.ts.map +0 -1
  350. package/types/dispenser-client.d.ts.map +0 -1
  351. package/types/indexer.d.ts.map +0 -1
  352. package/types/kmd-account-manager.d.ts.map +0 -1
  353. package/types/logging.d.ts.map +0 -1
  354. package/types/logic-error.d.ts.map +0 -1
  355. package/types/network-client.d.ts.map +0 -1
  356. package/types/testing.d.ts.map +0 -1
  357. package/types/transaction.d.ts.map +0 -1
  358. package/types/transfer.d.ts.map +0 -1
  359. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  360. package/util.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"client-manager.mjs","sources":["../../src/types/client-manager.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAcA,IAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;AACxB,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAEhC,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AA0BxC;MACa,aAAa,CAAA;AAKxB;;;;;;;;;;;;;;;;;;;AAmBG;AACH,IAAA,WAAA,CAAY,eAA4C,EAAA;AACtD,QAAA,MAAM,QAAQ,GACZ,OAAO,IAAI,eAAe;AACxB,cAAE,eAAe;AACjB,cAAE;gBACE,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,eAAe,CAAC,WAAW,CAAC;AAChE,gBAAA,OAAO,EAAE,eAAe,CAAC,aAAa,GAAG,aAAa,CAAC,gBAAgB,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,SAAS;AAClH,gBAAA,GAAG,EAAE,eAAe,CAAC,SAAS,GAAG,aAAa,CAAC,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,SAAS;aACnG,CAAA;AACP,QAAA,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAA;AAC5B,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;AAChC,QAAA,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,G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AC,CAAA;AAClF,QAAA,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAA;;QAEhD,OAAO,CAAC,cAAc,CAAC,mBAAmB,IAAI,WAAW,CAAC,KAAK,CAAC,CAAA;AAChE,QAAA,OAAO,OAAO,CAAA;KACf;AAED;;;;;;;;;;;AAWG;IACI,OAAO,+BAA+B,CAAC,mBAAiC,EAAA;QAC7E,OAAO,aAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,+BAA+B,EAAE,EAAE,mBAAmB,CAAC,CAAA;KAC5G;AAED;;;;;;;;;;AAUG;IACI,OAAO,YAAY,CAAC,MAAwB,EAAA;QACjD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;QACtC,OAAO,IAAI,GAAG,CAAC,KAAe,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;KAC9C;AAED;;;;;;;;AAQG;AACI,IAAA,OAAO,2BAA2B,GAAA;;;QAGvC,OAAO,aAAa,CAAC,YAAY,CAAC,EAAE,GAAG,aAAa,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAA;KAChI;AACF;;;;"}
1
+ {"version":3,"file":"client-manager.mjs","sources":["../../src/types/client-manager.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { SuggestedParamsWithMinFee } from 'algosdk/dist/types/types/transactions/base'\nimport { AlgoHttpClientWithRetry } from './algo-http-client-with-retry'\nimport { AlgorandClientInterface } from './algorand-client-interface'\nimport { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client'\nimport { AppFactory, AppFactoryParams } from './app-factory'\nimport { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client'\nimport { Expand } from './expand'\nimport { AlgoClientConfig, AlgoConfig, NetworkDetails, genesisIdIsLocalNet } from './network-client'\nimport Kmd = algosdk.Kmd\nimport Indexer = algosdk.Indexer\nimport Algodv2 = algosdk.Algodv2\nimport IntDecoding = algosdk.IntDecoding\n\n/** Clients from algosdk that interact with the official Algorand APIs */\nexport interface AlgoSdkClients {\n /** Algod client, see https://developer.algorand.org/docs/rest-apis/algod/ */\n algod: algosdk.Algodv2\n /** Optional indexer client, see https://developer.algorand.org/docs/rest-apis/indexer/ */\n indexer?: algosdk.Indexer\n /** Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ */\n kmd?: algosdk.Kmd\n}\n\n/** Params to get an app factory from `ClientManager`. */\nexport type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>\n\n/** Params to get an app client by creator address and name from `ClientManager`. */\nexport type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>\n\n/** Params to get an app client by ID from `ClientManager`. */\nexport type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>\n\n/** Params to get an app client by network from `ClientManager`. */\nexport type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>\n\n/** Params to get a typed app client by creator address and name from `ClientManager`. */\nexport type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>\n\n/** Params to get a typed app client by ID from `ClientManager`. */\nexport type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>\n\n/** Params to get a typed app client by network from `ClientManager`. */\nexport type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>\n\n/** Params to get a typed app factory from `ClientManager`. */\nexport type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>\n\n/** Exposes access to various API clients. */\nexport class ClientManager {\n private _algod: algosdk.Algodv2\n private _indexer?: algosdk.Indexer\n private _kmd?: algosdk.Kmd\n private _algorand?: AlgorandClientInterface\n\n /**\n * algosdk clients or config for interacting with the official Algorand APIs.\n * @param clientsOrConfig The clients or config to use\n * @example Algod client only\n * ```typescript\n * const clientManager = new ClientManager({ algod: algodClient })\n * ```\n * @example All clients\n * ```typescript\n * const clientManager = new ClientManager({ algod: algodClient, indexer: indexerClient, kmd: kmdClient })\n * ```\n * @example Algod config only\n * ```typescript\n * const clientManager = new ClientManager({ algodConfig })\n * ```\n * @example All client configs\n * ```typescript\n * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })\n * ```\n */\n constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface) {\n const _clients =\n 'algod' in clientsOrConfig\n ? clientsOrConfig\n : {\n algod: ClientManager.getAlgodClient(clientsOrConfig.algodConfig),\n indexer: clientsOrConfig.indexerConfig ? ClientManager.getIndexerClient(clientsOrConfig.indexerConfig) : undefined,\n kmd: clientsOrConfig.kmdConfig ? ClientManager.getKmdClient(clientsOrConfig.kmdConfig) : undefined,\n }\n this._algod = _clients.algod\n this._indexer = _clients.indexer\n this._kmd = _clients.kmd\n this._algorand = algorandClient\n }\n\n /** Returns an algosdk Algod API client. */\n public get algod(): algosdk.Algodv2 {\n return this._algod\n }\n\n /** Returns an algosdk Indexer API client or throws an error if it's not been provided. */\n public get indexer(): algosdk.Indexer {\n if (!this._indexer) throw new Error('Attempt to use Indexer client in AlgoKit instance with no Indexer configured')\n return this._indexer\n }\n\n /** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */\n public get indexerIfPresent(): algosdk.Indexer | undefined {\n return this._indexer\n }\n\n /** Returns an algosdk KMD API client or throws an error if it's not been provided. */\n public get kmd(): algosdk.Kmd {\n if (!this._kmd) throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n return this._kmd\n }\n\n private _getNetworkPromise: Promise<SuggestedParamsWithMinFee> | undefined\n /**\n * Get details about the current network.\n * @example Getting genesis ID\n * ```typescript\n * const network = await networkClient.network()\n * const genesisId = network.genesisId\n * ```\n * @returns The current network details\n */\n public async network(): Promise<NetworkDetails> {\n if (!this._getNetworkPromise) {\n this._getNetworkPromise = this._algod.getTransactionParams().do()\n }\n\n const params = await this._getNetworkPromise\n return {\n isTestNet: ['testnet-v1.0', 'testnet-v1', 'testnet'].includes(params.genesisID),\n isMainNet: ['mainnet-v1.0', 'mainnet-v1', 'mainnet'].includes(params.genesisID),\n isLocalNet: ClientManager.genesisIdIsLocalNet(params.genesisID),\n genesisId: params.genesisID,\n genesisHash: params.genesisHash,\n }\n }\n\n /**\n * Returns true if the given network genesisId is associated with a LocalNet network.\n * @param genesisId The network genesis ID\n * @returns Whether the given genesis ID is associated with a LocalNet network\n */\n public static genesisIdIsLocalNet(genesisId: string) {\n return genesisIdIsLocalNet(genesisId)\n }\n\n /**\n * Returns true if the current network is LocalNet.\n * @returns True if the current network is LocalNet.\n */\n public async isLocalNet() {\n return (await this.network()).isLocalNet\n }\n\n /**\n * Returns true if the current network is TestNet.\n * @returns True if the current network is TestNet.\n */\n public async isTestNet() {\n return (await this.network()).isTestNet\n }\n\n /**\n * Returns true if the current network is MainNet.\n * @returns True if the current network is MainNet.\n */\n public async isMainNet() {\n return (await this.network()).isMainNet\n }\n\n /**\n * Returns a TestNet Dispenser API client.\n *\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * @example\n * const client = clientManager.getTestNetDispenser(\n * {\n * authToken: 'your_auth_token',\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\n public getTestNetDispenser(params: TestNetDispenserApiClientParams) {\n return new TestNetDispenserApiClient(params)\n }\n\n /**\n * Returns a TestNet Dispenser API client, loading the auth token from `process.env.ALGOKIT_DISPENSER_ACCESS_TOKEN`.\n *\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * @example\n * const client = clientManager.getTestNetDispenserFromEnvironment(\n * {\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\n public getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>) {\n return new TestNetDispenserApiClient(params ? { ...params, authToken: '' } : undefined)\n }\n\n /**\n * Returns a new `AppFactory` client\n * @example Basic example\n * ```typescript\n * const factory = algorand.client.getAppFactory({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\/}',\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const factory = algorand.client.getAppFactory({\n * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,\n * defaultSender: \"SENDERADDRESS\",\n * appName: \"OverriddenAppName\",\n * version: \"2.0.0\",\n * updatable: true,\n * deletable: false,\n * deployTimeParams: { ONE: 1, TWO: 'value' }\n * })\n * ```\n */\n public getAppFactory(params: ClientAppFactoryParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app factory from a ClientManager without an Algorand client')\n }\n\n return new AppFactory({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.\n * This method resolves the app ID by looking up the creator address and name\n * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientByCreatorAndName({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * // appId resolved by looking for app ID of named app by this creator\n * creatorAddress: 'CREATORADDRESS',\n * })\n * ```\n * @returns The `AppClient`\n */\n public getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return AppClient.fromCreatorAndName({\n ...params,\n algorand: this._algorand,\n })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientById({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * appId: 12345n,\n * })\n * ```\n * @returns The `AppClient`\n */\n public getAppClientById(params: ClientAppClientParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n return new AppClient({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.\n * This method resolves the app ID for the current network based on\n * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n *\n * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientByNetwork({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * // appId resolved by using ARC-56 spec to find app ID for current network\n * })\n * ```\n * @returns The `AppClient`\n */\n public async getAppClientByNetwork(params: ClientAppClientByNetworkParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n return AppClient.fromNetwork({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolving the app by creator address and name.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by creator address and name\n * @example Use name in ARC-32 / ARC-56 app spec\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {\n * creatorAddress: \"CREATORADDRESS\",\n * defaultSender: alice,\n * })\n * ```\n * @example Specify name\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {\n * creatorAddress: \"CREATORADDRESS\",\n * name: \"contract-name\",\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public async getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params: ClientTypedAppClientByCreatorAndNameParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return typedClient.fromCreatorAndName({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolving the app by app ID.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by ID\n * @example\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {\n * appId: 12345n,\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params: ClientTypedAppClientParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return new typedClient({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolves the app ID for the current network based on\n * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n *\n * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by network\n * @example\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params?: ClientTypedAppClientByNetworkParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return typedClient.fromNetwork({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed app factory.\n * @param typedFactory The typed factory type to use\n * @param params The params to resolve the factory by\n * @example\n * ```typescript\n * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {\n * sender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app factory from a ClientManager without an Algorand client')\n }\n\n return new typedFactory({ ...params, algorand: this._algorand })\n }\n\n /**\n * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)\n *\n * If both `process.env.INDEXER_SERVER` and `process.env.ALGOD_SERVER` is defined it will use both along with optional `process.env.ALGOD_PORT`, `process.env.ALGOD_TOKEN`, `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.\n *\n * If only `process.env.ALGOD_SERVER` is defined it will use this along with optional `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN` and leave indexer as `undefined`.\n *\n * If only `process.env.INDEXER_SERVER` is defined it will use the default (LocalNet) configuration for both algod and indexer.\n *\n * It will return a KMD configuration that uses `process.env.KMD_PORT` (or port 4002) if `process.env.ALGOD_SERVER` is defined,\n * otherwise it will use the default LocalNet config unless it detects testnet or mainnet.\n * @example\n * ```typescript\n * const config = ClientManager.getConfigFromEnvironmentOrLocalNet()\n * ```\n * @returns The config for algod, indexer and kmd\n */\n public static getConfigFromEnvironmentOrLocalNet(): AlgoConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default client configuration from a non Node.js context; supply the config instead')\n }\n const [algodConfig, indexerConfig, kmdConfig] = process.env.ALGOD_SERVER\n ? [\n ClientManager.getAlgodConfigFromEnvironment(),\n process.env.INDEXER_SERVER ? ClientManager.getIndexerConfigFromEnvironment() : undefined,\n !process.env.ALGOD_SERVER.includes('mainnet') && !process.env.ALGOD_SERVER.includes('testnet')\n ? { ...ClientManager.getAlgodConfigFromEnvironment(), port: process?.env?.KMD_PORT ?? '4002' }\n : undefined,\n ]\n : [\n ClientManager.getDefaultLocalNetConfig('algod'),\n ClientManager.getDefaultLocalNetConfig('indexer'),\n ClientManager.getDefaultLocalNetConfig('kmd'),\n ]\n\n return {\n algodConfig,\n indexerConfig,\n kmdConfig,\n }\n }\n\n /** Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)\n *\n * Expects `process.env.ALGOD_SERVER` to be defined, and you can also specify `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN`.\n */\n public static getAlgodConfigFromEnvironment(): AlgoClientConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default algod configuration from a non Node.js context; supply the config instead')\n }\n\n if (!process.env.ALGOD_SERVER) {\n throw new Error('Attempt to get default algod configuration without specifying ALGOD_SERVER in the environment variables')\n }\n\n return {\n server: process.env.ALGOD_SERVER,\n port: process.env.ALGOD_PORT,\n token: process.env.ALGOD_TOKEN,\n }\n }\n\n /**\n * Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment).\n *\n * Expects `process.env.INDEXER_SERVER` to be defined, and you can also specify `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.\n */\n public static getIndexerConfigFromEnvironment(): AlgoClientConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default indexer configuration from a non Node.js context; supply the config instead')\n }\n\n if (!process.env.INDEXER_SERVER) {\n throw new Error('Attempt to get default indexer configuration without specifying INDEXER_SERVER in the environment variables')\n }\n\n return {\n server: process.env.INDEXER_SERVER,\n port: process.env.INDEXER_PORT,\n token: process.env.INDEXER_TOKEN,\n }\n }\n\n /** Returns the Algorand configuration to point to the free tier of the AlgoNode service.\n *\n * @param network Which network to connect to - TestNet or MainNet\n * @param config Which algod config to return - Algod or Indexer\n */\n public static getAlgoNodeConfig(network: 'testnet' | 'mainnet', config: 'algod' | 'indexer'): AlgoClientConfig {\n return {\n server: `https://${network}-${config === 'algod' ? 'api' : 'idx'}.algonode.cloud/`,\n port: 443,\n }\n }\n\n /** Returns the Algorand configuration to point to the default LocalNet.\n *\n * @param configOrPort Which algod config to return - algod, kmd, or indexer OR a port number\n */\n public static getDefaultLocalNetConfig(configOrPort: 'algod' | 'indexer' | 'kmd' | number): AlgoClientConfig {\n return {\n server: `http://localhost`,\n port: configOrPort === 'algod' ? 4001 : configOrPort === 'indexer' ? 8980 : configOrPort === 'kmd' ? 4002 : configOrPort,\n token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n }\n }\n\n /**\n * Returns an algod SDK client that automatically retries on idempotent calls.\n *\n * @param config The config of the client\n * @example AlgoNode (testnet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('testnet', 'algod'))\n * await algod.healthCheck().do()\n * ```\n * @example AlgoNode (mainnet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('mainnet', 'algod'))\n * await algod.healthCheck().do()\n * ```\n * @example Custom (e.g. default LocalNet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient({server: 'http://localhost', port: '4001', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * await algod.healthCheck().do()\n * ```\n */\n public static getAlgodClient(config: AlgoClientConfig): Algodv2 {\n const { token, server, port } = config\n const tokenHeader = typeof token === 'string' ? { 'X-Algo-API-Token': token } : token ?? {}\n const httpClientWithRetry = new AlgoHttpClientWithRetry(tokenHeader, server, port)\n return new algosdk.Algodv2(httpClientWithRetry, server)\n }\n\n /**\n * Returns an algod SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @example\n * ```typescript\n * // Uses process.env.ALGOD_SERVER, process.env.ALGOD_PORT and process.env.ALGOD_TOKEN\n * const algod = ClientManager.getAlgodClientFromEnvironment()\n * await algod.healthCheck().do()\n * ```\n */\n public static getAlgodClientFromEnvironment(): Algodv2 {\n return ClientManager.getAlgodClient(ClientManager.getAlgodConfigFromEnvironment())\n }\n\n /**\n * Returns an indexer SDK client that automatically retries on idempotent calls\n *\n * @param config The config of the client\n * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers\n * @example AlgoNode (testnet)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))\n * await indexer.makeHealthCheck().do()\n * ```\n * @example AlgoNode (mainnet)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('mainnet', 'indexer'))\n * await indexer.makeHealthCheck().do()\n * ```\n * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient({server: 'http://localhost', port: '8980', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * await indexer.makeHealthCheck().do()\n * ```\n * @example Override int decoding for responses\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(config, IntDecoding.BIGINT)\n * ```\n */\n public static getIndexerClient(config: AlgoClientConfig, overrideIntDecoding?: IntDecoding): Indexer {\n const { token, server, port } = config\n const tokenHeader = typeof token === 'string' ? { 'X-Indexer-API-Token': token } : token ?? {}\n const httpClientWithRetry = new AlgoHttpClientWithRetry(tokenHeader, server, port)\n const indexer = new Indexer(httpClientWithRetry)\n // Use mixed int decoding by default so bigints don't have lost precision\n indexer.setIntEncoding(overrideIntDecoding ?? IntDecoding.MIXED)\n return indexer\n }\n\n /**\n * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers\n * @example\n *\n * ```typescript\n * // Uses process.env.INDEXER_SERVER, process.env.INDEXER_PORT and process.env.INDEXER_TOKEN\n * const indexer = ClientManager.getIndexerClientFromEnvironment()\n * await indexer.makeHealthCheck().do()\n * ```\n */\n public static getIndexerClientFromEnvironment(overrideIntDecoding?: IntDecoding): Indexer {\n return ClientManager.getIndexerClient(ClientManager.getIndexerConfigFromEnvironment(), overrideIntDecoding)\n }\n\n /**\n * Returns a KMD SDK client.\n *\n * KMD client allows you to export private keys, which is useful to (for instance) get the default account in a LocalNet network.\n *\n * @param config The config for the client\n * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)\n * ```typescript\n * const kmd = ClientManager.getKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * ```\n */\n public static getKmdClient(config: AlgoClientConfig): Kmd {\n const { token, server, port } = config\n return new Kmd(token as string, server, port)\n }\n\n /**\n * Returns a KMD SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @example\n * ```typescript\n * // Uses process.env.ALGOD_SERVER, process.env.KMD_PORT (or if not specified: port 4002) and process.env.ALGOD_TOKEN\n * const kmd = ClientManager.getKmdClientFromEnvironment()\n * ```\n */\n public static getKmdClientFromEnvironment(): Kmd {\n // We can only use Kmd on the LocalNet otherwise it's not exposed so this makes some assumptions\n // (e.g. same token and server as algod and port 4002 by default)\n return ClientManager.getKmdClient({ ...ClientManager.getAlgodConfigFromEnvironment(), port: process?.env?.KMD_PORT ?? '4002' })\n }\n}\n\n/**\n * Interface to identify a typed client that can be used to interact with an application.\n */\nexport interface TypedAppClient<TClient> {\n new (params: Omit<AppClientParams, 'appSpec'>): TClient\n fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>\n fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>\n}\n\n/**\n * Interface to identify a typed factory that can be used to create and deploy an application.\n */\nexport interface TypedAppFactory<TClient> {\n new (params: Omit<AppFactoryParams, 'appSpec'>): TClient\n}\n"],"names":[],"mappings":";;;;;;;AASA,IAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;AACxB,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAEhC,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AAoCxC;MACa,aAAa,CAAA;AAMxB;;;;;;;;;;;;;;;;;;;AAmBG;IACH,WAAY,CAAA,eAA4C,EAAE,cAAwC,EAAA;AAChG,QAAA,MAAM,QAAQ,GACZ,OAAO,IAAI,eAAe;AACxB,cAAE,eAAe;AACjB,cAAE;gBACE,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,eA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AAY,CAAC,MAAwB,EAAA;QACjD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;QACtC,OAAO,IAAI,GAAG,CAAC,KAAe,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;KAC9C;AAED;;;;;;;;AAQG;AACI,IAAA,OAAO,2BAA2B,GAAA;;;QAGvC,OAAO,aAAa,CAAC,YAAY,CAAC,EAAE,GAAG,aAAa,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAA;KAChI;AACF;;;;"}
@@ -1,10 +1,20 @@
1
1
  import algosdk 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;
7
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
+ };
8
18
  /** Common parameters for defining a transaction. */
9
19
  export type CommonTransactionParams = {
10
20
  /** The address of the account sending the transaction. */
@@ -277,62 +287,121 @@ export type OnlineKeyRegistrationParams = CommonTransactionParams & {
277
287
  /** The 64 byte state proof public key commitment */
278
288
  stateProofKey?: Uint8Array;
279
289
  };
280
- /** Parameters to define an application call transaction. */
281
- export type AppCallParams = CommonTransactionParams & {
282
- /** 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. */
283
295
  onComplete?: algosdk.OnApplicationComplete;
284
- /** ID of the application */
285
- appId?: bigint;
286
- /** The program to execute for all OnCompletes other than ClearState */
287
- approvalProgram?: Uint8Array;
288
- /** The program to execute for ClearState OnComplete */
289
- clearProgram?: Uint8Array;
290
- /** The state schema for the app. This is immutable. */
291
- schema?: {
292
- /** The number of integers saved in global state */
293
- globalUints: number;
294
- /** The number of byte slices saved in global state */
295
- globalByteSlices: number;
296
- /** The number of integers saved in local state */
297
- localUints: number;
298
- /** The number of byte slices saved in local state */
299
- localByteSlices: number;
300
- };
301
- /** Application arguments */
296
+ /** Any [arguments to pass to the smart contract call](https://developer.algorand.org/docs/get-details/dapps/avm/teal/#argument-passing). */
302
297
  args?: Uint8Array[];
303
- /** Account references */
298
+ /** Any account addresses to add to the [accounts array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
304
299
  accountReferences?: string[];
305
- /** App references */
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). */
306
301
  appReferences?: bigint[];
307
- /** Asset references */
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). */
308
303
  assetReferences?: bigint[];
309
- /** Number of extra pages required for the programs */
310
- extraPages?: number;
311
- /** Box references */
312
- boxReferences?: algosdk.BoxReference[];
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)[];
313
310
  };
314
- /** Parameters to define an ABI method application call transaction. */
315
- export type MethodCallParams = CommonTransactionParams & Omit<AppCallParams, 'args'> & {
316
- /** ID of the application */
317
- appId: bigint;
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. */
319
+ schema?: {
320
+ /** The number of integers saved in global state. */
321
+ globalInts: number;
322
+ /** The number of byte slices saved in global state. */
323
+ globalByteSlices: number;
324
+ /** The number of integers saved in local state. */
325
+ localInts: number;
326
+ /** The number of byte slices saved in local state. */
327
+ localByteSlices: number;
328
+ };
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>;
345
+ };
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'>> & {
318
366
  /** The ABI method to call */
319
367
  method: algosdk.ABIMethod;
320
368
  /** Arguments to the ABI method, either:
321
369
  * * An ABI value
322
370
  * * A transaction with explicit signer
323
371
  * * A transaction (where the signer will be automatically assigned)
324
- * * An unawaited transaction (e.g. from algorand.transactions.transactionType())
372
+ * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
325
373
  * * Another method call (via method call params object)
326
374
  */
327
- args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | MethodCallParams)[];
375
+ args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>)[];
328
376
  };
329
- /** Parameters to configure transaction execution. */
330
- export interface ExecuteParams {
331
- /** The number of rounds to wait for confirmation. By default until the latest lastValid has past. */
332
- maxRoundsToWaitForConfirmation?: number;
333
- /** Whether to suppress log messages from transaction send, default: do not suppress. */
334
- suppressLog?: boolean;
335
- }
377
+ export type Txn = (PaymentParams & {
378
+ type: 'pay';
379
+ }) | (AssetCreateParams & {
380
+ type: 'assetCreate';
381
+ }) | (AssetConfigParams & {
382
+ type: 'assetConfig';
383
+ }) | (AssetFreezeParams & {
384
+ type: 'assetFreeze';
385
+ }) | (AssetDestroyParams & {
386
+ type: 'assetDestroy';
387
+ }) | (AssetTransferParams & {
388
+ type: 'assetTransfer';
389
+ }) | (AssetOptInParams & {
390
+ type: 'assetOptIn';
391
+ }) | (AssetOptOutParams & {
392
+ type: 'assetOptOut';
393
+ }) | ((AppCallParams | AppCreateParams | AppUpdateParams) & {
394
+ type: 'appCall';
395
+ }) | (OnlineKeyRegistrationParams & {
396
+ type: 'keyReg';
397
+ }) | (algosdk.TransactionWithSigner & {
398
+ type: 'txnWithSigner';
399
+ }) | {
400
+ atc: algosdk.AtomicTransactionComposer;
401
+ type: 'atc';
402
+ } | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & {
403
+ type: 'methodCall';
404
+ });
336
405
  /** Parameters to create an `AlgoKitComposer`. */
337
406
  export type AlgoKitComposerParams = {
338
407
  /** The algod client to use to get suggestedParams and send the transaction group */
@@ -345,9 +414,25 @@ export type AlgoKitComposerParams = {
345
414
  * then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).
346
415
  */
347
416
  defaultValidityWindow?: number;
417
+ /** An existing `AppManager` to use to manage app compilation and cache compilation results.
418
+ *
419
+ * If not specified than an ephemeral one will be created.
420
+ */
421
+ appManager?: AppManager;
348
422
  };
423
+ /** Set of transactions built by `AlgoKitComposer`. */
424
+ export interface BuiltTransactions {
425
+ /** The built transactions */
426
+ transactions: algosdk.Transaction[];
427
+ /** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */
428
+ methodCalls: Map<number, algosdk.ABIMethod>;
429
+ /** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */
430
+ signers: Map<number, algosdk.TransactionSigner>;
431
+ }
349
432
  /** AlgoKit Composer helps you compose and execute transactions as a transaction group. */
350
433
  export default class AlgoKitComposer {
434
+ /** Signer used to represent a lack of signer */
435
+ private static NULL_SIGNER;
351
436
  /** The ATC used to compose the group */
352
437
  private atc;
353
438
  /** Map of txid to ABI method */
@@ -364,11 +449,19 @@ export default class AlgoKitComposer {
364
449
  private defaultValidityWindow;
365
450
  /** Whether the validity window was explicitly set on construction */
366
451
  private defaultValidityWindowIsExplicit;
452
+ private appManager;
367
453
  /**
368
454
  * Create an `AlgoKitComposer`.
369
455
  * @param params The configuration for this composer
370
456
  */
371
457
  constructor(params: AlgoKitComposerParams);
458
+ /**
459
+ * Add a pre-built transaction to the transaction group.
460
+ * @param transaction The pre-built transaction
461
+ * @param signer Optional signer override for the transaction
462
+ * @returns The composer so you can chain method calls
463
+ */
464
+ addTransaction(transaction: Transaction, signer?: TransactionSigner): AlgoKitComposer;
372
465
  /**
373
466
  * Add a payment transaction to the transaction group.
374
467
  * @param params The payment transaction parameters
@@ -417,22 +510,72 @@ export default class AlgoKitComposer {
417
510
  * @returns The composer so you can chain method calls
418
511
  */
419
512
  addAssetOptOut(params: AssetOptOutParams): AlgoKitComposer;
513
+ /**
514
+ * Add an application create transaction to the transaction group.
515
+ *
516
+ * Note: we recommend using app clients to make it easier to make app calls.
517
+ * @param params The application create transaction parameters
518
+ * @returns The composer so you can chain method calls
519
+ */
520
+ addAppCreate(params: AppCreateParams): AlgoKitComposer;
521
+ /**
522
+ * Add an application update transaction to the transaction group.
523
+ *
524
+ * Note: we recommend using app clients to make it easier to make app calls.
525
+ * @param params The application update transaction parameters
526
+ * @returns The composer so you can chain method calls
527
+ */
528
+ addAppUpdate(params: AppUpdateParams): AlgoKitComposer;
529
+ /**
530
+ * Add an application delete transaction to the transaction group.
531
+ *
532
+ * Note: we recommend using app clients to make it easier to make app calls.
533
+ * @param params The application delete transaction parameters
534
+ * @returns The composer so you can chain method calls
535
+ */
536
+ addAppDelete(params: AppDeleteParams): AlgoKitComposer;
420
537
  /**
421
538
  * Add an application call transaction to the transaction group.
422
539
  *
540
+ * If you want to create or update an app use `addAppCreate` or `addAppUpdate`.
541
+ *
423
542
  * Note: we recommend using app clients to make it easier to make app calls.
424
543
  * @param params The application call transaction parameters
425
544
  * @returns The composer so you can chain method calls
426
545
  */
427
546
  addAppCall(params: AppCallParams): AlgoKitComposer;
428
547
  /**
429
- * Add an ABI method application call transaction to the transaction group.
548
+ * Add an ABI method create application call transaction to the transaction group.
549
+ *
550
+ * Note: we recommend using app clients to make it easier to make app calls.
551
+ * @param params The ABI create method application call transaction parameters
552
+ * @returns The composer so you can chain method calls
553
+ */
554
+ addAppCreateMethodCall(params: AppCreateMethodCall): this;
555
+ /**
556
+ * Add an ABI method update application call transaction to the transaction group.
557
+ *
558
+ * Note: we recommend using app clients to make it easier to make app calls.
559
+ * @param params The ABI update method application call transaction parameters
560
+ * @returns The composer so you can chain method calls
561
+ */
562
+ addAppUpdateMethodCall(params: AppUpdateMethodCall): this;
563
+ /**
564
+ * Add an ABI method delete application call transaction to the transaction group.
565
+ *
566
+ * Note: we recommend using app clients to make it easier to make app calls.
567
+ * @param params The ABI delete method application call transaction parameters
568
+ * @returns The composer so you can chain method calls
569
+ */
570
+ addAppDeleteMethodCall(params: AppDeleteMethodCall): this;
571
+ /**
572
+ * Add a non-create/non-update ABI method application call transaction to the transaction group.
430
573
  *
431
574
  * Note: we recommend using app clients to make it easier to make app calls.
432
575
  * @param params The ABI method application call transaction parameters
433
576
  * @returns The composer so you can chain method calls
434
577
  */
435
- addMethodCall(params: MethodCallParams): this;
578
+ addAppCallMethodCall(params: AppCallMethodCall): this;
436
579
  /**
437
580
  * Add an online key registration transaction to the transaction group.
438
581
  * @param params The online key registration transaction parameters
@@ -445,8 +588,14 @@ export default class AlgoKitComposer {
445
588
  * @returns The composer so you can chain method calls
446
589
  */
447
590
  addAtc(atc: algosdk.AtomicTransactionComposer): AlgoKitComposer;
591
+ /** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */
448
592
  private buildAtc;
449
593
  private commonTxnBuildStep;
594
+ /**
595
+ * Builds an ABI method call transaction and any other associated transactions represented in the ABI args.
596
+ * @param includeSigner Whether to include the actual signer for the transactions.
597
+ * If you are just building transactions without signers yet then set this to `false`.
598
+ */
450
599
  private buildMethodCall;
451
600
  private buildPayment;
452
601
  private buildAssetCreate;
@@ -456,23 +605,32 @@ export default class AlgoKitComposer {
456
605
  private buildAssetTransfer;
457
606
  private buildAppCall;
458
607
  private buildKeyReg;
608
+ /** Builds all transaction types apart from `txnWithSigner`, `atc` and `methodCall` since those ones can have custom signers that need to be retrieved. */
459
609
  private buildTxn;
460
610
  private buildTxnWithSigner;
461
611
  /**
462
- * Compose all of the transactions without signers and return the transaction objects directly.
612
+ * Compose all of the transactions without signers and return the transaction objects directly along with any ABI method calls.
463
613
  *
464
- * @returns The array of built transactions
614
+ * @returns The array of built transactions and any corresponding method calls
615
+ */
616
+ buildTransactions(): Promise<BuiltTransactions>;
617
+ /**
618
+ * Get the number of transactions currently added to this composer.
465
619
  */
466
- buildTransactions(): Promise<algosdk.Transaction[]>;
620
+ count(): Promise<number>;
467
621
  /**
468
622
  * Compose all of the transactions in a single atomic transaction group and an atomic transaction composer.
469
623
  *
470
624
  * You can then use the transactions standalone, or use the composer to execute or simulate the transactions.
625
+ *
626
+ * Once this method is called, no further transactions will be able to be added.
627
+ * You can safely call this method multiple times to get the same result.
471
628
  * @returns The built atomic transaction composer and the transactions
472
629
  */
473
630
  build(): Promise<{
474
631
  atc: algosdk.AtomicTransactionComposer;
475
632
  transactions: algosdk.TransactionWithSigner[];
633
+ methodCalls: any;
476
634
  }>;
477
635
  /**
478
636
  * Rebuild the group, discarding any previously built transactions.
@@ -482,12 +640,37 @@ export default class AlgoKitComposer {
482
640
  rebuild(): Promise<{
483
641
  atc: algosdk.AtomicTransactionComposer;
484
642
  transactions: algosdk.TransactionWithSigner[];
643
+ methodCalls: any;
485
644
  }>;
486
645
  /**
646
+ * Compose the atomic transaction group and send it to the network.
647
+ * @param params The parameters to control execution with
648
+ * @returns The execution result
649
+ */
650
+ send(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
651
+ /**
652
+ * @deprecated Use `send` instead.
653
+ *
487
654
  * Compose the atomic transaction group and send it to the network
655
+ *
656
+ * An alias for `composer.send(params)`.
488
657
  * @param params The parameters to control execution with
489
658
  * @returns The execution result
490
659
  */
491
- execute(params?: ExecuteParams): Promise<SendAtomicTransactionComposerResults>;
660
+ execute(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
661
+ /**
662
+ * Compose the atomic transaction group and simulate sending it to the network
663
+ * @returns The simulation result
664
+ */
665
+ simulate(options?: SimulateOptions): Promise<SendAtomicTransactionComposerResults & {
666
+ simulateResponse: SimulateResponse;
667
+ }>;
668
+ /**
669
+ * Create an encoded transaction note that follows the ARC-2 spec.
670
+ *
671
+ * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
672
+ * @param note The ARC-2 transaction note data
673
+ * @returns The binary encoded transaction note
674
+ */
675
+ static arc2Note(note: Arc2TransactionNote): Uint8Array;
492
676
  }
493
- //# sourceMappingURL=composer.d.ts.map