@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
package/types/app-spec.js CHANGED
@@ -1,3 +1,130 @@
1
1
  'use strict';
2
2
 
3
+ var algosdk = require('algosdk');
4
+
5
+ var ABIMethod = algosdk.ABIMethod;
6
+ function arc32ToArc56(appSpec) {
7
+ const arc32Structs = Object.values(appSpec.hints).flatMap((hint) => Object.entries(hint.structs ?? {}));
8
+ const structs = Object.fromEntries(arc32Structs.map(([_, struct]) => {
9
+ const fields = struct.elements.map((e) => ({ name: e[0], type: e[1] }));
10
+ return [struct.name, fields];
11
+ }));
12
+ const hint = (m) => appSpec.hints[new ABIMethod(m).getSignature()];
13
+ const actions = (m, type) => {
14
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
15
+ return hint(m)?.call_config !== undefined ? callConfigToActions(hint(m)?.call_config, type) : [];
16
+ };
17
+ const bareActions = (type) => {
18
+ return callConfigToActions(appSpec.bare_call_config, type);
19
+ };
20
+ const callConfigToActions = (c, type) => {
21
+ const actions = [];
22
+ if (c.close_out && ['ALL', type].includes(c.close_out))
23
+ actions.push('CloseOut');
24
+ if (c.delete_application && ['ALL', type].includes(c.delete_application))
25
+ actions.push('DeleteApplication');
26
+ if (c.no_op && ['ALL', type].includes(c.no_op))
27
+ actions.push('NoOp');
28
+ if (c.opt_in && ['ALL', type].includes(c.opt_in))
29
+ actions.push('OptIn');
30
+ if (c.update_application && ['ALL', type].includes(c.update_application))
31
+ actions.push('UpdateApplication');
32
+ return actions;
33
+ };
34
+ const getDefaultArgValue = (type, defaultArg) => {
35
+ if (!defaultArg)
36
+ return undefined;
37
+ if (defaultArg.source === 'abi-method') {
38
+ return {
39
+ source: 'method',
40
+ data: defaultArg.data.name,
41
+ };
42
+ }
43
+ return {
44
+ source: defaultArg.source === 'constant' ? 'literal' : defaultArg.source === 'global-state' ? 'global' : 'local',
45
+ data: Buffer.from(typeof defaultArg.data === 'number' ? algosdk.ABIType.from('uint64').encode(defaultArg.data) : defaultArg.data).toString('base64'),
46
+ type: type === 'string' ? 'AVMString' : type,
47
+ };
48
+ };
49
+ return {
50
+ arcs: [],
51
+ name: appSpec.contract.name,
52
+ desc: appSpec.contract.desc,
53
+ structs: structs,
54
+ methods: appSpec.contract.methods.map((m) => ({
55
+ name: m.name,
56
+ desc: m.desc,
57
+ args: m.args.map((a) => ({
58
+ name: a.name,
59
+ type: a.type,
60
+ desc: a.desc,
61
+ struct: a.name ? hint(m)?.structs?.[a.name]?.name : undefined,
62
+ defaultValue: getDefaultArgValue(a.type, !a.name ? undefined : hint(m)?.default_arguments?.[a.name]),
63
+ })),
64
+ returns: {
65
+ type: m.returns.type,
66
+ desc: m.returns.desc,
67
+ struct: hint(m)?.structs?.output?.name,
68
+ },
69
+ events: [],
70
+ readonly: hint(m)?.read_only,
71
+ actions: {
72
+ create: actions(m, 'CREATE'),
73
+ call: actions(m, 'CALL'),
74
+ },
75
+ })),
76
+ state: {
77
+ schema: {
78
+ global: {
79
+ ints: appSpec.state.global.num_uints,
80
+ bytes: appSpec.state.global.num_byte_slices,
81
+ },
82
+ local: {
83
+ ints: appSpec.state.local.num_uints,
84
+ bytes: appSpec.state.local.num_byte_slices,
85
+ },
86
+ },
87
+ keys: {
88
+ global: Object.fromEntries(Object.entries(appSpec.schema.global.declared).map((s) => [
89
+ s[0],
90
+ {
91
+ key: Buffer.from(s[1].key, 'utf-8').toString('base64'),
92
+ keyType: 'AVMString',
93
+ valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',
94
+ desc: s[1].descr,
95
+ },
96
+ ])),
97
+ local: Object.fromEntries(Object.entries(appSpec.schema.local.declared).map((s) => [
98
+ s[0],
99
+ {
100
+ key: Buffer.from(s[1].key, 'utf-8').toString('base64'),
101
+ keyType: 'AVMString',
102
+ valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',
103
+ desc: s[1].descr,
104
+ },
105
+ ])),
106
+ box: {},
107
+ },
108
+ maps: {
109
+ global: {},
110
+ local: {},
111
+ box: {},
112
+ },
113
+ },
114
+ source: appSpec.source,
115
+ bareActions: {
116
+ create: bareActions('CREATE'),
117
+ call: bareActions('CALL'),
118
+ },
119
+ byteCode: undefined,
120
+ compilerInfo: undefined,
121
+ events: undefined,
122
+ networks: undefined,
123
+ scratchVariables: undefined,
124
+ sourceInfo: undefined,
125
+ templateVariables: undefined,
126
+ };
127
+ }
128
+
129
+ exports.arc32ToArc56 = arc32ToArc56;
3
130
  //# sourceMappingURL=app-spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-spec.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"app-spec.js","sources":["../../src/types/app-spec.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Arc56Contract, Method as Arc56Method, StorageKey, StructField } from './app-arc56'\nimport ABIContractParams = algosdk.ABIContractParams\nimport ABIMethodParams = algosdk.ABIMethodParams\nimport ABIMethod = algosdk.ABIMethod\n\nexport function arc32ToArc56(appSpec: AppSpec): Arc56Contract {\n const arc32Structs = Object.values(appSpec.hints).flatMap((hint) => Object.entries(hint.structs ?? {}))\n const structs = Object.fromEntries(\n arc32Structs.map(([_, struct]) => {\n const fields = struct.elements.map((e) => ({ name: e[0], type: e[1] }))\n return [struct.name, fields]\n }),\n ) satisfies { [structName: string]: StructField[] }\n const hint = (m: ABIMethodParams) => appSpec.hints[new ABIMethod(m).getSignature()] as Hint | undefined\n const actions = (m: ABIMethodParams, type: 'CREATE' | 'CALL') => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n return hint(m)?.call_config !== undefined ? callConfigToActions(hint(m)?.call_config!, type) : []\n }\n const bareActions = (type: 'CREATE' | 'CALL') => {\n return callConfigToActions(appSpec.bare_call_config, type)\n }\n const callConfigToActions = (c: CallConfig, type: 'CREATE' | 'CALL') => {\n const actions: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[] = []\n if (c.close_out && ['ALL', type].includes(c.close_out)) actions.push('CloseOut')\n if (c.delete_application && ['ALL', type].includes(c.delete_application)) actions.push('DeleteApplication')\n if (c.no_op && ['ALL', type].includes(c.no_op)) actions.push('NoOp')\n if (c.opt_in && ['ALL', type].includes(c.opt_in)) actions.push('OptIn')\n if (c.update_application && ['ALL', type].includes(c.update_application)) actions.push('UpdateApplication')\n return actions\n }\n const getDefaultArgValue = (\n type: string,\n defaultArg: DefaultArgument | undefined,\n ): Arc56Contract['methods'][0]['args'][0]['defaultValue'] => {\n if (!defaultArg) return undefined\n\n if (defaultArg.source === 'abi-method') {\n return {\n source: 'method',\n data: defaultArg.data.name,\n }\n }\n\n return {\n source: defaultArg.source === 'constant' ? 'literal' : defaultArg.source === 'global-state' ? 'global' : 'local',\n data: Buffer.from(\n typeof defaultArg.data === 'number' ? algosdk.ABIType.from('uint64').encode(defaultArg.data) : defaultArg.data,\n ).toString('base64'),\n type: type === 'string' ? 'AVMString' : type,\n }\n }\n\n return {\n arcs: [],\n name: appSpec.contract.name,\n desc: appSpec.contract.desc,\n structs: structs,\n methods: appSpec.contract.methods.map(\n (m) =>\n ({\n name: m.name,\n desc: m.desc,\n args: m.args.map((a) => ({\n name: a.name,\n type: a.type,\n desc: a.desc,\n struct: a.name ? hint(m)?.structs?.[a.name]?.name : undefined,\n defaultValue: getDefaultArgValue(a.type, !a.name ? undefined : hint(m)?.default_arguments?.[a.name]),\n })),\n returns: {\n type: m.returns.type,\n desc: m.returns.desc,\n struct: hint(m)?.structs?.output?.name,\n },\n events: [],\n readonly: hint(m)?.read_only,\n actions: {\n create: actions(m, 'CREATE') as Arc56Method['actions']['create'],\n call: actions(m, 'CALL'),\n },\n }) satisfies Arc56Method,\n ),\n state: {\n schema: {\n global: {\n ints: appSpec.state.global.num_uints,\n bytes: appSpec.state.global.num_byte_slices,\n },\n local: {\n ints: appSpec.state.local.num_uints,\n bytes: appSpec.state.local.num_byte_slices,\n },\n },\n keys: {\n global: Object.fromEntries(\n Object.entries(appSpec.schema.global.declared).map((s) => [\n s[0],\n {\n key: Buffer.from(s[1].key, 'utf-8').toString('base64'),\n keyType: 'AVMString',\n valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',\n desc: s[1].descr,\n } satisfies StorageKey,\n ]),\n ),\n local: Object.fromEntries(\n Object.entries(appSpec.schema.local.declared).map((s) => [\n s[0],\n {\n key: Buffer.from(s[1].key, 'utf-8').toString('base64'),\n keyType: 'AVMString',\n valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',\n desc: s[1].descr,\n } satisfies StorageKey,\n ]),\n ),\n box: {},\n },\n maps: {\n global: {},\n local: {},\n box: {},\n },\n },\n source: appSpec.source,\n bareActions: {\n create: bareActions('CREATE') as unknown as Arc56Contract['bareActions']['create'],\n call: bareActions('CALL'),\n },\n byteCode: undefined,\n compilerInfo: undefined,\n events: undefined,\n networks: undefined,\n scratchVariables: undefined,\n sourceInfo: undefined,\n templateVariables: undefined,\n } satisfies Arc56Contract\n}\n\n/** An ARC-0032 Application Specification see https://github.com/algorandfoundation/ARCs/pull/150 */\nexport interface AppSpec {\n /** Method call hints */\n hints: HintSpec\n /** The TEAL source */\n source: AppSources\n /** The ABI-0004 contract definition see https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0004.md */\n contract: ABIContractParams\n /** The values that make up the local and global state */\n schema: SchemaSpec\n /** The rolled-up schema allocation values for local and global state */\n state: StateSchemaSpec\n /** The config of all BARE calls (i.e. non ABI calls with no args) */\n bare_call_config: CallConfig\n}\n\n/** A lookup of encoded method call spec to hint */\nexport type HintSpec = Record<string, Hint>\n\n/** The TEAL source of a contract */\nexport interface AppSources {\n /** The TEAL source of the approval program */\n approval: string\n /** The TEAL source of the clear program */\n clear: string\n}\n\n/** The various call configs:\n * * `NEVER`: Will not be called\n * * `CALL`: Can be called during a non-create call i.e. app id != 0\n * * `CREATE`: Can be called during a create call i.e. app id = 0\n * * `ALL`: Can be during a create OR non-create call\n **/\nexport type CallConfigValue = 'NEVER' | 'CALL' | 'CREATE' | 'ALL'\n\n/** Call configuration for a method */\nexport interface CallConfig {\n /** NoOp call config */\n no_op?: CallConfigValue\n /** Opt-in call config */\n opt_in?: CallConfigValue\n /** Close out call config */\n close_out?: CallConfigValue\n /** Update call config */\n update_application?: CallConfigValue\n /** Delete call config */\n delete_application?: CallConfigValue\n}\n\n/** Hint information for a given method call to allow client generation */\nexport interface Hint {\n /** Any user-defined struct/tuple types used in the method call, keyed by parameter name or `output` for return type */\n structs?: Record<string, Struct>\n read_only?: boolean\n default_arguments?: Record<string, DefaultArgument>\n call_config: CallConfig\n}\n\n/** The name of a field */\nexport type FieldName = string\n\n/** The string name of an ABI type */\nexport type ABIType = string\n\n/** The elements of the struct/tuple: `FieldName`, `ABIType` */\nexport type StructElement = [FieldName, ABIType]\n\n/** A user-defined struct/tuple type */\nexport interface Struct {\n /** The name of the type */\n name: string\n /** The elements (in order) that make up the struct/tuple */\n elements: StructElement[]\n}\n\n/**\n * Defines a strategy for obtaining a default value for a given ABI arg.\n */\nexport type DefaultArgument =\n | {\n /**\n * The default value should be fetched by invoking an ABI method\n */\n source: 'abi-method'\n data: ABIMethodParams\n }\n | {\n /**\n * The default value should be fetched from global state\n */\n source: 'global-state'\n /**\n * The key of the state variable\n */\n data: string\n }\n | {\n /**\n * The default value should be fetched from the local state of the sender user\n */\n source: 'local-state'\n /**\n * The key of the state variable\n */\n data: string\n }\n | {\n /**\n * The default value is a constant.\n */\n source: 'constant'\n /**\n * The static default value to use.\n */\n data: string | number\n }\n\n/** AVM data type */\nexport type AVMType = 'uint64' | 'bytes'\n\n/** Declared schema value specification */\nexport interface DeclaredSchemaValueSpec {\n /** The type of value */\n type: AVMType\n /** The name of the key */\n key: string\n /** A description of the variable */\n descr?: string\n /** Whether or not the value is set statically (at create time only) or dynamically */\n static?: boolean\n}\n\n/** Reserved schema value specification */\nexport interface ReservedSchemaValueSpec {\n /** The type of value */\n type: AVMType\n /** The description of the reserved storage space */\n descr: string\n /** The maximum number of slots to reserve */\n max_keys: number\n}\n\n/** The schema for global and local storage */\nexport interface SchemaSpec {\n /** The local storage schema */\n local: Schema\n /** The global storage schema */\n global: Schema\n}\n\n/** The storage schema definition */\nexport interface Schema {\n /** Declared storage schema */\n declared: Record<string, DeclaredSchemaValueSpec>\n /** Reserved storage schema */\n reserved: Record<string, ReservedSchemaValueSpec>\n}\n\n/** The rolled-up schema allocation specification for local and global state */\nexport interface StateSchemaSpec {\n /** Global storage spec */\n global: StateSchema\n /** Local storage spec */\n local: StateSchema\n}\n\n/** Schema spec summary for global or local storage */\nexport type StateSchema = {\n /** Number of uint slots */\n num_uints: number\n /** Number of byte slots */\n num_byte_slices: number\n}\n"],"names":[],"mappings":";;;;AAIA,IAAO,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;AAE9B,SAAU,YAAY,CAAC,OAAgB,EAAA;AAC3C,IAAA,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAA;AACvG,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAI;AAC/B,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CA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CAAC,CAAC;AACJ,oBAAA;AACE,wBAAA,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACtD,wBAAA,OAAO,EAAE,WAAW;AACpB,wBAAA,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,GAAG,WAAW,GAAG,UAAU;AAC5D,wBAAA,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;AACI,qBAAA;AACvB,iBAAA,CAAC,CACH;AACD,gBAAA,GAAG,EAAE,EAAE;AACR,aAAA;AACD,YAAA,IAAI,EAAE;AACJ,gBAAA,MAAM,EAAE,EAAE;AACV,gBAAA,KAAK,EAAE,EAAE;AACT,gBAAA,GAAG,EAAE,EAAE;AACR,aAAA;AACF,SAAA;QACD,MAAM,EAAE,OAAO,CAAC,MAAM;AACtB,QAAA,WAAW,EAAE;AACX,YAAA,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAsD;AAClF,YAAA,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;AAC1B,SAAA;AACD,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,gBAAgB,EAAE,SAAS;AAC3B,QAAA,UAAU,EAAE,SAAS;AACrB,QAAA,iBAAiB,EAAE,SAAS;KACL,CAAA;AAC3B;;;;"}
@@ -1,2 +1,128 @@
1
+ import algosdk from 'algosdk';
1
2
 
3
+ var ABIMethod = algosdk.ABIMethod;
4
+ function arc32ToArc56(appSpec) {
5
+ const arc32Structs = Object.values(appSpec.hints).flatMap((hint) => Object.entries(hint.structs ?? {}));
6
+ const structs = Object.fromEntries(arc32Structs.map(([_, struct]) => {
7
+ const fields = struct.elements.map((e) => ({ name: e[0], type: e[1] }));
8
+ return [struct.name, fields];
9
+ }));
10
+ const hint = (m) => appSpec.hints[new ABIMethod(m).getSignature()];
11
+ const actions = (m, type) => {
12
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
13
+ return hint(m)?.call_config !== undefined ? callConfigToActions(hint(m)?.call_config, type) : [];
14
+ };
15
+ const bareActions = (type) => {
16
+ return callConfigToActions(appSpec.bare_call_config, type);
17
+ };
18
+ const callConfigToActions = (c, type) => {
19
+ const actions = [];
20
+ if (c.close_out && ['ALL', type].includes(c.close_out))
21
+ actions.push('CloseOut');
22
+ if (c.delete_application && ['ALL', type].includes(c.delete_application))
23
+ actions.push('DeleteApplication');
24
+ if (c.no_op && ['ALL', type].includes(c.no_op))
25
+ actions.push('NoOp');
26
+ if (c.opt_in && ['ALL', type].includes(c.opt_in))
27
+ actions.push('OptIn');
28
+ if (c.update_application && ['ALL', type].includes(c.update_application))
29
+ actions.push('UpdateApplication');
30
+ return actions;
31
+ };
32
+ const getDefaultArgValue = (type, defaultArg) => {
33
+ if (!defaultArg)
34
+ return undefined;
35
+ if (defaultArg.source === 'abi-method') {
36
+ return {
37
+ source: 'method',
38
+ data: defaultArg.data.name,
39
+ };
40
+ }
41
+ return {
42
+ source: defaultArg.source === 'constant' ? 'literal' : defaultArg.source === 'global-state' ? 'global' : 'local',
43
+ data: Buffer.from(typeof defaultArg.data === 'number' ? algosdk.ABIType.from('uint64').encode(defaultArg.data) : defaultArg.data).toString('base64'),
44
+ type: type === 'string' ? 'AVMString' : type,
45
+ };
46
+ };
47
+ return {
48
+ arcs: [],
49
+ name: appSpec.contract.name,
50
+ desc: appSpec.contract.desc,
51
+ structs: structs,
52
+ methods: appSpec.contract.methods.map((m) => ({
53
+ name: m.name,
54
+ desc: m.desc,
55
+ args: m.args.map((a) => ({
56
+ name: a.name,
57
+ type: a.type,
58
+ desc: a.desc,
59
+ struct: a.name ? hint(m)?.structs?.[a.name]?.name : undefined,
60
+ defaultValue: getDefaultArgValue(a.type, !a.name ? undefined : hint(m)?.default_arguments?.[a.name]),
61
+ })),
62
+ returns: {
63
+ type: m.returns.type,
64
+ desc: m.returns.desc,
65
+ struct: hint(m)?.structs?.output?.name,
66
+ },
67
+ events: [],
68
+ readonly: hint(m)?.read_only,
69
+ actions: {
70
+ create: actions(m, 'CREATE'),
71
+ call: actions(m, 'CALL'),
72
+ },
73
+ })),
74
+ state: {
75
+ schema: {
76
+ global: {
77
+ ints: appSpec.state.global.num_uints,
78
+ bytes: appSpec.state.global.num_byte_slices,
79
+ },
80
+ local: {
81
+ ints: appSpec.state.local.num_uints,
82
+ bytes: appSpec.state.local.num_byte_slices,
83
+ },
84
+ },
85
+ keys: {
86
+ global: Object.fromEntries(Object.entries(appSpec.schema.global.declared).map((s) => [
87
+ s[0],
88
+ {
89
+ key: Buffer.from(s[1].key, 'utf-8').toString('base64'),
90
+ keyType: 'AVMString',
91
+ valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',
92
+ desc: s[1].descr,
93
+ },
94
+ ])),
95
+ local: Object.fromEntries(Object.entries(appSpec.schema.local.declared).map((s) => [
96
+ s[0],
97
+ {
98
+ key: Buffer.from(s[1].key, 'utf-8').toString('base64'),
99
+ keyType: 'AVMString',
100
+ valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',
101
+ desc: s[1].descr,
102
+ },
103
+ ])),
104
+ box: {},
105
+ },
106
+ maps: {
107
+ global: {},
108
+ local: {},
109
+ box: {},
110
+ },
111
+ },
112
+ source: appSpec.source,
113
+ bareActions: {
114
+ create: bareActions('CREATE'),
115
+ call: bareActions('CALL'),
116
+ },
117
+ byteCode: undefined,
118
+ compilerInfo: undefined,
119
+ events: undefined,
120
+ networks: undefined,
121
+ scratchVariables: undefined,
122
+ sourceInfo: undefined,
123
+ templateVariables: undefined,
124
+ };
125
+ }
126
+
127
+ export { arc32ToArc56 };
2
128
  //# sourceMappingURL=app-spec.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-spec.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"app-spec.mjs","sources":["../../src/types/app-spec.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Arc56Contract, Method as Arc56Method, StorageKey, StructField } from './app-arc56'\nimport ABIContractParams = algosdk.ABIContractParams\nimport ABIMethodParams = algosdk.ABIMethodParams\nimport ABIMethod = algosdk.ABIMethod\n\nexport function arc32ToArc56(appSpec: AppSpec): Arc56Contract {\n const arc32Structs = Object.values(appSpec.hints).flatMap((hint) => Object.entries(hint.structs ?? {}))\n const structs = Object.fromEntries(\n arc32Structs.map(([_, struct]) => {\n const fields = struct.elements.map((e) => ({ name: e[0], type: e[1] }))\n return [struct.name, fields]\n }),\n ) satisfies { [structName: string]: StructField[] }\n const hint = (m: ABIMethodParams) => appSpec.hints[new ABIMethod(m).getSignature()] as Hint | undefined\n const actions = (m: ABIMethodParams, type: 'CREATE' | 'CALL') => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n return hint(m)?.call_config !== undefined ? callConfigToActions(hint(m)?.call_config!, type) : []\n }\n const bareActions = (type: 'CREATE' | 'CALL') => {\n return callConfigToActions(appSpec.bare_call_config, type)\n }\n const callConfigToActions = (c: CallConfig, type: 'CREATE' | 'CALL') => {\n const actions: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[] = []\n if (c.close_out && ['ALL', type].includes(c.close_out)) actions.push('CloseOut')\n if (c.delete_application && ['ALL', type].includes(c.delete_application)) actions.push('DeleteApplication')\n if (c.no_op && ['ALL', type].includes(c.no_op)) actions.push('NoOp')\n if (c.opt_in && ['ALL', type].includes(c.opt_in)) actions.push('OptIn')\n if (c.update_application && ['ALL', type].includes(c.update_application)) actions.push('UpdateApplication')\n return actions\n }\n const getDefaultArgValue = (\n type: string,\n defaultArg: DefaultArgument | undefined,\n ): Arc56Contract['methods'][0]['args'][0]['defaultValue'] => {\n if (!defaultArg) return undefined\n\n if (defaultArg.source === 'abi-method') {\n return {\n source: 'method',\n data: defaultArg.data.name,\n }\n }\n\n return {\n source: defaultArg.source === 'constant' ? 'literal' : defaultArg.source === 'global-state' ? 'global' : 'local',\n data: Buffer.from(\n typeof defaultArg.data === 'number' ? algosdk.ABIType.from('uint64').encode(defaultArg.data) : defaultArg.data,\n ).toString('base64'),\n type: type === 'string' ? 'AVMString' : type,\n }\n }\n\n return {\n arcs: [],\n name: appSpec.contract.name,\n desc: appSpec.contract.desc,\n structs: structs,\n methods: appSpec.contract.methods.map(\n (m) =>\n ({\n name: m.name,\n desc: m.desc,\n args: m.args.map((a) => ({\n name: a.name,\n type: a.type,\n desc: a.desc,\n struct: a.name ? hint(m)?.structs?.[a.name]?.name : undefined,\n defaultValue: getDefaultArgValue(a.type, !a.name ? undefined : hint(m)?.default_arguments?.[a.name]),\n })),\n returns: {\n type: m.returns.type,\n desc: m.returns.desc,\n struct: hint(m)?.structs?.output?.name,\n },\n events: [],\n readonly: hint(m)?.read_only,\n actions: {\n create: actions(m, 'CREATE') as Arc56Method['actions']['create'],\n call: actions(m, 'CALL'),\n },\n }) satisfies Arc56Method,\n ),\n state: {\n schema: {\n global: {\n ints: appSpec.state.global.num_uints,\n bytes: appSpec.state.global.num_byte_slices,\n },\n local: {\n ints: appSpec.state.local.num_uints,\n bytes: appSpec.state.local.num_byte_slices,\n },\n },\n keys: {\n global: Object.fromEntries(\n Object.entries(appSpec.schema.global.declared).map((s) => [\n s[0],\n {\n key: Buffer.from(s[1].key, 'utf-8').toString('base64'),\n keyType: 'AVMString',\n valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',\n desc: s[1].descr,\n } satisfies StorageKey,\n ]),\n ),\n local: Object.fromEntries(\n Object.entries(appSpec.schema.local.declared).map((s) => [\n s[0],\n {\n key: Buffer.from(s[1].key, 'utf-8').toString('base64'),\n keyType: 'AVMString',\n valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',\n desc: s[1].descr,\n } satisfies StorageKey,\n ]),\n ),\n box: {},\n },\n maps: {\n global: {},\n local: {},\n box: {},\n },\n },\n source: appSpec.source,\n bareActions: {\n create: bareActions('CREATE') as unknown as Arc56Contract['bareActions']['create'],\n call: bareActions('CALL'),\n },\n byteCode: undefined,\n compilerInfo: undefined,\n events: undefined,\n networks: undefined,\n scratchVariables: undefined,\n sourceInfo: undefined,\n templateVariables: undefined,\n } satisfies Arc56Contract\n}\n\n/** An ARC-0032 Application Specification see https://github.com/algorandfoundation/ARCs/pull/150 */\nexport interface AppSpec {\n /** Method call hints */\n hints: HintSpec\n /** The TEAL source */\n source: AppSources\n /** The ABI-0004 contract definition see https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0004.md */\n contract: ABIContractParams\n /** The values that make up the local and global state */\n schema: SchemaSpec\n /** The rolled-up schema allocation values for local and global state */\n state: StateSchemaSpec\n /** The config of all BARE calls (i.e. non ABI calls with no args) */\n bare_call_config: CallConfig\n}\n\n/** A lookup of encoded method call spec to hint */\nexport type HintSpec = Record<string, Hint>\n\n/** The TEAL source of a contract */\nexport interface AppSources {\n /** The TEAL source of the approval program */\n approval: string\n /** The TEAL source of the clear program */\n clear: string\n}\n\n/** The various call configs:\n * * `NEVER`: Will not be called\n * * `CALL`: Can be called during a non-create call i.e. app id != 0\n * * `CREATE`: Can be called during a create call i.e. app id = 0\n * * `ALL`: Can be during a create OR non-create call\n **/\nexport type CallConfigValue = 'NEVER' | 'CALL' | 'CREATE' | 'ALL'\n\n/** Call configuration for a method */\nexport interface CallConfig {\n /** NoOp call config */\n no_op?: CallConfigValue\n /** Opt-in call config */\n opt_in?: CallConfigValue\n /** Close out call config */\n close_out?: CallConfigValue\n /** Update call config */\n update_application?: CallConfigValue\n /** Delete call config */\n delete_application?: CallConfigValue\n}\n\n/** Hint information for a given method call to allow client generation */\nexport interface Hint {\n /** Any user-defined struct/tuple types used in the method call, keyed by parameter name or `output` for return type */\n structs?: Record<string, Struct>\n read_only?: boolean\n default_arguments?: Record<string, DefaultArgument>\n call_config: CallConfig\n}\n\n/** The name of a field */\nexport type FieldName = string\n\n/** The string name of an ABI type */\nexport type ABIType = string\n\n/** The elements of the struct/tuple: `FieldName`, `ABIType` */\nexport type StructElement = [FieldName, ABIType]\n\n/** A user-defined struct/tuple type */\nexport interface Struct {\n /** The name of the type */\n name: string\n /** The elements (in order) that make up the struct/tuple */\n elements: StructElement[]\n}\n\n/**\n * Defines a strategy for obtaining a default value for a given ABI arg.\n */\nexport type DefaultArgument =\n | {\n /**\n * The default value should be fetched by invoking an ABI method\n */\n source: 'abi-method'\n data: ABIMethodParams\n }\n | {\n /**\n * The default value should be fetched from global state\n */\n source: 'global-state'\n /**\n * The key of the state variable\n */\n data: string\n }\n | {\n /**\n * The default value should be fetched from the local state of the sender user\n */\n source: 'local-state'\n /**\n * The key of the state variable\n */\n data: string\n }\n | {\n /**\n * The default value is a constant.\n */\n source: 'constant'\n /**\n * The static default value to use.\n */\n data: string | number\n }\n\n/** AVM data type */\nexport type AVMType = 'uint64' | 'bytes'\n\n/** Declared schema value specification */\nexport interface DeclaredSchemaValueSpec {\n /** The type of value */\n type: AVMType\n /** The name of the key */\n key: string\n /** A description of the variable */\n descr?: string\n /** Whether or not the value is set statically (at create time only) or dynamically */\n static?: boolean\n}\n\n/** Reserved schema value specification */\nexport interface ReservedSchemaValueSpec {\n /** The type of value */\n type: AVMType\n /** The description of the reserved storage space */\n descr: string\n /** The maximum number of slots to reserve */\n max_keys: number\n}\n\n/** The schema for global and local storage */\nexport interface SchemaSpec {\n /** The local storage schema */\n local: Schema\n /** The global storage schema */\n global: Schema\n}\n\n/** The storage schema definition */\nexport interface Schema {\n /** Declared storage schema */\n declared: Record<string, DeclaredSchemaValueSpec>\n /** Reserved storage schema */\n reserved: Record<string, ReservedSchemaValueSpec>\n}\n\n/** The rolled-up schema allocation specification for local and global state */\nexport interface StateSchemaSpec {\n /** Global storage spec */\n global: StateSchema\n /** Local storage spec */\n local: StateSchema\n}\n\n/** Schema spec summary for global or local storage */\nexport type StateSchema = {\n /** Number of uint slots */\n num_uints: number\n /** Number of byte slots */\n num_byte_slices: number\n}\n"],"names":[],"mappings":";;AAIA,IAAO,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;AAE9B,SAAU,YAAY,CAAC,OAAgB,EAAA;AAC3C,IAAA,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAA;AACvG,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAI;AAC/B,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACvE,QAAA,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;KAC7B,CAAC,CAC+C,CAAA;IACnD,MAAM,IAAI,GAAG,CAAC,CAAkB,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAqB,CAAA;AACvG,IAAA,MAAM,OAAO,GAAG,CAAC,CAAkB,EAAE,IAAuB,KAAI;;QAE9D,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,KAAK,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAY,EAAE,IAAI,CAAC,GAAG,EAAE,CAAA;AACnG,KAAC,CAAA;AACD,IAAA,MAAM,WAAW,GAAG,CAAC,IAAuB,KAAI;QAC9C,OAAO,mBAAmB,C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ACF,SAAA;QACD,MAAM,EAAE,OAAO,CAAC,MAAM;AACtB,QAAA,WAAW,EAAE;AACX,YAAA,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAsD;AAClF,YAAA,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;AAC1B,SAAA;AACD,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,gBAAgB,EAAE,SAAS;AAC3B,QAAA,UAAU,EAAE,SAAS;AACrB,QAAA,iBAAiB,EAAE,SAAS;KACL,CAAA;AAC3B;;;;"}
package/types/app.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import algosdk from 'algosdk';
2
- import { SendTransactionFrom, SendTransactionParams, SendTransactionResult, SendTransactionResults, TransactionNote, TransactionToSign } from './transaction';
2
+ import { Expand } from './expand';
3
+ import { SendSingleTransactionResult, SendTransactionFrom, SendTransactionParams, SendTransactionResult, SendTransactionResults, TransactionNote, TransactionToSign } from './transaction';
3
4
  import ABIArgument = algosdk.ABIArgument;
4
5
  import ABIMethod = algosdk.ABIMethod;
5
6
  import ABIMethodParams = algosdk.ABIMethodParams;
@@ -7,14 +8,14 @@ import ABIType = algosdk.ABIType;
7
8
  import ABIValue = algosdk.ABIValue;
8
9
  import Address = algosdk.Address;
9
10
  import OnApplicationComplete = algosdk.OnApplicationComplete;
10
- import SourceMap = algosdk.SourceMap;
11
+ import SourceMap = algosdk.ProgramSourceMap;
11
12
  import SuggestedParams = algosdk.SuggestedParams;
12
13
  import Transaction = algosdk.Transaction;
13
14
  /** The name of the TEAL template variable for deploy-time immutability control */
14
15
  export declare const UPDATABLE_TEMPLATE_NAME = "TMPL_UPDATABLE";
15
16
  /** The name of the TEAL template variable for deploy-time permanence control */
16
17
  export declare const DELETABLE_TEMPLATE_NAME = "TMPL_DELETABLE";
17
- /** The app create/update ARC-2 transaction note prefix */
18
+ /** The app create/update [ARC-2](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md) transaction note prefix */
18
19
  export declare const APP_DEPLOY_NOTE_DAPP = "ALGOKIT_DEPLOYER";
19
20
  /** The maximum number of bytes in a single app code page */
20
21
  export declare const APP_PAGE_MAX_SIZE = 2048;
@@ -28,6 +29,8 @@ export interface AppReference {
28
29
  appAddress: string;
29
30
  }
30
31
  /**
32
+ * @deprecated Use `types/app-manager/BoxReference` instead.
33
+ *
31
34
  * A grouping of the app ID and name of the box in an Uint8Array
32
35
  */
33
36
  export interface BoxReference {
@@ -41,6 +44,8 @@ export interface BoxReference {
41
44
  name: BoxIdentifier;
42
45
  }
43
46
  /**
47
+ * @deprecated Use `types/app-manager/BoxIdentifier` instead.
48
+ *
44
49
  * Something that identifies a box name - either a:
45
50
  * * `Uint8Array`
46
51
  * * `string` (that will be encoded to a Uint8Array)
@@ -90,7 +95,11 @@ export type ABIAppCallArgs = CoreAppCallArgs & {
90
95
  * * An ABI method definition (method and args)
91
96
  **/
92
97
  export type AppCallArgs = RawAppCallArgs | ABIAppCallArgs;
93
- /** Base interface for common data passed to an app create or update. */
98
+ /**
99
+ * @deprecated Use `TransactionComposer` to construct create app transactions instead.
100
+ *
101
+ * Base interface for common data passed to an app create or update.
102
+ */
94
103
  interface CreateOrUpdateAppParams extends SendTransactionParams {
95
104
  /** The account (with private key loaded) that will send the transaction */
96
105
  from: SendTransactionFrom;
@@ -105,19 +114,28 @@ interface CreateOrUpdateAppParams extends SendTransactionParams {
105
114
  /** The arguments passed in to the app call */
106
115
  args?: AppCallArgs;
107
116
  }
108
- /** Parameters that are passed in when creating an app. */
117
+ /**
118
+ * @deprecated Use `TransactionComposer` to construct create app transactions instead.
119
+ *
120
+ * Parameters that are passed in when creating an app. */
109
121
  export interface CreateAppParams extends CreateOrUpdateAppParams {
110
122
  /** The storage schema to request for the created app */
111
123
  schema: AppStorageSchema;
112
124
  /** Override the on-completion action for the create call; defaults to NoOp */
113
125
  onCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
114
126
  }
115
- /** Parameters that are passed in when updating an app. */
127
+ /**
128
+ * @deprecated Use `TransactionComposer` to construct update app transactions instead.
129
+ *
130
+ * Parameters that are passed in when updating an app. */
116
131
  export interface UpdateAppParams extends CreateOrUpdateAppParams {
117
132
  /** The id of the app to update */
118
133
  appId: number | bigint;
119
134
  }
120
- /** The type of call / [on-completion action](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#the-lifecycle-of-a-smart-contract) for a smart contract call.
135
+ /**
136
+ * @deprecated Use `algosdk.OnApplicationComplete` directly instead.
137
+ *
138
+ * The type of call / [on-completion action](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#the-lifecycle-of-a-smart-contract) for a smart contract call.
121
139
  *
122
140
  * Equivalent of `algosdk.OnApplicationComplete`, but as a more convenient string enum.
123
141
  *
@@ -163,7 +181,7 @@ export interface CompiledTeal {
163
181
  teal: string;
164
182
  /** The compiled code */
165
183
  compiled: string;
166
- /** The has returned by the compiler */
184
+ /** The hash returned by the compiler */
167
185
  compiledHash: string;
168
186
  /** The base64 encoded code as a byte array */
169
187
  compiledBase64ToBytes: Uint8Array;
@@ -175,16 +193,17 @@ export interface AppCallTransactionResultOfType<T> extends SendTransactionResult
175
193
  return?: T;
176
194
  }
177
195
  /** Result from calling an app */
178
- export interface AppCallTransactionResult extends AppCallTransactionResultOfType<ABIReturn> {
179
- }
196
+ export type AppCallTransactionResult = AppCallTransactionResultOfType<ABIReturn>;
180
197
  /** The return value of an ABI method call */
181
198
  export type ABIReturn = {
182
199
  rawReturnValue: Uint8Array;
183
200
  returnValue: ABIValue;
201
+ method: ABIMethod;
184
202
  decodeError: undefined;
185
203
  } | {
186
- rawReturnValue: undefined;
187
- returnValue: undefined;
204
+ rawReturnValue?: undefined;
205
+ returnValue?: undefined;
206
+ method?: undefined;
188
207
  decodeError: Error;
189
208
  };
190
209
  /**
@@ -267,17 +286,35 @@ export interface AppDeploymentParams extends Omit<CreateAppParams, 'onCompleteAc
267
286
  /** Any args to pass to any delete transaction that is issued as part of deployment */
268
287
  deleteArgs?: AppCallArgs;
269
288
  }
270
- /** The result of compiling the approval and clear TEAL for an app */
289
+ /** The result of compiling the approval and clear state TEAL programs for an app */
271
290
  export interface AppCompilationResult {
272
- /** The compilation result of approval */
291
+ /** The result of compiling the approval program */
273
292
  compiledApproval: CompiledTeal;
274
- /** The compilation result of clear */
293
+ /** The result of compiling the clear state program */
275
294
  compiledClear: CompiledTeal;
276
295
  }
296
+ export type AppReturn<TReturn> = {
297
+ /** The ABI method call return value */
298
+ return?: TReturn;
299
+ };
300
+ /** Result from sending a single app transaction. */
301
+ export type SendAppTransactionResult = Expand<SendSingleTransactionResult & {
302
+ /** If an ABI method was called the processed return value */
303
+ return?: ABIReturn;
304
+ }>;
305
+ /** Result from sending a single app transaction. */
306
+ export type SendAppUpdateTransactionResult = Expand<SendAppTransactionResult & Partial<AppCompilationResult>>;
307
+ /** Result from sending a single app transaction. */
308
+ export type SendAppCreateTransactionResult = Expand<SendAppUpdateTransactionResult & {
309
+ /** The id of the created app */
310
+ appId: bigint;
311
+ /** The Algorand address of the account associated with the app */
312
+ appAddress: Address;
313
+ }>;
277
314
  /** Object holding app state values */
278
315
  export interface AppState {
279
316
  [key: string]: {
280
- value: number | bigint;
317
+ value: bigint;
281
318
  keyRaw: Uint8Array;
282
319
  keyBase64: string;
283
320
  } | {
@@ -288,7 +325,8 @@ export interface AppState {
288
325
  keyBase64: string;
289
326
  };
290
327
  }
291
- /** The name of a box storage box */
328
+ /**
329
+ * The name of a box storage box */
292
330
  export interface BoxName {
293
331
  /** Name in UTF-8 */
294
332
  name: string;
@@ -298,6 +336,7 @@ export interface BoxName {
298
336
  nameBase64: string;
299
337
  }
300
338
  /**
339
+ * @deprecated Use `types/app-manager/BoxValueRequestParams` instead.
301
340
  * Parameters to get and decode a box value as an ABI type.
302
341
  */
303
342
  export interface BoxValueRequestParams {
@@ -309,6 +348,7 @@ export interface BoxValueRequestParams {
309
348
  type: ABIType;
310
349
  }
311
350
  /**
351
+ * @deprecated Use `types/app-manager/BoxValuesRequestParams` instead.
312
352
  * Parameters to get and decode a box value as an ABI type.
313
353
  */
314
354
  export interface BoxValuesRequestParams {
@@ -320,4 +360,3 @@ export interface BoxValuesRequestParams {
320
360
  type: ABIType;
321
361
  }
322
362
  export {};
323
- //# sourceMappingURL=app.d.ts.map
package/types/app.js CHANGED
@@ -4,7 +4,7 @@
4
4
  const UPDATABLE_TEMPLATE_NAME = 'TMPL_UPDATABLE';
5
5
  /** The name of the TEAL template variable for deploy-time permanence control */
6
6
  const DELETABLE_TEMPLATE_NAME = 'TMPL_DELETABLE';
7
- /** The app create/update ARC-2 transaction note prefix */
7
+ /** The app create/update [ARC-2](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md) transaction note prefix */
8
8
  const APP_DEPLOY_NOTE_DAPP = 'ALGOKIT_DEPLOYER';
9
9
  /** The maximum number of bytes in a single app code page */
10
10
  const APP_PAGE_MAX_SIZE = 2048;
package/types/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sources":["../../src/types/app.ts"],"sourcesContent":[null],"names":["OnUpdate","OnSchemaBreak"],"mappings":";;AAoBA;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,oBAAoB,GAAG,mBAAkB;AAEtD;AACO,MAAM,iBAAiB,GAAG,KAAI;AAErC;AACa,MAAA,iBAAiB,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAC;AA0OnE;AACYA,0BASX;AATD,CAAA,UAAY,QAAQ,EAAA;;AAElB,IAAA,QAAA,CAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;;AAET,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EATWA,gBAAQ,KAARA,gBAAQ,GASnB,EAAA,CAAA,CAAA,CAAA;AAED;AACYC,+BAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,aAAA,CAAA,aAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;;;;;;;;"}
1
+ {"version":3,"file":"app.js","sources":["../../src/types/app.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Expand } from './expand'\nimport {\n SendSingleTransactionResult,\n SendTransactionFrom,\n SendTransactionParams,\n SendTransactionResult,\n SendTransactionResults,\n TransactionNote,\n TransactionToSign,\n} from './transaction'\nimport ABIArgument = algosdk.ABIArgument\nimport ABIMethod = algosdk.ABIMethod\nimport ABIMethodParams = algosdk.ABIMethodParams\nimport ABIType = algosdk.ABIType\nimport ABIValue = algosdk.ABIValue\nimport Address = algosdk.Address\nimport OnApplicationComplete = algosdk.OnApplicationComplete\nimport SourceMap = algosdk.ProgramSourceMap\nimport SuggestedParams = algosdk.SuggestedParams\nimport Transaction = algosdk.Transaction\n\n/** The name of the TEAL template variable for deploy-time immutability control */\nexport const UPDATABLE_TEMPLATE_NAME = 'TMPL_UPDATABLE'\n\n/** The name of the TEAL template variable for deploy-time permanence control */\nexport const DELETABLE_TEMPLATE_NAME = 'TMPL_DELETABLE'\n\n/** The app create/update [ARC-2](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md) transaction note prefix */\nexport const APP_DEPLOY_NOTE_DAPP = 'ALGOKIT_DEPLOYER'\n\n/** The maximum number of bytes in a single app code page */\nexport const APP_PAGE_MAX_SIZE = 2048\n\n/** First 4 bytes of SHA-512/256 hash of \"return\" for retrieving ABI return values */\nexport const ABI_RETURN_PREFIX = new Uint8Array([21, 31, 124, 117])\n\n/** Information about an Algorand app */\nexport interface AppReference {\n /** The id of the app */\n appId: number | bigint\n /** The Algorand address of the account associated with the app */\n appAddress: string\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxReference` instead.\n *\n * A grouping of the app ID and name of the box in an Uint8Array\n */\nexport interface BoxReference {\n /**\n * A unique application id\n */\n appId: number | bigint\n /**\n * Name of box to reference\n */\n name: BoxIdentifier\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxIdentifier` instead.\n *\n * Something that identifies a box name - either a:\n * * `Uint8Array`\n * * `string` (that will be encoded to a Uint8Array)\n * * `SendTransactionFrom` (encoded into the public key address of the corresponding account)\n */\nexport type BoxIdentifier = string | Uint8Array | SendTransactionFrom\n\n/** Common app call arguments for ABI and non-ABI (raw) calls */\nexport interface CoreAppCallArgs {\n /** The optional lease for the transaction */\n lease?: string | Uint8Array\n /** Any box references to load */\n boxes?: (algosdk.BoxReference | BoxReference | BoxIdentifier)[]\n /** The address of any accounts to load in */\n accounts?: (string | Address)[]\n /** IDs of any apps to load into the foreignApps array */\n apps?: number[]\n /** IDs of any assets to load into the foreignAssets array */\n assets?: number[]\n /** Optional account / account address that should be authorised to transact on behalf of the from account the app call is sent from after this transaction.\n *\n * **Note:** Use with extreme caution and review the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/) first.\n */\n rekeyTo?: SendTransactionFrom | string\n}\n\n/**\n * App call args with non-ABI (raw) values (minus some processing like encoding strings as binary)\n */\nexport interface RawAppCallArgs extends CoreAppCallArgs {\n /** Any application arguments to pass through */\n appArgs?: (Uint8Array | string)[]\n /** Property to aid intellisense */\n method?: undefined\n}\n\n/** An argument for an ABI method, either a primitive value, or a transaction with or without signer, or the unawaited async return value of an algokit method that returns a `SendTransactionResult` */\nexport type ABIAppCallArg =\n | ABIArgument\n | TransactionToSign\n | Transaction\n | Promise<SendTransactionResult>\n | SendTransactionResult\n | undefined\n\n/**\n * App call args for an ABI call\n */\nexport type ABIAppCallArgs = CoreAppCallArgs & {\n /** The ABI method to call */\n method: ABIMethodParams | ABIMethod\n /** The ABI method args to pass in */\n methodArgs: ABIAppCallArg[]\n}\n\n/** Arguments to pass to an app call either:\n * * The raw app call values to pass through into the transaction (after processing); or\n * * An ABI method definition (method and args)\n **/\nexport type AppCallArgs = RawAppCallArgs | ABIAppCallArgs\n\n/**\n * @deprecated Use `TransactionComposer` to construct create app transactions instead.\n *\n * Base interface for common data passed to an app create or update.\n */\ninterface CreateOrUpdateAppParams extends SendTransactionParams {\n /** The account (with private key loaded) that will send the transaction */\n from: SendTransactionFrom\n /** The approval program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */\n approvalProgram: Uint8Array | string\n /** The clear state program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */\n clearStateProgram: Uint8Array | string\n /** Optional transaction parameters */\n transactionParams?: SuggestedParams\n /** The (optional) transaction note */\n note?: TransactionNote\n /** The arguments passed in to the app call */\n args?: AppCallArgs\n}\n\n/**\n * @deprecated Use `TransactionComposer` to construct create app transactions instead.\n *\n * Parameters that are passed in when creating an app. */\nexport interface CreateAppParams extends CreateOrUpdateAppParams {\n /** The storage schema to request for the created app */\n schema: AppStorageSchema\n /** Override the on-completion action for the create call; defaults to NoOp */\n onCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>\n}\n\n/**\n * @deprecated Use `TransactionComposer` to construct update app transactions instead.\n *\n * Parameters that are passed in when updating an app. */\nexport interface UpdateAppParams extends CreateOrUpdateAppParams {\n /** The id of the app to update */\n appId: number | bigint\n}\n\n/**\n * @deprecated Use `algosdk.OnApplicationComplete` directly instead.\n *\n * The type of call / [on-completion action](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#the-lifecycle-of-a-smart-contract) for a smart contract call.\n *\n * Equivalent of `algosdk.OnApplicationComplete`, but as a more convenient string enum.\n *\n * * `no_op`: Normal smart contract call, no special on-complete action\n * * `opt_in`: Opt-in to smart contract local storage\n * * `close_out`: Close-out local storage storage\n * * `clear_state`: Clear local storage state\n * * `update_application`: Update the smart contract\n * * `delete_application`: Delete the smart contract\n */\nexport type AppCallType = 'no_op' | 'opt_in' | 'close_out' | 'clear_state' | 'update_application' | 'delete_application'\n\n/** Parameters representing a call to an app. */\nexport interface AppCallParams extends SendTransactionParams {\n /** The id of the app to call */\n appId: number | bigint\n /** The type of call, everything except create (see `createApp`) and update (see `updateApp`) */\n callType: Exclude<AppCallType, 'update_application'> | Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>\n /** The account to make the call from */\n from: SendTransactionFrom\n /** Optional transaction parameters */\n transactionParams?: SuggestedParams\n /** The (optional) transaction note */\n note?: TransactionNote\n /** The arguments passed in to the app call */\n args?: AppCallArgs\n}\n\n/** Parameters representing the storage schema of an app. */\nexport interface AppStorageSchema {\n /** Restricts number of ints in per-user local state */\n localInts: number\n /** Restricts number of byte slices in per-user local state */\n localByteSlices: number\n /** Restricts number of ints in global state */\n globalInts: number\n /** Restricts number of byte slices in global state */\n globalByteSlices: number\n /** Any extra pages that are needed for the smart contract; if left blank then the right number of pages will be calculated based on the teal code size */\n extraPages?: number\n}\n\n/** Information about a compiled teal program */\nexport interface CompiledTeal {\n /** Original TEAL code */\n teal: string\n /** The compiled code */\n compiled: string\n /** The hash returned by the compiler */\n compiledHash: string\n /** The base64 encoded code as a byte array */\n compiledBase64ToBytes: Uint8Array\n /** Source map from the compilation */\n sourceMap: SourceMap\n}\n\nexport interface AppCallTransactionResultOfType<T> extends SendTransactionResults, SendTransactionResult {\n /** If an ABI method was called the processed return value */\n return?: T\n}\n\n/** Result from calling an app */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport type AppCallTransactionResult = AppCallTransactionResultOfType<ABIReturn>\n\n/** The return value of an ABI method call */\nexport type ABIReturn =\n | {\n rawReturnValue: Uint8Array\n returnValue: ABIValue\n method: ABIMethod\n decodeError: undefined\n }\n | { rawReturnValue?: undefined; returnValue?: undefined; method?: undefined; decodeError: Error }\n\n/**\n * The payload of the metadata to add to the transaction note when deploying an app, noting it will be prefixed with `APP_DEPLOY_NOTE_PREFIX`.\n */\nexport interface AppDeployMetadata {\n /** The unique name identifier of the app within the creator account */\n name: string\n /** The version of app that is / will be deployed */\n version: string\n /** Whether or not the app is deletable / permanent / unspecified */\n deletable?: boolean\n /** Whether or not the app is updatable / immutable / unspecified */\n updatable?: boolean\n}\n\n/** The metadata that can be collected about a deployed app */\nexport interface AppMetadata extends AppReference, AppDeployMetadata {\n /** The round the app was created */\n createdRound: number\n /** The last round that the app was updated */\n updatedRound: number\n /** The metadata when the app was created */\n createdMetadata: AppDeployMetadata\n /** Whether or not the app is deleted */\n deleted: boolean\n}\n\n/** A lookup of name -> Algorand app for a creator */\nexport interface AppLookup {\n creator: Readonly<string>\n apps: Readonly<{\n [name: string]: AppMetadata\n }>\n}\n\n/** Dictionary of deploy-time parameters to replace in a teal template.\n *\n * Note: Looks for `TMPL_{parameter}` for template replacements i.e. you can leave out the `TMPL_`.\n *\n */\nexport interface TealTemplateParams {\n [key: string]: string | bigint | number | Uint8Array\n}\n\n/** What action to perform when deploying an app and an update is detected in the TEAL code */\nexport enum OnUpdate {\n /** Fail the deployment */\n Fail,\n /** Update the app */\n UpdateApp,\n /** Delete the app and create a new one in its place */\n ReplaceApp,\n /** Create a new app */\n AppendApp,\n}\n\n/** What action to perform when deploying an app and a breaking schema change is detected */\nexport enum OnSchemaBreak {\n /** Fail the deployment */\n Fail,\n /** Delete the app and create a new one in its place */\n ReplaceApp,\n /** Create a new app */\n AppendApp,\n}\n\n/** The parameters to deploy an app */\nexport interface AppDeploymentParams\n extends Omit<CreateAppParams, 'onCompleteAction' | 'args' | 'note' | 'skipSending' | 'skipWaiting' | 'atc'> {\n /** The deployment metadata */\n metadata: AppDeployMetadata\n /** Any deploy-time parameters to replace in the TEAL code */\n deployTimeParams?: TealTemplateParams\n /** What action to perform if a schema break is detected */\n onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak\n /** What action to perform if a TEAL update is detected */\n onUpdate?: 'update' | 'replace' | 'fail' | 'append' | OnUpdate\n /** Optional cached value of the existing apps for the given creator */\n existingDeployments?: AppLookup\n /** Any args to pass to any create transaction that is issued as part of deployment */\n createArgs?: AppCallArgs\n /** Override the on-completion action for the create call; defaults to NoOp */\n createOnCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>\n /** Any args to pass to any update transaction that is issued as part of deployment */\n updateArgs?: AppCallArgs\n /** Any args to pass to any delete transaction that is issued as part of deployment */\n deleteArgs?: AppCallArgs\n}\n\n/** The result of compiling the approval and clear state TEAL programs for an app */\nexport interface AppCompilationResult {\n /** The result of compiling the approval program */\n compiledApproval: CompiledTeal\n /** The result of compiling the clear state program */\n compiledClear: CompiledTeal\n}\n\nexport type AppReturn<TReturn> = {\n /** The ABI method call return value */\n return?: TReturn\n}\n\n/** Result from sending a single app transaction. */\nexport type SendAppTransactionResult = Expand<\n SendSingleTransactionResult & {\n /** If an ABI method was called the processed return value */\n return?: ABIReturn\n }\n>\n\n/** Result from sending a single app transaction. */\nexport type SendAppUpdateTransactionResult = Expand<SendAppTransactionResult & Partial<AppCompilationResult>>\n\n/** Result from sending a single app transaction. */\nexport type SendAppCreateTransactionResult = Expand<\n SendAppUpdateTransactionResult & {\n /** The id of the created app */\n appId: bigint\n /** The Algorand address of the account associated with the app */\n appAddress: Address\n }\n>\n\n/** Object holding app state values */\nexport interface AppState {\n [key: string]:\n | {\n value: bigint\n keyRaw: Uint8Array\n keyBase64: string\n }\n | {\n value: string\n valueRaw: Uint8Array\n valueBase64: string\n keyRaw: Uint8Array\n keyBase64: string\n }\n}\n\n/**\n * The name of a box storage box */\nexport interface BoxName {\n /** Name in UTF-8 */\n name: string\n /** Name in binary bytes */\n nameRaw: Uint8Array\n /** Name in Base64 */\n nameBase64: string\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxValueRequestParams` instead.\n * Parameters to get and decode a box value as an ABI type.\n */\nexport interface BoxValueRequestParams {\n /** The ID of the app return box names for */\n appId: number | bigint\n /** The name of the box to return either as a string, binary array or `BoxName` */\n boxName: string | Uint8Array | BoxName\n /** The ABI type to decode the value using */\n type: ABIType\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxValuesRequestParams` instead.\n * Parameters to get and decode a box value as an ABI type.\n */\nexport interface BoxValuesRequestParams {\n /** The ID of the app return box names for */\n appId: number\n /** The names of the boxes to return either as a string, binary array or BoxName` */\n boxNames: (string | Uint8Array | BoxName)[]\n /** The ABI type to decode the value using */\n type: ABIType\n}\n"],"names":["OnUpdate","OnSchemaBreak"],"mappings":";;AAsBA;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,oBAAoB,GAAG,mBAAkB;AAEtD;AACO,MAAM,iBAAiB,GAAG,KAAI;AAErC;AACa,MAAA,iBAAiB,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAC;AA4PnE;AACYA,0BASX;AATD,CAAA,UAAY,QAAQ,EAAA;;AAElB,IAAA,QAAA,CAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;;AAET,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EATWA,gBAAQ,KAARA,gBAAQ,GASnB,EAAA,CAAA,CAAA,CAAA;AAED;AACYC,+BAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,aAAA,CAAA,aAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;;;;;;;;"}
package/types/app.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  const UPDATABLE_TEMPLATE_NAME = 'TMPL_UPDATABLE';
3
3
  /** The name of the TEAL template variable for deploy-time permanence control */
4
4
  const DELETABLE_TEMPLATE_NAME = 'TMPL_DELETABLE';
5
- /** The app create/update ARC-2 transaction note prefix */
5
+ /** The app create/update [ARC-2](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md) transaction note prefix */
6
6
  const APP_DEPLOY_NOTE_DAPP = 'ALGOKIT_DEPLOYER';
7
7
  /** The maximum number of bytes in a single app code page */
8
8
  const APP_PAGE_MAX_SIZE = 2048;
package/types/app.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.mjs","sources":["../../src/types/app.ts"],"sourcesContent":[null],"names":[],"mappings":"AAoBA;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,oBAAoB,GAAG,mBAAkB;AAEtD;AACO,MAAM,iBAAiB,GAAG,KAAI;AAErC;AACa,MAAA,iBAAiB,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAC;AA0OnE;IACY,SASX;AATD,CAAA,UAAY,QAAQ,EAAA;;AAElB,IAAA,QAAA,CAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;;AAET,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EATW,QAAQ,KAAR,QAAQ,GASnB,EAAA,CAAA,CAAA,CAAA;AAED;IACY,cAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,aAAA,CAAA,aAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"app.mjs","sources":["../../src/types/app.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Expand } from './expand'\nimport {\n SendSingleTransactionResult,\n SendTransactionFrom,\n SendTransactionParams,\n SendTransactionResult,\n SendTransactionResults,\n TransactionNote,\n TransactionToSign,\n} from './transaction'\nimport ABIArgument = algosdk.ABIArgument\nimport ABIMethod = algosdk.ABIMethod\nimport ABIMethodParams = algosdk.ABIMethodParams\nimport ABIType = algosdk.ABIType\nimport ABIValue = algosdk.ABIValue\nimport Address = algosdk.Address\nimport OnApplicationComplete = algosdk.OnApplicationComplete\nimport SourceMap = algosdk.ProgramSourceMap\nimport SuggestedParams = algosdk.SuggestedParams\nimport Transaction = algosdk.Transaction\n\n/** The name of the TEAL template variable for deploy-time immutability control */\nexport const UPDATABLE_TEMPLATE_NAME = 'TMPL_UPDATABLE'\n\n/** The name of the TEAL template variable for deploy-time permanence control */\nexport const DELETABLE_TEMPLATE_NAME = 'TMPL_DELETABLE'\n\n/** The app create/update [ARC-2](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md) transaction note prefix */\nexport const APP_DEPLOY_NOTE_DAPP = 'ALGOKIT_DEPLOYER'\n\n/** The maximum number of bytes in a single app code page */\nexport const APP_PAGE_MAX_SIZE = 2048\n\n/** First 4 bytes of SHA-512/256 hash of \"return\" for retrieving ABI return values */\nexport const ABI_RETURN_PREFIX = new Uint8Array([21, 31, 124, 117])\n\n/** Information about an Algorand app */\nexport interface AppReference {\n /** The id of the app */\n appId: number | bigint\n /** The Algorand address of the account associated with the app */\n appAddress: string\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxReference` instead.\n *\n * A grouping of the app ID and name of the box in an Uint8Array\n */\nexport interface BoxReference {\n /**\n * A unique application id\n */\n appId: number | bigint\n /**\n * Name of box to reference\n */\n name: BoxIdentifier\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxIdentifier` instead.\n *\n * Something that identifies a box name - either a:\n * * `Uint8Array`\n * * `string` (that will be encoded to a Uint8Array)\n * * `SendTransactionFrom` (encoded into the public key address of the corresponding account)\n */\nexport type BoxIdentifier = string | Uint8Array | SendTransactionFrom\n\n/** Common app call arguments for ABI and non-ABI (raw) calls */\nexport interface CoreAppCallArgs {\n /** The optional lease for the transaction */\n lease?: string | Uint8Array\n /** Any box references to load */\n boxes?: (algosdk.BoxReference | BoxReference | BoxIdentifier)[]\n /** The address of any accounts to load in */\n accounts?: (string | Address)[]\n /** IDs of any apps to load into the foreignApps array */\n apps?: number[]\n /** IDs of any assets to load into the foreignAssets array */\n assets?: number[]\n /** Optional account / account address that should be authorised to transact on behalf of the from account the app call is sent from after this transaction.\n *\n * **Note:** Use with extreme caution and review the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/) first.\n */\n rekeyTo?: SendTransactionFrom | string\n}\n\n/**\n * App call args with non-ABI (raw) values (minus some processing like encoding strings as binary)\n */\nexport interface RawAppCallArgs extends CoreAppCallArgs {\n /** Any application arguments to pass through */\n appArgs?: (Uint8Array | string)[]\n /** Property to aid intellisense */\n method?: undefined\n}\n\n/** An argument for an ABI method, either a primitive value, or a transaction with or without signer, or the unawaited async return value of an algokit method that returns a `SendTransactionResult` */\nexport type ABIAppCallArg =\n | ABIArgument\n | TransactionToSign\n | Transaction\n | Promise<SendTransactionResult>\n | SendTransactionResult\n | undefined\n\n/**\n * App call args for an ABI call\n */\nexport type ABIAppCallArgs = CoreAppCallArgs & {\n /** The ABI method to call */\n method: ABIMethodParams | ABIMethod\n /** The ABI method args to pass in */\n methodArgs: ABIAppCallArg[]\n}\n\n/** Arguments to pass to an app call either:\n * * The raw app call values to pass through into the transaction (after processing); or\n * * An ABI method definition (method and args)\n **/\nexport type AppCallArgs = RawAppCallArgs | ABIAppCallArgs\n\n/**\n * @deprecated Use `TransactionComposer` to construct create app transactions instead.\n *\n * Base interface for common data passed to an app create or update.\n */\ninterface CreateOrUpdateAppParams extends SendTransactionParams {\n /** The account (with private key loaded) that will send the transaction */\n from: SendTransactionFrom\n /** The approval program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */\n approvalProgram: Uint8Array | string\n /** The clear state program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */\n clearStateProgram: Uint8Array | string\n /** Optional transaction parameters */\n transactionParams?: SuggestedParams\n /** The (optional) transaction note */\n note?: TransactionNote\n /** The arguments passed in to the app call */\n args?: AppCallArgs\n}\n\n/**\n * @deprecated Use `TransactionComposer` to construct create app transactions instead.\n *\n * Parameters that are passed in when creating an app. */\nexport interface CreateAppParams extends CreateOrUpdateAppParams {\n /** The storage schema to request for the created app */\n schema: AppStorageSchema\n /** Override the on-completion action for the create call; defaults to NoOp */\n onCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>\n}\n\n/**\n * @deprecated Use `TransactionComposer` to construct update app transactions instead.\n *\n * Parameters that are passed in when updating an app. */\nexport interface UpdateAppParams extends CreateOrUpdateAppParams {\n /** The id of the app to update */\n appId: number | bigint\n}\n\n/**\n * @deprecated Use `algosdk.OnApplicationComplete` directly instead.\n *\n * The type of call / [on-completion action](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#the-lifecycle-of-a-smart-contract) for a smart contract call.\n *\n * Equivalent of `algosdk.OnApplicationComplete`, but as a more convenient string enum.\n *\n * * `no_op`: Normal smart contract call, no special on-complete action\n * * `opt_in`: Opt-in to smart contract local storage\n * * `close_out`: Close-out local storage storage\n * * `clear_state`: Clear local storage state\n * * `update_application`: Update the smart contract\n * * `delete_application`: Delete the smart contract\n */\nexport type AppCallType = 'no_op' | 'opt_in' | 'close_out' | 'clear_state' | 'update_application' | 'delete_application'\n\n/** Parameters representing a call to an app. */\nexport interface AppCallParams extends SendTransactionParams {\n /** The id of the app to call */\n appId: number | bigint\n /** The type of call, everything except create (see `createApp`) and update (see `updateApp`) */\n callType: Exclude<AppCallType, 'update_application'> | Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>\n /** The account to make the call from */\n from: SendTransactionFrom\n /** Optional transaction parameters */\n transactionParams?: SuggestedParams\n /** The (optional) transaction note */\n note?: TransactionNote\n /** The arguments passed in to the app call */\n args?: AppCallArgs\n}\n\n/** Parameters representing the storage schema of an app. */\nexport interface AppStorageSchema {\n /** Restricts number of ints in per-user local state */\n localInts: number\n /** Restricts number of byte slices in per-user local state */\n localByteSlices: number\n /** Restricts number of ints in global state */\n globalInts: number\n /** Restricts number of byte slices in global state */\n globalByteSlices: number\n /** Any extra pages that are needed for the smart contract; if left blank then the right number of pages will be calculated based on the teal code size */\n extraPages?: number\n}\n\n/** Information about a compiled teal program */\nexport interface CompiledTeal {\n /** Original TEAL code */\n teal: string\n /** The compiled code */\n compiled: string\n /** The hash returned by the compiler */\n compiledHash: string\n /** The base64 encoded code as a byte array */\n compiledBase64ToBytes: Uint8Array\n /** Source map from the compilation */\n sourceMap: SourceMap\n}\n\nexport interface AppCallTransactionResultOfType<T> extends SendTransactionResults, SendTransactionResult {\n /** If an ABI method was called the processed return value */\n return?: T\n}\n\n/** Result from calling an app */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport type AppCallTransactionResult = AppCallTransactionResultOfType<ABIReturn>\n\n/** The return value of an ABI method call */\nexport type ABIReturn =\n | {\n rawReturnValue: Uint8Array\n returnValue: ABIValue\n method: ABIMethod\n decodeError: undefined\n }\n | { rawReturnValue?: undefined; returnValue?: undefined; method?: undefined; decodeError: Error }\n\n/**\n * The payload of the metadata to add to the transaction note when deploying an app, noting it will be prefixed with `APP_DEPLOY_NOTE_PREFIX`.\n */\nexport interface AppDeployMetadata {\n /** The unique name identifier of the app within the creator account */\n name: string\n /** The version of app that is / will be deployed */\n version: string\n /** Whether or not the app is deletable / permanent / unspecified */\n deletable?: boolean\n /** Whether or not the app is updatable / immutable / unspecified */\n updatable?: boolean\n}\n\n/** The metadata that can be collected about a deployed app */\nexport interface AppMetadata extends AppReference, AppDeployMetadata {\n /** The round the app was created */\n createdRound: number\n /** The last round that the app was updated */\n updatedRound: number\n /** The metadata when the app was created */\n createdMetadata: AppDeployMetadata\n /** Whether or not the app is deleted */\n deleted: boolean\n}\n\n/** A lookup of name -> Algorand app for a creator */\nexport interface AppLookup {\n creator: Readonly<string>\n apps: Readonly<{\n [name: string]: AppMetadata\n }>\n}\n\n/** Dictionary of deploy-time parameters to replace in a teal template.\n *\n * Note: Looks for `TMPL_{parameter}` for template replacements i.e. you can leave out the `TMPL_`.\n *\n */\nexport interface TealTemplateParams {\n [key: string]: string | bigint | number | Uint8Array\n}\n\n/** What action to perform when deploying an app and an update is detected in the TEAL code */\nexport enum OnUpdate {\n /** Fail the deployment */\n Fail,\n /** Update the app */\n UpdateApp,\n /** Delete the app and create a new one in its place */\n ReplaceApp,\n /** Create a new app */\n AppendApp,\n}\n\n/** What action to perform when deploying an app and a breaking schema change is detected */\nexport enum OnSchemaBreak {\n /** Fail the deployment */\n Fail,\n /** Delete the app and create a new one in its place */\n ReplaceApp,\n /** Create a new app */\n AppendApp,\n}\n\n/** The parameters to deploy an app */\nexport interface AppDeploymentParams\n extends Omit<CreateAppParams, 'onCompleteAction' | 'args' | 'note' | 'skipSending' | 'skipWaiting' | 'atc'> {\n /** The deployment metadata */\n metadata: AppDeployMetadata\n /** Any deploy-time parameters to replace in the TEAL code */\n deployTimeParams?: TealTemplateParams\n /** What action to perform if a schema break is detected */\n onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak\n /** What action to perform if a TEAL update is detected */\n onUpdate?: 'update' | 'replace' | 'fail' | 'append' | OnUpdate\n /** Optional cached value of the existing apps for the given creator */\n existingDeployments?: AppLookup\n /** Any args to pass to any create transaction that is issued as part of deployment */\n createArgs?: AppCallArgs\n /** Override the on-completion action for the create call; defaults to NoOp */\n createOnCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>\n /** Any args to pass to any update transaction that is issued as part of deployment */\n updateArgs?: AppCallArgs\n /** Any args to pass to any delete transaction that is issued as part of deployment */\n deleteArgs?: AppCallArgs\n}\n\n/** The result of compiling the approval and clear state TEAL programs for an app */\nexport interface AppCompilationResult {\n /** The result of compiling the approval program */\n compiledApproval: CompiledTeal\n /** The result of compiling the clear state program */\n compiledClear: CompiledTeal\n}\n\nexport type AppReturn<TReturn> = {\n /** The ABI method call return value */\n return?: TReturn\n}\n\n/** Result from sending a single app transaction. */\nexport type SendAppTransactionResult = Expand<\n SendSingleTransactionResult & {\n /** If an ABI method was called the processed return value */\n return?: ABIReturn\n }\n>\n\n/** Result from sending a single app transaction. */\nexport type SendAppUpdateTransactionResult = Expand<SendAppTransactionResult & Partial<AppCompilationResult>>\n\n/** Result from sending a single app transaction. */\nexport type SendAppCreateTransactionResult = Expand<\n SendAppUpdateTransactionResult & {\n /** The id of the created app */\n appId: bigint\n /** The Algorand address of the account associated with the app */\n appAddress: Address\n }\n>\n\n/** Object holding app state values */\nexport interface AppState {\n [key: string]:\n | {\n value: bigint\n keyRaw: Uint8Array\n keyBase64: string\n }\n | {\n value: string\n valueRaw: Uint8Array\n valueBase64: string\n keyRaw: Uint8Array\n keyBase64: string\n }\n}\n\n/**\n * The name of a box storage box */\nexport interface BoxName {\n /** Name in UTF-8 */\n name: string\n /** Name in binary bytes */\n nameRaw: Uint8Array\n /** Name in Base64 */\n nameBase64: string\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxValueRequestParams` instead.\n * Parameters to get and decode a box value as an ABI type.\n */\nexport interface BoxValueRequestParams {\n /** The ID of the app return box names for */\n appId: number | bigint\n /** The name of the box to return either as a string, binary array or `BoxName` */\n boxName: string | Uint8Array | BoxName\n /** The ABI type to decode the value using */\n type: ABIType\n}\n\n/**\n * @deprecated Use `types/app-manager/BoxValuesRequestParams` instead.\n * Parameters to get and decode a box value as an ABI type.\n */\nexport interface BoxValuesRequestParams {\n /** The ID of the app return box names for */\n appId: number\n /** The names of the boxes to return either as a string, binary array or BoxName` */\n boxNames: (string | Uint8Array | BoxName)[]\n /** The ABI type to decode the value using */\n type: ABIType\n}\n"],"names":[],"mappings":"AAsBA;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,uBAAuB,GAAG,iBAAgB;AAEvD;AACO,MAAM,oBAAoB,GAAG,mBAAkB;AAEtD;AACO,MAAM,iBAAiB,GAAG,KAAI;AAErC;AACa,MAAA,iBAAiB,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAC;AA4PnE;IACY,SASX;AATD,CAAA,UAAY,QAAQ,EAAA;;AAElB,IAAA,QAAA,CAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;;AAET,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EATW,QAAQ,KAAR,QAAQ,GASnB,EAAA,CAAA,CAAA,CAAA;AAED;IACY,cAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;;AAEJ,IAAA,aAAA,CAAA,aAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;;AAEV,IAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACX,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}