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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -26
  3. package/account/account.d.ts +12 -10
  4. package/account/get-account-config-from-environment.d.ts +0 -1
  5. package/account/get-account.d.ts +2 -3
  6. package/account/get-dispenser-account.d.ts +2 -3
  7. package/account/index.d.ts +0 -1
  8. package/account/mnemonic-account.d.ts +1 -2
  9. package/amount.d.ts +15 -5
  10. package/app-client.d.ts +19 -5
  11. package/app-deploy.d.ts +18 -2
  12. package/app.d.ts +39 -3
  13. package/asset.d.ts +5 -6
  14. package/config.d.ts +0 -1
  15. package/debugging/debugging.d.ts +3 -5
  16. package/debugging/index.d.ts +0 -2
  17. package/dispenser-client.d.ts +0 -1
  18. package/index.d.ts +5 -4
  19. package/index.js +56 -46
  20. package/index.js.map +1 -1
  21. package/index.mjs +26 -25
  22. package/index.mjs.map +1 -1
  23. package/indexer-lookup.d.ts +10 -9
  24. package/localnet/get-kmd-wallet-account.d.ts +1 -2
  25. package/localnet/get-localnet-dispenser-account.d.ts +1 -2
  26. package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -2
  27. package/localnet/index.d.ts +0 -1
  28. package/localnet/is-localnet.d.ts +1 -2
  29. package/network-client.d.ts +3 -10
  30. package/package.json +3 -4
  31. package/{account → src/account}/account.js +21 -18
  32. package/src/account/account.js.map +1 -0
  33. package/{account → src/account}/account.mjs +22 -19
  34. package/src/account/account.mjs.map +1 -0
  35. package/src/account/get-account-config-from-environment.js.map +1 -0
  36. package/src/account/get-account-config-from-environment.mjs.map +1 -0
  37. package/{account → src/account}/get-account.js +3 -3
  38. package/src/account/get-account.js.map +1 -0
  39. package/{account → src/account}/get-account.mjs +3 -3
  40. package/src/account/get-account.mjs.map +1 -0
  41. package/{account → src/account}/get-dispenser-account.js +3 -3
  42. package/src/account/get-dispenser-account.js.map +1 -0
  43. package/{account → src/account}/get-dispenser-account.mjs +3 -3
  44. package/src/account/get-dispenser-account.mjs.map +1 -0
  45. package/{account → src/account}/mnemonic-account.js +1 -1
  46. package/src/account/mnemonic-account.js.map +1 -0
  47. package/{account → src/account}/mnemonic-account.mjs +1 -1
  48. package/src/account/mnemonic-account.mjs.map +1 -0
  49. package/{amount.js → src/amount.js} +10 -3
  50. package/src/amount.js.map +1 -0
  51. package/{amount.mjs → src/amount.mjs} +10 -4
  52. package/src/amount.mjs.map +1 -0
  53. package/{app-client.js → src/app-client.js} +20 -5
  54. package/src/app-client.js.map +1 -0
  55. package/{app-client.mjs → src/app-client.mjs} +20 -5
  56. package/src/app-client.mjs.map +1 -0
  57. package/src/app-deploy.js +285 -0
  58. package/src/app-deploy.js.map +1 -0
  59. package/src/app-deploy.mjs +276 -0
  60. package/src/app-deploy.mjs.map +1 -0
  61. package/src/app.js +349 -0
  62. package/src/app.js.map +1 -0
  63. package/src/app.mjs +329 -0
  64. package/src/app.mjs.map +1 -0
  65. package/{asset.js → src/asset.js} +6 -9
  66. package/src/asset.js.map +1 -0
  67. package/{asset.mjs → src/asset.mjs} +6 -9
  68. package/src/asset.mjs.map +1 -0
  69. package/{config.js → src/config.js} +1 -1
  70. package/src/config.js.map +1 -0
  71. package/{config.mjs → src/config.mjs} +1 -1
  72. package/src/config.mjs.map +1 -0
  73. package/src/debugging/debugging.js +15 -0
  74. package/src/debugging/debugging.js.map +1 -0
  75. package/src/debugging/debugging.mjs +13 -0
  76. package/src/debugging/debugging.mjs.map +1 -0
  77. package/{dispenser-client.js → src/dispenser-client.js} +1 -1
  78. package/src/dispenser-client.js.map +1 -0
  79. package/{dispenser-client.mjs → src/dispenser-client.mjs} +1 -1
  80. package/src/dispenser-client.mjs.map +1 -0
  81. package/{indexer-lookup.js → src/indexer-lookup.js} +14 -10
  82. package/src/indexer-lookup.js.map +1 -0
  83. package/{indexer-lookup.mjs → src/indexer-lookup.mjs} +14 -10
  84. package/src/indexer-lookup.mjs.map +1 -0
  85. package/{localnet → src/localnet}/get-kmd-wallet-account.js +3 -3
  86. package/src/localnet/get-kmd-wallet-account.js.map +1 -0
  87. package/{localnet → src/localnet}/get-kmd-wallet-account.mjs +3 -3
  88. package/src/localnet/get-kmd-wallet-account.mjs.map +1 -0
  89. package/{localnet → src/localnet}/get-localnet-dispenser-account.js +3 -3
  90. package/src/localnet/get-localnet-dispenser-account.js.map +1 -0
  91. package/{localnet → src/localnet}/get-localnet-dispenser-account.mjs +3 -3
  92. package/src/localnet/get-localnet-dispenser-account.mjs.map +1 -0
  93. package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.js +3 -3
  94. package/src/localnet/get-or-create-kmd-wallet-account.js.map +1 -0
  95. package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.mjs +3 -3
  96. package/src/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -0
  97. package/{localnet → src/localnet}/is-localnet.js +2 -2
  98. package/src/localnet/is-localnet.js.map +1 -0
  99. package/{localnet → src/localnet}/is-localnet.mjs +2 -2
  100. package/src/localnet/is-localnet.mjs.map +1 -0
  101. package/{network-client.js → src/network-client.js} +5 -12
  102. package/src/network-client.js.map +1 -0
  103. package/{network-client.mjs → src/network-client.mjs} +5 -12
  104. package/src/network-client.mjs.map +1 -0
  105. package/{testing → src/testing}/account.js +9 -3
  106. package/src/testing/account.js.map +1 -0
  107. package/{testing → src/testing}/account.mjs +10 -4
  108. package/src/testing/account.mjs.map +1 -0
  109. package/src/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  110. package/src/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -0
  111. package/{testing → src/testing}/fixtures/algorand-fixture.js +15 -16
  112. package/src/testing/fixtures/algorand-fixture.js.map +1 -0
  113. package/{testing → src/testing}/fixtures/algorand-fixture.mjs +15 -16
  114. package/src/testing/fixtures/algorand-fixture.mjs.map +1 -0
  115. package/src/testing/indexer.js.map +1 -0
  116. package/src/testing/indexer.mjs.map +1 -0
  117. package/{testing → src/testing}/test-logger.js +7 -3
  118. package/src/testing/test-logger.js.map +1 -0
  119. package/{testing → src/testing}/test-logger.mjs +7 -3
  120. package/src/testing/test-logger.mjs.map +1 -0
  121. package/src/testing/transaction-logger.js.map +1 -0
  122. package/src/testing/transaction-logger.mjs.map +1 -0
  123. package/src/transaction/legacy-bridge.js +129 -0
  124. package/src/transaction/legacy-bridge.js.map +1 -0
  125. package/src/transaction/legacy-bridge.mjs +124 -0
  126. package/src/transaction/legacy-bridge.mjs.map +1 -0
  127. package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.js +14 -9
  128. package/src/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -0
  129. package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.mjs +15 -10
  130. package/src/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -0
  131. package/{transaction → src/transaction}/transaction.js +217 -137
  132. package/src/transaction/transaction.js.map +1 -0
  133. package/{transaction → src/transaction}/transaction.mjs +218 -138
  134. package/src/transaction/transaction.mjs.map +1 -0
  135. package/{transfer → src/transfer}/transfer-algos.js +1 -1
  136. package/src/transfer/transfer-algos.js.map +1 -0
  137. package/{transfer → src/transfer}/transfer-algos.mjs +1 -1
  138. package/src/transfer/transfer-algos.mjs.map +1 -0
  139. package/{transfer → src/transfer}/transfer.js +8 -6
  140. package/src/transfer/transfer.js.map +1 -0
  141. package/{transfer → src/transfer}/transfer.mjs +8 -6
  142. package/src/transfer/transfer.mjs.map +1 -0
  143. package/{util.js → src/util.js} +11 -10
  144. package/src/util.js.map +1 -0
  145. package/{util.mjs → src/util.mjs} +11 -10
  146. package/src/util.mjs.map +1 -0
  147. package/testing/_asset.d.ts +2 -2
  148. package/testing/account.d.ts +4 -4
  149. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  150. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  151. package/testing/fixtures/index.d.ts +0 -1
  152. package/testing/index.d.ts +0 -1
  153. package/testing/index.js +6 -6
  154. package/testing/index.mjs +6 -6
  155. package/testing/indexer.d.ts +0 -1
  156. package/testing/test-logger.d.ts +0 -1
  157. package/testing/transaction-logger.d.ts +0 -1
  158. package/transaction/index.d.ts +0 -1
  159. package/transaction/legacy-bridge.d.ts +31 -6
  160. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -2
  161. package/transaction/transaction.d.ts +38 -19
  162. package/transfer/index.d.ts +0 -1
  163. package/transfer/transfer-algos.d.ts +1 -2
  164. package/transfer/transfer.d.ts +1 -2
  165. package/types/account-manager.d.ts +33 -25
  166. package/types/account-manager.js +56 -33
  167. package/types/account-manager.js.map +1 -1
  168. package/types/account-manager.mjs +58 -35
  169. package/types/account-manager.mjs.map +1 -1
  170. package/types/account.d.ts +17 -9
  171. package/types/account.js +2 -2
  172. package/types/account.js.map +1 -1
  173. package/types/account.mjs +3 -3
  174. package/types/account.mjs.map +1 -1
  175. package/types/algo-http-client-with-retry.d.ts +1 -3
  176. package/types/algo-http-client-with-retry.js +34 -4
  177. package/types/algo-http-client-with-retry.js.map +1 -1
  178. package/types/algo-http-client-with-retry.mjs +33 -3
  179. package/types/algo-http-client-with-retry.mjs.map +1 -1
  180. package/types/algorand-client-interface.d.ts +28 -0
  181. package/types/algorand-client-interface.js +3 -0
  182. package/types/algorand-client-interface.js.map +1 -0
  183. package/types/algorand-client-interface.mjs +2 -0
  184. package/types/algorand-client-interface.mjs.map +1 -0
  185. package/types/algorand-client-transaction-creator.d.ts +452 -23
  186. package/types/algorand-client-transaction-creator.js +407 -23
  187. package/types/algorand-client-transaction-creator.js.map +1 -1
  188. package/types/algorand-client-transaction-creator.mjs +407 -23
  189. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  190. package/types/algorand-client-transaction-sender.d.ts +772 -47
  191. package/types/algorand-client-transaction-sender.js +446 -16
  192. package/types/algorand-client-transaction-sender.js.map +1 -1
  193. package/types/algorand-client-transaction-sender.mjs +446 -16
  194. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  195. package/types/algorand-client.d.ts +24 -17
  196. package/types/algorand-client.js +26 -16
  197. package/types/algorand-client.js.map +1 -1
  198. package/types/algorand-client.mjs +28 -15
  199. package/types/algorand-client.mjs.map +1 -1
  200. package/types/amount.d.ts +10 -11
  201. package/types/amount.js +7 -7
  202. package/types/amount.js.map +1 -1
  203. package/types/amount.mjs +7 -7
  204. package/types/amount.mjs.map +1 -1
  205. package/types/app-arc56.d.ts +359 -0
  206. package/types/app-arc56.js +184 -0
  207. package/types/app-arc56.js.map +1 -0
  208. package/types/app-arc56.mjs +175 -0
  209. package/types/app-arc56.mjs.map +1 -0
  210. package/types/app-client.d.ts +1508 -12
  211. package/types/app-client.js +1023 -34
  212. package/types/app-client.js.map +1 -1
  213. package/types/app-client.mjs +1024 -36
  214. package/types/app-client.mjs.map +1 -1
  215. package/types/app-deployer.d.ts +126 -0
  216. package/types/app-deployer.js +353 -0
  217. package/types/app-deployer.js.map +1 -0
  218. package/types/app-deployer.mjs +351 -0
  219. package/types/app-deployer.mjs.map +1 -0
  220. package/types/app-factory.d.ts +846 -0
  221. package/types/app-factory.js +410 -0
  222. package/types/app-factory.js.map +1 -0
  223. package/types/app-factory.mjs +408 -0
  224. package/types/app-factory.mjs.map +1 -0
  225. package/types/app-manager.d.ts +244 -0
  226. package/types/app-manager.js +423 -0
  227. package/types/app-manager.js.map +1 -0
  228. package/types/app-manager.mjs +421 -0
  229. package/types/app-manager.mjs.map +1 -0
  230. package/types/app-spec.d.ts +2 -1
  231. package/types/app-spec.js +127 -0
  232. package/types/app-spec.js.map +1 -1
  233. package/types/app-spec.mjs +126 -0
  234. package/types/app-spec.mjs.map +1 -1
  235. package/types/app.d.ts +57 -18
  236. package/types/app.js +1 -1
  237. package/types/app.js.map +1 -1
  238. package/types/app.mjs +1 -1
  239. package/types/app.mjs.map +1 -1
  240. package/types/asset-manager.d.ts +10 -10
  241. package/types/asset-manager.js +15 -19
  242. package/types/asset-manager.js.map +1 -1
  243. package/types/asset-manager.mjs +15 -19
  244. package/types/asset-manager.mjs.map +1 -1
  245. package/types/asset.d.ts +0 -1
  246. package/types/async-event-emitter.d.ts +14 -0
  247. package/types/async-event-emitter.js +50 -0
  248. package/types/async-event-emitter.js.map +1 -0
  249. package/types/async-event-emitter.mjs +48 -0
  250. package/types/async-event-emitter.mjs.map +1 -0
  251. package/types/client-manager.d.ts +135 -60
  252. package/types/client-manager.js +158 -44
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +159 -45
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +271 -87
  257. package/types/composer.js +406 -126
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +407 -125
  260. package/types/composer.mjs.map +1 -1
  261. package/types/config.d.ts +3 -6
  262. package/types/config.js +5 -44
  263. package/types/config.js.map +1 -1
  264. package/types/config.mjs +5 -27
  265. package/types/config.mjs.map +1 -1
  266. package/types/debugging.d.ts +29 -101
  267. package/types/debugging.js +16 -109
  268. package/types/debugging.js.map +1 -1
  269. package/types/debugging.mjs +12 -107
  270. package/types/debugging.mjs.map +1 -1
  271. package/types/dispenser-client.d.ts +2 -2
  272. package/types/dispenser-client.js +10 -5
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +10 -5
  275. package/types/dispenser-client.mjs.map +1 -1
  276. package/types/expand.d.ts +7 -0
  277. package/types/expand.js +3 -0
  278. package/types/expand.js.map +1 -0
  279. package/types/expand.mjs +2 -0
  280. package/types/expand.mjs.map +1 -0
  281. package/types/indexer.d.ts +74 -756
  282. package/types/indexer.js.map +1 -1
  283. package/types/indexer.mjs.map +1 -1
  284. package/types/kmd-account-manager.d.ts +2 -3
  285. package/types/kmd-account-manager.js +4 -4
  286. package/types/kmd-account-manager.js.map +1 -1
  287. package/types/kmd-account-manager.mjs +5 -5
  288. package/types/kmd-account-manager.mjs.map +1 -1
  289. package/types/lifecycle-events.d.ts +10 -0
  290. package/types/lifecycle-events.js +8 -0
  291. package/types/lifecycle-events.js.map +1 -0
  292. package/types/lifecycle-events.mjs +8 -0
  293. package/types/lifecycle-events.mjs.map +1 -0
  294. package/types/logging.d.ts +0 -1
  295. package/types/logging.js.map +1 -1
  296. package/types/logging.mjs.map +1 -1
  297. package/types/logic-error.d.ts +2 -4
  298. package/types/logic-error.js +3 -3
  299. package/types/logic-error.js.map +1 -1
  300. package/types/logic-error.mjs +3 -3
  301. package/types/logic-error.mjs.map +1 -1
  302. package/types/network-client.d.ts +14 -2
  303. package/types/network-client.js.map +1 -1
  304. package/types/network-client.mjs.map +1 -1
  305. package/types/testing.d.ts +8 -10
  306. package/types/transaction.d.ts +17 -4
  307. package/types/transfer.d.ts +0 -1
  308. package/util.d.ts +2 -2
  309. package/account/account.d.ts.map +0 -1
  310. package/account/account.js.map +0 -1
  311. package/account/account.mjs.map +0 -1
  312. package/account/get-account-config-from-environment.d.ts.map +0 -1
  313. package/account/get-account-config-from-environment.js.map +0 -1
  314. package/account/get-account-config-from-environment.mjs.map +0 -1
  315. package/account/get-account.d.ts.map +0 -1
  316. package/account/get-account.js.map +0 -1
  317. package/account/get-account.mjs.map +0 -1
  318. package/account/get-dispenser-account.d.ts.map +0 -1
  319. package/account/get-dispenser-account.js.map +0 -1
  320. package/account/get-dispenser-account.mjs.map +0 -1
  321. package/account/index.d.ts.map +0 -1
  322. package/account/mnemonic-account.d.ts.map +0 -1
  323. package/account/mnemonic-account.js.map +0 -1
  324. package/account/mnemonic-account.mjs.map +0 -1
  325. package/amount.d.ts.map +0 -1
  326. package/amount.js.map +0 -1
  327. package/amount.mjs.map +0 -1
  328. package/app-client.d.ts.map +0 -1
  329. package/app-client.js.map +0 -1
  330. package/app-client.mjs.map +0 -1
  331. package/app-deploy.d.ts.map +0 -1
  332. package/app-deploy.js +0 -468
  333. package/app-deploy.js.map +0 -1
  334. package/app-deploy.mjs +0 -459
  335. package/app-deploy.mjs.map +0 -1
  336. package/app.d.ts.map +0 -1
  337. package/app.js +0 -599
  338. package/app.js.map +0 -1
  339. package/app.mjs +0 -579
  340. package/app.mjs.map +0 -1
  341. package/asset.d.ts.map +0 -1
  342. package/asset.js.map +0 -1
  343. package/asset.mjs.map +0 -1
  344. package/config.d.ts.map +0 -1
  345. package/config.js.map +0 -1
  346. package/config.mjs.map +0 -1
  347. package/debugging/debugging.d.ts.map +0 -1
  348. package/debugging/debugging.js +0 -139
  349. package/debugging/debugging.js.map +0 -1
  350. package/debugging/debugging.mjs +0 -118
  351. package/debugging/debugging.mjs.map +0 -1
  352. package/debugging/index.d.ts.map +0 -1
  353. package/debugging/simulate-and-persist-response.d.ts +0 -20
  354. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  355. package/debugging/simulate-and-persist-response.js +0 -108
  356. package/debugging/simulate-and-persist-response.js.map +0 -1
  357. package/debugging/simulate-and-persist-response.mjs +0 -89
  358. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  359. package/dispenser-client.d.ts.map +0 -1
  360. package/dispenser-client.js.map +0 -1
  361. package/dispenser-client.mjs.map +0 -1
  362. package/index.d.ts.map +0 -1
  363. package/indexer-lookup.d.ts.map +0 -1
  364. package/indexer-lookup.js.map +0 -1
  365. package/indexer-lookup.mjs.map +0 -1
  366. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  367. package/localnet/get-kmd-wallet-account.js.map +0 -1
  368. package/localnet/get-kmd-wallet-account.mjs.map +0 -1
  369. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  370. package/localnet/get-localnet-dispenser-account.js.map +0 -1
  371. package/localnet/get-localnet-dispenser-account.mjs.map +0 -1
  372. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  373. package/localnet/get-or-create-kmd-wallet-account.js.map +0 -1
  374. package/localnet/get-or-create-kmd-wallet-account.mjs.map +0 -1
  375. package/localnet/index.d.ts.map +0 -1
  376. package/localnet/is-localnet.d.ts.map +0 -1
  377. package/localnet/is-localnet.js.map +0 -1
  378. package/localnet/is-localnet.mjs.map +0 -1
  379. package/network-client.d.ts.map +0 -1
  380. package/network-client.js.map +0 -1
  381. package/network-client.mjs.map +0 -1
  382. package/testing/_asset.d.ts.map +0 -1
  383. package/testing/account.d.ts.map +0 -1
  384. package/testing/account.js.map +0 -1
  385. package/testing/account.mjs.map +0 -1
  386. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  387. package/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
  388. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +0 -1
  389. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  390. package/testing/fixtures/algorand-fixture.js.map +0 -1
  391. package/testing/fixtures/algorand-fixture.mjs.map +0 -1
  392. package/testing/fixtures/index.d.ts.map +0 -1
  393. package/testing/index.d.ts.map +0 -1
  394. package/testing/indexer.d.ts.map +0 -1
  395. package/testing/indexer.js.map +0 -1
  396. package/testing/indexer.mjs.map +0 -1
  397. package/testing/test-logger.d.ts.map +0 -1
  398. package/testing/test-logger.js.map +0 -1
  399. package/testing/test-logger.mjs.map +0 -1
  400. package/testing/transaction-logger.d.ts.map +0 -1
  401. package/testing/transaction-logger.js.map +0 -1
  402. package/testing/transaction-logger.mjs.map +0 -1
  403. package/transaction/index.d.ts.map +0 -1
  404. package/transaction/legacy-bridge.d.ts.map +0 -1
  405. package/transaction/legacy-bridge.js +0 -35
  406. package/transaction/legacy-bridge.js.map +0 -1
  407. package/transaction/legacy-bridge.mjs +0 -33
  408. package/transaction/legacy-bridge.mjs.map +0 -1
  409. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  410. package/transaction/perform-atomic-transaction-composer-simulate.js.map +0 -1
  411. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +0 -1
  412. package/transaction/transaction.d.ts.map +0 -1
  413. package/transaction/transaction.js.map +0 -1
  414. package/transaction/transaction.mjs.map +0 -1
  415. package/transfer/index.d.ts.map +0 -1
  416. package/transfer/transfer-algos.d.ts.map +0 -1
  417. package/transfer/transfer-algos.js.map +0 -1
  418. package/transfer/transfer-algos.mjs.map +0 -1
  419. package/transfer/transfer.d.ts.map +0 -1
  420. package/transfer/transfer.js.map +0 -1
  421. package/transfer/transfer.mjs.map +0 -1
  422. package/types/account-manager.d.ts.map +0 -1
  423. package/types/account.d.ts.map +0 -1
  424. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  425. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  426. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  427. package/types/algorand-client.d.ts.map +0 -1
  428. package/types/amount.d.ts.map +0 -1
  429. package/types/app-client.d.ts.map +0 -1
  430. package/types/app-spec.d.ts.map +0 -1
  431. package/types/app.d.ts.map +0 -1
  432. package/types/asset-manager.d.ts.map +0 -1
  433. package/types/asset.d.ts.map +0 -1
  434. package/types/client-manager.d.ts.map +0 -1
  435. package/types/composer.d.ts.map +0 -1
  436. package/types/config.d.ts.map +0 -1
  437. package/types/debugging.d.ts.map +0 -1
  438. package/types/dispenser-client.d.ts.map +0 -1
  439. package/types/indexer.d.ts.map +0 -1
  440. package/types/kmd-account-manager.d.ts.map +0 -1
  441. package/types/logging.d.ts.map +0 -1
  442. package/types/logic-error.d.ts.map +0 -1
  443. package/types/network-client.d.ts.map +0 -1
  444. package/types/testing.d.ts.map +0 -1
  445. package/types/transaction.d.ts.map +0 -1
  446. package/types/transfer.d.ts.map +0 -1
  447. package/types/urlTokenBaseHTTPClient.d.ts +0 -41
  448. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  449. package/types/urlTokenBaseHTTPClient.js +0 -153
  450. package/types/urlTokenBaseHTTPClient.js.map +0 -1
  451. package/types/urlTokenBaseHTTPClient.mjs +0 -151
  452. package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
  453. package/util.d.ts.map +0 -1
  454. package/util.js.map +0 -1
  455. package/util.mjs.map +0 -1
  456. /package/{account → src/account}/get-account-config-from-environment.js +0 -0
  457. /package/{account → src/account}/get-account-config-from-environment.mjs +0 -0
  458. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.js +0 -0
  459. /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.mjs +0 -0
  460. /package/{testing → src/testing}/indexer.js +0 -0
  461. /package/{testing → src/testing}/indexer.mjs +0 -0
  462. /package/{testing → src/testing}/transaction-logger.js +0 -0
  463. /package/{testing → src/testing}/transaction-logger.mjs +0 -0
@@ -1,12 +1,13 @@
1
1
  import algosdk from 'algosdk';
2
- import { AppLookup } from './app';
3
- import { AppDetails, AppDetailsBase, AppSpecAppDetailsBase, ApplicationClient, ResolveAppByCreatorAndNameBase, ResolveAppByIdBase } from './app-client';
2
+ import { AlgorandClientInterface } from './algorand-client-interface';
3
+ import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client';
4
+ import { AppFactory, AppFactoryParams } from './app-factory';
4
5
  import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client';
5
- import { AlgoClientConfig, AlgoConfig } from './network-client';
6
+ import { Expand } from './expand';
7
+ import { AlgoClientConfig, AlgoConfig, NetworkDetails } from './network-client';
6
8
  import Kmd = algosdk.Kmd;
7
9
  import Indexer = algosdk.Indexer;
8
10
  import Algodv2 = algosdk.Algodv2;
9
- import IntDecoding = algosdk.IntDecoding;
10
11
  /** Clients from algosdk that interact with the official Algorand APIs */
11
12
  export interface AlgoSdkClients {
12
13
  /** Algod client, see https://developer.algorand.org/docs/rest-apis/algod/ */
@@ -16,24 +17,28 @@ export interface AlgoSdkClients {
16
17
  /** Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ */
17
18
  kmd?: algosdk.Kmd;
18
19
  }
19
- /** Details of the current network. */
20
- export interface NetworkDetails {
21
- /** Whether or not the network is TestNet. */
22
- isTestNet: boolean;
23
- /** Whether or not the network is MainNet. */
24
- isMainNet: boolean;
25
- /** Whether or not the network is LocalNet. */
26
- isLocalNet: boolean;
27
- /** The genesis ID of the current network. */
28
- genesisId: string;
29
- /** The base64 genesis hash of the current network. */
30
- genesisHash: string;
31
- }
20
+ /** Params to get an app factory from `ClientManager`. */
21
+ export type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>;
22
+ /** Params to get an app client by creator address and name from `ClientManager`. */
23
+ export type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>;
24
+ /** Params to get an app client by ID from `ClientManager`. */
25
+ export type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>;
26
+ /** Params to get an app client by network from `ClientManager`. */
27
+ export type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>;
28
+ /** Params to get a typed app client by creator address and name from `ClientManager`. */
29
+ export type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
30
+ /** Params to get a typed app client by ID from `ClientManager`. */
31
+ export type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
32
+ /** Params to get a typed app client by network from `ClientManager`. */
33
+ export type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>;
34
+ /** Params to get a typed app factory from `ClientManager`. */
35
+ export type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>;
32
36
  /** Exposes access to various API clients. */
33
37
  export declare class ClientManager {
34
38
  private _algod;
35
39
  private _indexer?;
36
40
  private _kmd?;
41
+ private _algorand?;
37
42
  /**
38
43
  * algosdk clients or config for interacting with the official Algorand APIs.
39
44
  * @param clientsOrConfig The clients or config to use
@@ -54,11 +59,13 @@ export declare class ClientManager {
54
59
  * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
55
60
  * ```
56
61
  */
57
- constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients);
62
+ constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface);
58
63
  /** Returns an algosdk Algod API client. */
59
64
  get algod(): algosdk.Algodv2;
60
65
  /** Returns an algosdk Indexer API client or throws an error if it's not been provided. */
61
66
  get indexer(): algosdk.Indexer;
67
+ /** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */
68
+ get indexerIfPresent(): algosdk.Indexer | undefined;
62
69
  /** Returns an algosdk KMD API client or throws an error if it's not been provided. */
63
70
  get kmd(): algosdk.Kmd;
64
71
  private _getNetworkPromise;
@@ -127,28 +134,82 @@ export declare class ClientManager {
127
134
  */
128
135
  getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>): TestNetDispenserApiClient;
129
136
  /**
130
- * Returns a new `ApplicationClient` client, resolving the app by creator address and name.
131
- * @param details The details to resolve the app by creator address and name
132
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
133
- * @returns The `ApplicationClient`
137
+ * Returns a new `AppFactory` client
138
+ * @example Basic example
139
+ * ```typescript
140
+ * const factory = algorand.client.getAppFactory({
141
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
142
+ * })
143
+ * ```
144
+ * @example Advanced example
145
+ * ```typescript
146
+ * const factory = algorand.client.getAppFactory({
147
+ * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
148
+ * defaultSender: "SENDERADDRESS",
149
+ * appName: "OverriddenAppName",
150
+ * version: "2.0.0",
151
+ * updatable: true,
152
+ * deletable: false,
153
+ * deployTimeParams: { ONE: 1, TWO: 'value' }
154
+ * })
155
+ * ```
156
+ */
157
+ getAppFactory(params: ClientAppFactoryParams): AppFactory;
158
+ /**
159
+ * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
160
+ * This method resolves the app ID by looking up the creator address and name
161
+ * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
162
+ * @param params The parameters to create the app client
163
+ * @example Basic
164
+ * ```typescript
165
+ * const appClient = algorand.client.getAppClientByCreatorAndName({
166
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
167
+ * // appId resolved by looking for app ID of named app by this creator
168
+ * creatorAddress: 'CREATORADDRESS',
169
+ * })
170
+ * ```
171
+ * @returns The `AppClient`
172
+ */
173
+ getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
174
+ /**
175
+ * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
176
+ * @param params The parameters to create the app client
177
+ * @example Basic
178
+ * ```typescript
179
+ * const appClient = algorand.client.getAppClientById({
180
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
181
+ * appId: 12345n,
182
+ * })
183
+ * ```
184
+ * @returns The `AppClient`
134
185
  */
135
- getAppClientByCreatorAndName(details: AppClientByCreatorAndNameDetails, cachedAppLookup?: AppLookup): ApplicationClient;
186
+ getAppClientById(params: ClientAppClientParams): AppClient;
136
187
  /**
137
- * Returns a new `ApplicationClient` client, resolving the app by app ID.
138
- * @param details The details to resolve the app by ID
139
- * @returns The `ApplicationClient`
188
+ * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
189
+ * This method resolves the app ID for the current network based on
190
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
191
+ *
192
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
193
+ * @param params The parameters to create the app client
194
+ * @example Basic
195
+ * ```typescript
196
+ * const appClient = algorand.client.getAppClientByNetwork({
197
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
198
+ * // appId resolved by using ARC-56 spec to find app ID for current network
199
+ * })
200
+ * ```
201
+ * @returns The `AppClient`
140
202
  */
141
- getAppClientById(details: AppClientByIdDetails): ApplicationClient;
203
+ getAppClientByNetwork(params: ClientAppClientByNetworkParams): Promise<AppClient>;
142
204
  /**
143
205
  * Returns a new typed client, resolving the app by creator address and name.
144
206
  * @param typedClient The typed client type to use
145
- * @param details The details to resolve the app by creator address and name
146
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
147
- * @example Use name in ARC-32 app spec
207
+ * @param params The params to resolve the app by creator address and name
208
+ * @example Use name in ARC-32 / ARC-56 app spec
148
209
  * ```typescript
149
210
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
150
211
  * creatorAddress: "CREATORADDRESS",
151
- * sender: alice,
212
+ * defaultSender: alice,
152
213
  * })
153
214
  * ```
154
215
  * @example Specify name
@@ -156,26 +217,55 @@ export declare class ClientManager {
156
217
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
157
218
  * creatorAddress: "CREATORADDRESS",
158
219
  * name: "contract-name",
159
- * sender: alice,
220
+ * defaultSender: alice,
160
221
  * })
161
222
  * ```
162
223
  * @returns The typed client instance
163
224
  */
164
- getTypedAppClientByCreatorAndName<TClient>(typedClient: TypedAppClient<TClient>, details: TypedAppClientByCreatorAndNameDetails, cachedAppLookup?: AppLookup): TClient;
225
+ getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientByCreatorAndNameParams): Promise<InstanceType<TClient>>;
165
226
  /**
166
227
  * Returns a new typed client, resolving the app by app ID.
167
228
  * @param typedClient The typed client type to use
168
- * @param details The details to resolve the app by ID
229
+ * @param params The params to resolve the app by ID
169
230
  * @example
170
231
  * ```typescript
171
232
  * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
172
- * id: 12345,
233
+ * appId: 12345n,
234
+ * defaultSender: alice,
235
+ * })
236
+ * ```
237
+ * @returns The typed client instance
238
+ */
239
+ getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientParams): InstanceType<TClient>;
240
+ /**
241
+ * Returns a new typed client, resolves the app ID for the current network based on
242
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
243
+ *
244
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
245
+ * @param typedClient The typed client type to use
246
+ * @param params The params to resolve the app by network
247
+ * @example
248
+ * ```typescript
249
+ * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
250
+ * defaultSender: alice,
251
+ * })
252
+ * ```
253
+ * @returns The typed client instance
254
+ */
255
+ getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params?: ClientTypedAppClientByNetworkParams): Promise<InstanceType<TClient>>;
256
+ /**
257
+ * Returns a new typed app factory.
258
+ * @param typedFactory The typed factory type to use
259
+ * @param params The params to resolve the factory by
260
+ * @example
261
+ * ```typescript
262
+ * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
173
263
  * sender: alice,
174
264
  * })
175
265
  * ```
176
266
  * @returns The typed client instance
177
267
  */
178
- getTypedAppClientById<TClient>(typedClient: TypedAppClient<TClient>, details: TypedAppClientByIdDetails): TClient;
268
+ getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams): TClient;
179
269
  /**
180
270
  * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
181
271
  *
@@ -252,7 +342,6 @@ export declare class ClientManager {
252
342
  * Returns an indexer SDK client that automatically retries on idempotent calls
253
343
  *
254
344
  * @param config The config of the client
255
- * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers
256
345
  * @example AlgoNode (testnet)
257
346
  * ```typescript
258
347
  * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))
@@ -268,16 +357,11 @@ export declare class ClientManager {
268
357
  * const indexer = ClientManager.getIndexerClient({server: 'http://localhost', port: '8980', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
269
358
  * await indexer.makeHealthCheck().do()
270
359
  * ```
271
- * @example Override int decoding for responses
272
- * ```typescript
273
- * const indexer = ClientManager.getIndexerClient(config, IntDecoding.BIGINT)
274
- * ```
275
360
  */
276
- static getIndexerClient(config: AlgoClientConfig, overrideIntDecoding?: IntDecoding): Indexer;
361
+ static getIndexerClient(config: AlgoClientConfig): Indexer;
277
362
  /**
278
363
  * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
279
364
  *
280
- * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers
281
365
  * @example
282
366
  *
283
367
  * ```typescript
@@ -286,7 +370,7 @@ export declare class ClientManager {
286
370
  * await indexer.makeHealthCheck().do()
287
371
  * ```
288
372
  */
289
- static getIndexerClientFromEnvironment(overrideIntDecoding?: IntDecoding): Indexer;
373
+ static getIndexerClientFromEnvironment(): Indexer;
290
374
  /**
291
375
  * Returns a KMD SDK client.
292
376
  *
@@ -314,22 +398,13 @@ export declare class ClientManager {
314
398
  * Interface to identify a typed client that can be used to interact with an application.
315
399
  */
316
400
  export interface TypedAppClient<TClient> {
317
- new (details: AppDetails, algod: algosdk.Algodv2): TClient;
401
+ new (params: Omit<AppClientParams, 'appSpec'>): TClient;
402
+ fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>;
403
+ fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>;
318
404
  }
319
405
  /**
320
- * Details to resolve an app client by creator address and name.
321
- */
322
- export type AppClientByCreatorAndNameDetails = AppSpecAppDetailsBase & AppDetailsBase & Omit<ResolveAppByCreatorAndNameBase, 'findExistingUsing'>;
323
- /**
324
- * Details to resolve a typed app creator address and name.
325
- */
326
- export type TypedAppClientByCreatorAndNameDetails = AppDetailsBase & Omit<ResolveAppByCreatorAndNameBase, 'findExistingUsing'>;
327
- /**
328
- * Details to resolve an app client by app ID.
406
+ * Interface to identify a typed factory that can be used to create and deploy an application.
329
407
  */
330
- export type AppClientByIdDetails = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase;
331
- /**
332
- * Details to resolve a typed app by app ID.
333
- */
334
- export type TypedAppClientByIdDetails = AppDetailsBase & ResolveAppByIdBase;
335
- //# sourceMappingURL=client-manager.d.ts.map
408
+ export interface TypedAppFactory<TClient> {
409
+ new (params: Omit<AppFactoryParams, 'appSpec'>): TClient;
410
+ }
@@ -3,12 +3,12 @@
3
3
  var algosdk = require('algosdk');
4
4
  var types_algoHttpClientWithRetry = require('./algo-http-client-with-retry.js');
5
5
  var types_appClient = require('./app-client.js');
6
+ var types_appFactory = require('./app-factory.js');
6
7
  var types_dispenserClient = require('./dispenser-client.js');
7
8
  var types_networkClient = require('./network-client.js');
8
9
 
9
10
  var Kmd = algosdk.Kmd;
10
11
  var Indexer = algosdk.Indexer;
11
- var IntDecoding = algosdk.IntDecoding;
12
12
  /** Exposes access to various API clients. */
13
13
  class ClientManager {
14
14
  /**
@@ -31,7 +31,7 @@ class ClientManager {
31
31
  * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
32
32
  * ```
33
33
  */
34
- constructor(clientsOrConfig) {
34
+ constructor(clientsOrConfig, algorandClient) {
35
35
  const _clients = 'algod' in clientsOrConfig
36
36
  ? clientsOrConfig
37
37
  : {
@@ -42,6 +42,7 @@ class ClientManager {
42
42
  this._algod = _clients.algod;
43
43
  this._indexer = _clients.indexer;
44
44
  this._kmd = _clients.kmd;
45
+ this._algorand = algorandClient;
45
46
  }
46
47
  /** Returns an algosdk Algod API client. */
47
48
  get algod() {
@@ -53,6 +54,10 @@ class ClientManager {
53
54
  throw new Error('Attempt to use Indexer client in AlgoKit instance with no Indexer configured');
54
55
  return this._indexer;
55
56
  }
57
+ /** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */
58
+ get indexerIfPresent() {
59
+ return this._indexer;
60
+ }
56
61
  /** Returns an algosdk KMD API client or throws an error if it's not been provided. */
57
62
  get kmd() {
58
63
  if (!this._kmd)
@@ -74,11 +79,11 @@ class ClientManager {
74
79
  }
75
80
  const params = await this._getNetworkPromise;
76
81
  return {
77
- isTestNet: ['testnet-v1.0', 'testnet-v1', 'testnet'].includes(params.genesisID),
78
- isMainNet: ['mainnet-v1.0', 'mainnet-v1', 'mainnet'].includes(params.genesisID),
79
- isLocalNet: ClientManager.genesisIdIsLocalNet(params.genesisID),
80
- genesisId: params.genesisID,
81
- genesisHash: params.genesisHash,
82
+ isTestNet: ['testnet-v1.0', 'testnet-v1', 'testnet'].includes(params.genesisID ?? 'unknown'),
83
+ isMainNet: ['mainnet-v1.0', 'mainnet-v1', 'mainnet'].includes(params.genesisID ?? 'unknown'),
84
+ isLocalNet: ClientManager.genesisIdIsLocalNet(params.genesisID ?? 'unknown'),
85
+ genesisId: params.genesisID ?? 'unknown',
86
+ genesisHash: params.genesisHash ? Buffer.from(params.genesisHash).toString('base64') : 'unknown',
82
87
  };
83
88
  }
84
89
  /**
@@ -148,32 +153,105 @@ class ClientManager {
148
153
  return new types_dispenserClient.TestNetDispenserApiClient(params ? { ...params, authToken: '' } : undefined);
149
154
  }
150
155
  /**
151
- * Returns a new `ApplicationClient` client, resolving the app by creator address and name.
152
- * @param details The details to resolve the app by creator address and name
153
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
154
- * @returns The `ApplicationClient`
156
+ * Returns a new `AppFactory` client
157
+ * @example Basic example
158
+ * ```typescript
159
+ * const factory = algorand.client.getAppFactory({
160
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
161
+ * })
162
+ * ```
163
+ * @example Advanced example
164
+ * ```typescript
165
+ * const factory = algorand.client.getAppFactory({
166
+ * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
167
+ * defaultSender: "SENDERADDRESS",
168
+ * appName: "OverriddenAppName",
169
+ * version: "2.0.0",
170
+ * updatable: true,
171
+ * deletable: false,
172
+ * deployTimeParams: { ONE: 1, TWO: 'value' }
173
+ * })
174
+ * ```
155
175
  */
156
- getAppClientByCreatorAndName(details, cachedAppLookup) {
157
- return new types_appClient.ApplicationClient({ ...details, resolveBy: 'creatorAndName', findExistingUsing: cachedAppLookup ?? this.indexer }, this._algod);
176
+ getAppFactory(params) {
177
+ if (!this._algorand) {
178
+ throw new Error('Attempt to get app factory from a ClientManager without an Algorand client');
179
+ }
180
+ return new types_appFactory.AppFactory({ ...params, algorand: this._algorand });
158
181
  }
159
182
  /**
160
- * Returns a new `ApplicationClient` client, resolving the app by app ID.
161
- * @param details The details to resolve the app by ID
162
- * @returns The `ApplicationClient`
183
+ * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
184
+ * This method resolves the app ID by looking up the creator address and name
185
+ * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
186
+ * @param params The parameters to create the app client
187
+ * @example Basic
188
+ * ```typescript
189
+ * const appClient = algorand.client.getAppClientByCreatorAndName({
190
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
191
+ * // appId resolved by looking for app ID of named app by this creator
192
+ * creatorAddress: 'CREATORADDRESS',
193
+ * })
194
+ * ```
195
+ * @returns The `AppClient`
196
+ */
197
+ getAppClientByCreatorAndName(params) {
198
+ if (!this._algorand) {
199
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
200
+ }
201
+ return types_appClient.AppClient.fromCreatorAndName({
202
+ ...params,
203
+ algorand: this._algorand,
204
+ });
205
+ }
206
+ /**
207
+ * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
208
+ * @param params The parameters to create the app client
209
+ * @example Basic
210
+ * ```typescript
211
+ * const appClient = algorand.client.getAppClientById({
212
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
213
+ * appId: 12345n,
214
+ * })
215
+ * ```
216
+ * @returns The `AppClient`
217
+ */
218
+ getAppClientById(params) {
219
+ if (!this._algorand) {
220
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
221
+ }
222
+ return new types_appClient.AppClient({ ...params, algorand: this._algorand });
223
+ }
224
+ /**
225
+ * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
226
+ * This method resolves the app ID for the current network based on
227
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
228
+ *
229
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
230
+ * @param params The parameters to create the app client
231
+ * @example Basic
232
+ * ```typescript
233
+ * const appClient = algorand.client.getAppClientByNetwork({
234
+ * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
235
+ * // appId resolved by using ARC-56 spec to find app ID for current network
236
+ * })
237
+ * ```
238
+ * @returns The `AppClient`
163
239
  */
164
- getAppClientById(details) {
165
- return new types_appClient.ApplicationClient({ ...details, resolveBy: 'id' }, this._algod);
240
+ async getAppClientByNetwork(params) {
241
+ if (!this._algorand) {
242
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
243
+ }
244
+ return types_appClient.AppClient.fromNetwork({ ...params, algorand: this._algorand });
166
245
  }
167
246
  /**
168
247
  * Returns a new typed client, resolving the app by creator address and name.
169
248
  * @param typedClient The typed client type to use
170
- * @param details The details to resolve the app by creator address and name
171
- * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
172
- * @example Use name in ARC-32 app spec
249
+ * @param params The params to resolve the app by creator address and name
250
+ * @example Use name in ARC-32 / ARC-56 app spec
173
251
  * ```typescript
174
252
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
175
253
  * creatorAddress: "CREATORADDRESS",
176
- * sender: alice,
254
+ * defaultSender: alice,
177
255
  * })
178
256
  * ```
179
257
  * @example Specify name
@@ -181,29 +259,74 @@ class ClientManager {
181
259
  * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
182
260
  * creatorAddress: "CREATORADDRESS",
183
261
  * name: "contract-name",
184
- * sender: alice,
262
+ * defaultSender: alice,
185
263
  * })
186
264
  * ```
187
265
  * @returns The typed client instance
188
266
  */
189
- getTypedAppClientByCreatorAndName(typedClient, details, cachedAppLookup) {
190
- return new typedClient({ ...details, resolveBy: 'creatorAndName', findExistingUsing: cachedAppLookup ?? this.indexer }, this._algod);
267
+ async getTypedAppClientByCreatorAndName(typedClient, params) {
268
+ if (!this._algorand) {
269
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
270
+ }
271
+ return typedClient.fromCreatorAndName({ ...params, algorand: this._algorand });
191
272
  }
192
273
  /**
193
274
  * Returns a new typed client, resolving the app by app ID.
194
275
  * @param typedClient The typed client type to use
195
- * @param details The details to resolve the app by ID
276
+ * @param params The params to resolve the app by ID
196
277
  * @example
197
278
  * ```typescript
198
279
  * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
199
- * id: 12345,
280
+ * appId: 12345n,
281
+ * defaultSender: alice,
282
+ * })
283
+ * ```
284
+ * @returns The typed client instance
285
+ */
286
+ getTypedAppClientById(typedClient, params) {
287
+ if (!this._algorand) {
288
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
289
+ }
290
+ return new typedClient({ ...params, algorand: this._algorand });
291
+ }
292
+ /**
293
+ * Returns a new typed client, resolves the app ID for the current network based on
294
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
295
+ *
296
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
297
+ * @param typedClient The typed client type to use
298
+ * @param params The params to resolve the app by network
299
+ * @example
300
+ * ```typescript
301
+ * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
302
+ * defaultSender: alice,
303
+ * })
304
+ * ```
305
+ * @returns The typed client instance
306
+ */
307
+ getTypedAppClientByNetwork(typedClient, params) {
308
+ if (!this._algorand) {
309
+ throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
310
+ }
311
+ return typedClient.fromNetwork({ ...params, algorand: this._algorand });
312
+ }
313
+ /**
314
+ * Returns a new typed app factory.
315
+ * @param typedFactory The typed factory type to use
316
+ * @param params The params to resolve the factory by
317
+ * @example
318
+ * ```typescript
319
+ * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
200
320
  * sender: alice,
201
321
  * })
202
322
  * ```
203
323
  * @returns The typed client instance
204
324
  */
205
- getTypedAppClientById(typedClient, details) {
206
- return new typedClient({ ...details, resolveBy: 'id' }, this._algod);
325
+ getTypedAppFactory(typedFactory, params) {
326
+ if (!this._algorand) {
327
+ throw new Error('Attempt to get app factory from a ClientManager without an Algorand client');
328
+ }
329
+ return new typedFactory({ ...params, algorand: this._algorand });
207
330
  }
208
331
  /**
209
332
  * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
@@ -324,7 +447,7 @@ class ClientManager {
324
447
  */
325
448
  static getAlgodClient(config) {
326
449
  const { token, server, port } = config;
327
- const tokenHeader = typeof token === 'string' ? { 'X-Algo-API-Token': token } : token ?? {};
450
+ const tokenHeader = typeof token === 'string' ? { 'X-Algo-API-Token': token } : (token ?? {});
328
451
  const httpClientWithRetry = new types_algoHttpClientWithRetry.AlgoHttpClientWithRetry(tokenHeader, server, port);
329
452
  return new algosdk.Algodv2(httpClientWithRetry, server);
330
453
  }
@@ -345,7 +468,6 @@ class ClientManager {
345
468
  * Returns an indexer SDK client that automatically retries on idempotent calls
346
469
  *
347
470
  * @param config The config of the client
348
- * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers
349
471
  * @example AlgoNode (testnet)
350
472
  * ```typescript
351
473
  * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))
@@ -361,24 +483,16 @@ class ClientManager {
361
483
  * const indexer = ClientManager.getIndexerClient({server: 'http://localhost', port: '8980', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
362
484
  * await indexer.makeHealthCheck().do()
363
485
  * ```
364
- * @example Override int decoding for responses
365
- * ```typescript
366
- * const indexer = ClientManager.getIndexerClient(config, IntDecoding.BIGINT)
367
- * ```
368
486
  */
369
- static getIndexerClient(config, overrideIntDecoding) {
487
+ static getIndexerClient(config) {
370
488
  const { token, server, port } = config;
371
- const tokenHeader = typeof token === 'string' ? { 'X-Indexer-API-Token': token } : token ?? {};
489
+ const tokenHeader = typeof token === 'string' ? { 'X-Indexer-API-Token': token } : (token ?? {});
372
490
  const httpClientWithRetry = new types_algoHttpClientWithRetry.AlgoHttpClientWithRetry(tokenHeader, server, port);
373
- const indexer = new Indexer(httpClientWithRetry);
374
- // Use mixed int decoding by default so bigints don't have lost precision
375
- indexer.setIntEncoding(overrideIntDecoding ?? IntDecoding.MIXED);
376
- return indexer;
491
+ return new Indexer(httpClientWithRetry);
377
492
  }
378
493
  /**
379
494
  * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
380
495
  *
381
- * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers
382
496
  * @example
383
497
  *
384
498
  * ```typescript
@@ -387,8 +501,8 @@ class ClientManager {
387
501
  * await indexer.makeHealthCheck().do()
388
502
  * ```
389
503
  */
390
- static getIndexerClientFromEnvironment(overrideIntDecoding) {
391
- return ClientManager.getIndexerClient(ClientManager.getIndexerConfigFromEnvironment(), overrideIntDecoding);
504
+ static getIndexerClientFromEnvironment() {
505
+ return ClientManager.getIndexerClient(ClientManager.getIndexerConfigFromEnvironment());
392
506
  }
393
507
  /**
394
508
  * Returns a KMD SDK client.