@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-deploy.mjs","sources":["../../src/app-deploy.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { compileTeal, getAppOnCompleteAction } from './app'\nimport { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge'\nimport { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction'\nimport { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender'\nimport {\n ABIReturn,\n APP_DEPLOY_NOTE_DAPP,\n AppCompilationResult,\n AppDeployMetadata,\n AppDeploymentParams,\n AppLookup,\n AppMetadata,\n CompiledTeal,\n TealTemplateParams,\n} from './types/app'\nimport { AppDeployer } from './types/app-deployer'\nimport { AppManager, BoxReference } from './types/app-manager'\nimport { AssetManager } from './types/asset-manager'\nimport {\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n TransactionComposer,\n} from './types/composer'\nimport { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\nimport Indexer = algosdk.Indexer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * @deprecated Use `algorand.appDeployer.deploy` instead.\n *\n * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n *\n * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n *\n * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.\n *\n * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n *\n * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n * @param deployment The arguments to control the app deployment\n * @param algod An algod client\n * @param indexer An indexer client, needed if `existingDeployments` not passed in\n * @returns The app reference of the new/existing app\n */\nexport async function deployApp(\n deployment: AppDeploymentParams,\n algod: Algodv2,\n indexer?: Indexer,\n): Promise<\n Partial<AppCompilationResult> &\n (\n | (ConfirmedTransactionResults & AppMetadata & { return?: ABIReturn; operationPerformed: 'create' | 'update' })\n | (ConfirmedTransactionResults &\n AppMetadata & {\n return?: ABIReturn\n deleteReturn?: ABIReturn\n deleteResult: ConfirmedTransactionResult\n operationPerformed: 'replace'\n })\n | (AppMetadata & { operationPerformed: 'nothing' })\n )\n> {\n const appManager = new AppManager(algod)\n const newGroup = () =>\n new TransactionComposer({\n algod,\n getSigner: () => getSenderTransactionSigner(deployment.from),\n getSuggestedParams: async () =>\n deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),\n appManager,\n })\n const deployer = new AppDeployer(\n appManager,\n new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager),\n indexer,\n )\n\n const createParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.createArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.createArgs?.lease,\n rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n extraProgramPages: deployment.schema.extraPages,\n onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction) as Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.ClearStateOC\n >,\n schema: deployment.schema,\n } satisfies Partial<AppCreateParams>\n\n const updateParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.updateArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.updateArgs?.lease,\n rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n } satisfies Partial<AppUpdateParams>\n\n const deleteParams = {\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.deleteArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.deleteArgs?.lease,\n rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n } satisfies Partial<AppDeleteParams>\n\n const encoder = new TextEncoder()\n\n const result = await deployer.deploy({\n createParams: deployment.createArgs?.method\n ? ({\n ...createParams,\n method:\n 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),\n args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,\n } satisfies AppCreateMethodCall)\n : ({\n ...createParams,\n args:\n 'appArgs' in (deployment?.createArgs ?? {})\n ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies AppCreateParams),\n updateParams: deployment.updateArgs?.method\n ? ({\n ...updateParams,\n method:\n 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),\n args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppUpdateMethodCall, 'appId'>)\n : ({\n ...updateParams,\n args:\n 'appArgs' in (deployment?.updateArgs ?? {})\n ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppUpdateParams, 'appId'>),\n deleteParams: deployment.deleteArgs?.method\n ? ({\n ...deleteParams,\n method:\n 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),\n args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppDeleteMethodCall, 'appId'>)\n : ({\n ...deleteParams,\n args:\n 'appArgs' in (deployment?.deleteArgs ?? {})\n ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppDeleteParams, 'appId'>),\n metadata: deployment.metadata,\n deployTimeParams: deployment.deployTimeParams,\n onSchemaBreak: deployment.onSchemaBreak,\n onUpdate: deployment.onUpdate,\n existingDeployments: deployment.existingDeployments\n ? {\n creator: Address.fromString(deployment.existingDeployments.creator),\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: Address.fromString(app.appAddress),\n appId: BigInt(app.appId),\n createdRound: BigInt(app.createdRound),\n updatedRound: BigInt(app.updatedRound),\n },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return {\n ...result,\n appAddress: result.appAddress.toString(),\n appId: Number(result.appId),\n createdRound: Number(result.createdRound),\n updatedRound: Number(result.updatedRound),\n }\n}\n\n/**\n * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.\n *\n * Returns true is there is a breaking change in the application state schema from before to after.\n * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.\n * Otherwise, there is no error, the app just doesn't store data in the extra schema :(\n *\n * @param before The existing schema\n * @param after The new schema\n * @returns Whether or not there is a breaking change\n */\nexport function isSchemaIsBroken(before: modelsv2.ApplicationStateSchema, after: modelsv2.ApplicationStateSchema) {\n return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint\n}\n\n/**\n * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.\n *\n * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.\n *\n * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).\n *\n * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for\n * @param indexer An indexer client\n * @returns A name-based lookup of the app information (id, address)\n */\nexport async function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup> {\n const lookup = await new AppDeployer(undefined!, undefined!, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount))\n\n return {\n creator: lookup.creator.toString(),\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: app.appAddress.toString(),\n appId: Number(app.appId),\n createdRound: Number(app.createdRound),\n updatedRound: Number(app.updatedRound),\n },\n ]),\n ),\n }\n}\n\n/**\n * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.\n *\n * Return the transaction note for an app deployment.\n * @param metadata The metadata of the deployment\n * @returns The transaction note as a utf-8 string\n */\nexport function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote {\n return {\n dAppName: APP_DEPLOY_NOTE_DAPP,\n data: metadata,\n format: 'j',\n }\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead\n *\n * Replaces deploy-time deployment control parameters within the given teal code.\n *\n * * `TMPL_UPDATABLE` for updatability / immutability control\n * * `TMPL_DELETABLE` for deletability / permanence control\n *\n * Note: If these values are not undefined, but the corresponding `TMPL_*` value\n * isn't in the teal code it will throw an exception.\n *\n * @param tealCode The TEAL code to substitute\n * @param params The deploy-time deployment control parameter value to replace\n * @returns The replaced TEAL code\n */\nexport function replaceDeployTimeControlParams(tealCode: string, params: { updatable?: boolean; deletable?: boolean }) {\n return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params)\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateParams` instead\n *\n * Performs template substitution of a teal file.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @returns The TEAL code with replacements\n */\nexport function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams) {\n return AppManager.replaceTealTemplateParams(tealCode, templateParams)\n}\n\n/**\n * @deprecated Use `algorand.appManager.compileTealTemplate` instead.\n *\n * Performs template substitution of a teal file and compiles it, returning the compiled result.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param algod An algod client\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @param deploymentMetadata The deployment metadata the app will be deployed with\n * @returns The information about the compiled code\n */\nexport async function performTemplateSubstitutionAndCompile(\n tealCode: string,\n algod: Algodv2,\n templateParams?: TealTemplateParams,\n deploymentMetadata?: AppDeployMetadata,\n): Promise<CompiledTeal> {\n tealCode = stripTealComments(tealCode)\n\n tealCode = performTemplateSubstitution(tealCode, templateParams)\n\n if (deploymentMetadata) {\n tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata)\n }\n\n return await compileTeal(tealCode, algod)\n}\n\n/**\n * @deprecated Use `AppManager.stripTealComments` instead.\n *\n * Remove comments from TEAL Code\n *\n * @param tealCode The TEAL logic to compile\n * @returns The TEAL without comments\n */\nexport function stripTealComments(tealCode: string) {\n return AppManager.stripTealComments(tealCode)\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;;AAgBG;AACI,eAAe,SAAS,CAC7B,UAA+B,EAC/B,KAAc,EACd,OAAiB,EAAA;AAejB,IAAA,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAA;AACxC,IAAA,MAAM,QAAQ,GAAG,MACf,IAAI,mBAAmB,CAAC;QACtB,KAAK;QACL,SAAS,EAAE,MAAM,0BAA0B,CAAC,UAAU,CAAC,IAAI,CAAC;QAC5D,kBAAkB,EAAE,YAClB,UAAU,CAAC,iBAAiB,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,EAAE,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE;QAC9G,UAAU;AACX,KAAA,CAAC,CAAA;IACJ,MAAM,QAAQ,GAAG,IAAI,WAAW,CAC9B,UAAU,EACV,IAAI,+BAA+B,CAAC,QAAQ,EAAE,IAAI,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,UAAU,CAAC,EAC5F,OAAO,CACR,CAAA;AAED,IAAA,MAAM,YA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,EAAE,cAAc,CAAC,CAAA;IAEhE,IAAI,kBAAkB,EAAE;AACtB,QAAA,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;KACxE;AAED,IAAA,OAAO,MAAM,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,QAAgB,EAAA;AAChD,IAAA,OAAO,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AAC/C;;;;"}
package/src/app.js ADDED
@@ -0,0 +1,349 @@
1
+ 'use strict';
2
+
3
+ var algosdk = require('algosdk');
4
+ var legacyBridge = require('./transaction/legacy-bridge.js');
5
+ var transaction = require('./transaction/transaction.js');
6
+ var types_appManager = require('../types/app-manager.js');
7
+ var util = require('./util.js');
8
+
9
+ var ABIMethod = algosdk.ABIMethod;
10
+ var OnApplicationComplete = algosdk.OnApplicationComplete;
11
+ /**
12
+ * @deprecated Use `algorand.send.appCreate()` / `algorand.createTransaction.appCreate()` / `algorand.send.appCreateMethodCall()`
13
+ * / `algorand.createTransaction.appCreateMethodCall()` instead
14
+ *
15
+ * Creates a smart contract app, returns the details of the created app.
16
+ * @param create The parameters to create the app with
17
+ * @param algod An algod client
18
+ * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result
19
+ */
20
+ async function createApp(create, algod) {
21
+ const onComplete = getAppOnCompleteAction(create.onCompleteAction);
22
+ if (onComplete === algosdk.OnApplicationComplete.ClearStateOC) {
23
+ throw new Error('Cannot create an app with on-complete action of ClearState');
24
+ }
25
+ const result = create.args?.method
26
+ ? await legacyBridge.legacySendAppTransactionBridge(algod, create.from, create.args, create, {
27
+ sender: transaction.getSenderAddress(create.from),
28
+ onComplete,
29
+ approvalProgram: create.approvalProgram,
30
+ clearStateProgram: create.clearStateProgram,
31
+ method: create.args.method instanceof ABIMethod ? create.args.method : new ABIMethod(create.args.method),
32
+ extraProgramPages: create.schema.extraPages,
33
+ schema: create.schema,
34
+ }, (c) => c.appCreateMethodCall, (c) => c.appCreateMethodCall)
35
+ : await legacyBridge.legacySendAppTransactionBridge(algod, create.from, create.args, create, {
36
+ sender: transaction.getSenderAddress(create.from),
37
+ onComplete,
38
+ approvalProgram: create.approvalProgram,
39
+ clearStateProgram: create.clearStateProgram,
40
+ extraProgramPages: create.schema.extraPages,
41
+ schema: create.schema,
42
+ }, (c) => c.appCreate, (c) => c.appCreate);
43
+ return {
44
+ ...result,
45
+ appId: 'appId' in result ? Number(result.appId) : 0,
46
+ appAddress: 'appAddress' in result ? result.appAddress.toString() : '',
47
+ };
48
+ }
49
+ /**
50
+ * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`
51
+ * / `algorand.createTransaction.appUpdateMethodCall()` instead
52
+ *
53
+ * Updates a smart contract app.
54
+ * @param update The parameters to update the app with
55
+ * @param algod An algod client
56
+ * @returns The transaction send result and the compilation result
57
+ */
58
+ async function updateApp(update, algod) {
59
+ return update.args?.method
60
+ ? await legacyBridge.legacySendAppTransactionBridge(algod, update.from, update.args, update, {
61
+ appId: BigInt(update.appId),
62
+ sender: transaction.getSenderAddress(update.from),
63
+ onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
64
+ approvalProgram: update.approvalProgram,
65
+ clearStateProgram: update.clearStateProgram,
66
+ method: update.args.method instanceof ABIMethod ? update.args.method : new ABIMethod(update.args.method),
67
+ }, (c) => c.appUpdateMethodCall, (c) => c.appUpdateMethodCall)
68
+ : await legacyBridge.legacySendAppTransactionBridge(algod, update.from, update.args, update, {
69
+ appId: BigInt(update.appId),
70
+ sender: transaction.getSenderAddress(update.from),
71
+ onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
72
+ approvalProgram: update.approvalProgram,
73
+ clearStateProgram: update.clearStateProgram,
74
+ }, (c) => c.appUpdate, (c) => c.appUpdate);
75
+ }
76
+ /**
77
+ * @deprecated Use `algosdk.OnApplicationComplete` directly instead.
78
+ *
79
+ * Returns a `algosdk.OnApplicationComplete` for the given onCompleteAction.
80
+ *
81
+ * If given `undefined` will return `OnApplicationComplete.NoOpOC`.
82
+ *
83
+ * If given an `AppCallType` will convert the string enum to the correct underlying `algosdk.OnApplicationComplete`.
84
+ *
85
+ * @param onCompletionAction The on completion action
86
+ * @returns The `algosdk.OnApplicationComplete`
87
+ */
88
+ function getAppOnCompleteAction(onCompletionAction) {
89
+ switch (onCompletionAction) {
90
+ case undefined:
91
+ case 'no_op':
92
+ case OnApplicationComplete.NoOpOC:
93
+ return OnApplicationComplete.NoOpOC;
94
+ case 'opt_in':
95
+ case OnApplicationComplete.OptInOC:
96
+ return OnApplicationComplete.OptInOC;
97
+ case 'close_out':
98
+ case OnApplicationComplete.CloseOutOC:
99
+ return OnApplicationComplete.CloseOutOC;
100
+ case 'clear_state':
101
+ case OnApplicationComplete.ClearStateOC:
102
+ return OnApplicationComplete.ClearStateOC;
103
+ case 'update_application':
104
+ case OnApplicationComplete.UpdateApplicationOC:
105
+ return OnApplicationComplete.UpdateApplicationOC;
106
+ case 'delete_application':
107
+ case OnApplicationComplete.DeleteApplicationOC:
108
+ return OnApplicationComplete.DeleteApplicationOC;
109
+ }
110
+ }
111
+ /**
112
+ * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`
113
+ * / `algorand.createTransaction.appUpdateMethodCall()` instead
114
+ *
115
+ * Issues a call to a given app.
116
+ * @param call The call details.
117
+ * @param algod An algod client
118
+ * @returns The result of the call
119
+ */
120
+ async function callApp(call, algod) {
121
+ const onComplete = getAppOnCompleteAction(call.callType);
122
+ if (onComplete === algosdk.OnApplicationComplete.UpdateApplicationOC) {
123
+ throw new Error('Cannot execute an app call with on-complete action of Update');
124
+ }
125
+ if (call.args?.method && onComplete === algosdk.OnApplicationComplete.ClearStateOC) {
126
+ throw new Error('Cannot execute an ABI method call with on-complete action of ClearState');
127
+ }
128
+ return call.args?.method
129
+ ? await legacyBridge.legacySendAppTransactionBridge(algod, call.from, call.args, call, {
130
+ appId: BigInt(call.appId),
131
+ sender: transaction.getSenderAddress(call.from),
132
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
+ onComplete: onComplete,
134
+ method: call.args.method instanceof ABIMethod ? call.args.method : new ABIMethod(call.args.method),
135
+ }, (c) => c.appCallMethodCall, (c) => c.appCallMethodCall)
136
+ : await legacyBridge.legacySendAppTransactionBridge(algod, call.from, call.args, call, {
137
+ appId: BigInt(call.appId),
138
+ sender: transaction.getSenderAddress(call.from),
139
+ onComplete,
140
+ }, (c) => c.appCall, (c) => c.appCall);
141
+ }
142
+ /**
143
+ * @deprecated Use `AppManager.getABIReturn` instead.
144
+ *
145
+ * Returns any ABI return values for the given app call arguments and transaction confirmation.
146
+ * @param args The arguments that were used for the call
147
+ * @param confirmation The transaction confirmation from algod
148
+ * @returns The return value for the method call
149
+ */
150
+ function getABIReturn(args, confirmation) {
151
+ if (!args || !args.method) {
152
+ return undefined;
153
+ }
154
+ const method = 'txnCount' in args.method ? args.method : new ABIMethod(args.method);
155
+ return types_appManager.AppManager.getABIReturn(confirmation, method);
156
+ }
157
+ /**
158
+ * @deprecated Use `algorand.app.getGlobalState` instead.
159
+ *
160
+ * Returns the current global state values for the given app ID
161
+ * @param appId The ID of the app return global state for
162
+ * @param algod An algod client instance
163
+ * @returns The current global state
164
+ */
165
+ async function getAppGlobalState(appId, algod) {
166
+ return await new types_appManager.AppManager(algod).getGlobalState(BigInt(appId));
167
+ }
168
+ /**
169
+ * @deprecated Use `algorand.app.getLocalState` instead.
170
+ *
171
+ * Returns the current global state values for the given app ID and account
172
+ * @param appId The ID of the app return global state for
173
+ * @param account Either the string address of an account or an account object for the account to get local state for the given app
174
+ * @param algod An algod client instance
175
+ * @returns The current local state for the given (app, account) combination
176
+ */
177
+ async function getAppLocalState(appId, account, algod) {
178
+ return new types_appManager.AppManager(algod).getLocalState(BigInt(appId), transaction.getSenderAddress(account));
179
+ }
180
+ /**
181
+ * @deprecated Use `algorand.app.getBoxNames` instead.
182
+ * Returns the names of the boxes for the given app.
183
+ * @param appId The ID of the app return box names for
184
+ * @param algod An algod client instance
185
+ * @returns The current box names
186
+ */
187
+ async function getAppBoxNames(appId, algod) {
188
+ return new types_appManager.AppManager(algod).getBoxNames(BigInt(appId));
189
+ }
190
+ /**
191
+ * @deprecated Use `algorand.app.getBoxValue` instead.
192
+ * Returns the value of the given box name for the given app.
193
+ * @param appId The ID of the app return box names for
194
+ * @param boxName The name of the box to return either as a string, binary array or `BoxName`
195
+ * @param algod An algod client instance
196
+ * @returns The current box value as a byte array
197
+ */
198
+ async function getAppBoxValue(appId, boxName, algod) {
199
+ return new types_appManager.AppManager(algod).getBoxValue(BigInt(appId), typeof boxName !== 'string' && 'name' in boxName ? boxName.nameRaw : boxName);
200
+ }
201
+ /**
202
+ * @deprecated Use `algorand.app.getBoxValues` instead.
203
+ * Returns the value of the given box names for the given app.
204
+ * @param appId The ID of the app return box names for
205
+ * @param boxNames The names of the boxes to return either as a string, binary array or `BoxName`
206
+ * @param algod An algod client instance
207
+ * @returns The current box values as a byte array in the same order as the passed in box names
208
+ */
209
+ async function getAppBoxValues(appId, boxNames, algod) {
210
+ return new types_appManager.AppManager(algod).getBoxValues(BigInt(appId), boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)));
211
+ }
212
+ /**
213
+ * @deprecated Use `algorand.app.getBoxValueFromABIType` instead.
214
+ * Returns the value of the given box name for the given app decoded based on the given ABI type.
215
+ * @param request The parameters for the box value request
216
+ * @param algod An algod client instance
217
+ * @returns The current box value as an ABI value
218
+ */
219
+ async function getAppBoxValueFromABIType(request, algod) {
220
+ return new types_appManager.AppManager(algod).getBoxValueFromABIType({
221
+ appId: BigInt(request.appId),
222
+ boxName: typeof request.boxName !== 'string' && 'name' in request.boxName ? request.boxName.nameRaw : request.boxName,
223
+ type: request.type,
224
+ });
225
+ }
226
+ /**
227
+ * @deprecated Use `algorand.app.getBoxValuesFromABIType` instead.
228
+ * Returns the value of the given box names for the given app decoded based on the given ABI type.
229
+ * @param request The parameters for the box value request
230
+ * @param algod An algod client instance
231
+ * @returns The current box values as an ABI value in the same order as the passed in box names
232
+ */
233
+ async function getAppBoxValuesFromABIType(request, algod) {
234
+ return new types_appManager.AppManager(algod).getBoxValuesFromABIType({
235
+ appId: BigInt(request.appId),
236
+ boxNames: request.boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)),
237
+ type: request.type,
238
+ });
239
+ }
240
+ /**
241
+ * @deprecated Use `AppManager.decodeAppState` instead.
242
+ *
243
+ * Converts an array of global/local state values from the algod api to a more friendly
244
+ * generic object keyed by the UTF-8 value of the key.
245
+ * @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`
246
+ * @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values
247
+ */
248
+ function decodeAppState(state) {
249
+ return types_appManager.AppManager.decodeAppState(state.map(({ key, value }) => ({ key: Buffer.from(key, 'utf-8'), value })));
250
+ }
251
+ /**
252
+ * @deprecated Use `TransactionComposer` methods to construct transactions instead.
253
+ *
254
+ * Returns the app args ready to load onto an app `Transaction` object
255
+ * @param args The app call args
256
+ * @returns The args ready to load into a `Transaction`
257
+ */
258
+ function getAppArgsForTransaction(args) {
259
+ if (!args)
260
+ return undefined;
261
+ const encoder = new TextEncoder();
262
+ return {
263
+ accounts: args?.accounts?.map(_getAccountAddress),
264
+ appArgs: args?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a)),
265
+ boxes: args.boxes?.map(getBoxReference),
266
+ foreignApps: args?.apps,
267
+ foreignAssets: args?.assets,
268
+ lease: transaction.encodeLease(args?.lease),
269
+ };
270
+ }
271
+ /**
272
+ * @deprecated Use `TransactionComposer` methods to construct transactions instead.
273
+ *
274
+ * Returns the app args ready to load onto an ABI method call in `AtomicTransactionComposer`
275
+ * @param args The ABI app call args
276
+ * @param from The transaction signer
277
+ * @returns The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer
278
+ */
279
+ async function getAppArgsForABICall(args, from) {
280
+ return legacyBridge._getAppArgsForABICall(args, from);
281
+ }
282
+ /**
283
+ * @deprecated Use `AppManager.getBoxReference()` instead.
284
+ *
285
+ * Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`.
286
+ * @param box The box to return a reference for
287
+ * @returns The box reference ready to pass into a `Transaction`
288
+ */
289
+ function getBoxReference(box) {
290
+ return legacyBridge._getBoxReference(box);
291
+ }
292
+ function _getAccountAddress(account) {
293
+ return typeof account === 'string' ? account : algosdk.encodeAddress(account.publicKey);
294
+ }
295
+ /**
296
+ * @deprecated Use `algorand.app.getById` instead.
297
+ *
298
+ * Gets the current data for the given app from algod.
299
+ *
300
+ * @param appId The id of the app
301
+ * @param algod An algod client
302
+ * @returns The data about the app
303
+ */
304
+ async function getAppById(appId, algod) {
305
+ return await algod.getApplicationByID(util.toNumber(appId)).do();
306
+ }
307
+ /**
308
+ * @deprecated Use `algorand.app.compileTeal` instead.
309
+ *
310
+ * Compiles the given TEAL using algod and returns the result, including source map.
311
+ *
312
+ * @param algod An algod client
313
+ * @param tealCode The TEAL code
314
+ * @returns The information about the compiled file
315
+ */
316
+ async function compileTeal(tealCode, algod) {
317
+ return await new types_appManager.AppManager(algod).compileTeal(tealCode);
318
+ }
319
+ /**
320
+ * @deprecated Use `abiMethod.getSignature()` or `new ABIMethod(abiMethodParams).getSignature()` instead.
321
+ *
322
+ * Returns the encoded ABI spec for a given ABI Method
323
+ * @param method The method to return a signature for
324
+ * @returns The encoded ABI method spec e.g. `method_name(uint64,string)string`
325
+ */
326
+ const getABIMethodSignature = (method) => {
327
+ return 'getSignature' in method ? method.getSignature() : new ABIMethod(method).getSignature();
328
+ };
329
+
330
+ exports.callApp = callApp;
331
+ exports.compileTeal = compileTeal;
332
+ exports.createApp = createApp;
333
+ exports.decodeAppState = decodeAppState;
334
+ exports.getABIMethodSignature = getABIMethodSignature;
335
+ exports.getABIReturn = getABIReturn;
336
+ exports.getAppArgsForABICall = getAppArgsForABICall;
337
+ exports.getAppArgsForTransaction = getAppArgsForTransaction;
338
+ exports.getAppBoxNames = getAppBoxNames;
339
+ exports.getAppBoxValue = getAppBoxValue;
340
+ exports.getAppBoxValueFromABIType = getAppBoxValueFromABIType;
341
+ exports.getAppBoxValues = getAppBoxValues;
342
+ exports.getAppBoxValuesFromABIType = getAppBoxValuesFromABIType;
343
+ exports.getAppById = getAppById;
344
+ exports.getAppGlobalState = getAppGlobalState;
345
+ exports.getAppLocalState = getAppLocalState;
346
+ exports.getAppOnCompleteAction = getAppOnCompleteAction;
347
+ exports.getBoxReference = getBoxReference;
348
+ exports.updateApp = updateApp;
349
+ //# sourceMappingURL=app.js.map
package/src/app.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sources":["../../src/app.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { _getAppArgsForABICall, _getBoxReference, legacySendAppTransactionBridge } from './transaction/legacy-bridge'\nimport { encodeLease, getSenderAddress } from './transaction/transaction'\nimport {\n ABIAppCallArgs,\n ABIReturn,\n AppCallArgs,\n AppCallParams,\n AppCallTransactionResult,\n AppCallType,\n AppCompilationResult,\n AppReference,\n AppState,\n BoxIdentifier,\n BoxName,\n BoxReference,\n BoxValueRequestParams,\n BoxValuesRequestParams,\n CompiledTeal,\n CreateAppParams,\n RawAppCallArgs,\n UpdateAppParams,\n} from './types/app'\nimport { AppManager } from './types/app-manager'\nimport { SendTransactionFrom } from './types/transaction'\nimport { toNumber } from './util'\nimport ABIMethod = algosdk.ABIMethod\nimport ABIMethodParams = algosdk.ABIMethodParams\nimport ABIValue = algosdk.ABIValue\nimport Address = algosdk.Address\nimport Algodv2 = algosdk.Algodv2\nimport modelsv2 = algosdk.modelsv2\nimport OnApplicationComplete = algosdk.OnApplicationComplete\n\n/**\n * @deprecated Use `algorand.send.appCreate()` / `algorand.createTransaction.appCreate()` / `algorand.send.appCreateMethodCall()`\n * / `algorand.createTransaction.appCreateMethodCall()` instead\n *\n * Creates a smart contract app, returns the details of the created app.\n * @param create The parameters to create the app with\n * @param algod An algod client\n * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result\n */\nexport async function createApp(\n create: CreateAppParams,\n algod: Algodv2,\n): Promise<Partial<AppCompilationResult> & AppCallTransactionResult & AppReference> {\n const onComplete = getAppOnCompleteAction(create.onCompleteAction)\n if (onComplete === algosdk.OnApplicationComplete.ClearStateOC) {\n throw new Error('Cannot create an app with on-complete action of ClearState')\n }\n\n const result = create.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n create.from,\n create.args,\n create,\n {\n sender: getSenderAddress(create.from),\n onComplete,\n approvalProgram: create.approvalProgram,\n clearStateProgram: create.clearStateProgram,\n method: create.args.method instanceof ABIMethod ? create.args.method : new ABIMethod(create.args.method),\n extraProgramPages: create.schema.extraPages,\n schema: create.schema,\n },\n (c) => c.appCreateMethodCall,\n (c) => c.appCreateMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n create.from,\n create.args,\n create,\n {\n sender: getSenderAddress(create.from),\n onComplete,\n approvalProgram: create.approvalProgram,\n clearStateProgram: create.clearStateProgram,\n extraProgramPages: create.schema.extraPages,\n schema: create.schema,\n },\n (c) => c.appCreate,\n (c) => c.appCreate,\n )\n\n return {\n ...result,\n appId: 'appId' in result ? Number(result.appId) : 0,\n appAddress: 'appAddress' in result ? result.appAddress.toString() : '',\n }\n}\n\n/**\n * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`\n * / `algorand.createTransaction.appUpdateMethodCall()` instead\n *\n * Updates a smart contract app.\n * @param update The parameters to update the app with\n * @param algod An algod client\n * @returns The transaction send result and the compilation result\n */\nexport async function updateApp(\n update: UpdateAppParams,\n algod: Algodv2,\n): Promise<Partial<AppCompilationResult> & AppCallTransactionResult> {\n return update.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n update.from,\n update.args,\n update,\n {\n appId: BigInt(update.appId),\n sender: getSenderAddress(update.from),\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n approvalProgram: update.approvalProgram,\n clearStateProgram: update.clearStateProgram,\n method: update.args.method instanceof ABIMethod ? update.args.method : new ABIMethod(update.args.method),\n },\n (c) => c.appUpdateMethodCall,\n (c) => c.appUpdateMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n update.from,\n update.args,\n update,\n {\n appId: BigInt(update.appId),\n sender: getSenderAddress(update.from),\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n approvalProgram: update.approvalProgram,\n clearStateProgram: update.clearStateProgram,\n },\n (c) => c.appUpdate,\n (c) => c.appUpdate,\n )\n}\n\n/**\n * @deprecated Use `algosdk.OnApplicationComplete` directly instead.\n *\n * Returns a `algosdk.OnApplicationComplete` for the given onCompleteAction.\n *\n * If given `undefined` will return `OnApplicationComplete.NoOpOC`.\n *\n * If given an `AppCallType` will convert the string enum to the correct underlying `algosdk.OnApplicationComplete`.\n *\n * @param onCompletionAction The on completion action\n * @returns The `algosdk.OnApplicationComplete`\n */\nexport function getAppOnCompleteAction(onCompletionAction?: AppCallType | OnApplicationComplete) {\n switch (onCompletionAction) {\n case undefined:\n case 'no_op':\n case OnApplicationComplete.NoOpOC:\n return OnApplicationComplete.NoOpOC\n case 'opt_in':\n case OnApplicationComplete.OptInOC:\n return OnApplicationComplete.OptInOC\n case 'close_out':\n case OnApplicationComplete.CloseOutOC:\n return OnApplicationComplete.CloseOutOC\n case 'clear_state':\n case OnApplicationComplete.ClearStateOC:\n return OnApplicationComplete.ClearStateOC\n case 'update_application':\n case OnApplicationComplete.UpdateApplicationOC:\n return OnApplicationComplete.UpdateApplicationOC\n case 'delete_application':\n case OnApplicationComplete.DeleteApplicationOC:\n return OnApplicationComplete.DeleteApplicationOC\n }\n}\n\n/**\n * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`\n * / `algorand.createTransaction.appUpdateMethodCall()` instead\n *\n * Issues a call to a given app.\n * @param call The call details.\n * @param algod An algod client\n * @returns The result of the call\n */\nexport async function callApp(call: AppCallParams, algod: Algodv2): Promise<AppCallTransactionResult> {\n const onComplete = getAppOnCompleteAction(call.callType)\n if (onComplete === algosdk.OnApplicationComplete.UpdateApplicationOC) {\n throw new Error('Cannot execute an app call with on-complete action of Update')\n }\n if (call.args?.method && onComplete === algosdk.OnApplicationComplete.ClearStateOC) {\n throw new Error('Cannot execute an ABI method call with on-complete action of ClearState')\n }\n\n return call.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n call.from,\n call.args,\n call,\n {\n appId: BigInt(call.appId),\n sender: getSenderAddress(call.from),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onComplete: onComplete as any,\n method: call.args.method instanceof ABIMethod ? call.args.method : new ABIMethod(call.args.method),\n },\n (c) => c.appCallMethodCall,\n (c) => c.appCallMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n call.from,\n call.args,\n call,\n {\n appId: BigInt(call.appId),\n sender: getSenderAddress(call.from),\n onComplete,\n },\n (c) => c.appCall,\n (c) => c.appCall,\n )\n}\n\n/**\n * @deprecated Use `AppManager.getABIReturn` instead.\n *\n * Returns any ABI return values for the given app call arguments and transaction confirmation.\n * @param args The arguments that were used for the call\n * @param confirmation The transaction confirmation from algod\n * @returns The return value for the method call\n */\nexport function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2.PendingTransactionResponse): ABIReturn | undefined {\n if (!args || !args.method) {\n return undefined\n }\n const method = 'txnCount' in args.method ? args.method : new ABIMethod(args.method)\n\n return AppManager.getABIReturn(confirmation, method)\n}\n\n/**\n * @deprecated Use `algorand.app.getGlobalState` instead.\n *\n * Returns the current global state values for the given app ID\n * @param appId The ID of the app return global state for\n * @param algod An algod client instance\n * @returns The current global state\n */\nexport async function getAppGlobalState(appId: number | bigint, algod: Algodv2) {\n return await new AppManager(algod).getGlobalState(BigInt(appId))\n}\n\n/**\n * @deprecated Use `algorand.app.getLocalState` instead.\n *\n * Returns the current global state values for the given app ID and account\n * @param appId The ID of the app return global state for\n * @param account Either the string address of an account or an account object for the account to get local state for the given app\n * @param algod An algod client instance\n * @returns The current local state for the given (app, account) combination\n */\nexport async function getAppLocalState(appId: number | bigint, account: string | SendTransactionFrom, algod: Algodv2) {\n return new AppManager(algod).getLocalState(BigInt(appId), getSenderAddress(account))\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxNames` instead.\n * Returns the names of the boxes for the given app.\n * @param appId The ID of the app return box names for\n * @param algod An algod client instance\n * @returns The current box names\n */\nexport async function getAppBoxNames(appId: number | bigint, algod: Algodv2): Promise<BoxName[]> {\n return new AppManager(algod).getBoxNames(BigInt(appId))\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValue` instead.\n * Returns the value of the given box name for the given app.\n * @param appId The ID of the app return box names for\n * @param boxName The name of the box to return either as a string, binary array or `BoxName`\n * @param algod An algod client instance\n * @returns The current box value as a byte array\n */\nexport async function getAppBoxValue(appId: number | bigint, boxName: string | Uint8Array | BoxName, algod: Algodv2): Promise<Uint8Array> {\n return new AppManager(algod).getBoxValue(BigInt(appId), typeof boxName !== 'string' && 'name' in boxName ? boxName.nameRaw : boxName)\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValues` instead.\n * Returns the value of the given box names for the given app.\n * @param appId The ID of the app return box names for\n * @param boxNames The names of the boxes to return either as a string, binary array or `BoxName`\n * @param algod An algod client instance\n * @returns The current box values as a byte array in the same order as the passed in box names\n */\nexport async function getAppBoxValues(appId: number, boxNames: (string | Uint8Array | BoxName)[], algod: Algodv2): Promise<Uint8Array[]> {\n return new AppManager(algod).getBoxValues(\n BigInt(appId),\n boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)),\n )\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValueFromABIType` instead.\n * Returns the value of the given box name for the given app decoded based on the given ABI type.\n * @param request The parameters for the box value request\n * @param algod An algod client instance\n * @returns The current box value as an ABI value\n */\nexport async function getAppBoxValueFromABIType(request: BoxValueRequestParams, algod: Algodv2): Promise<ABIValue> {\n return new AppManager(algod).getBoxValueFromABIType({\n appId: BigInt(request.appId),\n boxName: typeof request.boxName !== 'string' && 'name' in request.boxName ? request.boxName.nameRaw : request.boxName,\n type: request.type,\n })\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValuesFromABIType` instead.\n * Returns the value of the given box names for the given app decoded based on the given ABI type.\n * @param request The parameters for the box value request\n * @param algod An algod client instance\n * @returns The current box values as an ABI value in the same order as the passed in box names\n */\nexport async function getAppBoxValuesFromABIType(request: BoxValuesRequestParams, algod: Algodv2): Promise<ABIValue[]> {\n return new AppManager(algod).getBoxValuesFromABIType({\n appId: BigInt(request.appId),\n boxNames: request.boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)),\n type: request.type,\n })\n}\n\n/**\n * @deprecated Use `AppManager.decodeAppState` instead.\n *\n * Converts an array of global/local state values from the algod api to a more friendly\n * generic object keyed by the UTF-8 value of the key.\n * @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`\n * @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values\n */\nexport function decodeAppState(state: { key: string; value: modelsv2.TealValue | modelsv2.EvalDelta }[]): AppState {\n return AppManager.decodeAppState(state.map(({ key, value }) => ({ key: Buffer.from(key, 'utf-8'), value })))\n}\n\n/**\n * @deprecated Use `TransactionComposer` methods to construct transactions instead.\n *\n * Returns the app args ready to load onto an app `Transaction` object\n * @param args The app call args\n * @returns The args ready to load into a `Transaction`\n */\nexport function getAppArgsForTransaction(args?: RawAppCallArgs) {\n if (!args) return undefined\n\n const encoder = new TextEncoder()\n return {\n accounts: args?.accounts?.map(_getAccountAddress),\n appArgs: args?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a)),\n boxes: args.boxes?.map(getBoxReference),\n foreignApps: args?.apps,\n foreignAssets: args?.assets,\n lease: encodeLease(args?.lease),\n }\n}\n\n/**\n * @deprecated Use `TransactionComposer` methods to construct transactions instead.\n *\n * Returns the app args ready to load onto an ABI method call in `AtomicTransactionComposer`\n * @param args The ABI app call args\n * @param from The transaction signer\n * @returns The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer\n */\nexport async function getAppArgsForABICall(args: ABIAppCallArgs, from: SendTransactionFrom) {\n return _getAppArgsForABICall(args, from)\n}\n\n/**\n * @deprecated Use `AppManager.getBoxReference()` instead.\n *\n * Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`.\n * @param box The box to return a reference for\n * @returns The box reference ready to pass into a `Transaction`\n */\nexport function getBoxReference(box: BoxIdentifier | BoxReference | algosdk.BoxReference): algosdk.BoxReference {\n return _getBoxReference(box)\n}\n\nfunction _getAccountAddress(account: string | Address) {\n return typeof account === 'string' ? account : algosdk.encodeAddress(account.publicKey)\n}\n\n/**\n * @deprecated Use `algorand.app.getById` instead.\n *\n * Gets the current data for the given app from algod.\n *\n * @param appId The id of the app\n * @param algod An algod client\n * @returns The data about the app\n */\nexport async function getAppById(appId: number | bigint, algod: Algodv2) {\n return await algod.getApplicationByID(toNumber(appId)).do()\n}\n\n/**\n * @deprecated Use `algorand.app.compileTeal` instead.\n *\n * Compiles the given TEAL using algod and returns the result, including source map.\n *\n * @param algod An algod client\n * @param tealCode The TEAL code\n * @returns The information about the compiled file\n */\nexport async function compileTeal(tealCode: string, algod: Algodv2): Promise<CompiledTeal> {\n return await new AppManager(algod).compileTeal(tealCode)\n}\n\n/**\n * @deprecated Use `abiMethod.getSignature()` or `new ABIMethod(abiMethodParams).getSignature()` instead.\n *\n * Returns the encoded ABI spec for a given ABI Method\n * @param method The method to return a signature for\n * @returns The encoded ABI method spec e.g. `method_name(uint64,string)string`\n */\nexport const getABIMethodSignature = (method: ABIMethodParams | ABIMethod) => {\n return 'getSignature' in method ? method.getSignature() : new ABIMethod(method).getSignature()\n}\n"],"names":["legacySendAppTransactionBridge","getSenderAddress","AppManager","encodeLease","_getAppArgsForABICall","_getBoxReference","toNumber"],"mappings":";;;;;;;;AA0BA,IAAO,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;AAMpC,IAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAA;AAE5D;;;;;;;;AAQG;AACI,eAAe,SAAS,CAC7B,MAAuB,EACvB,KAAc,EAAA;IAEd,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAClE,IAAI,UAAU,KAAK,OAAO,CAAC,qBAAqB,CAAC,YAAY,EAAE;AAC7D,QAAA,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAA;KAC9E;AAED,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM;AAChC,UAAE,MAAMA,2CAA8B,CAClC,KAAK,EACL,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,IAAI,EACX,MAAM,EACN;AACE,YAAA,MAAM,EAAEC,4BAAgB,CAAC,MAAM,CAAC,IAAI,CAAC;YACrC,UAAU;YACV,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,YAAY,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AACxG,YAAA,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;YAC3C,MAAM,EAAE,MAAM,CAAC,MAAM;AACtB,SAAA,EACD,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAC5B,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,CAC7B;AACH,UAAE,MAAMD,2CAA8B,CAClC,KAAK,EACL,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,IAAI,EACX,MAAM,EACN;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