@algorandfoundation/algokit-utils 7.0.0-beta.5 → 7.0.0-beta.7

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 (324) hide show
  1. package/README.md +2 -24
  2. package/account/account.d.ts +1 -2
  3. package/account/account.js.map +1 -1
  4. package/account/account.mjs.map +1 -1
  5. package/account/get-account-config-from-environment.d.ts +0 -1
  6. package/account/get-account-config-from-environment.js.map +1 -1
  7. package/account/get-account-config-from-environment.mjs.map +1 -1
  8. package/account/get-account.d.ts +0 -1
  9. package/account/get-account.js.map +1 -1
  10. package/account/get-account.mjs.map +1 -1
  11. package/account/get-dispenser-account.d.ts +0 -1
  12. package/account/get-dispenser-account.js.map +1 -1
  13. package/account/get-dispenser-account.mjs.map +1 -1
  14. package/account/index.d.ts +0 -1
  15. package/account/mnemonic-account.d.ts +0 -1
  16. package/account/mnemonic-account.js.map +1 -1
  17. package/account/mnemonic-account.mjs.map +1 -1
  18. package/amount.d.ts +0 -1
  19. package/amount.js.map +1 -1
  20. package/amount.mjs.map +1 -1
  21. package/app-client.d.ts +0 -1
  22. package/app-client.js.map +1 -1
  23. package/app-client.mjs.map +1 -1
  24. package/app-deploy.d.ts +0 -1
  25. package/app-deploy.js.map +1 -1
  26. package/app-deploy.mjs.map +1 -1
  27. package/app.d.ts +6 -7
  28. package/app.js +6 -6
  29. package/app.js.map +1 -1
  30. package/app.mjs +6 -6
  31. package/app.mjs.map +1 -1
  32. package/asset.d.ts +3 -4
  33. package/asset.js +3 -3
  34. package/asset.js.map +1 -1
  35. package/asset.mjs +3 -3
  36. package/asset.mjs.map +1 -1
  37. package/config.d.ts +0 -1
  38. package/config.js.map +1 -1
  39. package/config.mjs.map +1 -1
  40. package/debugging/debugging.d.ts +3 -5
  41. package/debugging/debugging.js +4 -127
  42. package/debugging/debugging.js.map +1 -1
  43. package/debugging/debugging.mjs +4 -108
  44. package/debugging/debugging.mjs.map +1 -1
  45. package/debugging/index.d.ts +0 -2
  46. package/dispenser-client.d.ts +0 -1
  47. package/dispenser-client.js.map +1 -1
  48. package/dispenser-client.mjs.map +1 -1
  49. package/index.d.ts +1 -1
  50. package/index.js +6 -2
  51. package/index.js.map +1 -1
  52. package/index.mjs +1 -1
  53. package/indexer-lookup.d.ts +0 -1
  54. package/indexer-lookup.js.map +1 -1
  55. package/indexer-lookup.mjs.map +1 -1
  56. package/localnet/get-kmd-wallet-account.d.ts +0 -1
  57. package/localnet/get-kmd-wallet-account.js.map +1 -1
  58. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  59. package/localnet/get-localnet-dispenser-account.d.ts +0 -1
  60. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  61. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  62. package/localnet/get-or-create-kmd-wallet-account.d.ts +0 -1
  63. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  64. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  65. package/localnet/index.d.ts +0 -1
  66. package/localnet/is-localnet.d.ts +0 -1
  67. package/localnet/is-localnet.js.map +1 -1
  68. package/localnet/is-localnet.mjs.map +1 -1
  69. package/network-client.d.ts +0 -1
  70. package/network-client.js.map +1 -1
  71. package/network-client.mjs.map +1 -1
  72. package/package.json +1 -1
  73. package/testing/_asset.d.ts +0 -1
  74. package/testing/account.d.ts +0 -1
  75. package/testing/account.js.map +1 -1
  76. package/testing/account.mjs.map +1 -1
  77. package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
  78. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  79. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  80. package/testing/fixtures/algorand-fixture.d.ts +0 -1
  81. package/testing/fixtures/algorand-fixture.js +1 -1
  82. package/testing/fixtures/algorand-fixture.js.map +1 -1
  83. package/testing/fixtures/algorand-fixture.mjs +1 -1
  84. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  85. package/testing/fixtures/index.d.ts +0 -1
  86. package/testing/index.d.ts +0 -1
  87. package/testing/indexer.d.ts +0 -1
  88. package/testing/indexer.js.map +1 -1
  89. package/testing/indexer.mjs.map +1 -1
  90. package/testing/test-logger.d.ts +0 -1
  91. package/testing/test-logger.js.map +1 -1
  92. package/testing/test-logger.mjs.map +1 -1
  93. package/testing/transaction-logger.d.ts +0 -1
  94. package/testing/transaction-logger.js.map +1 -1
  95. package/testing/transaction-logger.mjs.map +1 -1
  96. package/transaction/index.d.ts +0 -1
  97. package/transaction/legacy-bridge.d.ts +3 -4
  98. package/transaction/legacy-bridge.js.map +1 -1
  99. package/transaction/legacy-bridge.mjs.map +1 -1
  100. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
  101. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  102. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  103. package/transaction/transaction.d.ts +1 -4
  104. package/transaction/transaction.js +26 -31
  105. package/transaction/transaction.js.map +1 -1
  106. package/transaction/transaction.mjs +26 -31
  107. package/transaction/transaction.mjs.map +1 -1
  108. package/transfer/index.d.ts +0 -1
  109. package/transfer/transfer-algos.d.ts +1 -2
  110. package/transfer/transfer-algos.js +1 -1
  111. package/transfer/transfer-algos.js.map +1 -1
  112. package/transfer/transfer-algos.mjs +1 -1
  113. package/transfer/transfer-algos.mjs.map +1 -1
  114. package/transfer/transfer.d.ts +1 -2
  115. package/transfer/transfer.js +1 -1
  116. package/transfer/transfer.js.map +1 -1
  117. package/transfer/transfer.mjs +1 -1
  118. package/transfer/transfer.mjs.map +1 -1
  119. package/types/account-manager.d.ts +13 -5
  120. package/types/account-manager.js +17 -3
  121. package/types/account-manager.js.map +1 -1
  122. package/types/account-manager.mjs +17 -3
  123. package/types/account-manager.mjs.map +1 -1
  124. package/types/account.d.ts +0 -1
  125. package/types/account.js.map +1 -1
  126. package/types/account.mjs.map +1 -1
  127. package/types/algo-http-client-with-retry.d.ts +0 -1
  128. package/types/algo-http-client-with-retry.js.map +1 -1
  129. package/types/algo-http-client-with-retry.mjs.map +1 -1
  130. package/types/algorand-client-interface.d.ts +1 -2
  131. package/types/algorand-client-transaction-creator.d.ts +30 -31
  132. package/types/algorand-client-transaction-creator.js +30 -30
  133. package/types/algorand-client-transaction-creator.js.map +1 -1
  134. package/types/algorand-client-transaction-creator.mjs +30 -30
  135. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  136. package/types/algorand-client-transaction-sender.d.ts +19 -20
  137. package/types/algorand-client-transaction-sender.js +2 -2
  138. package/types/algorand-client-transaction-sender.js.map +1 -1
  139. package/types/algorand-client-transaction-sender.mjs +2 -2
  140. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  141. package/types/algorand-client.d.ts +8 -9
  142. package/types/algorand-client.js +8 -8
  143. package/types/algorand-client.js.map +1 -1
  144. package/types/algorand-client.mjs +8 -8
  145. package/types/algorand-client.mjs.map +1 -1
  146. package/types/amount.d.ts +0 -1
  147. package/types/amount.js.map +1 -1
  148. package/types/amount.mjs.map +1 -1
  149. package/types/app-arc56.d.ts +60 -38
  150. package/types/app-arc56.js +37 -16
  151. package/types/app-arc56.js.map +1 -1
  152. package/types/app-arc56.mjs +37 -16
  153. package/types/app-arc56.mjs.map +1 -1
  154. package/types/app-client.d.ts +100 -75
  155. package/types/app-client.js +154 -101
  156. package/types/app-client.js.map +1 -1
  157. package/types/app-client.mjs +154 -101
  158. package/types/app-client.mjs.map +1 -1
  159. package/types/app-deployer.d.ts +2 -3
  160. package/types/app-deployer.js +24 -24
  161. package/types/app-deployer.js.map +1 -1
  162. package/types/app-deployer.mjs +24 -24
  163. package/types/app-deployer.mjs.map +1 -1
  164. package/types/app-factory.d.ts +141 -87
  165. package/types/app-factory.js +106 -34
  166. package/types/app-factory.js.map +1 -1
  167. package/types/app-factory.mjs +107 -35
  168. package/types/app-factory.mjs.map +1 -1
  169. package/types/app-manager.d.ts +0 -1
  170. package/types/app-manager.js.map +1 -1
  171. package/types/app-manager.mjs.map +1 -1
  172. package/types/app-spec.d.ts +0 -1
  173. package/types/app-spec.js +15 -9
  174. package/types/app-spec.js.map +1 -1
  175. package/types/app-spec.mjs +15 -9
  176. package/types/app-spec.mjs.map +1 -1
  177. package/types/app.d.ts +0 -1
  178. package/types/app.js.map +1 -1
  179. package/types/app.mjs.map +1 -1
  180. package/types/asset-manager.d.ts +3 -4
  181. package/types/asset-manager.js +3 -3
  182. package/types/asset-manager.js.map +1 -1
  183. package/types/asset-manager.mjs +3 -3
  184. package/types/asset-manager.mjs.map +1 -1
  185. package/types/asset.d.ts +0 -1
  186. package/types/async-event-emitter.d.ts +23 -0
  187. package/types/async-event-emitter.js +55 -0
  188. package/types/async-event-emitter.js.map +1 -0
  189. package/types/async-event-emitter.mjs +53 -0
  190. package/types/async-event-emitter.mjs.map +1 -0
  191. package/types/client-manager.d.ts +30 -9
  192. package/types/client-manager.js +6 -0
  193. package/types/client-manager.js.map +1 -1
  194. package/types/client-manager.mjs +6 -0
  195. package/types/client-manager.mjs.map +1 -1
  196. package/types/composer.d.ts +57 -5
  197. package/types/composer.js +30 -14
  198. package/types/composer.js.map +1 -1
  199. package/types/composer.mjs +30 -14
  200. package/types/composer.mjs.map +1 -1
  201. package/types/config.d.ts +3 -6
  202. package/types/config.js +5 -44
  203. package/types/config.js.map +1 -1
  204. package/types/config.mjs +5 -27
  205. package/types/config.mjs.map +1 -1
  206. package/types/debugging.d.ts +29 -102
  207. package/types/debugging.js +16 -109
  208. package/types/debugging.js.map +1 -1
  209. package/types/debugging.mjs +12 -107
  210. package/types/debugging.mjs.map +1 -1
  211. package/types/dispenser-client.d.ts +0 -1
  212. package/types/dispenser-client.js +5 -4
  213. package/types/dispenser-client.js.map +1 -1
  214. package/types/dispenser-client.mjs +5 -4
  215. package/types/dispenser-client.mjs.map +1 -1
  216. package/types/expand.d.ts +0 -1
  217. package/types/indexer.d.ts +0 -1
  218. package/types/indexer.js.map +1 -1
  219. package/types/indexer.mjs.map +1 -1
  220. package/types/kmd-account-manager.d.ts +0 -1
  221. package/types/kmd-account-manager.js +2 -2
  222. package/types/kmd-account-manager.js.map +1 -1
  223. package/types/kmd-account-manager.mjs +2 -2
  224. package/types/kmd-account-manager.mjs.map +1 -1
  225. package/types/logging.d.ts +0 -1
  226. package/types/logging.js.map +1 -1
  227. package/types/logging.mjs.map +1 -1
  228. package/types/logic-error.d.ts +0 -1
  229. package/types/logic-error.js.map +1 -1
  230. package/types/logic-error.mjs.map +1 -1
  231. package/types/network-client.d.ts +0 -1
  232. package/types/network-client.js.map +1 -1
  233. package/types/network-client.mjs.map +1 -1
  234. package/types/testing.d.ts +0 -1
  235. package/types/transaction.d.ts +4 -7
  236. package/types/transfer.d.ts +0 -1
  237. package/types/urlTokenBaseHTTPClient.d.ts +0 -1
  238. package/types/urlTokenBaseHTTPClient.js +1 -1
  239. package/types/urlTokenBaseHTTPClient.js.map +1 -1
  240. package/types/urlTokenBaseHTTPClient.mjs +1 -1
  241. package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
  242. package/util.d.ts +0 -1
  243. package/util.js +0 -9
  244. package/util.js.map +1 -1
  245. package/util.mjs +1 -9
  246. package/util.mjs.map +1 -1
  247. package/account/account.d.ts.map +0 -1
  248. package/account/get-account-config-from-environment.d.ts.map +0 -1
  249. package/account/get-account.d.ts.map +0 -1
  250. package/account/get-dispenser-account.d.ts.map +0 -1
  251. package/account/index.d.ts.map +0 -1
  252. package/account/mnemonic-account.d.ts.map +0 -1
  253. package/amount.d.ts.map +0 -1
  254. package/app-client.d.ts.map +0 -1
  255. package/app-deploy.d.ts.map +0 -1
  256. package/app.d.ts.map +0 -1
  257. package/asset.d.ts.map +0 -1
  258. package/config.d.ts.map +0 -1
  259. package/debugging/debugging.d.ts.map +0 -1
  260. package/debugging/index.d.ts.map +0 -1
  261. package/debugging/simulate-and-persist-response.d.ts +0 -20
  262. package/debugging/simulate-and-persist-response.d.ts.map +0 -1
  263. package/debugging/simulate-and-persist-response.js +0 -108
  264. package/debugging/simulate-and-persist-response.js.map +0 -1
  265. package/debugging/simulate-and-persist-response.mjs +0 -89
  266. package/debugging/simulate-and-persist-response.mjs.map +0 -1
  267. package/dispenser-client.d.ts.map +0 -1
  268. package/index.d.ts.map +0 -1
  269. package/indexer-lookup.d.ts.map +0 -1
  270. package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
  271. package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
  272. package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
  273. package/localnet/index.d.ts.map +0 -1
  274. package/localnet/is-localnet.d.ts.map +0 -1
  275. package/network-client.d.ts.map +0 -1
  276. package/testing/_asset.d.ts.map +0 -1
  277. package/testing/account.d.ts.map +0 -1
  278. package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
  279. package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
  280. package/testing/fixtures/index.d.ts.map +0 -1
  281. package/testing/index.d.ts.map +0 -1
  282. package/testing/indexer.d.ts.map +0 -1
  283. package/testing/test-logger.d.ts.map +0 -1
  284. package/testing/transaction-logger.d.ts.map +0 -1
  285. package/transaction/index.d.ts.map +0 -1
  286. package/transaction/legacy-bridge.d.ts.map +0 -1
  287. package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
  288. package/transaction/transaction.d.ts.map +0 -1
  289. package/transfer/index.d.ts.map +0 -1
  290. package/transfer/transfer-algos.d.ts.map +0 -1
  291. package/transfer/transfer.d.ts.map +0 -1
  292. package/types/account-manager.d.ts.map +0 -1
  293. package/types/account.d.ts.map +0 -1
  294. package/types/algo-http-client-with-retry.d.ts.map +0 -1
  295. package/types/algorand-client-interface.d.ts.map +0 -1
  296. package/types/algorand-client-transaction-creator.d.ts.map +0 -1
  297. package/types/algorand-client-transaction-sender.d.ts.map +0 -1
  298. package/types/algorand-client.d.ts.map +0 -1
  299. package/types/amount.d.ts.map +0 -1
  300. package/types/app-arc56.d.ts.map +0 -1
  301. package/types/app-client.d.ts.map +0 -1
  302. package/types/app-deployer.d.ts.map +0 -1
  303. package/types/app-factory.d.ts.map +0 -1
  304. package/types/app-manager.d.ts.map +0 -1
  305. package/types/app-spec.d.ts.map +0 -1
  306. package/types/app.d.ts.map +0 -1
  307. package/types/asset-manager.d.ts.map +0 -1
  308. package/types/asset.d.ts.map +0 -1
  309. package/types/client-manager.d.ts.map +0 -1
  310. package/types/composer.d.ts.map +0 -1
  311. package/types/config.d.ts.map +0 -1
  312. package/types/debugging.d.ts.map +0 -1
  313. package/types/dispenser-client.d.ts.map +0 -1
  314. package/types/expand.d.ts.map +0 -1
  315. package/types/indexer.d.ts.map +0 -1
  316. package/types/kmd-account-manager.d.ts.map +0 -1
  317. package/types/logging.d.ts.map +0 -1
  318. package/types/logic-error.d.ts.map +0 -1
  319. package/types/network-client.d.ts.map +0 -1
  320. package/types/testing.d.ts.map +0 -1
  321. package/types/transaction.d.ts.map +0 -1
  322. package/types/transfer.d.ts.map +0 -1
  323. package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
  324. package/util.d.ts.map +0 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import algosdk from 'algosdk';
3
2
  import { AlgorandClientInterface } from './algorand-client-interface';
4
3
  import { AppReturn, SendAppTransactionResult, TealTemplateParams } from './app';
@@ -6,8 +5,9 @@ import { ABIStruct, Arc56Contract, Arc56Method } from './app-arc56';
6
5
  import { AppClient, AppClientBareCallParams, AppClientCompilationParams, AppClientMethodCallParams, AppClientParams, AppSourceMaps, ResolveAppClientByCreatorAndName } from './app-client';
7
6
  import { AppDeployParams } from './app-deployer';
8
7
  import { AppSpec } from './app-spec';
8
+ import { AppMethodCall, AppMethodCallTransactionArgument } from './composer';
9
9
  import { Expand } from './expand';
10
- import { ExecuteParams } from './transaction';
10
+ import { SendParams } from './transaction';
11
11
  import OnApplicationComplete = algosdk.OnApplicationComplete;
12
12
  import ABIValue = algosdk.ABIValue;
13
13
  /** Parameters to create an app client */
@@ -76,8 +76,14 @@ export type CreateSchema = {
76
76
  * This is immutable once the app is created. */
77
77
  extraProgramPages?: number;
78
78
  };
79
- /** Parameters to define a create call for an `AppFactory` */
80
- export type AppFactoryCreateParams = Expand<AppClientMethodCallParams & AppClientCompilationParams & CreateOnComplete & ExecuteParams & CreateSchema> | Expand<AppClientBareCallParams & AppClientCompilationParams & CreateOnComplete & ExecuteParams & CreateSchema>;
79
+ /** Params to specify a bare (raw) create call for an app */
80
+ export type AppFactoryCreateParams = Expand<AppClientBareCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>;
81
+ /** Params to specify a create method call for an app */
82
+ export type AppFactoryCreateMethodCallParams = Expand<AppClientMethodCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>;
83
+ /** Params to get an app client by ID from an app factory. */
84
+ export type AppFactoryAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
85
+ /** Params to get an app client by creator address and name from an app factory. */
86
+ export type AppFactoryResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
81
87
  /** Parameters to define a deployment for an `AppFactory` */
82
88
  export type AppFactoryDeployParams = Expand<Omit<AppDeployParams, 'createParams' | 'updateParams' | 'deleteParams' | 'metadata'> & {
83
89
  /** Create transaction parameters to use if a create needs to be issued as part of deployment */
@@ -115,7 +121,21 @@ export declare class AppFactory {
115
121
  private _clearSourceMap;
116
122
  private _paramsMethods;
117
123
  constructor(params: AppFactoryParams);
118
- /** Get parameters to define create and deploy related calls to the current app */
124
+ /** Get parameters to create transactions (create and deploy related calls) for the current app.
125
+ *
126
+ * A good mental model for this is that these parameters represent a deferred transaction creation.
127
+ * @example Create a transaction in the future using Algorand Client
128
+ * ```typescript
129
+ * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
130
+ * // ...
131
+ * await algorand.send.AppCreateMethodCall(createAppParams)
132
+ * ```
133
+ * @example Define a nested transaction as an ABI argument
134
+ * ```typescript
135
+ * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
136
+ * await appClient.send.call({method: 'my_method', args: [createAppParams]})
137
+ * ```
138
+ */
119
139
  get params(): {
120
140
  /** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */
121
141
  create: (params: {
@@ -136,7 +156,7 @@ export declare class AppFactory {
136
156
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
137
157
  sender?: string | undefined;
138
158
  method: string;
139
- args?: (algosdk.ABIValue | import("./composer").AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
159
+ args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
140
160
  deployTimeParams?: TealTemplateParams | undefined;
141
161
  updatable?: boolean | undefined;
142
162
  deletable?: boolean | undefined;
@@ -152,10 +172,10 @@ export declare class AppFactory {
152
172
  } | undefined;
153
173
  extraProgramPages?: number | undefined;
154
174
  }) => Promise<({
155
- approvalProgram: Buffer;
156
- clearStateProgram: Buffer;
157
- compiledApproval?: undefined;
158
- compiledClear?: undefined;
175
+ approvalProgram: Uint8Array;
176
+ compiledApproval: undefined;
177
+ clearStateProgram: Uint8Array;
178
+ compiledClear: undefined;
159
179
  deployTimeParams: TealTemplateParams | undefined;
160
180
  schema: {
161
181
  /** The number of integers saved in global state. */
@@ -184,7 +204,7 @@ export declare class AppFactory {
184
204
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
185
205
  sender?: string | undefined;
186
206
  method: string;
187
- args?: (algosdk.ABIValue | import("./composer").AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
207
+ args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
188
208
  updatable?: boolean | undefined;
189
209
  deletable?: boolean | undefined;
190
210
  extraProgramPages?: number | undefined;
@@ -221,14 +241,14 @@ export declare class AppFactory {
221
241
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
222
242
  sender?: string | undefined;
223
243
  method: string;
224
- args?: (algosdk.ABIValue | import("./composer").AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
244
+ args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
225
245
  updatable?: boolean | undefined;
226
246
  deletable?: boolean | undefined;
227
247
  extraProgramPages?: number | undefined;
228
248
  }) & {
229
249
  sender: string;
230
250
  method: Arc56Method;
231
- args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | import("./composer").AppMethodCall<{
251
+ args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | AppMethodCall<{
232
252
  lease?: string | Uint8Array | undefined;
233
253
  note?: string | Uint8Array | undefined;
234
254
  maxFee?: import("./amount").AlgoAmount | undefined;
@@ -255,7 +275,7 @@ export declare class AppFactory {
255
275
  localByteSlices: number;
256
276
  } | undefined;
257
277
  extraProgramPages?: number | undefined;
258
- }> | import("./composer").AppMethodCall<{
278
+ }> | AppMethodCall<{
259
279
  sender: string;
260
280
  signer?: algosdk.TransactionSigner | import("./account").TransactionSignerAccount | undefined;
261
281
  rekeyTo?: string | undefined;
@@ -276,7 +296,7 @@ export declare class AppFactory {
276
296
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
277
297
  approvalProgram: string | Uint8Array;
278
298
  clearStateProgram: string | Uint8Array;
279
- }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
299
+ }> | AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
280
300
  onComplete: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC;
281
301
  }>;
282
302
  /** Return params for a deployment update ABI call */
@@ -298,7 +318,7 @@ export declare class AppFactory {
298
318
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
299
319
  sender?: string | undefined;
300
320
  method: string;
301
- args?: (algosdk.ABIValue | import("./composer").AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
321
+ args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
302
322
  }) => {
303
323
  lease?: string | Uint8Array | undefined;
304
324
  note?: string | Uint8Array | undefined;
@@ -317,11 +337,11 @@ export declare class AppFactory {
317
337
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
318
338
  sender?: string | undefined;
319
339
  method: string;
320
- args?: (algosdk.ABIValue | import("./composer").AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
340
+ args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
321
341
  } & {
322
342
  sender: string;
323
343
  method: Arc56Method;
324
- args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | import("./composer").AppMethodCall<{
344
+ args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | AppMethodCall<{
325
345
  lease?: string | Uint8Array | undefined;
326
346
  note?: string | Uint8Array | undefined;
327
347
  maxFee?: import("./amount").AlgoAmount | undefined;
@@ -348,7 +368,7 @@ export declare class AppFactory {
348
368
  localByteSlices: number;
349
369
  } | undefined;
350
370
  extraProgramPages?: number | undefined;
351
- }> | import("./composer").AppMethodCall<{
371
+ }> | AppMethodCall<{
352
372
  sender: string;
353
373
  signer?: algosdk.TransactionSigner | import("./account").TransactionSignerAccount | undefined;
354
374
  rekeyTo?: string | undefined;
@@ -369,7 +389,7 @@ export declare class AppFactory {
369
389
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
370
390
  approvalProgram: string | Uint8Array;
371
391
  clearStateProgram: string | Uint8Array;
372
- }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
392
+ }> | AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
373
393
  onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC;
374
394
  };
375
395
  /** Return params for a deployment delete ABI call */
@@ -391,7 +411,7 @@ export declare class AppFactory {
391
411
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
392
412
  sender?: string | undefined;
393
413
  method: string;
394
- args?: (algosdk.ABIValue | import("./composer").AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
414
+ args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
395
415
  }) => {
396
416
  lease?: string | Uint8Array | undefined;
397
417
  note?: string | Uint8Array | undefined;
@@ -410,11 +430,11 @@ export declare class AppFactory {
410
430
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
411
431
  sender?: string | undefined;
412
432
  method: string;
413
- args?: (algosdk.ABIValue | import("./composer").AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
433
+ args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
414
434
  } & {
415
435
  sender: string;
416
436
  method: Arc56Method;
417
- args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | import("./composer").AppMethodCall<{
437
+ args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | AppMethodCall<{
418
438
  lease?: string | Uint8Array | undefined;
419
439
  note?: string | Uint8Array | undefined;
420
440
  maxFee?: import("./amount").AlgoAmount | undefined;
@@ -441,7 +461,7 @@ export declare class AppFactory {
441
461
  localByteSlices: number;
442
462
  } | undefined;
443
463
  extraProgramPages?: number | undefined;
444
- }> | import("./composer").AppMethodCall<{
464
+ }> | AppMethodCall<{
445
465
  sender: string;
446
466
  signer?: algosdk.TransactionSigner | import("./account").TransactionSignerAccount | undefined;
447
467
  rekeyTo?: string | undefined;
@@ -462,7 +482,7 @@ export declare class AppFactory {
462
482
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
463
483
  approvalProgram: string | Uint8Array;
464
484
  clearStateProgram: string | Uint8Array;
465
- }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
485
+ }> | AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
466
486
  onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC;
467
487
  };
468
488
  bare: {
@@ -500,10 +520,10 @@ export declare class AppFactory {
500
520
  } | undefined;
501
521
  extraProgramPages?: number | undefined;
502
522
  } | undefined) => Promise<({
503
- approvalProgram: Buffer;
504
- clearStateProgram: Buffer;
505
- compiledApproval?: undefined;
506
- compiledClear?: undefined;
523
+ approvalProgram: Uint8Array;
524
+ compiledApproval: undefined;
525
+ clearStateProgram: Uint8Array;
526
+ compiledClear: undefined;
507
527
  deployTimeParams: TealTemplateParams | undefined;
508
528
  schema: {
509
529
  /** The number of integers saved in global state. */
@@ -655,44 +675,68 @@ export declare class AppFactory {
655
675
  };
656
676
  };
657
677
  };
658
- /**
659
- * Creates an instance of the app and returns the result of the creation
660
- * transaction and an app client to interact with that app instance.
661
- *
662
- * Performs deploy-time TEAL template placeholder substitutions (if specified).
663
- * @param params The parameters to create the app
664
- * @returns The app client and the result of the creation transaction
665
- */
666
- create(params?: AppFactoryCreateParams): Promise<{
667
- app: AppClient;
668
- result: {
669
- compiledApproval?: import("./app").CompiledTeal | undefined;
670
- compiledClear?: import("./app").CompiledTeal | undefined;
671
- appId: bigint;
672
- groupId: string;
673
- txIds: string[];
674
- returns?: import("./app").ABIReturn[] | undefined;
675
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
676
- transactions: algosdk.Transaction[];
677
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
678
- transaction: algosdk.Transaction;
679
- appAddress: string;
680
- return?: algosdk.ABIValue | ABIStruct | undefined;
681
- } | {
682
- compiledApproval?: import("./app").CompiledTeal | undefined;
683
- compiledClear?: import("./app").CompiledTeal | undefined;
684
- return: undefined;
685
- groupId: string;
686
- txIds: string[];
687
- returns?: import("./app").ABIReturn[] | undefined;
688
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
678
+ /** Create transactions for the current app */
679
+ readonly createTransaction: {
680
+ /** Create bare (raw) transactions for the current app */
681
+ bare: {
682
+ /** Create a create call transaction, including deploy-time TEAL template replacements and compilation if provided */
683
+ create: (params?: AppFactoryCreateParams) => Promise<algosdk.Transaction>;
684
+ };
685
+ /** Create a create ABI call transaction, including deploy-time TEAL template replacements and compilation if provided */
686
+ create: (params: AppFactoryCreateMethodCallParams) => Promise<{
689
687
  transactions: algosdk.Transaction[];
690
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
691
- transaction: algosdk.Transaction;
692
- appId: bigint;
693
- appAddress: string;
688
+ methodCalls: Map<number, algosdk.ABIMethod>;
689
+ signers: Map<number, algosdk.TransactionSigner>;
690
+ }>;
691
+ };
692
+ /** Send transactions to the current app */
693
+ readonly send: {
694
+ /** Send bare (raw) transactions for the current app */
695
+ bare: {
696
+ create: (params?: AppFactoryCreateParams & SendParams) => Promise<{
697
+ appClient: AppClient;
698
+ result: {
699
+ compiledApproval?: import("./app").CompiledTeal | undefined;
700
+ compiledClear?: import("./app").CompiledTeal | undefined;
701
+ return: undefined;
702
+ groupId: string;
703
+ txIds: string[];
704
+ returns?: import("./app").ABIReturn[] | undefined;
705
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
706
+ transactions: algosdk.Transaction[];
707
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
708
+ transaction: algosdk.Transaction;
709
+ appId: bigint;
710
+ appAddress: string;
711
+ };
712
+ }>;
694
713
  };
695
- }>;
714
+ /**
715
+ * Creates an instance of the app and returns the result of the creation
716
+ * transaction and an app client to interact with that app instance.
717
+ *
718
+ * Performs deploy-time TEAL template placeholder substitutions (if specified).
719
+ * @param params The parameters to create the app
720
+ * @returns The app client and the result of the creation transaction
721
+ */
722
+ create: (params: AppFactoryCreateMethodCallParams & SendParams) => Promise<{
723
+ appClient: AppClient;
724
+ result: {
725
+ compiledApproval?: import("./app").CompiledTeal | undefined;
726
+ compiledClear?: import("./app").CompiledTeal | undefined;
727
+ appId: bigint;
728
+ groupId: string;
729
+ txIds: string[];
730
+ returns?: import("./app").ABIReturn[] | undefined;
731
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
732
+ transactions: algosdk.Transaction[];
733
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
734
+ transaction: algosdk.Transaction;
735
+ appAddress: string;
736
+ return?: algosdk.ABIValue | ABIStruct | undefined;
737
+ };
738
+ }>;
739
+ };
696
740
  /**
697
741
  * 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).
698
742
  *
@@ -705,14 +749,14 @@ export declare class AppFactory {
705
749
  * @returns The app client and the result of the deployment
706
750
  */
707
751
  deploy(params: AppFactoryDeployParams): Promise<{
708
- app: AppClient;
752
+ appClient: AppClient;
709
753
  result: {
710
754
  return: algosdk.ABIValue | ABIStruct | undefined;
711
755
  deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
712
- approvalProgram: Buffer;
713
- clearStateProgram: Buffer;
714
- compiledApproval?: import("./app").CompiledTeal | undefined;
715
- compiledClear?: import("./app").CompiledTeal | undefined;
756
+ approvalProgram: Uint8Array;
757
+ compiledApproval: undefined;
758
+ clearStateProgram: Uint8Array;
759
+ compiledClear: undefined;
716
760
  operationPerformed: "create";
717
761
  version: string;
718
762
  name: string;
@@ -759,10 +803,10 @@ export declare class AppFactory {
759
803
  } | {
760
804
  return: algosdk.ABIValue | ABIStruct | undefined;
761
805
  deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
762
- approvalProgram: Buffer;
763
- clearStateProgram: Buffer;
764
- compiledApproval?: import("./app").CompiledTeal | undefined;
765
- compiledClear?: import("./app").CompiledTeal | undefined;
806
+ approvalProgram: Uint8Array;
807
+ compiledApproval: undefined;
808
+ clearStateProgram: Uint8Array;
809
+ compiledClear: undefined;
766
810
  operationPerformed: "update";
767
811
  appId: bigint;
768
812
  appAddress: string;
@@ -809,10 +853,10 @@ export declare class AppFactory {
809
853
  } | {
810
854
  return: algosdk.ABIValue | ABIStruct | undefined;
811
855
  deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
812
- approvalProgram: Buffer;
813
- clearStateProgram: Buffer;
814
- compiledApproval?: import("./app").CompiledTeal | undefined;
815
- compiledClear?: import("./app").CompiledTeal | undefined;
856
+ approvalProgram: Uint8Array;
857
+ compiledApproval: undefined;
858
+ clearStateProgram: Uint8Array;
859
+ compiledClear: undefined;
816
860
  operationPerformed: "replace";
817
861
  version: string;
818
862
  name: string;
@@ -861,10 +905,10 @@ export declare class AppFactory {
861
905
  } | {
862
906
  return: algosdk.ABIValue | ABIStruct | undefined;
863
907
  deleteReturn: algosdk.ABIValue | ABIStruct | undefined;
864
- approvalProgram: Buffer;
865
- clearStateProgram: Buffer;
866
- compiledApproval?: undefined;
867
- compiledClear?: undefined;
908
+ approvalProgram: Uint8Array;
909
+ compiledApproval: undefined;
910
+ clearStateProgram: Uint8Array;
911
+ compiledClear: undefined;
868
912
  operationPerformed: "nothing";
869
913
  appId: bigint;
870
914
  appAddress: string;
@@ -904,7 +948,7 @@ export declare class AppFactory {
904
948
  * @param params The parameters to create the app client
905
949
  * @returns The `AppClient`
906
950
  */
907
- getAppClientById(params: Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>): AppClient;
951
+ getAppClientById(params: AppFactoryAppClientParams): AppClient;
908
952
  /**
909
953
  * Returns a new `AppClient` client, resolving the app by creator address and name
910
954
  * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
@@ -914,7 +958,7 @@ export declare class AppFactory {
914
958
  * @param params The parameters to create the app client
915
959
  * @returns The `AppClient`
916
960
  */
917
- getAppClientByCreatorAddressAndName(params: Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'> & ResolveAppClientByCreatorAndName>): Promise<AppClient>;
961
+ getAppClientByCreatorAndName(params: AppFactoryResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
918
962
  /**
919
963
  * Takes an error that may include a logic error from a call to the current app and re-exposes the
920
964
  * error to include source code information via the source map and ARC-56 spec.
@@ -946,9 +990,20 @@ export declare class AppFactory {
946
990
  *
947
991
  * Will store any generated source maps for later use in debugging.
948
992
  */
949
- private compile;
993
+ compile(compilation?: AppClientCompilationParams): Promise<{
994
+ approvalProgram: Uint8Array;
995
+ compiledApproval: undefined;
996
+ clearStateProgram: Uint8Array;
997
+ compiledClear: undefined;
998
+ } | {
999
+ approvalProgram: Uint8Array;
1000
+ compiledApproval: import("./app").CompiledTeal;
1001
+ clearStateProgram: Uint8Array;
1002
+ compiledClear: import("./app").CompiledTeal;
1003
+ }>;
950
1004
  private getBareParams;
951
1005
  private getABIParams;
1006
+ private getCreateABIArgsWithDefaultValues;
952
1007
  /** Returns the sender for a call, using the `defaultSender`
953
1008
  * if none provided and throws an error if neither provided */
954
1009
  private getSender;
@@ -962,6 +1017,5 @@ export declare class AppFactory {
962
1017
  * @param method The method that was called
963
1018
  * @returns The smart contract response with an updated return value
964
1019
  */
965
- parseMethodCallReturn<TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, TResult extends SendAppTransactionResult = SendAppTransactionResult>(result: Promise<TResult> | TResult, method: Arc56Method): Promise<Expand<Omit<TResult, 'return'> & AppReturn<TReturn>>>;
1020
+ parseMethodCallReturn<TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, TResult extends SendAppTransactionResult = SendAppTransactionResult>(result: Promise<TResult> | TResult, method: Arc56Method): Promise<Omit<TResult, 'return'> & AppReturn<TReturn>>;
966
1021
  }
967
- //# sourceMappingURL=app-factory.d.ts.map
@@ -14,6 +14,69 @@ var OnApplicationComplete = algosdk.OnApplicationComplete;
14
14
  */
15
15
  class AppFactory {
16
16
  constructor(params) {
17
+ /** Create transactions for the current app */
18
+ this.createTransaction = {
19
+ /** Create bare (raw) transactions for the current app */
20
+ bare: {
21
+ /** Create a create call transaction, including deploy-time TEAL template replacements and compilation if provided */
22
+ create: async (params) => {
23
+ return this._algorand.createTransaction.appCreate(await this.params.bare.create(params));
24
+ },
25
+ },
26
+ /** Create a create ABI call transaction, including deploy-time TEAL template replacements and compilation if provided */
27
+ create: async (params) => {
28
+ return this._algorand.createTransaction.appCreateMethodCall(await this.params.create(params));
29
+ },
30
+ };
31
+ /** Send transactions to the current app */
32
+ this.send = {
33
+ /** Send bare (raw) transactions for the current app */
34
+ bare: {
35
+ create: async (params) => {
36
+ const updatable = params?.updatable ?? this._updatable;
37
+ const deletable = params?.deletable ?? this._deletable;
38
+ const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams;
39
+ const compiled = await this.compile({ deployTimeParams, updatable, deletable });
40
+ const result = await this.handleCallErrors(async () => ({
41
+ ...(await this._algorand.send.appCreate(await this.params.bare.create({ ...params, updatable, deletable, deployTimeParams }))),
42
+ return: undefined,
43
+ }));
44
+ return {
45
+ appClient: this.getAppClientById({
46
+ appId: result.appId,
47
+ }),
48
+ result: {
49
+ ...result,
50
+ ...compiled,
51
+ },
52
+ };
53
+ },
54
+ },
55
+ /**
56
+ * Creates an instance of the app and returns the result of the creation
57
+ * transaction and an app client to interact with that app instance.
58
+ *
59
+ * Performs deploy-time TEAL template placeholder substitutions (if specified).
60
+ * @param params The parameters to create the app
61
+ * @returns The app client and the result of the creation transaction
62
+ */
63
+ create: async (params) => {
64
+ const updatable = params?.updatable ?? this._updatable;
65
+ const deletable = params?.deletable ?? this._deletable;
66
+ const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams;
67
+ const compiled = await this.compile({ deployTimeParams, updatable, deletable });
68
+ const result = await this.handleCallErrors(async () => this.parseMethodCallReturn(this._algorand.send.appCreateMethodCall(await this.params.create({ ...params, updatable, deletable, deployTimeParams })), types_appArc56.getArc56Method(params.method, this._appSpec)));
69
+ return {
70
+ appClient: this.getAppClientById({
71
+ appId: result.appId,
72
+ }),
73
+ result: {
74
+ ...result,
75
+ ...compiled,
76
+ },
77
+ };
78
+ },
79
+ };
17
80
  this._appSpec = types_appClient.AppClient.normaliseAppSpec(params.appSpec);
18
81
  this._appName = params.appName ?? this._appSpec.name;
19
82
  this._algorand = params.algorand;
@@ -24,38 +87,23 @@ class AppFactory {
24
87
  this._deletable = params.deletable;
25
88
  this._paramsMethods = this.getParamsMethods();
26
89
  }
27
- /** Get parameters to define create and deploy related calls to the current app */
28
- get params() {
29
- return this._paramsMethods;
30
- }
31
- /**
32
- * Creates an instance of the app and returns the result of the creation
33
- * transaction and an app client to interact with that app instance.
90
+ /** Get parameters to create transactions (create and deploy related calls) for the current app.
34
91
  *
35
- * Performs deploy-time TEAL template placeholder substitutions (if specified).
36
- * @param params The parameters to create the app
37
- * @returns The app client and the result of the creation transaction
92
+ * A good mental model for this is that these parameters represent a deferred transaction creation.
93
+ * @example Create a transaction in the future using Algorand Client
94
+ * ```typescript
95
+ * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
96
+ * // ...
97
+ * await algorand.send.AppCreateMethodCall(createAppParams)
98
+ * ```
99
+ * @example Define a nested transaction as an ABI argument
100
+ * ```typescript
101
+ * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})
102
+ * await appClient.send.call({method: 'my_method', args: [createAppParams]})
103
+ * ```
38
104
  */
39
- async create(params) {
40
- const updatable = params?.updatable ?? this._updatable;
41
- const deletable = params?.deletable ?? this._deletable;
42
- const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams;
43
- const compiled = await this.compile({ deployTimeParams, updatable, deletable });
44
- const result = await this.handleCallErrors(async () => params && 'method' in params
45
- ? this.parseMethodCallReturn(this._algorand.send.appCreateMethodCall(await this.params.create({ ...params, updatable, deletable, deployTimeParams })), types_appArc56.getArc56Method(params.method, this._appSpec))
46
- : {
47
- ...(await this._algorand.send.appCreate(await this.params.bare.create({ ...params, updatable, deletable, deployTimeParams }))),
48
- return: undefined,
49
- });
50
- return {
51
- app: this.getAppClientById({
52
- appId: result.appId,
53
- }),
54
- result: {
55
- ...result,
56
- ...compiled,
57
- },
58
- };
105
+ get params() {
106
+ return this._paramsMethods;
59
107
  }
60
108
  /**
61
109
  * 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).
@@ -91,7 +139,7 @@ class AppFactory {
91
139
  deletable,
92
140
  },
93
141
  });
94
- const app = this.getAppClientById({
142
+ const appClient = this.getAppClientById({
95
143
  appId: deployResult.appId,
96
144
  });
97
145
  const result = {
@@ -99,7 +147,7 @@ class AppFactory {
99
147
  ...compiled,
100
148
  };
101
149
  return {
102
- app,
150
+ appClient,
103
151
  result: {
104
152
  ...result,
105
153
  return: 'return' in result
@@ -145,7 +193,7 @@ class AppFactory {
145
193
  * @param params The parameters to create the app client
146
194
  * @returns The `AppClient`
147
195
  */
148
- getAppClientByCreatorAddressAndName(params) {
196
+ getAppClientByCreatorAndName(params) {
149
197
  return types_appClient.AppClient.fromCreatorAndName({
150
198
  ...params,
151
199
  algorand: this._algorand,
@@ -290,10 +338,34 @@ class AppFactory {
290
338
  ...params,
291
339
  sender: this.getSender(params.sender),
292
340
  method: types_appArc56.getArc56Method(params.method, this._appSpec),
293
- args: types_appClient.AppClient.getABIArgsWithDefaultValues(params.method, params.args, this._appSpec),
341
+ args: this.getCreateABIArgsWithDefaultValues(params.method, params.args),
294
342
  onComplete,
295
343
  };
296
344
  }
345
+ getCreateABIArgsWithDefaultValues(methodNameOrSignature, args) {
346
+ const m = types_appArc56.getArc56Method(methodNameOrSignature, this._appSpec);
347
+ return args?.map((a, i) => {
348
+ const arg = m.args[i];
349
+ if (a !== undefined) {
350
+ // If a struct then convert to tuple for the underlying call
351
+ return arg.struct && typeof a === 'object' && !Array.isArray(a)
352
+ ? types_appArc56.getABITupleFromABIStruct(a, this._appSpec.structs[arg.struct], this._appSpec.structs)
353
+ : a;
354
+ }
355
+ const defaultValue = arg.defaultValue;
356
+ if (defaultValue) {
357
+ switch (defaultValue.source) {
358
+ case 'literal':
359
+ if (typeof defaultValue.data === 'number')
360
+ return defaultValue.data;
361
+ return types_appArc56.getABIDecodedValue(Buffer.from(defaultValue.data, 'base64'), m.method.args[i].type, this._appSpec.structs);
362
+ default:
363
+ throw new Error(`Can't provide default value for ${defaultValue.source} for a contract creation call`);
364
+ }
365
+ }
366
+ throw new Error(`No value provided for required argument ${arg.name ?? `arg${i + 1}`} in call to method ${m.name}`);
367
+ });
368
+ }
297
369
  /** Returns the sender for a call, using the `defaultSender`
298
370
  * if none provided and throws an error if neither provided */
299
371
  getSender(sender) {