@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
@@ -1,963 +1,793 @@
1
- import algosdk, { Address } from 'algosdk';
2
- import { TransactionSignerAccount } from './account';
3
- import { type AlgorandClient } from './algorand-client';
4
- import { AppReturn, SendAppTransactionResult, TealTemplateParams } from './app';
5
- import { ABIStruct, Arc56Contract, Arc56Method } from './app-arc56';
6
- import { AppClient, AppClientBareCallParams, AppClientCompilationParams, AppClientMethodCallParams, AppClientParams, AppSourceMaps, ResolveAppClientByCreatorAndName } from './app-client';
7
- import { AppDeployParams } from './app-deployer';
8
- import { AppSpec } from './app-spec';
9
- import { AppMethodCall, AppMethodCallTransactionArgument } from './composer';
10
- import { Expand } from './expand';
11
- import { SendParams } from './transaction';
12
- import OnApplicationComplete = algosdk.OnApplicationComplete;
13
- import ABIValue = algosdk.ABIValue;
14
- import TransactionSigner = algosdk.TransactionSigner;
1
+ import { AlgoAmount } from "./amount.js";
2
+ import { TransactionSignerAccount } from "./account.js";
3
+ import { Expand } from "./expand.js";
4
+ import { ABIReturn, AppDeployMetadata, AppReturn, CompiledTeal, SendAppTransactionResult, TealTemplateParams } from "./app.js";
5
+ import { ConfirmedTransactionResult, SendParams } from "./transaction.js";
6
+ import { BoxIdentifier, BoxReference, ResourceReference } from "./app-manager.js";
7
+ import { AppMethodCall, AppMethodCallParams, AppMethodCallTransactionArgument } from "./composer.js";
8
+ import { ABIStruct, Arc56Contract, Arc56Method } from "./app-arc56.js";
9
+ import { AppDeployParams } from "./app-deployer.js";
10
+ import { AppSpec } from "./app-spec.js";
11
+ import { AlgorandClient } from "./algorand-client.js";
12
+ import { AppClient, AppClientBareCallParams, AppClientCompilationParams, AppClientCompilationResult, AppClientMethodCallParams, AppClientParams, AppSourceMaps, ResolveAppClientByCreatorAndName } from "./app-client.js";
13
+ import algosdk, { Address } from "algosdk";
14
+
15
+ //#region src/types/app-factory.d.ts
15
16
  /** Parameters to create an app client */
16
- export interface AppFactoryParams {
17
- /** The ARC-56 or ARC-32 application spec as either:
18
- * * Parsed JSON ARC-56 `Contract`
19
- * * Parsed JSON ARC-32 `AppSpec`
20
- * * Raw JSON string (in either ARC-56 or ARC-32 format)
21
- */
22
- appSpec: Arc56Contract | AppSpec | string;
23
- /** `AlgorandClient` instance */
24
- algorand: AlgorandClient;
25
- /**
26
- * Optional override for the app name; used for on-chain metadata and lookups.
27
- * Defaults to the ARC-32/ARC-56 app spec name.
28
- */
29
- appName?: string;
30
- /** Optional address to use for the account to use as the default sender for calls. */
31
- defaultSender?: Address | string;
32
- /** Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from `AlgorandClient`). */
33
- defaultSigner?: TransactionSigner;
34
- /** The version of app that is / will be deployed; defaults to 1.0 */
35
- version?: string;
36
- /**
37
- * Whether or not the contract should have deploy-time immutability control set, undefined = ignore.
38
- * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.
39
- *
40
- * Useful if you want to vend multiple contracts from the same factory without specifying this value
41
- * for each call.
42
- */
43
- updatable?: boolean;
44
- /**
45
- * Whether or not the contract should have deploy-time permanence control set, undefined = ignore.
46
- * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.
47
- *
48
- * Useful if you want to vend multiple contracts from the same factory without specifying this value
49
- * for each call.
50
- */
51
- deletable?: boolean;
52
- /**
53
- * Optional deploy-time TEAL template replacement parameters.
54
- * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.
55
- *
56
- * Useful if you want to vend multiple contracts from the same factory without specifying this value
57
- * for each call.
58
- */
59
- deployTimeParams?: TealTemplateParams;
17
+ interface AppFactoryParams {
18
+ /** The ARC-56 or ARC-32 application spec as either:
19
+ * * Parsed JSON ARC-56 `Contract`
20
+ * * Parsed JSON ARC-32 `AppSpec`
21
+ * * Raw JSON string (in either ARC-56 or ARC-32 format)
22
+ */
23
+ appSpec: Arc56Contract | AppSpec | string;
24
+ /** `AlgorandClient` instance */
25
+ algorand: AlgorandClient;
26
+ /**
27
+ * Optional override for the app name; used for on-chain metadata and lookups.
28
+ * Defaults to the ARC-32/ARC-56 app spec name.
29
+ */
30
+ appName?: string;
31
+ /** Optional address to use for the account to use as the default sender for calls. */
32
+ defaultSender?: Address | string;
33
+ /** Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from `AlgorandClient`). */
34
+ defaultSigner?: TransactionSigner;
35
+ /** The version of app that is / will be deployed; defaults to 1.0 */
36
+ version?: string;
37
+ /**
38
+ * Whether or not the contract should have deploy-time immutability control set, undefined = ignore.
39
+ * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.
40
+ *
41
+ * Useful if you want to vend multiple contracts from the same factory without specifying this value
42
+ * for each call.
43
+ */
44
+ updatable?: boolean;
45
+ /**
46
+ * Whether or not the contract should have deploy-time permanence control set, undefined = ignore.
47
+ * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.
48
+ *
49
+ * Useful if you want to vend multiple contracts from the same factory without specifying this value
50
+ * for each call.
51
+ */
52
+ deletable?: boolean;
53
+ /**
54
+ * Optional deploy-time TEAL template replacement parameters.
55
+ * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.
56
+ *
57
+ * Useful if you want to vend multiple contracts from the same factory without specifying this value
58
+ * for each call.
59
+ */
60
+ deployTimeParams?: TealTemplateParams;
60
61
  }
61
62
  /** onComplete parameter for a create app call */
62
- export type CreateOnComplete = {
63
- onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
63
+ type CreateOnComplete = {
64
+ onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
64
65
  };
65
66
  /** Specifies a schema used for creating an app */
66
- export type CreateSchema = {
67
- /** The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec. */
68
- schema?: {
69
- /** The number of integers saved in global state. */
70
- globalInts: number;
71
- /** The number of byte slices saved in global state. */
72
- globalByteSlices: number;
73
- /** The number of integers saved in local state. */
74
- localInts: number;
75
- /** The number of byte slices saved in local state. */
76
- localByteSlices: number;
77
- };
78
- /** Number of extra pages required for the programs.
79
- * Defaults to the number needed for the programs in this call if not specified.
80
- * This is immutable once the app is created. */
81
- extraProgramPages?: number;
67
+ type CreateSchema = {
68
+ /** The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec. */schema?: {
69
+ /** The number of integers saved in global state. */globalInts: number; /** The number of byte slices saved in global state. */
70
+ globalByteSlices: number; /** The number of integers saved in local state. */
71
+ localInts: number; /** The number of byte slices saved in local state. */
72
+ localByteSlices: number;
73
+ };
74
+ /** Number of extra pages required for the programs.
75
+ * Defaults to the number needed for the programs in this call if not specified.
76
+ * This is immutable once the app is created. */
77
+ extraProgramPages?: number;
82
78
  };
83
79
  /** Params to specify a bare (raw) create call for an app */
84
- export type AppFactoryCreateParams = Expand<AppClientBareCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>;
80
+ type AppFactoryCreateParams = Expand<AppClientBareCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>;
85
81
  /** Params to specify a create method call for an app */
86
- export type AppFactoryCreateMethodCallParams = Expand<AppClientMethodCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>;
82
+ type AppFactoryCreateMethodCallParams = Expand<AppClientMethodCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>;
87
83
  /** Params to get an app client by ID from an app factory. */
88
- export type AppFactoryAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
84
+ type AppFactoryAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
89
85
  /** Params to get an app client by creator address and name from an app factory. */
90
- export type AppFactoryResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
86
+ type AppFactoryResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
91
87
  /** Parameters to define a deployment for an `AppFactory` */
92
- export type AppFactoryDeployParams = Expand<Omit<AppDeployParams, 'createParams' | 'updateParams' | 'deleteParams' | 'metadata'> & {
93
- /** Create transaction parameters to use if a create needs to be issued as part of deployment */
94
- createParams?: Expand<AppClientMethodCallParams & CreateOnComplete & CreateSchema> | Expand<AppClientBareCallParams & CreateOnComplete & CreateSchema>;
95
- /** Update transaction parameters to use if a create needs to be issued as part of deployment */
96
- updateParams?: AppClientMethodCallParams | AppClientBareCallParams;
97
- /** Delete transaction parameters to use if a create needs to be issued as part of deployment */
98
- deleteParams?: AppClientMethodCallParams | AppClientBareCallParams;
99
- /**
100
- * Whether or not the contract should have deploy-time immutability control set.
101
- * `undefined` = use AppFactory constructor value if set or base it on the app spec.
102
- */
103
- updatable?: boolean;
104
- /**
105
- * Whether or not the contract should have deploy-time permanence control set.
106
- * `undefined` = use AppFactory constructor value if set or base it on the app spec.
107
- */
108
- deletable?: boolean;
109
- /** Override the app name for this deployment */
110
- appName?: string;
88
+ type AppFactoryDeployParams = Expand<Omit<AppDeployParams, 'createParams' | 'updateParams' | 'deleteParams' | 'metadata'> & {
89
+ /** Create transaction parameters to use if a create needs to be issued as part of deployment */createParams?: Expand<AppClientMethodCallParams & CreateOnComplete & CreateSchema> | Expand<AppClientBareCallParams & CreateOnComplete & CreateSchema>; /** Update transaction parameters to use if a create needs to be issued as part of deployment */
90
+ updateParams?: AppClientMethodCallParams | AppClientBareCallParams; /** Delete transaction parameters to use if a create needs to be issued as part of deployment */
91
+ deleteParams?: AppClientMethodCallParams | AppClientBareCallParams;
92
+ /**
93
+ * Whether or not the contract should have deploy-time immutability control set.
94
+ * `undefined` = use AppFactory constructor value if set or base it on the app spec.
95
+ */
96
+ updatable?: boolean;
97
+ /**
98
+ * Whether or not the contract should have deploy-time permanence control set.
99
+ * `undefined` = use AppFactory constructor value if set or base it on the app spec.
100
+ */
101
+ deletable?: boolean; /** Override the app name for this deployment */
102
+ appName?: string;
111
103
  }>;
112
104
  /**
113
105
  * ARC-56/ARC-32 app factory that, for a given app spec, allows you to create
114
106
  * and deploy one or more app instances and to create one or more app clients
115
107
  * to interact with those (or other) app instances.
116
108
  */
117
- export declare class AppFactory {
118
- private _appSpec;
119
- private _appName;
120
- private _algorand;
121
- private _version;
122
- private _defaultSender?;
123
- private _defaultSigner?;
124
- private _deployTimeParams?;
125
- private _updatable?;
126
- private _deletable?;
127
- private _approvalSourceMap;
128
- private _clearSourceMap;
129
- private _paramsMethods;
130
- /**
131
- * Create a new app factory.
132
- * @param params The parameters to create the app factory
133
- * @returns The `AppFactory` instance
134
- * @example
135
- * ```typescript
136
- * const appFactory = new AppFactory({
137
- * appSpec: appSpec,
138
- * algorand: AlgorandClient.mainNet(),
139
- * })
140
- */
141
- constructor(params: AppFactoryParams);
142
- /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */
143
- get appName(): string;
144
- /** The ARC-56 app spec being used */
145
- get appSpec(): Arc56Contract;
146
- /** Return the algorand client this factory is using. */
147
- get algorand(): AlgorandClient;
148
- /** Get parameters to create transactions (create and deploy related calls) for the current app.
149
- *
150
- * A good mental model for this is that these parameters represent a deferred transaction creation.
151
- * @example Create a transaction in the future using Algorand Client
152
- * ```typescript
153
- * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
154
- * // ...
155
- * await algorand.send.AppCreateMethodCall(createAppParams)
156
- * ```
157
- * @example Define a nested transaction as an ABI argument
158
- * ```typescript
159
- * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
160
- * await appClient.send.call({method: 'my_method', args: [createAppParams]})
161
- * ```
162
- */
163
- get params(): {
164
- /** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */
165
- create: (params: {
166
- maxFee?: import("./amount").AlgoAmount | undefined;
167
- note?: string | Uint8Array | undefined;
168
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
169
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
170
- rejectVersion?: number | undefined;
171
- lease?: string | Uint8Array | undefined;
172
- rekeyTo?: string | algosdk.Address | undefined;
173
- staticFee?: import("./amount").AlgoAmount | undefined;
174
- extraFee?: import("./amount").AlgoAmount | undefined;
175
- validityWindow?: number | bigint | undefined;
176
- firstValidRound?: bigint | undefined;
177
- lastValidRound?: bigint | undefined;
178
- accountReferences?: (string | algosdk.Address)[] | undefined;
179
- appReferences?: bigint[] | undefined;
180
- assetReferences?: bigint[] | undefined;
181
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
182
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
183
- sender?: string | algosdk.Address | undefined;
184
- method: string;
185
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
186
- deployTimeParams?: TealTemplateParams | undefined;
187
- updatable?: boolean | undefined;
188
- deletable?: boolean | undefined;
189
- schema?: {
190
- /** The number of integers saved in global state. */
191
- globalInts: number;
192
- /** The number of byte slices saved in global state. */
193
- globalByteSlices: number;
194
- /** The number of integers saved in local state. */
195
- localInts: number;
196
- /** The number of byte slices saved in local state. */
197
- localByteSlices: number;
198
- } | undefined;
199
- extraProgramPages?: number | undefined;
200
- }) => Promise<{
201
- deployTimeParams: TealTemplateParams | undefined;
202
- schema: {
203
- /** The number of integers saved in global state. */
204
- globalInts: number;
205
- /** The number of byte slices saved in global state. */
206
- globalByteSlices: number;
207
- /** The number of integers saved in local state. */
208
- localInts: number;
209
- /** The number of byte slices saved in local state. */
210
- localByteSlices: number;
211
- };
212
- approvalProgram: Uint8Array;
213
- clearStateProgram: Uint8Array;
214
- maxFee?: import("./amount").AlgoAmount | undefined;
215
- note?: string | Uint8Array | undefined;
216
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
217
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
218
- rejectVersion?: number | undefined;
219
- lease?: string | Uint8Array | undefined;
220
- rekeyTo?: string | algosdk.Address | undefined;
221
- staticFee?: import("./amount").AlgoAmount | undefined;
222
- extraFee?: import("./amount").AlgoAmount | undefined;
223
- validityWindow?: number | bigint | undefined;
224
- firstValidRound?: bigint | undefined;
225
- lastValidRound?: bigint | undefined;
226
- accountReferences?: (string | algosdk.Address)[] | undefined;
227
- appReferences?: bigint[] | undefined;
228
- assetReferences?: bigint[] | undefined;
229
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
230
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
231
- sender?: string | algosdk.Address | undefined;
232
- method: string;
233
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
234
- updatable?: boolean | undefined;
235
- deletable?: boolean | undefined;
236
- extraProgramPages?: number | undefined;
237
- } & {
238
- sender: algosdk.Address;
239
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
240
- method: Arc56Method;
241
- args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | AppMethodCall<{
242
- sender: string | algosdk.Address;
243
- maxFee?: import("./amount").AlgoAmount | undefined;
244
- note?: string | Uint8Array | undefined;
245
- args?: Uint8Array[] | undefined;
246
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
247
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
248
- rejectVersion?: number | undefined;
249
- lease?: string | Uint8Array | undefined;
250
- rekeyTo?: string | algosdk.Address | undefined;
251
- staticFee?: import("./amount").AlgoAmount | undefined;
252
- extraFee?: import("./amount").AlgoAmount | undefined;
253
- validityWindow?: number | bigint | undefined;
254
- firstValidRound?: bigint | undefined;
255
- lastValidRound?: bigint | undefined;
256
- accountReferences?: (string | algosdk.Address)[] | undefined;
257
- appReferences?: bigint[] | undefined;
258
- assetReferences?: bigint[] | undefined;
259
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
260
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
261
- approvalProgram: string | Uint8Array;
262
- clearStateProgram: string | Uint8Array;
263
- schema?: {
264
- globalInts: number;
265
- globalByteSlices: number;
266
- localInts: number;
267
- localByteSlices: number;
268
- } | undefined;
269
- extraProgramPages?: number | undefined;
270
- }> | AppMethodCall<{
271
- sender: string | algosdk.Address;
272
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
273
- rekeyTo?: string | algosdk.Address | undefined;
274
- note?: string | Uint8Array | undefined;
275
- lease?: string | Uint8Array | undefined;
276
- staticFee?: import("./amount").AlgoAmount | undefined;
277
- extraFee?: import("./amount").AlgoAmount | undefined;
278
- maxFee?: import("./amount").AlgoAmount | undefined;
279
- validityWindow?: number | bigint | undefined;
280
- firstValidRound?: bigint | undefined;
281
- lastValidRound?: bigint | undefined;
282
- appId: bigint;
283
- onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
284
- args?: Uint8Array[] | undefined;
285
- accountReferences?: (string | algosdk.Address)[] | undefined;
286
- appReferences?: bigint[] | undefined;
287
- assetReferences?: bigint[] | undefined;
288
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
289
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
290
- rejectVersion?: number | undefined;
291
- approvalProgram: string | Uint8Array;
292
- clearStateProgram: string | Uint8Array;
293
- }> | AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
294
- onComplete: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC;
295
- }>;
296
- /** Return params for a deployment update ABI call */
297
- deployUpdate: (params: {
298
- maxFee?: import("./amount").AlgoAmount | undefined;
299
- note?: string | Uint8Array | undefined;
300
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
301
- onComplete?: algosdk.OnApplicationComplete | undefined;
302
- rejectVersion?: number | undefined;
303
- lease?: string | Uint8Array | undefined;
304
- rekeyTo?: string | algosdk.Address | undefined;
305
- staticFee?: import("./amount").AlgoAmount | undefined;
306
- extraFee?: import("./amount").AlgoAmount | undefined;
307
- validityWindow?: number | bigint | undefined;
308
- firstValidRound?: bigint | undefined;
309
- lastValidRound?: bigint | undefined;
310
- accountReferences?: (string | algosdk.Address)[] | undefined;
311
- appReferences?: bigint[] | undefined;
312
- assetReferences?: bigint[] | undefined;
313
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
314
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
315
- sender?: string | algosdk.Address | undefined;
316
- method: string;
317
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
318
- }) => {
319
- maxFee?: import("./amount").AlgoAmount | undefined;
320
- note?: string | Uint8Array | undefined;
321
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
322
- onComplete?: algosdk.OnApplicationComplete | undefined;
323
- rejectVersion?: number | undefined;
324
- lease?: string | Uint8Array | undefined;
325
- rekeyTo?: string | algosdk.Address | undefined;
326
- staticFee?: import("./amount").AlgoAmount | undefined;
327
- extraFee?: import("./amount").AlgoAmount | undefined;
328
- validityWindow?: number | bigint | undefined;
329
- firstValidRound?: bigint | undefined;
330
- lastValidRound?: bigint | undefined;
331
- accountReferences?: (string | algosdk.Address)[] | undefined;
332
- appReferences?: bigint[] | undefined;
333
- assetReferences?: bigint[] | undefined;
334
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
335
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
336
- sender?: string | algosdk.Address | undefined;
337
- method: string;
338
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
339
- } & {
340
- sender: algosdk.Address;
341
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
342
- method: Arc56Method;
343
- args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | AppMethodCall<{
344
- sender: string | algosdk.Address;
345
- maxFee?: import("./amount").AlgoAmount | undefined;
346
- note?: string | Uint8Array | undefined;
347
- args?: Uint8Array[] | undefined;
348
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
349
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
350
- rejectVersion?: number | undefined;
351
- lease?: string | Uint8Array | undefined;
352
- rekeyTo?: string | algosdk.Address | undefined;
353
- staticFee?: import("./amount").AlgoAmount | undefined;
354
- extraFee?: import("./amount").AlgoAmount | undefined;
355
- validityWindow?: number | bigint | undefined;
356
- firstValidRound?: bigint | undefined;
357
- lastValidRound?: bigint | undefined;
358
- accountReferences?: (string | algosdk.Address)[] | undefined;
359
- appReferences?: bigint[] | undefined;
360
- assetReferences?: bigint[] | undefined;
361
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
362
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
363
- approvalProgram: string | Uint8Array;
364
- clearStateProgram: string | Uint8Array;
365
- schema?: {
366
- globalInts: number;
367
- globalByteSlices: number;
368
- localInts: number;
369
- localByteSlices: number;
370
- } | undefined;
371
- extraProgramPages?: number | undefined;
372
- }> | AppMethodCall<{
373
- sender: string | algosdk.Address;
374
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
375
- rekeyTo?: string | algosdk.Address | undefined;
376
- note?: string | Uint8Array | undefined;
377
- lease?: string | Uint8Array | undefined;
378
- staticFee?: import("./amount").AlgoAmount | undefined;
379
- extraFee?: import("./amount").AlgoAmount | undefined;
380
- maxFee?: import("./amount").AlgoAmount | undefined;
381
- validityWindow?: number | bigint | undefined;
382
- firstValidRound?: bigint | undefined;
383
- lastValidRound?: bigint | undefined;
384
- appId: bigint;
385
- onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
386
- args?: Uint8Array[] | undefined;
387
- accountReferences?: (string | algosdk.Address)[] | undefined;
388
- appReferences?: bigint[] | undefined;
389
- assetReferences?: bigint[] | undefined;
390
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
391
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
392
- rejectVersion?: number | undefined;
393
- approvalProgram: string | Uint8Array;
394
- clearStateProgram: string | Uint8Array;
395
- }> | AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
396
- onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC;
397
- };
398
- /** Return params for a deployment delete ABI call */
399
- deployDelete: (params: {
400
- maxFee?: import("./amount").AlgoAmount | undefined;
401
- note?: string | Uint8Array | undefined;
402
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
403
- onComplete?: algosdk.OnApplicationComplete | undefined;
404
- rejectVersion?: number | undefined;
405
- lease?: string | Uint8Array | undefined;
406
- rekeyTo?: string | algosdk.Address | undefined;
407
- staticFee?: import("./amount").AlgoAmount | undefined;
408
- extraFee?: import("./amount").AlgoAmount | undefined;
409
- validityWindow?: number | bigint | undefined;
410
- firstValidRound?: bigint | undefined;
411
- lastValidRound?: bigint | undefined;
412
- accountReferences?: (string | algosdk.Address)[] | undefined;
413
- appReferences?: bigint[] | undefined;
414
- assetReferences?: bigint[] | undefined;
415
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
416
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
417
- sender?: string | algosdk.Address | undefined;
418
- method: string;
419
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
420
- }) => {
421
- maxFee?: import("./amount").AlgoAmount | undefined;
422
- note?: string | Uint8Array | undefined;
423
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
424
- onComplete?: algosdk.OnApplicationComplete | undefined;
425
- rejectVersion?: number | undefined;
426
- lease?: string | Uint8Array | undefined;
427
- rekeyTo?: string | algosdk.Address | undefined;
428
- staticFee?: import("./amount").AlgoAmount | undefined;
429
- extraFee?: import("./amount").AlgoAmount | undefined;
430
- validityWindow?: number | bigint | undefined;
431
- firstValidRound?: bigint | undefined;
432
- lastValidRound?: bigint | undefined;
433
- accountReferences?: (string | algosdk.Address)[] | undefined;
434
- appReferences?: bigint[] | undefined;
435
- assetReferences?: bigint[] | undefined;
436
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
437
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
438
- sender?: string | algosdk.Address | undefined;
439
- method: string;
440
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
441
- } & {
442
- sender: algosdk.Address;
443
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
444
- method: Arc56Method;
445
- args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | AppMethodCall<{
446
- sender: string | algosdk.Address;
447
- maxFee?: import("./amount").AlgoAmount | undefined;
448
- note?: string | Uint8Array | undefined;
449
- args?: Uint8Array[] | undefined;
450
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
451
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
452
- rejectVersion?: number | undefined;
453
- lease?: string | Uint8Array | undefined;
454
- rekeyTo?: string | algosdk.Address | undefined;
455
- staticFee?: import("./amount").AlgoAmount | undefined;
456
- extraFee?: import("./amount").AlgoAmount | undefined;
457
- validityWindow?: number | bigint | undefined;
458
- firstValidRound?: bigint | undefined;
459
- lastValidRound?: bigint | undefined;
460
- accountReferences?: (string | algosdk.Address)[] | undefined;
461
- appReferences?: bigint[] | undefined;
462
- assetReferences?: bigint[] | undefined;
463
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
464
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
465
- approvalProgram: string | Uint8Array;
466
- clearStateProgram: string | Uint8Array;
467
- schema?: {
468
- globalInts: number;
469
- globalByteSlices: number;
470
- localInts: number;
471
- localByteSlices: number;
472
- } | undefined;
473
- extraProgramPages?: number | undefined;
474
- }> | AppMethodCall<{
475
- sender: string | algosdk.Address;
476
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
477
- rekeyTo?: string | algosdk.Address | undefined;
478
- note?: string | Uint8Array | undefined;
479
- lease?: string | Uint8Array | undefined;
480
- staticFee?: import("./amount").AlgoAmount | undefined;
481
- extraFee?: import("./amount").AlgoAmount | undefined;
482
- maxFee?: import("./amount").AlgoAmount | undefined;
483
- validityWindow?: number | bigint | undefined;
484
- firstValidRound?: bigint | undefined;
485
- lastValidRound?: bigint | undefined;
486
- appId: bigint;
487
- onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
488
- args?: Uint8Array[] | undefined;
489
- accountReferences?: (string | algosdk.Address)[] | undefined;
490
- appReferences?: bigint[] | undefined;
491
- assetReferences?: bigint[] | undefined;
492
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
493
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
494
- rejectVersion?: number | undefined;
495
- approvalProgram: string | Uint8Array;
496
- clearStateProgram: string | Uint8Array;
497
- }> | AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
498
- onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC;
499
- };
500
- bare: {
501
- /** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */
502
- create: (params?: {
503
- maxFee?: import("./amount").AlgoAmount | undefined;
504
- note?: string | Uint8Array | undefined;
505
- args?: Uint8Array[] | undefined;
506
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
507
- rejectVersion?: number | undefined;
508
- lease?: string | Uint8Array | undefined;
509
- rekeyTo?: string | algosdk.Address | undefined;
510
- staticFee?: import("./amount").AlgoAmount | undefined;
511
- extraFee?: import("./amount").AlgoAmount | undefined;
512
- validityWindow?: number | bigint | undefined;
513
- firstValidRound?: bigint | undefined;
514
- lastValidRound?: bigint | undefined;
515
- accountReferences?: (string | algosdk.Address)[] | undefined;
516
- appReferences?: bigint[] | undefined;
517
- assetReferences?: bigint[] | undefined;
518
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
519
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
520
- sender?: string | algosdk.Address | undefined;
521
- deployTimeParams?: TealTemplateParams | undefined;
522
- updatable?: boolean | undefined;
523
- deletable?: boolean | undefined;
524
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
525
- schema?: {
526
- /** The number of integers saved in global state. */
527
- globalInts: number;
528
- /** The number of byte slices saved in global state. */
529
- globalByteSlices: number;
530
- /** The number of integers saved in local state. */
531
- localInts: number;
532
- /** The number of byte slices saved in local state. */
533
- localByteSlices: number;
534
- } | undefined;
535
- extraProgramPages?: number | undefined;
536
- } | undefined) => Promise<{
537
- approvalProgram: Uint8Array;
538
- clearStateProgram: Uint8Array;
539
- compiledApproval?: import("./app").CompiledTeal | undefined;
540
- compiledClear?: import("./app").CompiledTeal | undefined;
541
- deployTimeParams: TealTemplateParams | undefined;
542
- schema: {
543
- /** The number of integers saved in global state. */
544
- globalInts: number;
545
- /** The number of byte slices saved in global state. */
546
- globalByteSlices: number;
547
- /** The number of integers saved in local state. */
548
- localInts: number;
549
- /** The number of byte slices saved in local state. */
550
- localByteSlices: number;
551
- };
552
- maxFee?: import("./amount").AlgoAmount | undefined;
553
- note?: string | Uint8Array | undefined;
554
- args?: Uint8Array[] | undefined;
555
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
556
- rejectVersion?: number | undefined;
557
- lease?: string | Uint8Array | undefined;
558
- rekeyTo?: string | algosdk.Address | undefined;
559
- staticFee?: import("./amount").AlgoAmount | undefined;
560
- extraFee?: import("./amount").AlgoAmount | undefined;
561
- validityWindow?: number | bigint | undefined;
562
- firstValidRound?: bigint | undefined;
563
- lastValidRound?: bigint | undefined;
564
- accountReferences?: (string | algosdk.Address)[] | undefined;
565
- appReferences?: bigint[] | undefined;
566
- assetReferences?: bigint[] | undefined;
567
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
568
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
569
- sender?: string | algosdk.Address | undefined;
570
- updatable?: boolean | undefined;
571
- deletable?: boolean | undefined;
572
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
573
- extraProgramPages?: number | undefined;
574
- } & {
575
- sender: algosdk.Address;
576
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
577
- onComplete: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC;
578
- }>;
579
- /** Return params for a deployment update bare call */
580
- deployUpdate: (params?: {
581
- maxFee?: import("./amount").AlgoAmount | undefined;
582
- note?: string | Uint8Array | undefined;
583
- args?: Uint8Array[] | undefined;
584
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
585
- rejectVersion?: number | undefined;
586
- lease?: string | Uint8Array | undefined;
587
- rekeyTo?: string | algosdk.Address | undefined;
588
- staticFee?: import("./amount").AlgoAmount | undefined;
589
- extraFee?: import("./amount").AlgoAmount | undefined;
590
- validityWindow?: number | bigint | undefined;
591
- firstValidRound?: bigint | undefined;
592
- lastValidRound?: bigint | undefined;
593
- accountReferences?: (string | algosdk.Address)[] | undefined;
594
- appReferences?: bigint[] | undefined;
595
- assetReferences?: bigint[] | undefined;
596
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
597
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
598
- sender?: string | algosdk.Address | undefined;
599
- } | undefined) => {
600
- maxFee?: import("./amount").AlgoAmount | undefined;
601
- note?: string | Uint8Array | undefined;
602
- args?: Uint8Array[] | undefined;
603
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
604
- rejectVersion?: number | undefined;
605
- lease?: string | Uint8Array | undefined;
606
- rekeyTo?: string | algosdk.Address | undefined;
607
- staticFee?: import("./amount").AlgoAmount | undefined;
608
- extraFee?: import("./amount").AlgoAmount | undefined;
609
- validityWindow?: number | bigint | undefined;
610
- firstValidRound?: bigint | undefined;
611
- lastValidRound?: bigint | undefined;
612
- accountReferences?: (string | algosdk.Address)[] | undefined;
613
- appReferences?: bigint[] | undefined;
614
- assetReferences?: bigint[] | undefined;
615
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
616
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
617
- sender?: string | algosdk.Address | undefined;
618
- } & {
619
- sender: algosdk.Address;
620
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
621
- onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC;
622
- };
623
- /** Return params for a deployment delete bare call */
624
- deployDelete: (params?: {
625
- maxFee?: import("./amount").AlgoAmount | undefined;
626
- note?: string | Uint8Array | undefined;
627
- args?: Uint8Array[] | undefined;
628
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
629
- rejectVersion?: number | undefined;
630
- lease?: string | Uint8Array | undefined;
631
- rekeyTo?: string | algosdk.Address | undefined;
632
- staticFee?: import("./amount").AlgoAmount | undefined;
633
- extraFee?: import("./amount").AlgoAmount | undefined;
634
- validityWindow?: number | bigint | undefined;
635
- firstValidRound?: bigint | undefined;
636
- lastValidRound?: bigint | undefined;
637
- accountReferences?: (string | algosdk.Address)[] | undefined;
638
- appReferences?: bigint[] | undefined;
639
- assetReferences?: bigint[] | undefined;
640
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
641
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
642
- sender?: string | algosdk.Address | undefined;
643
- } | undefined) => {
644
- maxFee?: import("./amount").AlgoAmount | undefined;
645
- note?: string | Uint8Array | undefined;
646
- args?: Uint8Array[] | undefined;
647
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
648
- rejectVersion?: number | undefined;
649
- lease?: string | Uint8Array | undefined;
650
- rekeyTo?: string | algosdk.Address | undefined;
651
- staticFee?: import("./amount").AlgoAmount | undefined;
652
- extraFee?: import("./amount").AlgoAmount | undefined;
653
- validityWindow?: number | bigint | undefined;
654
- firstValidRound?: bigint | undefined;
655
- lastValidRound?: bigint | undefined;
656
- accountReferences?: (string | algosdk.Address)[] | undefined;
657
- appReferences?: bigint[] | undefined;
658
- assetReferences?: bigint[] | undefined;
659
- boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
660
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
661
- sender?: string | algosdk.Address | undefined;
662
- } & {
663
- sender: algosdk.Address;
664
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
665
- onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC;
666
- };
667
- };
109
+ declare class AppFactory {
110
+ private _appSpec;
111
+ private _appName;
112
+ private _algorand;
113
+ private _version;
114
+ private _defaultSender?;
115
+ private _defaultSigner?;
116
+ private _deployTimeParams?;
117
+ private _updatable?;
118
+ private _deletable?;
119
+ private _approvalSourceMap;
120
+ private _clearSourceMap;
121
+ private _paramsMethods;
122
+ /**
123
+ * Create a new app factory.
124
+ * @param params The parameters to create the app factory
125
+ * @returns The `AppFactory` instance
126
+ * @example
127
+ * ```typescript
128
+ * const appFactory = new AppFactory({
129
+ * appSpec: appSpec,
130
+ * algorand: AlgorandClient.mainNet(),
131
+ * })
132
+ */
133
+ constructor(params: AppFactoryParams);
134
+ /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */
135
+ get appName(): string;
136
+ /** The ARC-56 app spec being used */
137
+ get appSpec(): Arc56Contract;
138
+ /** Return the algorand client this factory is using. */
139
+ get algorand(): AlgorandClient;
140
+ /** Get parameters to create transactions (create and deploy related calls) for the current app.
141
+ *
142
+ * A good mental model for this is that these parameters represent a deferred transaction creation.
143
+ * @example Create a transaction in the future using Algorand Client
144
+ * ```typescript
145
+ * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
146
+ * // ...
147
+ * await algorand.send.AppCreateMethodCall(createAppParams)
148
+ * ```
149
+ * @example Define a nested transaction as an ABI argument
150
+ * ```typescript
151
+ * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
152
+ * await appClient.send.call({method: 'my_method', args: [createAppParams]})
153
+ * ```
154
+ */
155
+ get params(): {
156
+ /** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */create: (params: AppFactoryCreateMethodCallParams) => Promise<{
157
+ deployTimeParams: TealTemplateParams | undefined;
158
+ schema: {
159
+ /** The number of integers saved in global state. */globalInts: number; /** The number of byte slices saved in global state. */
160
+ globalByteSlices: number; /** The number of integers saved in local state. */
161
+ localInts: number; /** The number of byte slices saved in local state. */
162
+ localByteSlices: number;
163
+ };
164
+ approvalProgram: Uint8Array<ArrayBufferLike>;
165
+ clearStateProgram: Uint8Array<ArrayBufferLike>;
166
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
167
+ rekeyTo?: (string | Address) | undefined;
168
+ note?: (Uint8Array | string) | undefined;
169
+ lease?: (Uint8Array | string) | undefined;
170
+ staticFee?: AlgoAmount | undefined;
171
+ extraFee?: AlgoAmount | undefined;
172
+ maxFee?: AlgoAmount | undefined;
173
+ validityWindow?: number | bigint | undefined;
174
+ firstValidRound?: bigint | undefined;
175
+ lastValidRound?: bigint | undefined;
176
+ onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
177
+ accountReferences?: (string | Address)[] | undefined;
178
+ appReferences?: bigint[] | undefined;
179
+ assetReferences?: bigint[] | undefined;
180
+ boxReferences?: (BoxReference | BoxIdentifier)[];
181
+ accessReferences?: ResourceReference[] | undefined;
182
+ rejectVersion?: number | undefined;
183
+ sender?: (Address | string) | undefined;
184
+ method: string;
185
+ args?: (ABIValue | ABIStruct | AppMethodCallTransactionArgument | undefined)[];
186
+ updatable?: boolean | undefined;
187
+ deletable?: boolean | undefined;
188
+ extraProgramPages?: number | undefined;
189
+ } & {
190
+ sender: algosdk.Address;
191
+ signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
192
+ method: Arc56Method;
193
+ args: (algosdk.TransactionWithSigner | algosdk.ABIValue | algosdk.Transaction | Promise<algosdk.Transaction> | AppMethodCall<{
194
+ sender: string | Address;
195
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
196
+ rekeyTo?: (string | Address) | undefined;
197
+ note?: (Uint8Array | string) | undefined;
198
+ lease?: (Uint8Array | string) | undefined;
199
+ staticFee?: AlgoAmount | undefined;
200
+ extraFee?: AlgoAmount | undefined;
201
+ maxFee?: AlgoAmount | undefined;
202
+ validityWindow?: number | bigint | undefined;
203
+ firstValidRound?: bigint | undefined;
204
+ lastValidRound?: bigint | undefined;
205
+ onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
206
+ args?: Uint8Array[] | undefined;
207
+ accountReferences?: (string | Address)[] | undefined;
208
+ appReferences?: bigint[] | undefined;
209
+ assetReferences?: bigint[] | undefined;
210
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
211
+ accessReferences?: ResourceReference[] | undefined;
212
+ rejectVersion?: number | undefined;
213
+ approvalProgram: string | Uint8Array;
214
+ clearStateProgram: string | Uint8Array;
215
+ schema?: {
216
+ globalInts: number;
217
+ globalByteSlices: number;
218
+ localInts: number;
219
+ localByteSlices: number;
220
+ } | undefined;
221
+ extraProgramPages?: number | undefined;
222
+ }> | AppMethodCall<{
223
+ sender: string | Address;
224
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
225
+ rekeyTo?: (string | Address) | undefined;
226
+ note?: (Uint8Array | string) | undefined;
227
+ lease?: (Uint8Array | string) | undefined;
228
+ staticFee?: AlgoAmount | undefined;
229
+ extraFee?: AlgoAmount | undefined;
230
+ maxFee?: AlgoAmount | undefined;
231
+ validityWindow?: number | bigint | undefined;
232
+ firstValidRound?: bigint | undefined;
233
+ lastValidRound?: bigint | undefined;
234
+ appId: bigint;
235
+ onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
236
+ args?: Uint8Array[] | undefined;
237
+ accountReferences?: (string | Address)[] | undefined;
238
+ appReferences?: bigint[] | undefined;
239
+ assetReferences?: bigint[] | undefined;
240
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
241
+ accessReferences?: ResourceReference[] | undefined;
242
+ rejectVersion?: number | undefined;
243
+ approvalProgram: string | Uint8Array;
244
+ clearStateProgram: string | Uint8Array;
245
+ }> | AppMethodCall<AppMethodCallParams> | undefined)[] | undefined;
246
+ onComplete: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC;
247
+ }>; /** Return params for a deployment update ABI call */
248
+ deployUpdate: (params: AppClientMethodCallParams) => {
249
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
250
+ rekeyTo?: (string | Address) | undefined;
251
+ note?: (Uint8Array | string) | undefined;
252
+ lease?: (Uint8Array | string) | undefined;
253
+ staticFee?: AlgoAmount | undefined;
254
+ extraFee?: AlgoAmount | undefined;
255
+ maxFee?: AlgoAmount | undefined;
256
+ validityWindow?: number | bigint | undefined;
257
+ firstValidRound?: bigint | undefined;
258
+ lastValidRound?: bigint | undefined;
259
+ onComplete?: algosdk.OnApplicationComplete | undefined;
260
+ accountReferences?: (string | Address)[] | undefined;
261
+ appReferences?: bigint[] | undefined;
262
+ assetReferences?: bigint[] | undefined;
263
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
264
+ accessReferences?: ResourceReference[] | undefined;
265
+ rejectVersion?: number | undefined;
266
+ sender?: (Address | string) | undefined;
267
+ method: string;
268
+ args?: (ABIValue | ABIStruct | AppMethodCallTransactionArgument | undefined)[] | undefined;
269
+ } & {
270
+ sender: algosdk.Address;
271
+ signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
272
+ method: Arc56Method;
273
+ args: (algosdk.TransactionWithSigner | algosdk.ABIValue | algosdk.Transaction | Promise<algosdk.Transaction> | AppMethodCall<{
274
+ sender: string | Address;
275
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
276
+ rekeyTo?: (string | Address) | undefined;
277
+ note?: (Uint8Array | string) | undefined;
278
+ lease?: (Uint8Array | string) | undefined;
279
+ staticFee?: AlgoAmount | undefined;
280
+ extraFee?: AlgoAmount | undefined;
281
+ maxFee?: AlgoAmount | undefined;
282
+ validityWindow?: number | bigint | undefined;
283
+ firstValidRound?: bigint | undefined;
284
+ lastValidRound?: bigint | undefined;
285
+ onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
286
+ args?: Uint8Array[] | undefined;
287
+ accountReferences?: (string | Address)[] | undefined;
288
+ appReferences?: bigint[] | undefined;
289
+ assetReferences?: bigint[] | undefined;
290
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
291
+ accessReferences?: ResourceReference[] | undefined;
292
+ rejectVersion?: number | undefined;
293
+ approvalProgram: string | Uint8Array;
294
+ clearStateProgram: string | Uint8Array;
295
+ schema?: {
296
+ globalInts: number;
297
+ globalByteSlices: number;
298
+ localInts: number;
299
+ localByteSlices: number;
300
+ } | undefined;
301
+ extraProgramPages?: number | undefined;
302
+ }> | AppMethodCall<{
303
+ sender: string | Address;
304
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
305
+ rekeyTo?: (string | Address) | undefined;
306
+ note?: (Uint8Array | string) | undefined;
307
+ lease?: (Uint8Array | string) | undefined;
308
+ staticFee?: AlgoAmount | undefined;
309
+ extraFee?: AlgoAmount | undefined;
310
+ maxFee?: AlgoAmount | undefined;
311
+ validityWindow?: number | bigint | undefined;
312
+ firstValidRound?: bigint | undefined;
313
+ lastValidRound?: bigint | undefined;
314
+ appId: bigint;
315
+ onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
316
+ args?: Uint8Array[] | undefined;
317
+ accountReferences?: (string | Address)[] | undefined;
318
+ appReferences?: bigint[] | undefined;
319
+ assetReferences?: bigint[] | undefined;
320
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
321
+ accessReferences?: ResourceReference[] | undefined;
322
+ rejectVersion?: number | undefined;
323
+ approvalProgram: string | Uint8Array;
324
+ clearStateProgram: string | Uint8Array;
325
+ }> | AppMethodCall<AppMethodCallParams> | undefined)[] | undefined;
326
+ onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC;
327
+ }; /** Return params for a deployment delete ABI call */
328
+ deployDelete: (params: AppClientMethodCallParams) => {
329
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
330
+ rekeyTo?: (string | Address) | undefined;
331
+ note?: (Uint8Array | string) | undefined;
332
+ lease?: (Uint8Array | string) | undefined;
333
+ staticFee?: AlgoAmount | undefined;
334
+ extraFee?: AlgoAmount | undefined;
335
+ maxFee?: AlgoAmount | undefined;
336
+ validityWindow?: number | bigint | undefined;
337
+ firstValidRound?: bigint | undefined;
338
+ lastValidRound?: bigint | undefined;
339
+ onComplete?: algosdk.OnApplicationComplete | undefined;
340
+ accountReferences?: (string | Address)[] | undefined;
341
+ appReferences?: bigint[] | undefined;
342
+ assetReferences?: bigint[] | undefined;
343
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
344
+ accessReferences?: ResourceReference[] | undefined;
345
+ rejectVersion?: number | undefined;
346
+ sender?: (Address | string) | undefined;
347
+ method: string;
348
+ args?: (ABIValue | ABIStruct | AppMethodCallTransactionArgument | undefined)[] | undefined;
349
+ } & {
350
+ sender: algosdk.Address;
351
+ signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
352
+ method: Arc56Method;
353
+ args: (algosdk.TransactionWithSigner | algosdk.ABIValue | algosdk.Transaction | Promise<algosdk.Transaction> | AppMethodCall<{
354
+ sender: string | Address;
355
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
356
+ rekeyTo?: (string | Address) | undefined;
357
+ note?: (Uint8Array | string) | undefined;
358
+ lease?: (Uint8Array | string) | undefined;
359
+ staticFee?: AlgoAmount | undefined;
360
+ extraFee?: AlgoAmount | undefined;
361
+ maxFee?: AlgoAmount | undefined;
362
+ validityWindow?: number | bigint | undefined;
363
+ firstValidRound?: bigint | undefined;
364
+ lastValidRound?: bigint | undefined;
365
+ onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
366
+ args?: Uint8Array[] | undefined;
367
+ accountReferences?: (string | Address)[] | undefined;
368
+ appReferences?: bigint[] | undefined;
369
+ assetReferences?: bigint[] | undefined;
370
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
371
+ accessReferences?: ResourceReference[] | undefined;
372
+ rejectVersion?: number | undefined;
373
+ approvalProgram: string | Uint8Array;
374
+ clearStateProgram: string | Uint8Array;
375
+ schema?: {
376
+ globalInts: number;
377
+ globalByteSlices: number;
378
+ localInts: number;
379
+ localByteSlices: number;
380
+ } | undefined;
381
+ extraProgramPages?: number | undefined;
382
+ }> | AppMethodCall<{
383
+ sender: string | Address;
384
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
385
+ rekeyTo?: (string | Address) | undefined;
386
+ note?: (Uint8Array | string) | undefined;
387
+ lease?: (Uint8Array | string) | undefined;
388
+ staticFee?: AlgoAmount | undefined;
389
+ extraFee?: AlgoAmount | undefined;
390
+ maxFee?: AlgoAmount | undefined;
391
+ validityWindow?: number | bigint | undefined;
392
+ firstValidRound?: bigint | undefined;
393
+ lastValidRound?: bigint | undefined;
394
+ appId: bigint;
395
+ onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
396
+ args?: Uint8Array[] | undefined;
397
+ accountReferences?: (string | Address)[] | undefined;
398
+ appReferences?: bigint[] | undefined;
399
+ assetReferences?: bigint[] | undefined;
400
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
401
+ accessReferences?: ResourceReference[] | undefined;
402
+ rejectVersion?: number | undefined;
403
+ approvalProgram: string | Uint8Array;
404
+ clearStateProgram: string | Uint8Array;
405
+ }> | AppMethodCall<AppMethodCallParams> | undefined)[] | undefined;
406
+ onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC;
668
407
  };
669
- /** Create transactions for the current app */
670
- readonly createTransaction: {
671
- /** Create bare (raw) transactions for the current app */
672
- bare: {
673
- /**
674
- * Create a create app call transaction using a bare (raw) create call.
675
- *
676
- * Performs deploy-time TEAL template placeholder substitutions (if specified).
677
- * @param params The parameters to create the create call transaction
678
- * @returns The create call transaction
679
- */
680
- create: (params?: AppFactoryCreateParams) => Promise<algosdk.Transaction>;
408
+ bare: {
409
+ /** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */create: (params?: AppFactoryCreateParams) => Promise<{
410
+ approvalProgram: Uint8Array;
411
+ clearStateProgram: Uint8Array;
412
+ compiledApproval?: CompiledTeal | undefined;
413
+ compiledClear?: CompiledTeal | undefined;
414
+ deployTimeParams: TealTemplateParams | undefined;
415
+ schema: {
416
+ /** The number of integers saved in global state. */globalInts: number; /** The number of byte slices saved in global state. */
417
+ globalByteSlices: number; /** The number of integers saved in local state. */
418
+ localInts: number; /** The number of byte slices saved in local state. */
419
+ localByteSlices: number;
681
420
  };
682
- /**
683
- * Create a create app call transaction using an ABI create call.
684
- *
685
- * Performs deploy-time TEAL template placeholder substitutions (if specified).
686
- * @param params The parameters to create the create call transaction
687
- * @returns The create call transaction
688
- */
689
- create: (params: AppFactoryCreateMethodCallParams) => Promise<{
690
- transactions: algosdk.Transaction[];
691
- methodCalls: Map<number, algosdk.ABIMethod>;
692
- signers: Map<number, algosdk.TransactionSigner>;
693
- }>;
421
+ signer?: algosdk.TransactionSigner | TransactionSignerAccount;
422
+ rekeyTo?: string | Address;
423
+ note?: Uint8Array | string;
424
+ lease?: Uint8Array | string;
425
+ staticFee?: AlgoAmount;
426
+ extraFee?: AlgoAmount;
427
+ maxFee?: AlgoAmount;
428
+ validityWindow?: number | bigint;
429
+ firstValidRound?: bigint;
430
+ lastValidRound?: bigint;
431
+ args?: Uint8Array[];
432
+ accountReferences?: (string | Address)[];
433
+ appReferences?: bigint[];
434
+ assetReferences?: bigint[];
435
+ boxReferences?: (BoxReference | BoxIdentifier)[];
436
+ accessReferences?: ResourceReference[];
437
+ rejectVersion?: number;
438
+ sender?: Address | string;
439
+ updatable?: boolean;
440
+ deletable?: boolean;
441
+ onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
442
+ extraProgramPages?: number;
443
+ } & {
444
+ sender: algosdk.Address;
445
+ signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
446
+ onComplete: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC;
447
+ }>; /** Return params for a deployment update bare call */
448
+ deployUpdate: (params?: AppClientBareCallParams) => {
449
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
450
+ rekeyTo?: (string | Address) | undefined;
451
+ note?: (Uint8Array | string) | undefined;
452
+ lease?: (Uint8Array | string) | undefined;
453
+ staticFee?: AlgoAmount | undefined;
454
+ extraFee?: AlgoAmount | undefined;
455
+ maxFee?: AlgoAmount | undefined;
456
+ validityWindow?: number | bigint | undefined;
457
+ firstValidRound?: bigint | undefined;
458
+ lastValidRound?: bigint | undefined;
459
+ args?: Uint8Array[] | undefined;
460
+ accountReferences?: (string | Address)[] | undefined;
461
+ appReferences?: bigint[] | undefined;
462
+ assetReferences?: bigint[] | undefined;
463
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
464
+ accessReferences?: ResourceReference[] | undefined;
465
+ rejectVersion?: number | undefined;
466
+ sender?: (Address | string) | undefined;
467
+ } & {
468
+ sender: algosdk.Address;
469
+ signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
470
+ onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC;
471
+ }; /** Return params for a deployment delete bare call */
472
+ deployDelete: (params?: AppClientBareCallParams) => {
473
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
474
+ rekeyTo?: (string | Address) | undefined;
475
+ note?: (Uint8Array | string) | undefined;
476
+ lease?: (Uint8Array | string) | undefined;
477
+ staticFee?: AlgoAmount | undefined;
478
+ extraFee?: AlgoAmount | undefined;
479
+ maxFee?: AlgoAmount | undefined;
480
+ validityWindow?: number | bigint | undefined;
481
+ firstValidRound?: bigint | undefined;
482
+ lastValidRound?: bigint | undefined;
483
+ args?: Uint8Array[] | undefined;
484
+ accountReferences?: (string | Address)[] | undefined;
485
+ appReferences?: bigint[] | undefined;
486
+ assetReferences?: bigint[] | undefined;
487
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
488
+ accessReferences?: ResourceReference[] | undefined;
489
+ rejectVersion?: number | undefined;
490
+ sender?: (Address | string) | undefined;
491
+ } & {
492
+ sender: algosdk.Address;
493
+ signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
494
+ onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC;
495
+ };
694
496
  };
695
- /** Send transactions to the current app */
696
- readonly send: {
697
- /** Send bare (raw) transactions for the current app */
698
- bare: {
699
- /**
700
- * Creates an instance of the app using a bare (raw) create call and returns the result
701
- * of the creation transaction and an app client to interact with that app instance.
702
- *
703
- * Performs deploy-time TEAL template placeholder substitutions (if specified).
704
- * @param params The parameters to create the app
705
- * @returns The app client and the result of the creation transaction
706
- */
707
- create: (params?: AppFactoryCreateParams & SendParams) => Promise<{
708
- appClient: AppClient;
709
- result: {
710
- compiledApproval?: import("./app").CompiledTeal | undefined;
711
- compiledClear?: import("./app").CompiledTeal | undefined;
712
- return: undefined;
713
- groupId: string;
714
- txIds: string[];
715
- returns?: import("./app").ABIReturn[] | undefined;
716
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
717
- transactions: algosdk.Transaction[];
718
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
719
- transaction: algosdk.Transaction;
720
- appId: bigint;
721
- appAddress: algosdk.Address;
722
- };
723
- }>;
724
- };
725
- /**
726
- * Creates an instance of the app and returns the result of the creation
727
- * transaction and an app client to interact with that app instance.
728
- *
729
- * Performs deploy-time TEAL template placeholder substitutions (if specified).
730
- * @param params The parameters to create the app
731
- * @returns The app client and the result of the creation transaction
732
- */
733
- create: (params: AppFactoryCreateMethodCallParams & SendParams) => Promise<{
734
- appClient: AppClient;
735
- result: {
736
- compiledApproval?: import("./app").CompiledTeal | undefined;
737
- compiledClear?: import("./app").CompiledTeal | undefined;
738
- appId: bigint;
739
- groupId: string;
740
- txIds: string[];
741
- returns?: import("./app").ABIReturn[] | undefined;
742
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
743
- transactions: algosdk.Transaction[];
744
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
745
- transaction: algosdk.Transaction;
746
- appAddress: algosdk.Address;
747
- return?: algosdk.ABIValue | ABIStruct | undefined;
748
- };
749
- }>;
497
+ };
498
+ /** Create transactions for the current app */
499
+ readonly createTransaction: {
500
+ /** Create bare (raw) transactions for the current app */bare: {
501
+ /**
502
+ * Create a create app call transaction using a bare (raw) create call.
503
+ *
504
+ * Performs deploy-time TEAL template placeholder substitutions (if specified).
505
+ * @param params The parameters to create the create call transaction
506
+ * @returns The create call transaction
507
+ */
508
+ create: (params?: AppFactoryCreateParams) => Promise<algosdk.Transaction>;
750
509
  };
751
510
  /**
752
- * Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified).
753
- *
754
- * **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`.
511
+ * Create a create app call transaction using an ABI create call.
755
512
  *
756
- * **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.
757
- *
758
- * **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.
759
- * @param params The arguments to control the app deployment
760
- * @returns The app client and the result of the deployment
761
- * @example
762
- * ```ts
763
- * const { appClient, result } = await factory.deploy({
764
- * createParams: {
765
- * sender: 'SENDER_ADDRESS',
766
- * approvalProgram: 'APPROVAL PROGRAM',
767
- * clearStateProgram: 'CLEAR PROGRAM',
768
- * schema: {
769
- * globalByteSlices: 0,
770
- * globalInts: 0,
771
- * localByteSlices: 0,
772
- * localInts: 0
773
- * }
774
- * },
775
- * updateParams: {
776
- * sender: 'SENDER_ADDRESS'
777
- * },
778
- * deleteParams: {
779
- * sender: 'SENDER_ADDRESS'
780
- * },
781
- * metadata: { name: 'my_app', version: '2.0', updatable: false, deletable: false },
782
- * onSchemaBreak: 'append',
783
- * onUpdate: 'append'
784
- * })
785
- * ```
513
+ * Performs deploy-time TEAL template placeholder substitutions (if specified).
514
+ * @param params The parameters to create the create call transaction
515
+ * @returns The create call transaction
786
516
  */
787
- deploy(params: AppFactoryDeployParams): Promise<{
517
+ create: (params: AppFactoryCreateMethodCallParams) => Promise<{
518
+ transactions: algosdk.Transaction[];
519
+ methodCalls: Map<number, algosdk.ABIMethod>;
520
+ signers: Map<number, algosdk.TransactionSigner>;
521
+ }>;
522
+ };
523
+ /** Send transactions to the current app */
524
+ readonly send: {
525
+ /** Send bare (raw) transactions for the current app */bare: {
526
+ /**
527
+ * Creates an instance of the app using a bare (raw) create call and returns the result
528
+ * of the creation transaction and an app client to interact with that app instance.
529
+ *
530
+ * Performs deploy-time TEAL template placeholder substitutions (if specified).
531
+ * @param params The parameters to create the app
532
+ * @returns The app client and the result of the creation transaction
533
+ */
534
+ create: (params?: AppFactoryCreateParams & SendParams) => Promise<{
788
535
  appClient: AppClient;
789
536
  result: {
790
- return: algosdk.ABIValue | ABIStruct | undefined;
791
- deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
792
- compiledApproval?: import("./app").CompiledTeal | undefined;
793
- compiledClear?: import("./app").CompiledTeal | undefined;
794
- operationPerformed: "create";
795
- version: string;
796
- name: string;
797
- createdRound: bigint;
798
- updatedRound: bigint;
799
- createdMetadata: import("./app").AppDeployMetadata;
800
- deleted: boolean;
801
- deletable?: boolean | undefined;
802
- updatable?: boolean | undefined;
803
- groupId: string;
804
- txIds: string[];
805
- returns?: import("./app").ABIReturn[] | undefined;
806
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
807
- transactions: algosdk.Transaction[];
808
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
809
- transaction: algosdk.Transaction;
810
- appId: bigint;
811
- appAddress: algosdk.Address;
812
- } | {
813
- return: algosdk.ABIValue | ABIStruct | undefined;
814
- deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
815
- compiledApproval?: import("./app").CompiledTeal | undefined;
816
- compiledClear?: import("./app").CompiledTeal | undefined;
817
- operationPerformed: "update";
818
- appId: bigint;
819
- appAddress: algosdk.Address;
820
- createdRound: bigint;
821
- updatedRound: bigint;
822
- createdMetadata: import("./app").AppDeployMetadata;
823
- deleted: boolean;
824
- name: string;
825
- version: string;
826
- deletable?: boolean | undefined;
827
- updatable?: boolean | undefined;
828
- groupId: string;
829
- txIds: string[];
830
- returns?: import("./app").ABIReturn[] | undefined;
831
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
832
- transactions: algosdk.Transaction[];
833
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
834
- transaction: algosdk.Transaction;
835
- } | {
836
- return: algosdk.ABIValue | ABIStruct | undefined;
837
- deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
838
- compiledApproval?: import("./app").CompiledTeal | undefined;
839
- compiledClear?: import("./app").CompiledTeal | undefined;
840
- operationPerformed: "replace";
841
- version: string;
842
- name: string;
843
- createdRound: bigint;
844
- updatedRound: bigint;
845
- createdMetadata: import("./app").AppDeployMetadata;
846
- deleted: boolean;
847
- deletable?: boolean | undefined;
848
- updatable?: boolean | undefined;
849
- groupId: string;
850
- txIds: string[];
851
- returns?: import("./app").ABIReturn[] | undefined;
852
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
853
- transactions: algosdk.Transaction[];
854
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
855
- transaction: algosdk.Transaction;
856
- appId: bigint;
857
- appAddress: algosdk.Address;
858
- deleteResult: import("./transaction").ConfirmedTransactionResult;
859
- } | {
860
- return: algosdk.ABIValue | ABIStruct | undefined;
861
- deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
862
- compiledApproval?: import("./app").CompiledTeal | undefined;
863
- compiledClear?: import("./app").CompiledTeal | undefined;
864
- operationPerformed: "nothing";
865
- appId: bigint;
866
- appAddress: algosdk.Address;
867
- createdRound: bigint;
868
- updatedRound: bigint;
869
- createdMetadata: import("./app").AppDeployMetadata;
870
- deleted: boolean;
871
- name: string;
872
- version: string;
873
- deletable?: boolean | undefined;
874
- updatable?: boolean | undefined;
537
+ compiledApproval?: CompiledTeal | undefined;
538
+ compiledClear?: CompiledTeal | undefined;
539
+ return: undefined;
540
+ groupId: string;
541
+ txIds: string[];
542
+ returns?: ABIReturn[] | undefined;
543
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
544
+ transactions: algosdk.Transaction[];
545
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
546
+ transaction: algosdk.Transaction;
547
+ appId: bigint;
548
+ appAddress: Address;
875
549
  };
876
- }>;
877
- /**
878
- * Returns a new `AppClient` client for an app instance of the given ID.
879
- *
880
- * Automatically populates appName, defaultSender and source maps from the factory
881
- * if not specified in the params.
882
- * @param params The parameters to create the app client
883
- * @returns The `AppClient` instance
884
- * @example
885
- * ```typescript
886
- * const appClient = factory.getAppClientById({ appId: 12345n })
887
- * ```
888
- */
889
- getAppClientById(params: AppFactoryAppClientParams): AppClient;
890
- /**
891
- * Returns a new `AppClient` client, resolving the app by creator address and name
892
- * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
893
- *
894
- * Automatically populates appName, defaultSender and source maps from the factory
895
- * if not specified in the params.
896
- * @param params The parameters to create the app client
897
- * @returns The `AppClient` instance
898
- * @example
899
- * ```typescript
900
- * const appClient = factory.getAppClientByCreatorAndName({ creatorAddress: 'CREATOR_ADDRESS', appName: 'my_app' })
901
- * ```
902
- */
903
- getAppClientByCreatorAndName(params: AppFactoryResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
904
- /**
905
- * Takes an error that may include a logic error from a call to the current app and re-exposes the
906
- * error to include source code information via the source map and ARC-56 spec.
907
- * @param e The error to parse
908
- * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)
909
- * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
910
- */
911
- exposeLogicError(e: Error, isClearStateProgram?: boolean): Error;
912
- /**
913
- * Export the current source maps for the app.
914
- * @returns The source maps
915
- */
916
- exportSourceMaps(): AppSourceMaps;
917
- /**
918
- * Import source maps for the app.
919
- * @param sourceMaps The source maps to import
920
- */
921
- importSourceMaps(sourceMaps: AppSourceMaps): void;
922
- private getDeployTimeControl;
923
- private getParamsMethods;
924
- /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */
925
- private handleCallErrors;
926
- /**
927
- * Compiles the approval and clear state programs (if TEAL templates provided),
928
- * performing any provided deploy-time parameter replacement and stores
929
- * the source maps.
930
- *
931
- * If no TEAL templates provided it will use any byte code provided in the app spec.
932
- *
933
- * Will store any generated source maps for later use in debugging.
934
- * @param compilation Optional compilation parameters to use for the compilation
935
- * @returns The compilation result
936
- * @example
937
- * ```typescript
938
- * const result = await factory.compile()
939
- * ```
940
- */
941
- compile(compilation?: AppClientCompilationParams): Promise<import("./app-client").AppClientCompilationResult>;
942
- private getBareParams;
943
- private getABIParams;
944
- private getCreateABIArgsWithDefaultValues;
945
- /** Returns the sender for a call, using the `defaultSender`
946
- * if none provided and throws an error if neither provided */
947
- private getSender;
948
- /** Returns the signer for a call, using the provided signer or the `defaultSigner`
949
- * if no signer was provided and the sender resolves to the default sender, the call will use default signer
950
- * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */
951
- private getSigner;
550
+ }>;
551
+ };
952
552
  /**
953
- * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type
954
- * on the ARC-56 method.
553
+ * Creates an instance of the app and returns the result of the creation
554
+ * transaction and an app client to interact with that app instance.
955
555
  *
956
- * If the return type is a struct then the struct will be returned.
957
- *
958
- * @param result The SendAppTransactionResult to be mapped
959
- * @param method The method that was called
960
- * @returns The smart contract response with an updated return value
556
+ * Performs deploy-time TEAL template placeholder substitutions (if specified).
557
+ * @param params The parameters to create the app
558
+ * @returns The app client and the result of the creation transaction
961
559
  */
962
- parseMethodCallReturn<TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, TResult extends SendAppTransactionResult = SendAppTransactionResult>(result: Promise<TResult> | TResult, method: Arc56Method): Promise<Omit<TResult, 'return'> & AppReturn<TReturn>>;
560
+ create: (params: AppFactoryCreateMethodCallParams & SendParams) => Promise<{
561
+ appClient: AppClient;
562
+ result: {
563
+ compiledApproval?: CompiledTeal | undefined;
564
+ compiledClear?: CompiledTeal | undefined;
565
+ appId: bigint;
566
+ groupId: string;
567
+ txIds: string[];
568
+ returns?: ABIReturn[] | undefined;
569
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
570
+ transactions: algosdk.Transaction[];
571
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
572
+ transaction: algosdk.Transaction;
573
+ appAddress: Address;
574
+ return?: algosdk.ABIValue | Uint8Array<ArrayBufferLike> | ABIStruct | undefined;
575
+ };
576
+ }>;
577
+ };
578
+ /**
579
+ * Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified).
580
+ *
581
+ * **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`.
582
+ *
583
+ * **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.
584
+ *
585
+ * **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.
586
+ * @param params The arguments to control the app deployment
587
+ * @returns The app client and the result of the deployment
588
+ * @example
589
+ * ```ts
590
+ * const { appClient, result } = await factory.deploy({
591
+ * createParams: {
592
+ * sender: 'SENDER_ADDRESS',
593
+ * approvalProgram: 'APPROVAL PROGRAM',
594
+ * clearStateProgram: 'CLEAR PROGRAM',
595
+ * schema: {
596
+ * globalByteSlices: 0,
597
+ * globalInts: 0,
598
+ * localByteSlices: 0,
599
+ * localInts: 0
600
+ * }
601
+ * },
602
+ * updateParams: {
603
+ * sender: 'SENDER_ADDRESS'
604
+ * },
605
+ * deleteParams: {
606
+ * sender: 'SENDER_ADDRESS'
607
+ * },
608
+ * metadata: { name: 'my_app', version: '2.0', updatable: false, deletable: false },
609
+ * onSchemaBreak: 'append',
610
+ * onUpdate: 'append'
611
+ * })
612
+ * ```
613
+ */
614
+ deploy(params: AppFactoryDeployParams): Promise<{
615
+ appClient: AppClient;
616
+ result: {
617
+ return: algosdk.ABIValue | ABIStruct | undefined;
618
+ deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
619
+ compiledApproval?: CompiledTeal | undefined;
620
+ compiledClear?: CompiledTeal | undefined;
621
+ operationPerformed: "create";
622
+ name: string;
623
+ updatable?: boolean | undefined;
624
+ deletable?: boolean | undefined;
625
+ createdRound: bigint;
626
+ updatedRound: bigint;
627
+ createdMetadata: AppDeployMetadata;
628
+ deleted: boolean;
629
+ version: string;
630
+ groupId: string;
631
+ txIds: string[];
632
+ returns?: ABIReturn[] | undefined;
633
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
634
+ transactions: algosdk.Transaction[];
635
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
636
+ transaction: algosdk.Transaction;
637
+ appId: bigint;
638
+ appAddress: Address;
639
+ } | {
640
+ return: algosdk.ABIValue | ABIStruct | undefined;
641
+ deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
642
+ compiledApproval?: CompiledTeal | undefined;
643
+ compiledClear?: CompiledTeal | undefined;
644
+ operationPerformed: "update";
645
+ appId: bigint;
646
+ appAddress: Address;
647
+ createdRound: bigint;
648
+ updatedRound: bigint;
649
+ createdMetadata: AppDeployMetadata;
650
+ deleted: boolean;
651
+ name: string;
652
+ version: string;
653
+ deletable?: boolean | undefined;
654
+ updatable?: boolean | undefined;
655
+ groupId: string;
656
+ txIds: string[];
657
+ returns?: ABIReturn[] | undefined;
658
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
659
+ transactions: algosdk.Transaction[];
660
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
661
+ transaction: algosdk.Transaction;
662
+ } | {
663
+ return: algosdk.ABIValue | ABIStruct | undefined;
664
+ deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
665
+ compiledApproval?: CompiledTeal | undefined;
666
+ compiledClear?: CompiledTeal | undefined;
667
+ operationPerformed: "replace";
668
+ name: string;
669
+ updatable?: boolean | undefined;
670
+ deletable?: boolean | undefined;
671
+ createdRound: bigint;
672
+ updatedRound: bigint;
673
+ createdMetadata: AppDeployMetadata;
674
+ deleted: boolean;
675
+ version: string;
676
+ groupId: string;
677
+ txIds: string[];
678
+ returns?: ABIReturn[] | undefined;
679
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
680
+ transactions: algosdk.Transaction[];
681
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
682
+ transaction: algosdk.Transaction;
683
+ appId: bigint;
684
+ appAddress: Address;
685
+ deleteResult: ConfirmedTransactionResult;
686
+ } | {
687
+ return: algosdk.ABIValue | ABIStruct | undefined;
688
+ deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
689
+ compiledApproval?: CompiledTeal | undefined;
690
+ compiledClear?: CompiledTeal | undefined;
691
+ operationPerformed: "nothing";
692
+ appId: bigint;
693
+ appAddress: Address;
694
+ createdRound: bigint;
695
+ updatedRound: bigint;
696
+ createdMetadata: AppDeployMetadata;
697
+ deleted: boolean;
698
+ name: string;
699
+ version: string;
700
+ deletable?: boolean | undefined;
701
+ updatable?: boolean | undefined;
702
+ };
703
+ }>;
704
+ /**
705
+ * Returns a new `AppClient` client for an app instance of the given ID.
706
+ *
707
+ * Automatically populates appName, defaultSender and source maps from the factory
708
+ * if not specified in the params.
709
+ * @param params The parameters to create the app client
710
+ * @returns The `AppClient` instance
711
+ * @example
712
+ * ```typescript
713
+ * const appClient = factory.getAppClientById({ appId: 12345n })
714
+ * ```
715
+ */
716
+ getAppClientById(params: AppFactoryAppClientParams): AppClient;
717
+ /**
718
+ * Returns a new `AppClient` client, resolving the app by creator address and name
719
+ * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
720
+ *
721
+ * Automatically populates appName, defaultSender and source maps from the factory
722
+ * if not specified in the params.
723
+ * @param params The parameters to create the app client
724
+ * @returns The `AppClient` instance
725
+ * @example
726
+ * ```typescript
727
+ * const appClient = factory.getAppClientByCreatorAndName({ creatorAddress: 'CREATOR_ADDRESS', appName: 'my_app' })
728
+ * ```
729
+ */
730
+ getAppClientByCreatorAndName(params: AppFactoryResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
731
+ /**
732
+ * Takes an error that may include a logic error from a call to the current app and re-exposes the
733
+ * error to include source code information via the source map and ARC-56 spec.
734
+ * @param e The error to parse
735
+ * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)
736
+ * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
737
+ */
738
+ exposeLogicError(e: Error, isClearStateProgram?: boolean): Error;
739
+ /**
740
+ * Export the current source maps for the app.
741
+ * @returns The source maps
742
+ */
743
+ exportSourceMaps(): AppSourceMaps;
744
+ /**
745
+ * Import source maps for the app.
746
+ * @param sourceMaps The source maps to import
747
+ */
748
+ importSourceMaps(sourceMaps: AppSourceMaps): void;
749
+ private getDeployTimeControl;
750
+ private getParamsMethods;
751
+ /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */
752
+ private handleCallErrors;
753
+ /**
754
+ * Compiles the approval and clear state programs (if TEAL templates provided),
755
+ * performing any provided deploy-time parameter replacement and stores
756
+ * the source maps.
757
+ *
758
+ * If no TEAL templates provided it will use any byte code provided in the app spec.
759
+ *
760
+ * Will store any generated source maps for later use in debugging.
761
+ * @param compilation Optional compilation parameters to use for the compilation
762
+ * @returns The compilation result
763
+ * @example
764
+ * ```typescript
765
+ * const result = await factory.compile()
766
+ * ```
767
+ */
768
+ compile(compilation?: AppClientCompilationParams): Promise<AppClientCompilationResult>;
769
+ private getBareParams;
770
+ private getABIParams;
771
+ private getCreateABIArgsWithDefaultValues;
772
+ /** Returns the sender for a call, using the `defaultSender`
773
+ * if none provided and throws an error if neither provided */
774
+ private getSender;
775
+ /** Returns the signer for a call, using the provided signer or the `defaultSigner`
776
+ * if no signer was provided and the sender resolves to the default sender, the call will use default signer
777
+ * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */
778
+ private getSigner;
779
+ /**
780
+ * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type
781
+ * on the ARC-56 method.
782
+ *
783
+ * If the return type is a struct then the struct will be returned.
784
+ *
785
+ * @param result The SendAppTransactionResult to be mapped
786
+ * @param method The method that was called
787
+ * @returns The smart contract response with an updated return value
788
+ */
789
+ parseMethodCallReturn<TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, TResult extends SendAppTransactionResult = SendAppTransactionResult>(result: Promise<TResult> | TResult, method: Arc56Method): Promise<Omit<TResult, 'return'> & AppReturn<TReturn>>;
963
790
  }
791
+ //#endregion
792
+ export { AppFactory, AppFactoryAppClientParams, AppFactoryCreateMethodCallParams, AppFactoryCreateParams, AppFactoryDeployParams, AppFactoryParams, AppFactoryResolveAppClientByCreatorAndNameParams, CreateOnComplete, CreateSchema };
793
+ //# sourceMappingURL=app-factory.d.ts.map