@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.2

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 (340) hide show
  1. package/_virtual/_rolldown/runtime.js +33 -0
  2. package/_virtual/_rolldown/runtime.mjs +13 -0
  3. package/account/account.d.ts +25 -30
  4. package/account/account.js +151 -146
  5. package/account/account.js.map +1 -1
  6. package/account/account.mjs +149 -144
  7. package/account/account.mjs.map +1 -1
  8. package/account/get-account-config-from-environment.d.ts +7 -2
  9. package/account/get-account-config-from-environment.js +19 -21
  10. package/account/get-account-config-from-environment.js.map +1 -1
  11. package/account/get-account-config-from-environment.mjs +19 -19
  12. package/account/get-account-config-from-environment.mjs.map +1 -1
  13. package/account/get-account.d.ts +14 -12
  14. package/account/get-account.js +56 -59
  15. package/account/get-account.js.map +1 -1
  16. package/account/get-account.mjs +56 -57
  17. package/account/get-account.mjs.map +1 -1
  18. package/account/get-dispenser-account.d.ts +9 -5
  19. package/account/get-dispenser-account.js +20 -18
  20. package/account/get-dispenser-account.js.map +1 -1
  21. package/account/get-dispenser-account.mjs +20 -16
  22. package/account/get-dispenser-account.mjs.map +1 -1
  23. package/account/mnemonic-account.d.ts +7 -3
  24. package/account/mnemonic-account.js +17 -17
  25. package/account/mnemonic-account.js.map +1 -1
  26. package/account/mnemonic-account.mjs +15 -15
  27. package/account/mnemonic-account.mjs.map +1 -1
  28. package/amount.d.ts +40 -35
  29. package/amount.js +33 -34
  30. package/amount.js.map +1 -1
  31. package/amount.mjs +33 -32
  32. package/amount.mjs.map +1 -1
  33. package/app-client.d.ts +10 -6
  34. package/app-client.js +91 -86
  35. package/app-client.js.map +1 -1
  36. package/app-client.mjs +91 -84
  37. package/app-client.mjs.map +1 -1
  38. package/app-deploy.d.ts +26 -24
  39. package/app-deploy.js +235 -253
  40. package/app-deploy.js.map +1 -1
  41. package/app-deploy.mjs +233 -251
  42. package/app-deploy.mjs.map +1 -1
  43. package/app.d.ts +45 -46
  44. package/app.js +253 -271
  45. package/app.js.map +1 -1
  46. package/app.mjs +249 -267
  47. package/app.mjs.map +1 -1
  48. package/asset.d.ts +16 -12
  49. package/asset.js +116 -122
  50. package/asset.js.map +1 -1
  51. package/asset.mjs +116 -120
  52. package/asset.mjs.map +1 -1
  53. package/config.d.ts +7 -2
  54. package/config.js +5 -7
  55. package/config.js.map +1 -1
  56. package/config.mjs +5 -4
  57. package/config.mjs.map +1 -1
  58. package/debugging/debugging.d.ts +5 -1
  59. package/debugging/debugging.js +11 -11
  60. package/debugging/debugging.js.map +1 -1
  61. package/debugging/debugging.mjs +11 -9
  62. package/debugging/debugging.mjs.map +1 -1
  63. package/dispenser-client.d.ts +7 -2
  64. package/dispenser-client.js +23 -24
  65. package/dispenser-client.js.map +1 -1
  66. package/dispenser-client.mjs +23 -22
  67. package/dispenser-client.mjs.map +1 -1
  68. package/index.d.ts +27 -18
  69. package/index.js +140 -143
  70. package/index.mjs +27 -29
  71. package/indexer-lookup.d.ts +18 -11
  72. package/indexer-lookup.js +112 -120
  73. package/indexer-lookup.js.map +1 -1
  74. package/indexer-lookup.mjs +105 -118
  75. package/indexer-lookup.mjs.map +1 -1
  76. package/localnet/get-kmd-wallet-account.d.ts +9 -7
  77. package/localnet/get-kmd-wallet-account.js +28 -26
  78. package/localnet/get-kmd-wallet-account.js.map +1 -1
  79. package/localnet/get-kmd-wallet-account.mjs +28 -24
  80. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  81. package/localnet/get-localnet-dispenser-account.d.ts +7 -5
  82. package/localnet/get-localnet-dispenser-account.js +17 -15
  83. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  84. package/localnet/get-localnet-dispenser-account.mjs +17 -13
  85. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  86. package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
  87. package/localnet/get-or-create-kmd-wallet-account.js +28 -26
  88. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  89. package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
  90. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  91. package/localnet/is-localnet.d.ts +7 -3
  92. package/localnet/is-localnet.js +9 -10
  93. package/localnet/is-localnet.js.map +1 -1
  94. package/localnet/is-localnet.mjs +9 -8
  95. package/localnet/is-localnet.mjs.map +1 -1
  96. package/network-client.d.ts +17 -15
  97. package/network-client.js +115 -116
  98. package/network-client.js.map +1 -1
  99. package/network-client.mjs +115 -114
  100. package/network-client.mjs.map +1 -1
  101. package/package.json +12 -3
  102. package/testing/account.d.ts +11 -9
  103. package/testing/account.js +31 -33
  104. package/testing/account.js.map +1 -1
  105. package/testing/account.mjs +29 -31
  106. package/testing/account.mjs.map +1 -1
  107. package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
  108. package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
  109. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  110. package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
  111. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  112. package/testing/fixtures/algorand-fixture.d.ts +9 -4
  113. package/testing/fixtures/algorand-fixture.js +67 -62
  114. package/testing/fixtures/algorand-fixture.js.map +1 -1
  115. package/testing/fixtures/algorand-fixture.mjs +66 -59
  116. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  117. package/testing/index.d.ts +7 -5
  118. package/testing/index.js +13 -18
  119. package/testing/index.mjs +7 -7
  120. package/testing/indexer.d.ts +5 -1
  121. package/testing/indexer.js +28 -37
  122. package/testing/indexer.js.map +1 -1
  123. package/testing/indexer.mjs +28 -35
  124. package/testing/indexer.mjs.map +1 -1
  125. package/testing/test-logger.d.ts +41 -36
  126. package/testing/test-logger.js +71 -76
  127. package/testing/test-logger.js.map +1 -1
  128. package/testing/test-logger.mjs +71 -74
  129. package/testing/test-logger.mjs.map +1 -1
  130. package/testing/transaction-logger.d.ts +30 -27
  131. package/testing/transaction-logger.js +77 -93
  132. package/testing/transaction-logger.js.map +1 -1
  133. package/testing/transaction-logger.mjs +74 -90
  134. package/testing/transaction-logger.mjs.map +1 -1
  135. package/transaction/legacy-bridge.js +100 -111
  136. package/transaction/legacy-bridge.js.map +1 -1
  137. package/transaction/legacy-bridge.mjs +97 -108
  138. package/transaction/legacy-bridge.mjs.map +1 -1
  139. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
  140. package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
  141. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  142. package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
  143. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  144. package/transaction/transaction.d.ts +34 -35
  145. package/transaction/transaction.js +716 -914
  146. package/transaction/transaction.js.map +1 -1
  147. package/transaction/transaction.mjs +713 -911
  148. package/transaction/transaction.mjs.map +1 -1
  149. package/transfer/transfer-algos.d.ts +9 -5
  150. package/transfer/transfer-algos.js +26 -27
  151. package/transfer/transfer-algos.js.map +1 -1
  152. package/transfer/transfer-algos.mjs +26 -25
  153. package/transfer/transfer-algos.mjs.map +1 -1
  154. package/transfer/transfer.d.ts +11 -8
  155. package/transfer/transfer.js +94 -100
  156. package/transfer/transfer.js.map +1 -1
  157. package/transfer/transfer.mjs +94 -98
  158. package/transfer/transfer.mjs.map +1 -1
  159. package/types/account-manager.d.ts +432 -429
  160. package/types/account-manager.js +591 -602
  161. package/types/account-manager.js.map +1 -1
  162. package/types/account-manager.mjs +587 -599
  163. package/types/account-manager.mjs.map +1 -1
  164. package/types/account.d.ts +192 -202
  165. package/types/account.js +91 -88
  166. package/types/account.js.map +1 -1
  167. package/types/account.mjs +88 -86
  168. package/types/account.mjs.map +1 -1
  169. package/types/algo-http-client-with-retry.d.ts +15 -10
  170. package/types/algo-http-client-with-retry.js +70 -92
  171. package/types/algo-http-client-with-retry.js.map +1 -1
  172. package/types/algo-http-client-with-retry.mjs +69 -90
  173. package/types/algo-http-client-with-retry.mjs.map +1 -1
  174. package/types/algorand-client-transaction-creator.d.ts +778 -771
  175. package/types/algorand-client-transaction-creator.js +733 -732
  176. package/types/algorand-client-transaction-creator.js.map +1 -1
  177. package/types/algorand-client-transaction-creator.mjs +732 -730
  178. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  179. package/types/algorand-client-transaction-sender.d.ts +1090 -1360
  180. package/types/algorand-client-transaction-sender.js +930 -961
  181. package/types/algorand-client-transaction-sender.js.map +1 -1
  182. package/types/algorand-client-transaction-sender.mjs +927 -959
  183. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  184. package/types/algorand-client.d.ts +239 -236
  185. package/types/algorand-client.js +322 -320
  186. package/types/algorand-client.js.map +1 -1
  187. package/types/algorand-client.mjs +321 -318
  188. package/types/algorand-client.mjs.map +1 -1
  189. package/types/amount.d.ts +47 -43
  190. package/types/amount.js +66 -70
  191. package/types/amount.js.map +1 -1
  192. package/types/amount.mjs +63 -68
  193. package/types/amount.mjs.map +1 -1
  194. package/types/app-arc56.d.ts +235 -272
  195. package/types/app-arc56.js +124 -170
  196. package/types/app-arc56.js.map +1 -1
  197. package/types/app-arc56.mjs +121 -168
  198. package/types/app-arc56.mjs.map +1 -1
  199. package/types/app-client.d.ts +1128 -2009
  200. package/types/app-client.js +1633 -1791
  201. package/types/app-client.js.map +1 -1
  202. package/types/app-client.mjs +1624 -1783
  203. package/types/app-client.mjs.map +1 -1
  204. package/types/app-deployer.d.ts +139 -141
  205. package/types/app-deployer.js +344 -384
  206. package/types/app-deployer.js.map +1 -1
  207. package/types/app-deployer.mjs +341 -382
  208. package/types/app-deployer.mjs.map +1 -1
  209. package/types/app-factory.d.ts +762 -932
  210. package/types/app-factory.js +496 -488
  211. package/types/app-factory.js.map +1 -1
  212. package/types/app-factory.mjs +491 -484
  213. package/types/app-factory.mjs.map +1 -1
  214. package/types/app-manager.d.ts +304 -310
  215. package/types/app-manager.js +422 -475
  216. package/types/app-manager.js.map +1 -1
  217. package/types/app-manager.mjs +419 -473
  218. package/types/app-manager.mjs.map +1 -1
  219. package/types/app-spec.d.ts +118 -117
  220. package/types/app-spec.js +125 -135
  221. package/types/app-spec.js.map +1 -1
  222. package/types/app-spec.mjs +121 -132
  223. package/types/app-spec.mjs.map +1 -1
  224. package/types/app.d.ts +229 -241
  225. package/types/app.js +36 -28
  226. package/types/app.js.map +1 -1
  227. package/types/app.mjs +33 -26
  228. package/types/app.mjs.map +1 -1
  229. package/types/asset-manager.d.ts +204 -199
  230. package/types/asset-manager.js +165 -174
  231. package/types/asset-manager.js.map +1 -1
  232. package/types/asset-manager.mjs +164 -172
  233. package/types/asset-manager.mjs.map +1 -1
  234. package/types/asset.d.ts +95 -91
  235. package/types/asset.js +0 -3
  236. package/types/asset.mjs +0 -2
  237. package/types/async-event-emitter.d.ts +18 -13
  238. package/types/async-event-emitter.js +37 -49
  239. package/types/async-event-emitter.js.map +1 -1
  240. package/types/async-event-emitter.mjs +36 -47
  241. package/types/async-event-emitter.mjs.map +1 -1
  242. package/types/client-manager.d.ts +453 -451
  243. package/types/client-manager.js +602 -598
  244. package/types/client-manager.js.map +1 -1
  245. package/types/client-manager.mjs +597 -594
  246. package/types/client-manager.mjs.map +1 -1
  247. package/types/composer.d.ts +1211 -1258
  248. package/types/composer.js +1436 -1498
  249. package/types/composer.js.map +1 -1
  250. package/types/composer.mjs +1430 -1493
  251. package/types/composer.mjs.map +1 -1
  252. package/types/config.d.ts +53 -48
  253. package/types/config.js +78 -77
  254. package/types/config.js.map +1 -1
  255. package/types/config.mjs +77 -75
  256. package/types/config.mjs.map +1 -1
  257. package/types/debugging.d.ts +25 -23
  258. package/types/debugging.js +9 -11
  259. package/types/debugging.js.map +1 -1
  260. package/types/debugging.mjs +8 -9
  261. package/types/debugging.mjs.map +1 -1
  262. package/types/dispenser-client.d.ts +57 -52
  263. package/types/dispenser-client.js +120 -141
  264. package/types/dispenser-client.js.map +1 -1
  265. package/types/dispenser-client.mjs +119 -139
  266. package/types/dispenser-client.mjs.map +1 -1
  267. package/types/expand.d.ts +5 -3
  268. package/types/expand.js +0 -3
  269. package/types/expand.mjs +0 -2
  270. package/types/indexer.d.ts +104 -100
  271. package/types/indexer.js +36 -31
  272. package/types/indexer.js.map +1 -1
  273. package/types/indexer.mjs +32 -30
  274. package/types/indexer.mjs.map +1 -1
  275. package/types/instance-of.d.ts +5 -3
  276. package/types/instance-of.js +0 -3
  277. package/types/instance-of.mjs +0 -2
  278. package/types/kmd-account-manager.d.ts +75 -70
  279. package/types/kmd-account-manager.js +150 -184
  280. package/types/kmd-account-manager.js.map +1 -1
  281. package/types/kmd-account-manager.mjs +147 -182
  282. package/types/kmd-account-manager.mjs.map +1 -1
  283. package/types/lifecycle-events.d.ts +13 -8
  284. package/types/lifecycle-events.js +10 -7
  285. package/types/lifecycle-events.js.map +1 -1
  286. package/types/lifecycle-events.mjs +9 -7
  287. package/types/lifecycle-events.mjs.map +1 -1
  288. package/types/logging.d.ts +15 -11
  289. package/types/logging.js +30 -31
  290. package/types/logging.js.map +1 -1
  291. package/types/logging.mjs +29 -29
  292. package/types/logging.mjs.map +1 -1
  293. package/types/logic-error.d.ts +33 -29
  294. package/types/logic-error.js +50 -49
  295. package/types/logic-error.js.map +1 -1
  296. package/types/logic-error.mjs +49 -47
  297. package/types/logic-error.mjs.map +1 -1
  298. package/types/network-client.d.ts +32 -27
  299. package/types/network-client.js +10 -9
  300. package/types/network-client.js.map +1 -1
  301. package/types/network-client.mjs +9 -7
  302. package/types/network-client.mjs.map +1 -1
  303. package/types/testing.d.ts +131 -132
  304. package/types/testing.js +0 -3
  305. package/types/testing.mjs +0 -2
  306. package/types/transaction.d.ts +110 -110
  307. package/types/transaction.js +0 -3
  308. package/types/transaction.mjs +0 -2
  309. package/types/transfer.d.ts +70 -66
  310. package/types/transfer.js +0 -3
  311. package/types/transfer.mjs +0 -2
  312. package/util.js +73 -118
  313. package/util.js.map +1 -1
  314. package/util.mjs +73 -116
  315. package/util.mjs.map +1 -1
  316. package/account/index.d.ts +0 -5
  317. package/debugging/index.d.ts +0 -1
  318. package/index.js.map +0 -1
  319. package/index.mjs.map +0 -1
  320. package/localnet/index.d.ts +0 -4
  321. package/testing/_asset.d.ts +0 -3
  322. package/testing/fixtures/index.d.ts +0 -2
  323. package/testing/index.js.map +0 -1
  324. package/testing/index.mjs.map +0 -1
  325. package/transaction/index.d.ts +0 -2
  326. package/transaction/legacy-bridge.d.ts +0 -35
  327. package/transfer/index.d.ts +0 -2
  328. package/types/asset.js.map +0 -1
  329. package/types/asset.mjs.map +0 -1
  330. package/types/expand.js.map +0 -1
  331. package/types/expand.mjs.map +0 -1
  332. package/types/instance-of.js.map +0 -1
  333. package/types/instance-of.mjs.map +0 -1
  334. package/types/testing.js.map +0 -1
  335. package/types/testing.mjs.map +0 -1
  336. package/types/transaction.js.map +0 -1
  337. package/types/transaction.mjs.map +0 -1
  338. package/types/transfer.js.map +0 -1
  339. package/types/transfer.mjs.map +0 -1
  340. package/util.d.ts +0 -48
package/app-deploy.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app-deploy.js","sources":["../src/app-deploy.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { compileTeal, getAppOnCompleteAction } from './app'\nimport { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge'\nimport { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction'\nimport { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender'\nimport {\n ABIReturn,\n APP_DEPLOY_NOTE_DAPP,\n AppCompilationResult,\n AppDeployMetadata,\n AppDeploymentParams,\n AppLookup,\n AppMetadata,\n CompiledTeal,\n TealTemplateParams,\n} from './types/app'\nimport { AppDeployer } from './types/app-deployer'\nimport { AppManager, BoxReference } from './types/app-manager'\nimport { AssetManager } from './types/asset-manager'\nimport {\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n TransactionComposer,\n} from './types/composer'\nimport { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\nimport Indexer = algosdk.Indexer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * @deprecated Use `algorand.appDeployer.deploy` instead.\n *\n * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n *\n * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n *\n * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.\n *\n * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n *\n * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n * @param deployment The arguments to control the app deployment\n * @param algod An algod client\n * @param indexer An indexer client, needed if `existingDeployments` not passed in\n * @returns The app reference of the new/existing app\n */\nexport async function deployApp(\n deployment: AppDeploymentParams,\n algod: Algodv2,\n indexer?: Indexer,\n): Promise<\n Partial<AppCompilationResult> &\n (\n | (ConfirmedTransactionResults & AppMetadata & { return?: ABIReturn; operationPerformed: 'create' | 'update' })\n | (ConfirmedTransactionResults &\n AppMetadata & {\n return?: ABIReturn\n deleteReturn?: ABIReturn\n deleteResult: ConfirmedTransactionResult\n operationPerformed: 'replace'\n })\n | (AppMetadata & { operationPerformed: 'nothing' })\n )\n> {\n const appManager = new AppManager(algod)\n const newGroup = () =>\n new TransactionComposer({\n algod,\n getSigner: () => getSenderTransactionSigner(deployment.from),\n getSuggestedParams: async () =>\n deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),\n appManager,\n })\n const deployer = new AppDeployer(\n appManager,\n new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager),\n indexer,\n )\n\n const createParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.createArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.createArgs?.lease,\n rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n extraProgramPages: deployment.schema.extraPages,\n onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction) as Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.ClearStateOC\n >,\n schema: deployment.schema,\n } satisfies Partial<AppCreateParams>\n\n const updateParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.updateArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.updateArgs?.lease,\n rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n } satisfies Partial<AppUpdateParams>\n\n const deleteParams = {\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.deleteArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.deleteArgs?.lease,\n rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n } satisfies Partial<AppDeleteParams>\n\n const encoder = new TextEncoder()\n\n const result = await deployer.deploy({\n createParams: deployment.createArgs?.method\n ? ({\n ...createParams,\n method:\n 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),\n args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,\n } satisfies AppCreateMethodCall)\n : ({\n ...createParams,\n args:\n 'appArgs' in (deployment?.createArgs ?? {})\n ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies AppCreateParams),\n updateParams: deployment.updateArgs?.method\n ? ({\n ...updateParams,\n method:\n 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),\n args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppUpdateMethodCall, 'appId'>)\n : ({\n ...updateParams,\n args:\n 'appArgs' in (deployment?.updateArgs ?? {})\n ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppUpdateParams, 'appId'>),\n deleteParams: deployment.deleteArgs?.method\n ? ({\n ...deleteParams,\n method:\n 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),\n args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppDeleteMethodCall, 'appId'>)\n : ({\n ...deleteParams,\n args:\n 'appArgs' in (deployment?.deleteArgs ?? {})\n ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppDeleteParams, 'appId'>),\n metadata: deployment.metadata,\n deployTimeParams: deployment.deployTimeParams,\n onSchemaBreak: deployment.onSchemaBreak,\n onUpdate: deployment.onUpdate,\n existingDeployments: deployment.existingDeployments\n ? {\n creator: Address.fromString(deployment.existingDeployments.creator),\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: Address.fromString(app.appAddress),\n appId: BigInt(app.appId),\n createdRound: BigInt(app.createdRound),\n updatedRound: BigInt(app.updatedRound),\n },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return {\n ...result,\n appAddress: result.appAddress.toString(),\n appId: Number(result.appId),\n createdRound: Number(result.createdRound),\n updatedRound: Number(result.updatedRound),\n }\n}\n\n/**\n * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.\n *\n * Returns true is there is a breaking change in the application state schema from before to after.\n * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.\n * Otherwise, there is no error, the app just doesn't store data in the extra schema :(\n *\n * @param before The existing schema\n * @param after The new schema\n * @returns Whether or not there is a breaking change\n */\nexport function isSchemaIsBroken(before: modelsv2.ApplicationStateSchema, after: modelsv2.ApplicationStateSchema) {\n return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint\n}\n\n/**\n * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.\n *\n * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.\n *\n * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).\n *\n * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for\n * @param indexer An indexer client\n * @returns A name-based lookup of the app information (id, address)\n */\nexport async function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup> {\n const lookup = await new AppDeployer(undefined!, undefined!, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount))\n\n return {\n creator: lookup.creator.toString(),\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: app.appAddress.toString(),\n appId: Number(app.appId),\n createdRound: Number(app.createdRound),\n updatedRound: Number(app.updatedRound),\n },\n ]),\n ),\n }\n}\n\n/**\n * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.\n *\n * Return the transaction note for an app deployment.\n * @param metadata The metadata of the deployment\n * @returns The transaction note as a utf-8 string\n */\nexport function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote {\n return {\n dAppName: APP_DEPLOY_NOTE_DAPP,\n data: metadata,\n format: 'j',\n }\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead\n *\n * Replaces deploy-time deployment control parameters within the given teal code.\n *\n * * `TMPL_UPDATABLE` for updatability / immutability control\n * * `TMPL_DELETABLE` for deletability / permanence control\n *\n * Note: If these values are not undefined, but the corresponding `TMPL_*` value\n * isn't in the teal code it will throw an exception.\n *\n * @param tealCode The TEAL code to substitute\n * @param params The deploy-time deployment control parameter value to replace\n * @returns The replaced TEAL code\n */\nexport function replaceDeployTimeControlParams(tealCode: string, params: { updatable?: boolean; deletable?: boolean }) {\n return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params)\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateParams` instead\n *\n * Performs template substitution of a teal file.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @returns The TEAL code with replacements\n */\nexport function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams) {\n return AppManager.replaceTealTemplateParams(tealCode, templateParams)\n}\n\n/**\n * @deprecated Use `algorand.appManager.compileTealTemplate` instead.\n *\n * Performs template substitution of a teal file and compiles it, returning the compiled result.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param algod An algod client\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @param deploymentMetadata The deployment metadata the app will be deployed with\n * @returns The information about the compiled code\n */\nexport async function performTemplateSubstitutionAndCompile(\n tealCode: string,\n algod: Algodv2,\n templateParams?: TealTemplateParams,\n deploymentMetadata?: AppDeployMetadata,\n): Promise<CompiledTeal> {\n tealCode = stripTealComments(tealCode)\n\n tealCode = performTemplateSubstitution(tealCode, templateParams)\n\n if (deploymentMetadata) {\n tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata)\n }\n\n return await compileTeal(tealCode, algod)\n}\n\n/**\n * @deprecated Use `AppManager.stripTealComments` instead.\n *\n * Remove comments from TEAL Code\n *\n * @param tealCode The TEAL logic to compile\n * @returns The TEAL without comments\n */\nexport function stripTealComments(tealCode: string) {\n return AppManager.stripTealComments(tealCode)\n}\n"],"names":["AppManager","TransactionComposer","getSenderTransactionSigner","AppDeployer","AlgorandClientTransactionSender","AssetManager","getSenderAddress","_getBoxReference","getAppOnCompleteAction","_getAppArgsForABICall","Address","APP_DEPLOY_NOTE_DAPP","compileTeal"],"mappings":";;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;;AAgBG;AACI,eAAe,SAAS,CAC7B,UAA+B,EAC/B,KAAc,EACd,OAAiB,EAAA;AAejB,IAAA,MAAM,UAAU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AAChF;AAEA;;;;;;;;;;AAUG;AACa,SAAA,2BAA2B,CAAC,QAAgB,EAAE,cAAmC,EAAA;IAC/F,OAAOA,2BAAU,CAAC,yBAAyB,CAAC,QAAQ,EAAE,cAAc,CAAC;AACvE;AAEA;;;;;;;;;;;;AAYG;AACI,eAAe,qCAAqC,CACzD,QAAgB,EAChB,KAAc,EACd,cAAmC,EACnC,kBAAsC,EAAA;AAEtC,IAAA,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC;AAEtC,IAAA,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,cAAc,CAAC;IAEhE,IAAI,kBAAkB,EAAE;AACtB,QAAA,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,kBAAkB,CAAC;;AAGzE,IAAA,OAAO,MAAMY,eAAW,CAAC,QAAQ,EAAE,KAAK,CAAC;AAC3C;AAEA;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,QAAgB,EAAA;AAChD,IAAA,OAAOZ,2BAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC;AAC/C;;;;;;;;;;;"}
1
+ {"version":3,"file":"app-deploy.js","names":["AppManager","TransactionComposer","getSenderTransactionSigner","AppDeployer","AlgorandClientTransactionSender","AssetManager","getSenderAddress","_getBoxReference","getAppOnCompleteAction","_getAppArgsForABICall","Address","APP_DEPLOY_NOTE_DAPP","compileTeal"],"sources":["../src/app-deploy.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { compileTeal, getAppOnCompleteAction } from './app'\nimport { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge'\nimport { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction'\nimport { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender'\nimport {\n ABIReturn,\n APP_DEPLOY_NOTE_DAPP,\n AppCompilationResult,\n AppDeployMetadata,\n AppDeploymentParams,\n AppLookup,\n AppMetadata,\n CompiledTeal,\n TealTemplateParams,\n} from './types/app'\nimport { AppDeployer } from './types/app-deployer'\nimport { AppManager, BoxReference } from './types/app-manager'\nimport { AssetManager } from './types/asset-manager'\nimport {\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n TransactionComposer,\n} from './types/composer'\nimport { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\nimport Indexer = algosdk.Indexer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * @deprecated Use `algorand.appDeployer.deploy` instead.\n *\n * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n *\n * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/src/content/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n *\n * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.\n *\n * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n *\n * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n * @param deployment The arguments to control the app deployment\n * @param algod An algod client\n * @param indexer An indexer client, needed if `existingDeployments` not passed in\n * @returns The app reference of the new/existing app\n */\nexport async function deployApp(\n deployment: AppDeploymentParams,\n algod: Algodv2,\n indexer?: Indexer,\n): Promise<\n Partial<AppCompilationResult> &\n (\n | (ConfirmedTransactionResults & AppMetadata & { return?: ABIReturn; operationPerformed: 'create' | 'update' })\n | (ConfirmedTransactionResults &\n AppMetadata & {\n return?: ABIReturn\n deleteReturn?: ABIReturn\n deleteResult: ConfirmedTransactionResult\n operationPerformed: 'replace'\n })\n | (AppMetadata & { operationPerformed: 'nothing' })\n )\n> {\n const appManager = new AppManager(algod)\n const newGroup = () =>\n new TransactionComposer({\n algod,\n getSigner: () => getSenderTransactionSigner(deployment.from),\n getSuggestedParams: async () =>\n deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),\n appManager,\n })\n const deployer = new AppDeployer(\n appManager,\n new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager),\n indexer,\n )\n\n const createParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.createArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.createArgs?.lease,\n rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n extraProgramPages: deployment.schema.extraPages,\n onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction) as Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.ClearStateOC\n >,\n schema: deployment.schema,\n } satisfies Partial<AppCreateParams>\n\n const updateParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.updateArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.updateArgs?.lease,\n rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n } satisfies Partial<AppUpdateParams>\n\n const deleteParams = {\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.deleteArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.deleteArgs?.lease,\n rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n } satisfies Partial<AppDeleteParams>\n\n const encoder = new TextEncoder()\n\n const result = await deployer.deploy({\n createParams: deployment.createArgs?.method\n ? ({\n ...createParams,\n method:\n 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),\n args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,\n } satisfies AppCreateMethodCall)\n : ({\n ...createParams,\n args:\n 'appArgs' in (deployment?.createArgs ?? {})\n ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies AppCreateParams),\n updateParams: deployment.updateArgs?.method\n ? ({\n ...updateParams,\n method:\n 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),\n args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppUpdateMethodCall, 'appId'>)\n : ({\n ...updateParams,\n args:\n 'appArgs' in (deployment?.updateArgs ?? {})\n ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppUpdateParams, 'appId'>),\n deleteParams: deployment.deleteArgs?.method\n ? ({\n ...deleteParams,\n method:\n 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),\n args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppDeleteMethodCall, 'appId'>)\n : ({\n ...deleteParams,\n args:\n 'appArgs' in (deployment?.deleteArgs ?? {})\n ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppDeleteParams, 'appId'>),\n metadata: deployment.metadata,\n deployTimeParams: deployment.deployTimeParams,\n onSchemaBreak: deployment.onSchemaBreak,\n onUpdate: deployment.onUpdate,\n existingDeployments: deployment.existingDeployments\n ? {\n creator: Address.fromString(deployment.existingDeployments.creator),\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: Address.fromString(app.appAddress),\n appId: BigInt(app.appId),\n createdRound: BigInt(app.createdRound),\n updatedRound: BigInt(app.updatedRound),\n },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return {\n ...result,\n appAddress: result.appAddress.toString(),\n appId: Number(result.appId),\n createdRound: Number(result.createdRound),\n updatedRound: Number(result.updatedRound),\n }\n}\n\n/**\n * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.\n *\n * Returns true is there is a breaking change in the application state schema from before to after.\n * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.\n * Otherwise, there is no error, the app just doesn't store data in the extra schema :(\n *\n * @param before The existing schema\n * @param after The new schema\n * @returns Whether or not there is a breaking change\n */\nexport function isSchemaIsBroken(before: modelsv2.ApplicationStateSchema, after: modelsv2.ApplicationStateSchema) {\n return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint\n}\n\n/**\n * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.\n *\n * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.\n *\n * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).\n *\n * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for\n * @param indexer An indexer client\n * @returns A name-based lookup of the app information (id, address)\n */\nexport async function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup> {\n const lookup = await new AppDeployer(undefined!, undefined!, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount))\n\n return {\n creator: lookup.creator.toString(),\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: app.appAddress.toString(),\n appId: Number(app.appId),\n createdRound: Number(app.createdRound),\n updatedRound: Number(app.updatedRound),\n },\n ]),\n ),\n }\n}\n\n/**\n * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.\n *\n * Return the transaction note for an app deployment.\n * @param metadata The metadata of the deployment\n * @returns The transaction note as a utf-8 string\n */\nexport function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote {\n return {\n dAppName: APP_DEPLOY_NOTE_DAPP,\n data: metadata,\n format: 'j',\n }\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead\n *\n * Replaces deploy-time deployment control parameters within the given teal code.\n *\n * * `TMPL_UPDATABLE` for updatability / immutability control\n * * `TMPL_DELETABLE` for deletability / permanence control\n *\n * Note: If these values are not undefined, but the corresponding `TMPL_*` value\n * isn't in the teal code it will throw an exception.\n *\n * @param tealCode The TEAL code to substitute\n * @param params The deploy-time deployment control parameter value to replace\n * @returns The replaced TEAL code\n */\nexport function replaceDeployTimeControlParams(tealCode: string, params: { updatable?: boolean; deletable?: boolean }) {\n return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params)\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateParams` instead\n *\n * Performs template substitution of a teal file.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @returns The TEAL code with replacements\n */\nexport function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams) {\n return AppManager.replaceTealTemplateParams(tealCode, templateParams)\n}\n\n/**\n * @deprecated Use `algorand.appManager.compileTealTemplate` instead.\n *\n * Performs template substitution of a teal file and compiles it, returning the compiled result.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param algod An algod client\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @param deploymentMetadata The deployment metadata the app will be deployed with\n * @returns The information about the compiled code\n */\nexport async function performTemplateSubstitutionAndCompile(\n tealCode: string,\n algod: Algodv2,\n templateParams?: TealTemplateParams,\n deploymentMetadata?: AppDeployMetadata,\n): Promise<CompiledTeal> {\n tealCode = stripTealComments(tealCode)\n\n tealCode = performTemplateSubstitution(tealCode, templateParams)\n\n if (deploymentMetadata) {\n tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata)\n }\n\n return await compileTeal(tealCode, algod)\n}\n\n/**\n * @deprecated Use `AppManager.stripTealComments` instead.\n *\n * Remove comments from TEAL Code\n *\n * @param tealCode The TEAL logic to compile\n * @returns The TEAL without comments\n */\nexport function stripTealComments(tealCode: string) {\n return AppManager.stripTealComments(tealCode)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,eAAsB,UACpB,YACA,OACA,SAcA;CACA,MAAM,aAAa,IAAIA,oBAAAA,WAAW,KAAK;CAC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rH,OAAOX,oBAAAA,WAAW,2CAA2C,UAAU,MAAM;AAC/E;;;;;;;;;;;;AAaA,SAAgB,4BAA4B,UAAkB,gBAAqC;CACjG,OAAOA,oBAAAA,WAAW,0BAA0B,UAAU,cAAc;AACtE;;;;;;;;;;;;;;AAeA,eAAsB,sCACpB,UACA,OACA,gBACA,oBACuB;CACvB,WAAW,kBAAkB,QAAQ;CAErC,WAAW,4BAA4B,UAAU,cAAc;CAE/D,IAAI,oBACF,WAAW,+BAA+B,UAAU,kBAAkB;CAGxE,OAAO,MAAMY,cAAAA,YAAY,UAAU,KAAK;AAC1C;;;;;;;;;AAUA,SAAgB,kBAAkB,UAAkB;CAClD,OAAOZ,oBAAAA,WAAW,kBAAkB,QAAQ;AAC9C"}
package/app-deploy.mjs CHANGED
@@ -1,276 +1,258 @@
1
- import algosdk, { Address } from 'algosdk';
2
- import { getAppOnCompleteAction, compileTeal } from './app.mjs';
3
- import { _getBoxReference, _getAppArgsForABICall } from './transaction/legacy-bridge.mjs';
4
- import { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction.mjs';
5
- import { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender.mjs';
6
- import { APP_DEPLOY_NOTE_DAPP } from './types/app.mjs';
7
- import { AppDeployer } from './types/app-deployer.mjs';
8
- import { AppManager } from './types/app-manager.mjs';
9
- import { AssetManager } from './types/asset-manager.mjs';
10
- import { TransactionComposer } from './types/composer.mjs';
11
-
1
+ import { APP_DEPLOY_NOTE_DAPP } from "./types/app.mjs";
2
+ import { getSenderAddress, getSenderTransactionSigner } from "./transaction/transaction.mjs";
3
+ import { AppManager } from "./types/app-manager.mjs";
4
+ import { TransactionComposer } from "./types/composer.mjs";
5
+ import { AlgorandClientTransactionSender } from "./types/algorand-client-transaction-sender.mjs";
6
+ import { AssetManager } from "./types/asset-manager.mjs";
7
+ import { _getAppArgsForABICall, _getBoxReference } from "./transaction/legacy-bridge.mjs";
8
+ import { compileTeal, getAppOnCompleteAction } from "./app.mjs";
9
+ import { AppDeployer } from "./types/app-deployer.mjs";
10
+ import algosdk, { Address } from "algosdk";
11
+ //#region src/app-deploy.ts
12
12
  /**
13
- * @deprecated Use `algorand.appDeployer.deploy` instead.
14
- *
15
- * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
16
- *
17
- * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
18
- *
19
- * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.
20
- *
21
- * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.
22
- *
23
- * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.
24
- * @param deployment The arguments to control the app deployment
25
- * @param algod An algod client
26
- * @param indexer An indexer client, needed if `existingDeployments` not passed in
27
- * @returns The app reference of the new/existing app
28
- */
13
+ * @deprecated Use `algorand.appDeployer.deploy` instead.
14
+ *
15
+ * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
16
+ *
17
+ * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/src/content/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
18
+ *
19
+ * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.
20
+ *
21
+ * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.
22
+ *
23
+ * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.
24
+ * @param deployment The arguments to control the app deployment
25
+ * @param algod An algod client
26
+ * @param indexer An indexer client, needed if `existingDeployments` not passed in
27
+ * @returns The app reference of the new/existing app
28
+ */
29
29
  async function deployApp(deployment, algod, indexer) {
30
- const appManager = new AppManager(algod);
31
- const newGroup = () => new TransactionComposer({
32
- algod,
33
- getSigner: () => getSenderTransactionSigner(deployment.from),
34
- getSuggestedParams: async () => deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),
35
- appManager,
36
- });
37
- const deployer = new AppDeployer(appManager, new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager), indexer);
38
- const createParams = {
39
- approvalProgram: deployment.approvalProgram,
40
- clearStateProgram: deployment.clearStateProgram,
41
- sender: getSenderAddress(deployment.from),
42
- accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),
43
- appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),
44
- assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),
45
- boxReferences: deployment.createArgs?.boxes
46
- ?.map(_getBoxReference)
47
- ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name })),
48
- lease: deployment.createArgs?.lease,
49
- rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,
50
- staticFee: deployment.fee,
51
- maxFee: deployment.maxFee,
52
- extraProgramPages: deployment.schema.extraPages,
53
- onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction),
54
- schema: deployment.schema,
55
- };
56
- const updateParams = {
57
- approvalProgram: deployment.approvalProgram,
58
- clearStateProgram: deployment.clearStateProgram,
59
- sender: getSenderAddress(deployment.from),
60
- accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),
61
- appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),
62
- assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),
63
- boxReferences: deployment.updateArgs?.boxes
64
- ?.map(_getBoxReference)
65
- ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name })),
66
- lease: deployment.updateArgs?.lease,
67
- rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,
68
- staticFee: deployment.fee,
69
- maxFee: deployment.maxFee,
70
- onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
71
- };
72
- const deleteParams = {
73
- sender: getSenderAddress(deployment.from),
74
- accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),
75
- appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),
76
- assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),
77
- boxReferences: deployment.deleteArgs?.boxes
78
- ?.map(_getBoxReference)
79
- ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name })),
80
- lease: deployment.deleteArgs?.lease,
81
- rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,
82
- staticFee: deployment.fee,
83
- maxFee: deployment.maxFee,
84
- onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
85
- };
86
- const encoder = new TextEncoder();
87
- const result = await deployer.deploy({
88
- createParams: deployment.createArgs?.method
89
- ? ({
90
- ...createParams,
91
- method: 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),
92
- args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,
93
- })
94
- : ({
95
- ...createParams,
96
- args: 'appArgs' in (deployment?.createArgs ?? {})
97
- ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))
98
- : undefined,
99
- }),
100
- updateParams: deployment.updateArgs?.method
101
- ? ({
102
- ...updateParams,
103
- method: 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),
104
- args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,
105
- })
106
- : ({
107
- ...updateParams,
108
- args: 'appArgs' in (deployment?.updateArgs ?? {})
109
- ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))
110
- : undefined,
111
- }),
112
- deleteParams: deployment.deleteArgs?.method
113
- ? ({
114
- ...deleteParams,
115
- method: 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),
116
- args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,
117
- })
118
- : ({
119
- ...deleteParams,
120
- args: 'appArgs' in (deployment?.deleteArgs ?? {})
121
- ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))
122
- : undefined,
123
- }),
124
- metadata: deployment.metadata,
125
- deployTimeParams: deployment.deployTimeParams,
126
- onSchemaBreak: deployment.onSchemaBreak,
127
- onUpdate: deployment.onUpdate,
128
- existingDeployments: deployment.existingDeployments
129
- ? {
130
- creator: Address.fromString(deployment.existingDeployments.creator),
131
- apps: Object.fromEntries(Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [
132
- name,
133
- {
134
- ...app,
135
- appAddress: Address.fromString(app.appAddress),
136
- appId: BigInt(app.appId),
137
- createdRound: BigInt(app.createdRound),
138
- updatedRound: BigInt(app.updatedRound),
139
- },
140
- ])),
141
- }
142
- : undefined,
143
- maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,
144
- populateAppCallResources: deployment.populateAppCallResources,
145
- suppressLog: deployment.suppressLog,
146
- });
147
- return {
148
- ...result,
149
- appAddress: result.appAddress.toString(),
150
- appId: Number(result.appId),
151
- createdRound: Number(result.createdRound),
152
- updatedRound: Number(result.updatedRound),
153
- };
30
+ const appManager = new AppManager(algod);
31
+ const newGroup = () => new TransactionComposer({
32
+ algod,
33
+ getSigner: () => getSenderTransactionSigner(deployment.from),
34
+ getSuggestedParams: async () => deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),
35
+ appManager
36
+ });
37
+ const deployer = new AppDeployer(appManager, new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager), indexer);
38
+ const createParams = {
39
+ approvalProgram: deployment.approvalProgram,
40
+ clearStateProgram: deployment.clearStateProgram,
41
+ sender: getSenderAddress(deployment.from),
42
+ accountReferences: deployment.createArgs?.accounts?.map((a) => typeof a === "string" ? a : algosdk.encodeAddress(a.publicKey)),
43
+ appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),
44
+ assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),
45
+ boxReferences: deployment.createArgs?.boxes?.map(_getBoxReference)?.map((r) => ({
46
+ appId: BigInt(r.appIndex),
47
+ name: r.name
48
+ })),
49
+ lease: deployment.createArgs?.lease,
50
+ rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : void 0,
51
+ staticFee: deployment.fee,
52
+ maxFee: deployment.maxFee,
53
+ extraProgramPages: deployment.schema.extraPages,
54
+ onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction),
55
+ schema: deployment.schema
56
+ };
57
+ const updateParams = {
58
+ approvalProgram: deployment.approvalProgram,
59
+ clearStateProgram: deployment.clearStateProgram,
60
+ sender: getSenderAddress(deployment.from),
61
+ accountReferences: deployment.updateArgs?.accounts?.map((a) => typeof a === "string" ? a : algosdk.encodeAddress(a.publicKey)),
62
+ appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),
63
+ assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),
64
+ boxReferences: deployment.updateArgs?.boxes?.map(_getBoxReference)?.map((r) => ({
65
+ appId: BigInt(r.appIndex),
66
+ name: r.name
67
+ })),
68
+ lease: deployment.updateArgs?.lease,
69
+ rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : void 0,
70
+ staticFee: deployment.fee,
71
+ maxFee: deployment.maxFee,
72
+ onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC
73
+ };
74
+ const deleteParams = {
75
+ sender: getSenderAddress(deployment.from),
76
+ accountReferences: deployment.deleteArgs?.accounts?.map((a) => typeof a === "string" ? a : algosdk.encodeAddress(a.publicKey)),
77
+ appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),
78
+ assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),
79
+ boxReferences: deployment.deleteArgs?.boxes?.map(_getBoxReference)?.map((r) => ({
80
+ appId: BigInt(r.appIndex),
81
+ name: r.name
82
+ })),
83
+ lease: deployment.deleteArgs?.lease,
84
+ rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : void 0,
85
+ staticFee: deployment.fee,
86
+ maxFee: deployment.maxFee,
87
+ onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC
88
+ };
89
+ const encoder = new TextEncoder();
90
+ const result = await deployer.deploy({
91
+ createParams: deployment.createArgs?.method ? {
92
+ ...createParams,
93
+ method: "txnCount" in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),
94
+ args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs
95
+ } : {
96
+ ...createParams,
97
+ args: "appArgs" in (deployment?.createArgs ?? {}) ? deployment.createArgs?.appArgs?.map((a) => typeof a === "string" ? encoder.encode(a) : a) : void 0
98
+ },
99
+ updateParams: deployment.updateArgs?.method ? {
100
+ ...updateParams,
101
+ method: "txnCount" in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),
102
+ args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs
103
+ } : {
104
+ ...updateParams,
105
+ args: "appArgs" in (deployment?.updateArgs ?? {}) ? deployment.updateArgs?.appArgs?.map((a) => typeof a === "string" ? encoder.encode(a) : a) : void 0
106
+ },
107
+ deleteParams: deployment.deleteArgs?.method ? {
108
+ ...deleteParams,
109
+ method: "txnCount" in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),
110
+ args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs
111
+ } : {
112
+ ...deleteParams,
113
+ args: "appArgs" in (deployment?.deleteArgs ?? {}) ? deployment.deleteArgs?.appArgs?.map((a) => typeof a === "string" ? encoder.encode(a) : a) : void 0
114
+ },
115
+ metadata: deployment.metadata,
116
+ deployTimeParams: deployment.deployTimeParams,
117
+ onSchemaBreak: deployment.onSchemaBreak,
118
+ onUpdate: deployment.onUpdate,
119
+ existingDeployments: deployment.existingDeployments ? {
120
+ creator: Address.fromString(deployment.existingDeployments.creator),
121
+ apps: Object.fromEntries(Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [name, {
122
+ ...app,
123
+ appAddress: Address.fromString(app.appAddress),
124
+ appId: BigInt(app.appId),
125
+ createdRound: BigInt(app.createdRound),
126
+ updatedRound: BigInt(app.updatedRound)
127
+ }]))
128
+ } : void 0,
129
+ maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,
130
+ populateAppCallResources: deployment.populateAppCallResources,
131
+ suppressLog: deployment.suppressLog
132
+ });
133
+ return {
134
+ ...result,
135
+ appAddress: result.appAddress.toString(),
136
+ appId: Number(result.appId),
137
+ createdRound: Number(result.createdRound),
138
+ updatedRound: Number(result.updatedRound)
139
+ };
154
140
  }
155
141
  /**
156
- * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.
157
- *
158
- * Returns true is there is a breaking change in the application state schema from before to after.
159
- * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.
160
- * Otherwise, there is no error, the app just doesn't store data in the extra schema :(
161
- *
162
- * @param before The existing schema
163
- * @param after The new schema
164
- * @returns Whether or not there is a breaking change
165
- */
142
+ * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.
143
+ *
144
+ * Returns true is there is a breaking change in the application state schema from before to after.
145
+ * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.
146
+ * Otherwise, there is no error, the app just doesn't store data in the extra schema :(
147
+ *
148
+ * @param before The existing schema
149
+ * @param after The new schema
150
+ * @returns Whether or not there is a breaking change
151
+ */
166
152
  function isSchemaIsBroken(before, after) {
167
- return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint;
153
+ return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint;
168
154
  }
169
155
  /**
170
- * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.
171
- *
172
- * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.
173
- *
174
- * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).
175
- *
176
- * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for
177
- * @param indexer An indexer client
178
- * @returns A name-based lookup of the app information (id, address)
179
- */
156
+ * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.
157
+ *
158
+ * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.
159
+ *
160
+ * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).
161
+ *
162
+ * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for
163
+ * @param indexer An indexer client
164
+ * @returns A name-based lookup of the app information (id, address)
165
+ */
180
166
  async function getCreatorAppsByName(creatorAccount, indexer) {
181
- const lookup = await new AppDeployer(undefined, undefined, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount));
182
- return {
183
- creator: lookup.creator.toString(),
184
- apps: Object.fromEntries(Object.entries(lookup.apps).map(([name, app]) => [
185
- name,
186
- {
187
- ...app,
188
- appAddress: app.appAddress.toString(),
189
- appId: Number(app.appId),
190
- createdRound: Number(app.createdRound),
191
- updatedRound: Number(app.updatedRound),
192
- },
193
- ])),
194
- };
167
+ const lookup = await new AppDeployer(void 0, void 0, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount));
168
+ return {
169
+ creator: lookup.creator.toString(),
170
+ apps: Object.fromEntries(Object.entries(lookup.apps).map(([name, app]) => [name, {
171
+ ...app,
172
+ appAddress: app.appAddress.toString(),
173
+ appId: Number(app.appId),
174
+ createdRound: Number(app.createdRound),
175
+ updatedRound: Number(app.updatedRound)
176
+ }]))
177
+ };
195
178
  }
196
179
  /**
197
- * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.
198
- *
199
- * Return the transaction note for an app deployment.
200
- * @param metadata The metadata of the deployment
201
- * @returns The transaction note as a utf-8 string
202
- */
180
+ * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.
181
+ *
182
+ * Return the transaction note for an app deployment.
183
+ * @param metadata The metadata of the deployment
184
+ * @returns The transaction note as a utf-8 string
185
+ */
203
186
  function getAppDeploymentTransactionNote(metadata) {
204
- return {
205
- dAppName: APP_DEPLOY_NOTE_DAPP,
206
- data: metadata,
207
- format: 'j',
208
- };
187
+ return {
188
+ dAppName: APP_DEPLOY_NOTE_DAPP,
189
+ data: metadata,
190
+ format: "j"
191
+ };
209
192
  }
210
193
  /**
211
- * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead
212
- *
213
- * Replaces deploy-time deployment control parameters within the given teal code.
214
- *
215
- * * `TMPL_UPDATABLE` for updatability / immutability control
216
- * * `TMPL_DELETABLE` for deletability / permanence control
217
- *
218
- * Note: If these values are not undefined, but the corresponding `TMPL_*` value
219
- * isn't in the teal code it will throw an exception.
220
- *
221
- * @param tealCode The TEAL code to substitute
222
- * @param params The deploy-time deployment control parameter value to replace
223
- * @returns The replaced TEAL code
224
- */
194
+ * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead
195
+ *
196
+ * Replaces deploy-time deployment control parameters within the given teal code.
197
+ *
198
+ * * `TMPL_UPDATABLE` for updatability / immutability control
199
+ * * `TMPL_DELETABLE` for deletability / permanence control
200
+ *
201
+ * Note: If these values are not undefined, but the corresponding `TMPL_*` value
202
+ * isn't in the teal code it will throw an exception.
203
+ *
204
+ * @param tealCode The TEAL code to substitute
205
+ * @param params The deploy-time deployment control parameter value to replace
206
+ * @returns The replaced TEAL code
207
+ */
225
208
  function replaceDeployTimeControlParams(tealCode, params) {
226
- return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params);
209
+ return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params);
227
210
  }
228
211
  /**
229
- * @deprecated Use `AppManager.replaceTealTemplateParams` instead
230
- *
231
- * Performs template substitution of a teal file.
232
- *
233
- * Looks for `TMPL_{parameter}` for template replacements.
234
- *
235
- * @param tealCode The TEAL logic to compile
236
- * @param templateParams Any parameters to replace in the .teal file before compiling
237
- * @returns The TEAL code with replacements
238
- */
212
+ * @deprecated Use `AppManager.replaceTealTemplateParams` instead
213
+ *
214
+ * Performs template substitution of a teal file.
215
+ *
216
+ * Looks for `TMPL_{parameter}` for template replacements.
217
+ *
218
+ * @param tealCode The TEAL logic to compile
219
+ * @param templateParams Any parameters to replace in the .teal file before compiling
220
+ * @returns The TEAL code with replacements
221
+ */
239
222
  function performTemplateSubstitution(tealCode, templateParams) {
240
- return AppManager.replaceTealTemplateParams(tealCode, templateParams);
223
+ return AppManager.replaceTealTemplateParams(tealCode, templateParams);
241
224
  }
242
225
  /**
243
- * @deprecated Use `algorand.appManager.compileTealTemplate` instead.
244
- *
245
- * Performs template substitution of a teal file and compiles it, returning the compiled result.
246
- *
247
- * Looks for `TMPL_{parameter}` for template replacements.
248
- *
249
- * @param tealCode The TEAL logic to compile
250
- * @param algod An algod client
251
- * @param templateParams Any parameters to replace in the .teal file before compiling
252
- * @param deploymentMetadata The deployment metadata the app will be deployed with
253
- * @returns The information about the compiled code
254
- */
226
+ * @deprecated Use `algorand.appManager.compileTealTemplate` instead.
227
+ *
228
+ * Performs template substitution of a teal file and compiles it, returning the compiled result.
229
+ *
230
+ * Looks for `TMPL_{parameter}` for template replacements.
231
+ *
232
+ * @param tealCode The TEAL logic to compile
233
+ * @param algod An algod client
234
+ * @param templateParams Any parameters to replace in the .teal file before compiling
235
+ * @param deploymentMetadata The deployment metadata the app will be deployed with
236
+ * @returns The information about the compiled code
237
+ */
255
238
  async function performTemplateSubstitutionAndCompile(tealCode, algod, templateParams, deploymentMetadata) {
256
- tealCode = stripTealComments(tealCode);
257
- tealCode = performTemplateSubstitution(tealCode, templateParams);
258
- if (deploymentMetadata) {
259
- tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata);
260
- }
261
- return await compileTeal(tealCode, algod);
239
+ tealCode = stripTealComments(tealCode);
240
+ tealCode = performTemplateSubstitution(tealCode, templateParams);
241
+ if (deploymentMetadata) tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata);
242
+ return await compileTeal(tealCode, algod);
262
243
  }
263
244
  /**
264
- * @deprecated Use `AppManager.stripTealComments` instead.
265
- *
266
- * Remove comments from TEAL Code
267
- *
268
- * @param tealCode The TEAL logic to compile
269
- * @returns The TEAL without comments
270
- */
245
+ * @deprecated Use `AppManager.stripTealComments` instead.
246
+ *
247
+ * Remove comments from TEAL Code
248
+ *
249
+ * @param tealCode The TEAL logic to compile
250
+ * @returns The TEAL without comments
251
+ */
271
252
  function stripTealComments(tealCode) {
272
- return AppManager.stripTealComments(tealCode);
253
+ return AppManager.stripTealComments(tealCode);
273
254
  }
274
-
255
+ //#endregion
275
256
  export { deployApp, getAppDeploymentTransactionNote, getCreatorAppsByName, isSchemaIsBroken, performTemplateSubstitution, performTemplateSubstitutionAndCompile, replaceDeployTimeControlParams, stripTealComments };
276
- //# sourceMappingURL=app-deploy.mjs.map
257
+
258
+ //# sourceMappingURL=app-deploy.mjs.map