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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,1818 +1,935 @@
1
- import algosdk, { Address } from 'algosdk';
2
- import { TransactionSignerAccount } from './account';
3
- import { type AlgorandClient } from './algorand-client';
4
- import { AlgoAmount } from './amount';
5
- import { ABIAppCallArgs, ABIReturn, AppCallArgs, AppCallTransactionResult, AppCallType, AppCompilationResult, AppMetadata, AppReference, AppReturn, AppState, AppStorageSchema, BoxName, AppLookup as LegacyAppLookup, OnSchemaBreak, OnUpdate, RawAppCallArgs, SendAppTransactionResult, TealTemplateParams } from './app';
6
- import { ABIStruct, Arc56Contract, Arc56Method, ProgramSourceInfo } from './app-arc56';
7
- import { AppLookup } from './app-deployer';
8
- import { AppManager, BoxIdentifier } from './app-manager';
9
- import { AppSpec } from './app-spec';
10
- import { AppCallMethodCall, AppCallParams, AppDeleteMethodCall, AppDeleteParams, AppMethodCall, AppMethodCallTransactionArgument, CommonAppCallParams, PaymentParams } from './composer';
11
- import { Expand } from './expand';
12
- import { SendParams, SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction';
13
- import ABIMethod = algosdk.ABIMethod;
14
- import ABIMethodParams = algosdk.ABIMethodParams;
15
- import ABIType = algosdk.ABIType;
16
- import ABIValue = algosdk.ABIValue;
17
- import Algodv2 = algosdk.Algodv2;
18
- import Indexer = algosdk.Indexer;
19
- import OnApplicationComplete = algosdk.OnApplicationComplete;
20
- import SourceMap = algosdk.ProgramSourceMap;
21
- import SuggestedParams = algosdk.SuggestedParams;
22
- import TransactionSigner = algosdk.TransactionSigner;
1
+ import { AlgoAmount } from "./amount.js";
2
+ import { TransactionSignerAccount } from "./account.js";
3
+ import { Expand } from "./expand.js";
4
+ import { ABIAppCallArgs, ABIReturn, AppCallArgs, AppCallTransactionResult, AppCallType, AppCompilationResult, AppDeployMetadata, AppLookup, AppMetadata, AppReference, AppReturn, AppState, AppStorageSchema, BoxName, CompiledTeal, OnSchemaBreak, OnUpdate, RawAppCallArgs, SendAppTransactionResult, TealTemplateParams } from "./app.js";
5
+ import { ConfirmedTransactionResult, SendParams, SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionNote } from "./transaction.js";
6
+ import { AppManager, BoxIdentifier, BoxReference, ResourceReference } from "./app-manager.js";
7
+ import { AppCallMethodCall, AppDeleteMethodCall, AppMethodCall, AppMethodCallParams, AppMethodCallTransactionArgument, CommonAppCallParams, PaymentParams } from "./composer.js";
8
+ import { ABIStruct, Arc56Contract, Arc56Method, ProgramSourceInfo } from "./app-arc56.js";
9
+ import { AppLookup as AppLookup$1 } from "./app-deployer.js";
10
+ import { AppSpec } from "./app-spec.js";
11
+ import { AlgorandClient } from "./algorand-client.js";
12
+ import algosdk, { Address } from "algosdk";
13
+
14
+ //#region src/types/app-client.d.ts
23
15
  /** Configuration to resolve app by creator and name `getCreatorAppsByName` */
24
- export type ResolveAppByCreatorAndNameBase = {
25
- /** The address of the app creator account to resolve the app by */
26
- creatorAddress: Address | string;
27
- /** The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) */
28
- name?: string;
29
- /** The mechanism to find an existing app instance metadata for the given creator and name; either:
30
- * * An indexer instance to search the creator account apps; or
31
- * * The cached value of the existing apps for the given creator from `getCreatorAppsByName`
32
- */
33
- findExistingUsing: Indexer | LegacyAppLookup;
16
+ type ResolveAppByCreatorAndNameBase = {
17
+ /** The address of the app creator account to resolve the app by */creatorAddress: Address | string; /** The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) */
18
+ name?: string;
19
+ /** The mechanism to find an existing app instance metadata for the given creator and name; either:
20
+ * * An indexer instance to search the creator account apps; or
21
+ * * The cached value of the existing apps for the given creator from `getCreatorAppsByName`
22
+ */
23
+ findExistingUsing: Indexer | AppLookup;
34
24
  };
35
25
  /** Configuration to resolve app by creator and name `getCreatorAppsByName` */
36
- export type ResolveAppByCreatorAndName = ResolveAppByCreatorAndNameBase & {
37
- /** How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` */
38
- resolveBy: 'creatorAndName';
26
+ type ResolveAppByCreatorAndName = ResolveAppByCreatorAndNameBase & {
27
+ /** How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` */resolveBy: 'creatorAndName';
39
28
  };
40
29
  /** Configuration to resolve app by ID */
41
- export interface ResolveAppByIdBase {
42
- /** The id of an existing app to call using this client, or 0 if the app hasn't been created yet */
43
- id: number | bigint;
44
- /** The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) */
45
- name?: string;
30
+ interface ResolveAppByIdBase {
31
+ /** The id of an existing app to call using this client, or 0 if the app hasn't been created yet */
32
+ id: number | bigint;
33
+ /** The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) */
34
+ name?: string;
46
35
  }
47
- export interface ResolveAppById extends ResolveAppByIdBase {
48
- /** How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` */
49
- resolveBy: 'id';
36
+ interface ResolveAppById extends ResolveAppByIdBase {
37
+ /** How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` */
38
+ resolveBy: 'id';
50
39
  }
51
40
  /** The details of an AlgoKit Utils deployed app */
52
- export type AppDetailsBase = {
53
- /** Default sender to use for transactions issued by this application client */
54
- sender?: SendTransactionFrom;
55
- /** Default suggested params object to use */
56
- params?: SuggestedParams;
57
- /** Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get
58
- * used in calls to `deploy`, `create` and `update` unless overridden in those calls
59
- */
60
- deployTimeParams?: TealTemplateParams;
41
+ type AppDetailsBase = {
42
+ /** Default sender to use for transactions issued by this application client */sender?: SendTransactionFrom; /** Default suggested params object to use */
43
+ params?: SuggestedParams;
44
+ /** Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get
45
+ * used in calls to `deploy`, `create` and `update` unless overridden in those calls
46
+ */
47
+ deployTimeParams?: TealTemplateParams;
61
48
  };
62
49
  /** The details of an AlgoKit Utils deployed app */
63
- export type AppDetails = AppDetailsBase & (ResolveAppById | ResolveAppByCreatorAndName);
50
+ type AppDetails = AppDetailsBase & (ResolveAppById | ResolveAppByCreatorAndName);
64
51
  /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app */
65
- export type AppSpecAppDetailsBase = {
66
- /** The ARC-0032 application spec as either:
67
- * * Parsed JSON `AppSpec`
68
- * * Raw JSON string
69
- */
70
- app: AppSpec | string;
52
+ type AppSpecAppDetailsBase = {
53
+ /** The ARC-0032 application spec as either:
54
+ * * Parsed JSON `AppSpec`
55
+ * * Raw JSON string
56
+ */
57
+ app: AppSpec | string;
71
58
  };
72
59
  /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by id*/
73
- export type AppSpecAppDetailsById = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase;
60
+ type AppSpecAppDetailsById = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase;
74
61
  /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by creator and name*/
75
- export type AppSpecAppDetailsByCreatorAndName = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByCreatorAndNameBase;
62
+ type AppSpecAppDetailsByCreatorAndName = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByCreatorAndNameBase;
76
63
  /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app */
77
- export type AppSpecAppDetails = AppSpecAppDetailsBase & AppDetails;
64
+ type AppSpecAppDetails = AppSpecAppDetailsBase & AppDetails;
78
65
  /** Core parameters to pass into ApplicationClient.deploy */
79
- export interface AppClientDeployCoreParams {
80
- /** The version of the contract, uses "1.0" by default */
81
- version?: string;
82
- /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */
83
- sender?: SendTransactionFrom;
84
- /** Parameters to control transaction sending */
85
- sendParams?: Omit<SendTransactionParams, 'skipSending' | 'skipWaiting'>;
86
- /** Whether or not to allow updates in the contract using the deploy-time updatability control if present in your contract.
87
- * If this is not specified then it will automatically be determined based on the AppSpec definition
88
- **/
89
- allowUpdate?: boolean;
90
- /** Whether or not to allow deletes in the contract using the deploy-time deletability control if present in your contract.
91
- * If this is not specified then it will automatically be determined based on the AppSpec definition
92
- **/
93
- allowDelete?: boolean;
94
- /** What action to perform if a schema break is detected */
95
- onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak;
96
- /** What action to perform if a TEAL update is detected */
97
- onUpdate?: 'update' | 'replace' | 'append' | 'fail' | OnUpdate;
66
+ interface AppClientDeployCoreParams {
67
+ /** The version of the contract, uses "1.0" by default */
68
+ version?: string;
69
+ /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */
70
+ sender?: SendTransactionFrom;
71
+ /** Parameters to control transaction sending */
72
+ sendParams?: Omit<SendTransactionParams, 'skipSending' | 'skipWaiting'>;
73
+ /** Whether or not to allow updates in the contract using the deploy-time updatability control if present in your contract.
74
+ * If this is not specified then it will automatically be determined based on the AppSpec definition
75
+ **/
76
+ allowUpdate?: boolean;
77
+ /** Whether or not to allow deletes in the contract using the deploy-time deletability control if present in your contract.
78
+ * If this is not specified then it will automatically be determined based on the AppSpec definition
79
+ **/
80
+ allowDelete?: boolean;
81
+ /** What action to perform if a schema break is detected */
82
+ onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak;
83
+ /** What action to perform if a TEAL update is detected */
84
+ onUpdate?: 'update' | 'replace' | 'append' | 'fail' | OnUpdate;
98
85
  }
99
86
  /** Call interface parameters to pass into ApplicationClient.deploy */
100
- export interface AppClientDeployCallInterfaceParams {
101
- /** Any deploy-time parameters to replace in the TEAL code */
102
- deployTimeParams?: TealTemplateParams;
103
- /** Any args to pass to any create transaction that is issued as part of deployment */
104
- createArgs?: AppClientCallArgs;
105
- /** Override the on-completion action for the create call; defaults to NoOp */
106
- createOnCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
107
- /** Any args to pass to any update transaction that is issued as part of deployment */
108
- updateArgs?: AppClientCallArgs;
109
- /** Any args to pass to any delete transaction that is issued as part of deployment */
110
- deleteArgs?: AppClientCallArgs;
87
+ interface AppClientDeployCallInterfaceParams {
88
+ /** Any deploy-time parameters to replace in the TEAL code */
89
+ deployTimeParams?: TealTemplateParams;
90
+ /** Any args to pass to any create transaction that is issued as part of deployment */
91
+ createArgs?: AppClientCallArgs;
92
+ /** Override the on-completion action for the create call; defaults to NoOp */
93
+ createOnCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
94
+ /** Any args to pass to any update transaction that is issued as part of deployment */
95
+ updateArgs?: AppClientCallArgs;
96
+ /** Any args to pass to any delete transaction that is issued as part of deployment */
97
+ deleteArgs?: AppClientCallArgs;
111
98
  }
112
99
  /** Parameters to pass into ApplicationClient.deploy */
113
- export interface AppClientDeployParams extends AppClientDeployCoreParams, AppClientDeployCallInterfaceParams {
114
- /** Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. */
115
- schema?: Partial<AppStorageSchema>;
100
+ interface AppClientDeployParams extends AppClientDeployCoreParams, AppClientDeployCallInterfaceParams {
101
+ /** Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. */
102
+ schema?: Partial<AppStorageSchema>;
116
103
  }
117
- export type AppClientCallRawArgs = RawAppCallArgs;
118
- export interface AppClientCallABIArgs extends Omit<ABIAppCallArgs, 'method'> {
119
- /** If calling an ABI method then either the name of the method, or the ABI signature */
120
- method: string;
104
+ type AppClientCallRawArgs = RawAppCallArgs;
105
+ interface AppClientCallABIArgs extends Omit<ABIAppCallArgs, 'method'> {
106
+ /** If calling an ABI method then either the name of the method, or the ABI signature */
107
+ method: string;
121
108
  }
122
109
  /** The arguments to pass to an Application Client smart contract call */
123
- export type AppClientCallArgs = AppClientCallRawArgs | AppClientCallABIArgs;
110
+ type AppClientCallArgs = AppClientCallRawArgs | AppClientCallABIArgs;
124
111
  /** Common (core) parameters to construct a ApplicationClient contract call */
125
- export interface AppClientCallCoreParams {
126
- /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */
127
- sender?: SendTransactionFrom;
128
- /** The transaction note for the smart contract call */
129
- note?: TransactionNote;
130
- /** Parameters to control transaction sending */
131
- sendParams?: SendTransactionParams;
112
+ interface AppClientCallCoreParams {
113
+ /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */
114
+ sender?: SendTransactionFrom;
115
+ /** The transaction note for the smart contract call */
116
+ note?: TransactionNote;
117
+ /** Parameters to control transaction sending */
118
+ sendParams?: SendTransactionParams;
132
119
  }
133
120
  /** Parameters to construct a ApplicationClient contract call */
134
- export type AppClientCallParams = AppClientCallArgs & AppClientCallCoreParams;
121
+ type AppClientCallParams = AppClientCallArgs & AppClientCallCoreParams;
135
122
  /** Parameters to construct a ApplicationClient clear state contract call */
136
- export type AppClientClearStateParams = AppClientCallRawArgs & AppClientCallCoreParams;
137
- export interface AppClientCompilationParams {
138
- /** Any deploy-time parameters to replace in the TEAL code */
139
- deployTimeParams?: TealTemplateParams;
140
- /** Whether or not the contract should have deploy-time immutability control set, undefined = ignore */
141
- updatable?: boolean;
142
- /** Whether or not the contract should have deploy-time permanence control set, undefined = ignore */
143
- deletable?: boolean;
123
+ type AppClientClearStateParams = AppClientCallRawArgs & AppClientCallCoreParams;
124
+ interface AppClientCompilationParams {
125
+ /** Any deploy-time parameters to replace in the TEAL code */
126
+ deployTimeParams?: TealTemplateParams;
127
+ /** Whether or not the contract should have deploy-time immutability control set, undefined = ignore */
128
+ updatable?: boolean;
129
+ /** Whether or not the contract should have deploy-time permanence control set, undefined = ignore */
130
+ deletable?: boolean;
144
131
  }
145
132
  /** On-complete action parameter for creating a contract using ApplicationClient */
146
- export type AppClientCreateOnComplete = {
147
- /** Override the on-completion action for the create call; defaults to NoOp */
148
- onCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
133
+ type AppClientCreateOnComplete = {
134
+ /** Override the on-completion action for the create call; defaults to NoOp */onCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
149
135
  };
150
136
  /** Parameters for creating a contract using ApplicationClient */
151
- export type AppClientCreateParams = AppClientCallParams & AppClientCompilationParams & AppClientCreateOnComplete & {
152
- /** Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. */
153
- schema?: Partial<AppStorageSchema>;
137
+ type AppClientCreateParams = AppClientCallParams & AppClientCompilationParams & AppClientCreateOnComplete & {
138
+ /** Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. */schema?: Partial<AppStorageSchema>;
154
139
  };
155
140
  /** Parameters for updating a contract using ApplicationClient */
156
- export type AppClientUpdateParams = AppClientCallParams & AppClientCompilationParams;
141
+ type AppClientUpdateParams = AppClientCallParams & AppClientCompilationParams;
157
142
  /** Parameters for funding an app account */
158
- export interface FundAppAccountParams {
159
- amount: AlgoAmount;
160
- /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */
161
- sender?: SendTransactionFrom;
162
- /** The transaction note for the smart contract call */
163
- note?: TransactionNote;
164
- /** Parameters to control transaction sending */
165
- sendParams?: SendTransactionParams;
143
+ interface FundAppAccountParams {
144
+ amount: AlgoAmount;
145
+ /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */
146
+ sender?: SendTransactionFrom;
147
+ /** The transaction note for the smart contract call */
148
+ note?: TransactionNote;
149
+ /** Parameters to control transaction sending */
150
+ sendParams?: SendTransactionParams;
166
151
  }
167
152
  /** Source maps for an Algorand app */
168
- export interface AppSourceMaps {
169
- /** The source map of the approval program */
170
- approvalSourceMap: SourceMapExport;
171
- /** The source map of the clear program */
172
- clearSourceMap: SourceMapExport;
153
+ interface AppSourceMaps {
154
+ /** The source map of the approval program */
155
+ approvalSourceMap: SourceMapExport;
156
+ /** The source map of the clear program */
157
+ clearSourceMap: SourceMapExport;
173
158
  }
174
- export interface SourceMapExport {
175
- version: number;
176
- sources: string[];
177
- names: string[];
178
- mappings: string;
159
+ interface SourceMapExport {
160
+ version: number;
161
+ sources: string[];
162
+ names: string[];
163
+ mappings: string;
179
164
  }
180
165
  /**
181
166
  * The result of asking an `AppClient` to compile a program.
182
167
  *
183
168
  * Always contains the compiled bytecode, and may contain the result of compiling TEAL (including sourcemap) if it was available.
184
169
  */
185
- export interface AppClientCompilationResult extends Partial<AppCompilationResult> {
186
- /** The compiled bytecode of the approval program, ready to deploy to algod */
187
- approvalProgram: Uint8Array;
188
- /** The compiled bytecode of the clear state program, ready to deploy to algod */
189
- clearStateProgram: Uint8Array;
170
+ interface AppClientCompilationResult extends Partial<AppCompilationResult> {
171
+ /** The compiled bytecode of the approval program, ready to deploy to algod */
172
+ approvalProgram: Uint8Array;
173
+ /** The compiled bytecode of the clear state program, ready to deploy to algod */
174
+ clearStateProgram: Uint8Array;
190
175
  }
191
176
  /** Parameters to create an app client */
192
- export interface AppClientParams {
193
- /** The ID of the app instance this client should make calls against. */
194
- appId: bigint;
195
- /** The ARC-56 or ARC-32 application spec as either:
196
- * * Parsed JSON ARC-56 `Contract`
197
- * * Parsed JSON ARC-32 `AppSpec`
198
- * * Raw JSON string (in either ARC-56 or ARC-32 format)
199
- */
200
- appSpec: Arc56Contract | AppSpec | string;
201
- /** An `AlgorandClient` instance */
202
- algorand: AlgorandClient;
203
- /**
204
- * Optional override for the app name; used for on-chain metadata and lookups.
205
- * Defaults to the ARC-32/ARC-56 app spec name
206
- */
207
- appName?: string;
208
- /** Optional address to use for the account to use as the default sender for calls. */
209
- defaultSender?: Address | string;
210
- /** Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from `AlgorandClient`). */
211
- defaultSigner?: TransactionSigner;
212
- /** Optional source map for the approval program */
213
- approvalSourceMap?: SourceMap;
214
- /** Optional source map for the clear state program */
215
- clearSourceMap?: SourceMap;
177
+ interface AppClientParams {
178
+ /** The ID of the app instance this client should make calls against. */
179
+ appId: bigint;
180
+ /** The ARC-56 or ARC-32 application spec as either:
181
+ * * Parsed JSON ARC-56 `Contract`
182
+ * * Parsed JSON ARC-32 `AppSpec`
183
+ * * Raw JSON string (in either ARC-56 or ARC-32 format)
184
+ */
185
+ appSpec: Arc56Contract | AppSpec | string;
186
+ /** An `AlgorandClient` instance */
187
+ algorand: AlgorandClient;
188
+ /**
189
+ * Optional override for the app name; used for on-chain metadata and lookups.
190
+ * Defaults to the ARC-32/ARC-56 app spec name
191
+ */
192
+ appName?: string;
193
+ /** Optional address to use for the account to use as the default sender for calls. */
194
+ defaultSender?: Address | string;
195
+ /** Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from `AlgorandClient`). */
196
+ defaultSigner?: TransactionSigner;
197
+ /** Optional source map for the approval program */
198
+ approvalSourceMap?: SourceMap;
199
+ /** Optional source map for the clear state program */
200
+ clearSourceMap?: SourceMap;
216
201
  }
217
202
  /** Parameters to clone an app client */
218
- export type CloneAppClientParams = Expand<Partial<Omit<AppClientParams, 'algorand' | 'appSpec'>>>;
203
+ type CloneAppClientParams = Expand<Partial<Omit<AppClientParams, 'algorand' | 'appSpec'>>>;
219
204
  /** onComplete parameter for a non-update app call */
220
- export type CallOnComplete = {
221
- /** On-complete of the call; defaults to no-op */
222
- onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>;
205
+ type CallOnComplete = {
206
+ /** On-complete of the call; defaults to no-op */onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>;
223
207
  };
224
208
  /** AppClient common parameters for a bare app call */
225
- export type AppClientBareCallParams = Expand<Omit<CommonAppCallParams, 'appId' | 'sender' | 'onComplete'> & {
226
- /** The address of the account sending the transaction, if undefined then the app client's defaultSender is used. */
227
- sender?: Address | string;
209
+ type AppClientBareCallParams = Expand<Omit<CommonAppCallParams, 'appId' | 'sender' | 'onComplete'> & {
210
+ /** The address of the account sending the transaction, if undefined then the app client's defaultSender is used. */sender?: Address | string;
228
211
  }>;
229
212
  /** AppClient common parameters for an ABI method call */
230
- export type AppClientMethodCallParams = Expand<Omit<CommonAppCallParams, 'appId' | 'sender' | 'method' | 'args'> & {
231
- /** The address of the account sending the transaction, if undefined then the app client's defaultSender is used. */
232
- sender?: Address | string;
233
- /** The method name or method signature to call if an ABI call is being emitted
234
- * @example Method name
235
- * `my_method`
236
- * @example Method signature
237
- * `my_method(unit64,string)bytes`
238
- */
239
- method: string;
240
- /** Arguments to the ABI method, either:
241
- * * An ABI value
242
- * * An ARC-56 struct
243
- * * A transaction with explicit signer
244
- * * A transaction (where the signer will be automatically assigned)
245
- * * An unawaited transaction (e.g. from algorand.createTransaction.transactionType())
246
- * * Another method call (via method call params object)
247
- * * undefined (this represents a placeholder for either a default argument or a transaction argument that is fulfilled by another method call argument)
248
- */
249
- args?: (ABIValue | ABIStruct | AppMethodCallTransactionArgument | undefined)[];
213
+ type AppClientMethodCallParams = Expand<Omit<CommonAppCallParams, 'appId' | 'sender' | 'method' | 'args'> & {
214
+ /** The address of the account sending the transaction, if undefined then the app client's defaultSender is used. */sender?: Address | string;
215
+ /** The method name or method signature to call if an ABI call is being emitted
216
+ * @example Method name
217
+ * `my_method`
218
+ * @example Method signature
219
+ * `my_method(unit64,string)bytes`
220
+ */
221
+ method: string;
222
+ /** Arguments to the ABI method, either:
223
+ * * An ABI value
224
+ * * An ARC-56 struct
225
+ * * A transaction with explicit signer
226
+ * * A transaction (where the signer will be automatically assigned)
227
+ * * An unawaited transaction (e.g. from algorand.createTransaction.transactionType())
228
+ * * Another method call (via method call params object)
229
+ * * undefined (this represents a placeholder for either a default argument or a transaction argument that is fulfilled by another method call argument)
230
+ */
231
+ args?: (ABIValue | ABIStruct | AppMethodCallTransactionArgument | undefined)[];
250
232
  }>;
251
233
  /** Parameters for funding an app account */
252
- export type FundAppParams = Expand<Omit<PaymentParams, 'receiver' | 'sender'> & SendParams & {
253
- /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */
254
- sender?: Address | string;
234
+ type FundAppParams = Expand<Omit<PaymentParams, 'receiver' | 'sender'> & SendParams & {
235
+ /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */sender?: Address | string;
255
236
  }>;
256
237
  /** Resolve an app client instance by looking up an app created by the given creator with the given name */
257
- export type ResolveAppClientByCreatorAndName = Expand<Omit<AppClientParams, 'appId'> & {
258
- /** The address of the creator account for the app */
259
- creatorAddress: Address | string;
260
- /** An optional cached app lookup that matches a name to on-chain details;
261
- * either this is needed or indexer is required to be passed in to this `ClientManager` on construction.
262
- */
263
- appLookupCache?: AppLookup;
264
- /** Whether or not to ignore the `AppDeployer` lookup cache and force an on-chain lookup, default: use any cached value */
265
- ignoreCache?: boolean;
238
+ type ResolveAppClientByCreatorAndName = Expand<Omit<AppClientParams, 'appId'> & {
239
+ /** The address of the creator account for the app */creatorAddress: Address | string;
240
+ /** An optional cached app lookup that matches a name to on-chain details;
241
+ * either this is needed or indexer is required to be passed in to this `ClientManager` on construction.
242
+ */
243
+ appLookupCache?: AppLookup$1; /** Whether or not to ignore the `AppDeployer` lookup cache and force an on-chain lookup, default: use any cached value */
244
+ ignoreCache?: boolean;
266
245
  }>;
267
246
  /** Resolve an app client instance by looking up the current network. */
268
- export type ResolveAppClientByNetwork = Expand<Omit<AppClientParams, 'appId'>>;
247
+ type ResolveAppClientByNetwork = Expand<Omit<AppClientParams, 'appId'>>;
269
248
  /** ARC-56/ARC-32 application client that allows you to manage calls and
270
249
  * state for a specific deployed instance of an app (with a known app ID). */
271
- export declare class AppClient {
272
- private _appId;
273
- private _appAddress;
274
- private _appName;
275
- private _appSpec;
276
- private _algorand;
277
- private _defaultSender?;
278
- private _defaultSigner?;
279
- private _approvalSourceMap;
280
- private _clearSourceMap;
281
- private _localStateMethods;
282
- private _globalStateMethods;
283
- private _boxStateMethods;
284
- private _paramsMethods;
285
- private _createTransactionsMethods;
286
- private _sendMethods;
287
- private _lastCompiled;
250
+ declare class AppClient {
251
+ private _appId;
252
+ private _appAddress;
253
+ private _appName;
254
+ private _appSpec;
255
+ private _algorand;
256
+ private _defaultSender?;
257
+ private _defaultSigner?;
258
+ private _approvalSourceMap;
259
+ private _clearSourceMap;
260
+ private _localStateMethods;
261
+ private _globalStateMethods;
262
+ private _boxStateMethods;
263
+ private _paramsMethods;
264
+ private _createTransactionsMethods;
265
+ private _sendMethods;
266
+ private _lastCompiled;
267
+ /**
268
+ * Create a new app client.
269
+ * @param params The parameters to create the app client
270
+ * @returns The `AppClient` instance
271
+ * @example
272
+ * ```typescript
273
+ * const appClient = new AppClient({
274
+ * appId: 12345678n,
275
+ * appSpec: appSpec,
276
+ * algorand: AlgorandClient.mainNet(),
277
+ * })
278
+ */
279
+ constructor(params: AppClientParams);
280
+ /**
281
+ * Clone this app client with different params
282
+ *
283
+ * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.
284
+ * @returns A new app client with the altered params
285
+ * @example
286
+ * ```typescript
287
+ * const appClient2 = appClient.clone({ defaultSender: 'NEW_SENDER_ADDRESS' })
288
+ * ```
289
+ */
290
+ clone(params: CloneAppClientParams): AppClient;
291
+ /**
292
+ * Returns a new `AppClient` client, resolving the app by creator address and name
293
+ * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
294
+ * @param params The parameters to create the app client
295
+ * @returns The `AppClient` instance
296
+ * @example
297
+ * ```typescript
298
+ * const appClient = await AppClient.fromCreatorAndName({
299
+ * creatorAddress: 'CREATOR_ADDRESS',
300
+ * name: 'APP_NAME',
301
+ * appSpec: appSpec,
302
+ * algorand: AlgorandClient.mainNet(),
303
+ * })
304
+ */
305
+ static fromCreatorAndName(params: ResolveAppClientByCreatorAndName): Promise<AppClient>;
306
+ /**
307
+ * Returns an `AppClient` instance for the current network based on
308
+ * pre-determined network-specific app IDs specified in the ARC-56 app spec.
309
+ *
310
+ * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
311
+ * @param params The parameters to create the app client
312
+ * @returns The `AppClient` instance
313
+ * @example
314
+ * ```typescript
315
+ * const appClient = await AppClient.fromNetwork({
316
+ * appSpec: appSpec,
317
+ * algorand: AlgorandClient.mainNet(),
318
+ * })
319
+ */
320
+ static fromNetwork(params: ResolveAppClientByNetwork): Promise<AppClient>;
321
+ /**
322
+ * Takes a string or parsed JSON object that could be ARC-32 or ARC-56 format and
323
+ * normalises it into a parsed ARC-56 contract object.
324
+ * @param spec The spec to normalise
325
+ * @returns The normalised ARC-56 contract object
326
+ * @example
327
+ * ```typescript
328
+ * const arc56AppSpec = AppClient.normaliseAppSpec(appSpec)
329
+ * ```
330
+ */
331
+ static normaliseAppSpec(spec: Arc56Contract | AppSpec | string): Arc56Contract;
332
+ /** The ID of the app instance this client is linked to. */
333
+ get appId(): bigint;
334
+ /** The app address of the app instance this client is linked to. */
335
+ get appAddress(): algosdk.Address;
336
+ /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */
337
+ get appName(): string;
338
+ /** The ARC-56 app spec being used */
339
+ get appSpec(): Arc56Contract;
340
+ /** A reference to the underlying `AlgorandClient` this app client is using. */
341
+ get algorand(): AlgorandClient;
342
+ /** Get parameters to create transactions for the current app.
343
+ *
344
+ * A good mental model for this is that these parameters represent a deferred transaction creation.
345
+ * @example Create a transaction in the future using Algorand Client
346
+ * ```typescript
347
+ * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
348
+ * // ...
349
+ * await algorand.send.AppMethodCall(myMethodCall)
350
+ * ```
351
+ * @example Define a nested transaction as an ABI argument
352
+ * ```typescript
353
+ * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
354
+ * await appClient.send.call({method: 'my_method2', args: [myMethodCall]})
355
+ * ```
356
+ */
357
+ get params(): {
288
358
  /**
289
- * Create a new app client.
290
- * @param params The parameters to create the app client
291
- * @returns The `AppClient` instance
292
- * @example
293
- * ```typescript
294
- * const appClient = new AppClient({
295
- * appId: 12345678n,
296
- * appSpec: appSpec,
297
- * algorand: AlgorandClient.mainNet(),
298
- * })
359
+ * Return params for a payment transaction to fund the app account
360
+ * @param params The parameters for the fund app accont payment transaction
361
+ * @returns The parameters which can be used to create a fund app account payment transaction
299
362
  */
300
- constructor(params: AppClientParams);
363
+ fundAppAccount: (params: FundAppParams) => {
364
+ sender: algosdk.Address;
365
+ signer: TransactionSignerAccount | algosdk.TransactionSigner | undefined;
366
+ receiver: algosdk.Address;
367
+ rekeyTo?: (string | Address) | undefined;
368
+ note?: (Uint8Array | string) | undefined;
369
+ lease?: (Uint8Array | string) | undefined;
370
+ staticFee?: AlgoAmount | undefined;
371
+ extraFee?: AlgoAmount | undefined;
372
+ maxFee?: AlgoAmount | undefined;
373
+ validityWindow?: number | bigint | undefined;
374
+ firstValidRound?: bigint | undefined;
375
+ lastValidRound?: bigint | undefined;
376
+ amount: AlgoAmount;
377
+ closeRemainderTo?: (string | Address) | undefined;
378
+ maxRoundsToWaitForConfirmation?: number | undefined;
379
+ suppressLog?: boolean | undefined;
380
+ populateAppCallResources?: boolean | undefined;
381
+ coverAppCallInnerTransactionFees?: boolean | undefined;
382
+ };
301
383
  /**
302
- * Clone this app client with different params
303
- *
304
- * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.
305
- * @returns A new app client with the altered params
306
- * @example
307
- * ```typescript
308
- * const appClient2 = appClient.clone({ defaultSender: 'NEW_SENDER_ADDRESS' })
309
- * ```
384
+ * Return params for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
385
+ * @param params The parameters for the update ABI method call
386
+ * @returns The parameters which can be used to create an update ABI method call
310
387
  */
311
- clone(params: CloneAppClientParams): AppClient;
388
+ update: (params: AppClientMethodCallParams & AppClientCompilationParams) => Promise<{
389
+ /** The compiled bytecode of the approval program, ready to deploy to algod */approvalProgram: Uint8Array; /** The compiled bytecode of the clear state program, ready to deploy to algod */
390
+ clearStateProgram: Uint8Array;
391
+ compiledApproval?: CompiledTeal | undefined;
392
+ compiledClear?: CompiledTeal | undefined;
393
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
394
+ rekeyTo?: (string | Address) | undefined;
395
+ note?: (Uint8Array | string) | undefined;
396
+ lease?: (Uint8Array | string) | undefined;
397
+ staticFee?: AlgoAmount | undefined;
398
+ extraFee?: AlgoAmount | undefined;
399
+ maxFee?: AlgoAmount | undefined;
400
+ validityWindow?: number | bigint | undefined;
401
+ firstValidRound?: bigint | undefined;
402
+ lastValidRound?: bigint | undefined;
403
+ onComplete?: algosdk.OnApplicationComplete | undefined;
404
+ accountReferences?: (string | Address)[] | undefined;
405
+ appReferences?: bigint[] | undefined;
406
+ assetReferences?: bigint[] | undefined;
407
+ boxReferences?: (BoxReference | BoxIdentifier)[];
408
+ accessReferences?: ResourceReference[] | undefined;
409
+ rejectVersion?: number | undefined;
410
+ sender?: (Address | string) | undefined;
411
+ method: string;
412
+ args?: (ABIValue | ABIStruct | AppMethodCallTransactionArgument | undefined)[]; /** Any deploy-time parameters to replace in the TEAL code */
413
+ deployTimeParams?: TealTemplateParams; /** Whether or not the contract should have deploy-time immutability control set, undefined = ignore */
414
+ updatable?: boolean; /** Whether or not the contract should have deploy-time permanence control set, undefined = ignore */
415
+ deletable?: boolean;
416
+ } & {
417
+ appId: bigint;
418
+ sender: algosdk.Address;
419
+ signer: TransactionSignerAccount | algosdk.TransactionSigner | undefined;
420
+ method: Arc56Method;
421
+ onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC;
422
+ args: (algosdk.Transaction | Promise<algosdk.Transaction> | algosdk.ABIValue | algosdk.TransactionWithSigner | AppMethodCall<{
423
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
424
+ sender: string | Address;
425
+ rekeyTo?: (string | Address) | undefined;
426
+ note?: (Uint8Array | string) | undefined;
427
+ lease?: (Uint8Array | string) | undefined;
428
+ staticFee?: AlgoAmount | undefined;
429
+ extraFee?: AlgoAmount | undefined;
430
+ maxFee?: AlgoAmount | undefined;
431
+ validityWindow?: number | bigint | undefined;
432
+ firstValidRound?: bigint | undefined;
433
+ lastValidRound?: bigint | undefined;
434
+ onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
435
+ args?: Uint8Array[] | undefined;
436
+ accountReferences?: (string | Address)[] | undefined;
437
+ appReferences?: bigint[] | undefined;
438
+ assetReferences?: bigint[] | undefined;
439
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
440
+ accessReferences?: ResourceReference[] | undefined;
441
+ rejectVersion?: number | undefined;
442
+ approvalProgram: string | Uint8Array;
443
+ clearStateProgram: string | Uint8Array;
444
+ schema?: {
445
+ globalInts: number;
446
+ globalByteSlices: number;
447
+ localInts: number;
448
+ localByteSlices: number;
449
+ } | undefined;
450
+ extraProgramPages?: number | undefined;
451
+ }> | AppMethodCall<{
452
+ sender: string | Address;
453
+ signer?: (algosdk.TransactionSigner | TransactionSignerAccount) | undefined;
454
+ rekeyTo?: (string | Address) | undefined;
455
+ note?: (Uint8Array | string) | undefined;
456
+ lease?: (Uint8Array | string) | undefined;
457
+ staticFee?: AlgoAmount | undefined;
458
+ extraFee?: AlgoAmount | undefined;
459
+ maxFee?: AlgoAmount | undefined;
460
+ validityWindow?: number | bigint | undefined;
461
+ firstValidRound?: bigint | undefined;
462
+ lastValidRound?: bigint | undefined;
463
+ appId: bigint;
464
+ onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
465
+ args?: Uint8Array[] | undefined;
466
+ accountReferences?: (string | Address)[] | undefined;
467
+ appReferences?: bigint[] | undefined;
468
+ assetReferences?: bigint[] | undefined;
469
+ boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
470
+ accessReferences?: ResourceReference[] | undefined;
471
+ rejectVersion?: number | undefined;
472
+ approvalProgram: string | Uint8Array;
473
+ clearStateProgram: string | Uint8Array;
474
+ }> | AppMethodCall<AppMethodCallParams> | undefined)[] | undefined;
475
+ }>;
312
476
  /**
313
- * Returns a new `AppClient` client, resolving the app by creator address and name
314
- * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
315
- * @param params The parameters to create the app client
316
- * @returns The `AppClient` instance
317
- * @example
318
- * ```typescript
319
- * const appClient = await AppClient.fromCreatorAndName({
320
- * creatorAddress: 'CREATOR_ADDRESS',
321
- * name: 'APP_NAME',
322
- * appSpec: appSpec,
323
- * algorand: AlgorandClient.mainNet(),
324
- * })
477
+ * Return params for an opt-in ABI call
478
+ * @param params The parameters for the opt-in ABI method call
479
+ * @returns The parameters which can be used to create an opt-in ABI method call
325
480
  */
326
- static fromCreatorAndName(params: ResolveAppClientByCreatorAndName): Promise<AppClient>;
481
+ optIn: (params: AppClientMethodCallParams) => Promise<AppCallMethodCall>;
327
482
  /**
328
- * Returns an `AppClient` instance for the current network based on
329
- * pre-determined network-specific app IDs specified in the ARC-56 app spec.
330
- *
331
- * If no IDs are in the app spec or the network isn't recognised, an error is thrown.
332
- * @param params The parameters to create the app client
333
- * @returns The `AppClient` instance
334
- * @example
335
- * ```typescript
336
- * const appClient = await AppClient.fromNetwork({
337
- * appSpec: appSpec,
338
- * algorand: AlgorandClient.mainNet(),
339
- * })
483
+ * Return params for an delete ABI call
484
+ * @param params The parameters for the delete ABI method call
485
+ * @returns The parameters which can be used to create a delete ABI method call
340
486
  */
341
- static fromNetwork(params: ResolveAppClientByNetwork): Promise<AppClient>;
342
- /**
343
- * Takes a string or parsed JSON object that could be ARC-32 or ARC-56 format and
344
- * normalises it into a parsed ARC-56 contract object.
345
- * @param spec The spec to normalise
346
- * @returns The normalised ARC-56 contract object
347
- * @example
348
- * ```typescript
349
- * const arc56AppSpec = AppClient.normaliseAppSpec(appSpec)
350
- * ```
487
+ delete: (params: AppClientMethodCallParams) => Promise<AppDeleteMethodCall>;
488
+ /** Return params for an close out ABI call
489
+ * @param params The parameters for the close out ABI method call
490
+ * @returns The parameters which can be used to create a close out ABI method call
351
491
  */
352
- static normaliseAppSpec(spec: Arc56Contract | AppSpec | string): Arc56Contract;
353
- /** The ID of the app instance this client is linked to. */
354
- get appId(): bigint;
355
- /** The app address of the app instance this client is linked to. */
356
- get appAddress(): algosdk.Address;
357
- /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */
358
- get appName(): string;
359
- /** The ARC-56 app spec being used */
360
- get appSpec(): Arc56Contract;
361
- /** A reference to the underlying `AlgorandClient` this app client is using. */
362
- get algorand(): AlgorandClient;
363
- /** Get parameters to create transactions for the current app.
364
- *
365
- * A good mental model for this is that these parameters represent a deferred transaction creation.
366
- * @example Create a transaction in the future using Algorand Client
367
- * ```typescript
368
- * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
369
- * // ...
370
- * await algorand.send.AppMethodCall(myMethodCall)
371
- * ```
372
- * @example Define a nested transaction as an ABI argument
373
- * ```typescript
374
- * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
375
- * await appClient.send.call({method: 'my_method2', args: [myMethodCall]})
376
- * ```
492
+ closeOut: (params: AppClientMethodCallParams) => Promise<AppCallMethodCall>;
493
+ /** Return params for an ABI call
494
+ * @param params The parameters for the ABI method call
495
+ * @returns The parameters which can be used to create an ABI method call
377
496
  */
378
- get params(): {
379
- /**
380
- * Return params for a payment transaction to fund the app account
381
- * @param params The parameters for the fund app accont payment transaction
382
- * @returns The parameters which can be used to create a fund app account payment transaction
383
- */
384
- fundAppAccount: (params: {
385
- maxFee?: AlgoAmount | undefined;
386
- note?: string | Uint8Array | undefined;
387
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
388
- lease?: string | Uint8Array | undefined;
389
- rekeyTo?: string | algosdk.Address | undefined;
390
- staticFee?: AlgoAmount | undefined;
391
- extraFee?: AlgoAmount | undefined;
392
- validityWindow?: number | bigint | undefined;
393
- firstValidRound?: bigint | undefined;
394
- lastValidRound?: bigint | undefined;
395
- amount: AlgoAmount;
396
- closeRemainderTo?: string | algosdk.Address | undefined;
397
- maxRoundsToWaitForConfirmation?: number | undefined;
398
- suppressLog?: boolean | undefined;
399
- populateAppCallResources?: boolean | undefined;
400
- coverAppCallInnerTransactionFees?: boolean | undefined;
401
- sender?: string | algosdk.Address | undefined;
402
- }) => {
403
- sender: algosdk.Address;
404
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
405
- receiver: algosdk.Address;
406
- maxFee?: AlgoAmount | undefined;
407
- note?: string | Uint8Array | undefined;
408
- lease?: string | Uint8Array | undefined;
409
- rekeyTo?: string | algosdk.Address | undefined;
410
- staticFee?: AlgoAmount | undefined;
411
- extraFee?: AlgoAmount | undefined;
412
- validityWindow?: number | bigint | undefined;
413
- firstValidRound?: bigint | undefined;
414
- lastValidRound?: bigint | undefined;
415
- amount: AlgoAmount;
416
- closeRemainderTo?: string | algosdk.Address | undefined;
417
- maxRoundsToWaitForConfirmation?: number | undefined;
418
- suppressLog?: boolean | undefined;
419
- populateAppCallResources?: boolean | undefined;
420
- coverAppCallInnerTransactionFees?: boolean | undefined;
421
- };
422
- /**
423
- * Return params for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
424
- * @param params The parameters for the update ABI method call
425
- * @returns The parameters which can be used to create an update ABI method call
426
- */
427
- update: (params: {
428
- maxFee?: AlgoAmount | undefined;
429
- note?: string | Uint8Array | undefined;
430
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
431
- onComplete?: algosdk.OnApplicationComplete | undefined;
432
- rejectVersion?: number | undefined;
433
- lease?: string | Uint8Array | undefined;
434
- rekeyTo?: string | algosdk.Address | undefined;
435
- staticFee?: AlgoAmount | undefined;
436
- extraFee?: AlgoAmount | undefined;
437
- validityWindow?: number | bigint | undefined;
438
- firstValidRound?: bigint | undefined;
439
- lastValidRound?: bigint | undefined;
440
- accountReferences?: (string | algosdk.Address)[] | undefined;
441
- appReferences?: bigint[] | undefined;
442
- assetReferences?: bigint[] | undefined;
443
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
444
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
445
- sender?: string | algosdk.Address | undefined;
446
- method: string;
447
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
448
- } & AppClientCompilationParams) => Promise<{
449
- /** The compiled bytecode of the approval program, ready to deploy to algod */
450
- approvalProgram: Uint8Array;
451
- /** The compiled bytecode of the clear state program, ready to deploy to algod */
452
- clearStateProgram: Uint8Array;
453
- compiledApproval?: import("./app").CompiledTeal | undefined;
454
- compiledClear?: import("./app").CompiledTeal | undefined;
455
- maxFee?: AlgoAmount | undefined;
456
- note?: string | Uint8Array | undefined;
457
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
458
- onComplete?: algosdk.OnApplicationComplete | undefined;
459
- rejectVersion?: number | undefined;
460
- lease?: string | Uint8Array | undefined;
461
- rekeyTo?: string | algosdk.Address | undefined;
462
- staticFee?: AlgoAmount | undefined;
463
- extraFee?: AlgoAmount | undefined;
464
- validityWindow?: number | bigint | undefined;
465
- firstValidRound?: bigint | undefined;
466
- lastValidRound?: bigint | undefined;
467
- accountReferences?: (string | algosdk.Address)[] | undefined;
468
- appReferences?: bigint[] | undefined;
469
- assetReferences?: bigint[] | undefined;
470
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
471
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
472
- sender?: string | algosdk.Address | undefined;
473
- method: string;
474
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
475
- /** Any deploy-time parameters to replace in the TEAL code */
476
- deployTimeParams?: TealTemplateParams | undefined;
477
- /** Whether or not the contract should have deploy-time immutability control set, undefined = ignore */
478
- updatable?: boolean | undefined;
479
- /** Whether or not the contract should have deploy-time permanence control set, undefined = ignore */
480
- deletable?: boolean | undefined;
481
- } & {
482
- appId: bigint;
483
- sender: algosdk.Address;
484
- signer: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
485
- method: Arc56Method;
486
- onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC;
487
- args: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | AppMethodCall<{
488
- sender: string | algosdk.Address;
489
- maxFee?: AlgoAmount | undefined;
490
- note?: string | Uint8Array | undefined;
491
- args?: Uint8Array[] | undefined;
492
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
493
- onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
494
- rejectVersion?: number | undefined;
495
- lease?: string | Uint8Array | undefined;
496
- rekeyTo?: string | algosdk.Address | undefined;
497
- staticFee?: AlgoAmount | undefined;
498
- extraFee?: AlgoAmount | undefined;
499
- validityWindow?: number | bigint | undefined;
500
- firstValidRound?: bigint | undefined;
501
- lastValidRound?: bigint | undefined;
502
- accountReferences?: (string | algosdk.Address)[] | undefined;
503
- appReferences?: bigint[] | undefined;
504
- assetReferences?: bigint[] | undefined;
505
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
506
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
507
- approvalProgram: string | Uint8Array;
508
- clearStateProgram: string | Uint8Array;
509
- schema?: {
510
- globalInts: number;
511
- globalByteSlices: number;
512
- localInts: number;
513
- localByteSlices: number;
514
- } | undefined;
515
- extraProgramPages?: number | undefined;
516
- }> | AppMethodCall<{
517
- sender: string | algosdk.Address;
518
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
519
- rekeyTo?: string | algosdk.Address | undefined;
520
- note?: string | Uint8Array | undefined;
521
- lease?: string | Uint8Array | undefined;
522
- staticFee?: AlgoAmount | undefined;
523
- extraFee?: AlgoAmount | undefined;
524
- maxFee?: AlgoAmount | undefined;
525
- validityWindow?: number | bigint | undefined;
526
- firstValidRound?: bigint | undefined;
527
- lastValidRound?: bigint | undefined;
528
- appId: bigint;
529
- onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
530
- args?: Uint8Array[] | undefined;
531
- accountReferences?: (string | algosdk.Address)[] | undefined;
532
- appReferences?: bigint[] | undefined;
533
- assetReferences?: bigint[] | undefined;
534
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
535
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
536
- rejectVersion?: number | undefined;
537
- approvalProgram: string | Uint8Array;
538
- clearStateProgram: string | Uint8Array;
539
- }> | AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
540
- }>;
541
- /**
542
- * Return params for an opt-in ABI call
543
- * @param params The parameters for the opt-in ABI method call
544
- * @returns The parameters which can be used to create an opt-in ABI method call
545
- */
546
- optIn: (params: {
547
- maxFee?: AlgoAmount | undefined;
548
- note?: string | Uint8Array | undefined;
549
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
550
- onComplete?: algosdk.OnApplicationComplete | undefined;
551
- rejectVersion?: number | undefined;
552
- lease?: string | Uint8Array | undefined;
553
- rekeyTo?: string | algosdk.Address | undefined;
554
- staticFee?: AlgoAmount | undefined;
555
- extraFee?: AlgoAmount | undefined;
556
- validityWindow?: number | bigint | undefined;
557
- firstValidRound?: bigint | undefined;
558
- lastValidRound?: bigint | undefined;
559
- accountReferences?: (string | algosdk.Address)[] | undefined;
560
- appReferences?: bigint[] | undefined;
561
- assetReferences?: bigint[] | undefined;
562
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
563
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
564
- sender?: string | algosdk.Address | undefined;
565
- method: string;
566
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
567
- }) => Promise<AppCallMethodCall>;
568
- /**
569
- * Return params for an delete ABI call
570
- * @param params The parameters for the delete ABI method call
571
- * @returns The parameters which can be used to create a delete ABI method call
572
- */
573
- delete: (params: {
574
- maxFee?: AlgoAmount | undefined;
575
- note?: string | Uint8Array | undefined;
576
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
577
- onComplete?: algosdk.OnApplicationComplete | undefined;
578
- rejectVersion?: number | undefined;
579
- lease?: string | Uint8Array | undefined;
580
- rekeyTo?: string | algosdk.Address | undefined;
581
- staticFee?: AlgoAmount | undefined;
582
- extraFee?: AlgoAmount | undefined;
583
- validityWindow?: number | bigint | undefined;
584
- firstValidRound?: bigint | undefined;
585
- lastValidRound?: bigint | undefined;
586
- accountReferences?: (string | algosdk.Address)[] | undefined;
587
- appReferences?: bigint[] | undefined;
588
- assetReferences?: bigint[] | undefined;
589
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
590
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
591
- sender?: string | algosdk.Address | undefined;
592
- method: string;
593
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
594
- }) => Promise<AppDeleteMethodCall>;
595
- /** Return params for an close out ABI call
596
- * @param params The parameters for the close out ABI method call
597
- * @returns The parameters which can be used to create a close out ABI method call
598
- */
599
- closeOut: (params: {
600
- maxFee?: AlgoAmount | undefined;
601
- note?: string | Uint8Array | undefined;
602
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
603
- onComplete?: algosdk.OnApplicationComplete | undefined;
604
- rejectVersion?: number | undefined;
605
- lease?: string | Uint8Array | undefined;
606
- rekeyTo?: string | algosdk.Address | undefined;
607
- staticFee?: AlgoAmount | undefined;
608
- extraFee?: 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?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
616
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
617
- sender?: string | algosdk.Address | undefined;
618
- method: string;
619
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
620
- }) => Promise<AppCallMethodCall>;
621
- /** Return params for an ABI call
622
- * @param params The parameters for the ABI method call
623
- * @returns The parameters which can be used to create an ABI method call
624
- */
625
- call: (params: {
626
- maxFee?: AlgoAmount | undefined;
627
- note?: string | Uint8Array | undefined;
628
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
629
- onComplete?: algosdk.OnApplicationComplete | undefined;
630
- rejectVersion?: number | undefined;
631
- lease?: string | Uint8Array | undefined;
632
- rekeyTo?: string | algosdk.Address | undefined;
633
- staticFee?: AlgoAmount | undefined;
634
- extraFee?: AlgoAmount | undefined;
635
- validityWindow?: number | bigint | undefined;
636
- firstValidRound?: bigint | undefined;
637
- lastValidRound?: bigint | undefined;
638
- accountReferences?: (string | algosdk.Address)[] | undefined;
639
- appReferences?: bigint[] | undefined;
640
- assetReferences?: bigint[] | undefined;
641
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
642
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
643
- sender?: string | algosdk.Address | undefined;
644
- method: string;
645
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
646
- } & CallOnComplete) => Promise<AppCallMethodCall>;
647
- } & {
648
- /** Interact with bare (raw) call parameters */ bare: {
649
- /** Return params for an update call, including deploy-time TEAL template replacements and compilation if provided */
650
- update: (params?: ({
651
- maxFee?: AlgoAmount | undefined;
652
- note?: string | Uint8Array | undefined;
653
- args?: Uint8Array[] | undefined;
654
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
655
- rejectVersion?: number | undefined;
656
- lease?: string | Uint8Array | undefined;
657
- rekeyTo?: string | algosdk.Address | undefined;
658
- staticFee?: AlgoAmount | undefined;
659
- extraFee?: AlgoAmount | undefined;
660
- validityWindow?: number | bigint | undefined;
661
- firstValidRound?: bigint | undefined;
662
- lastValidRound?: bigint | undefined;
663
- accountReferences?: (string | algosdk.Address)[] | undefined;
664
- appReferences?: bigint[] | undefined;
665
- assetReferences?: bigint[] | undefined;
666
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
667
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
668
- sender?: string | algosdk.Address | undefined;
669
- } & AppClientCompilationParams) | undefined) => Promise<{
670
- sender: string | algosdk.Address;
671
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
672
- rekeyTo?: string | algosdk.Address | undefined;
673
- note?: string | Uint8Array | undefined;
674
- lease?: string | Uint8Array | undefined;
675
- staticFee?: AlgoAmount | undefined;
676
- extraFee?: AlgoAmount | undefined;
677
- maxFee?: AlgoAmount | undefined;
678
- validityWindow?: number | bigint | undefined;
679
- firstValidRound?: bigint | undefined;
680
- lastValidRound?: bigint | undefined;
681
- appId: bigint;
682
- onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
683
- args?: Uint8Array[] | undefined;
684
- accountReferences?: (string | algosdk.Address)[] | undefined;
685
- appReferences?: bigint[] | undefined;
686
- assetReferences?: bigint[] | undefined;
687
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
688
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
689
- rejectVersion?: number | undefined;
690
- approvalProgram: string | Uint8Array;
691
- clearStateProgram: string | Uint8Array;
692
- }>;
693
- /** Return params for an opt-in call */
694
- optIn: (params?: {
695
- maxFee?: AlgoAmount | undefined;
696
- note?: string | Uint8Array | undefined;
697
- args?: Uint8Array[] | undefined;
698
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
699
- rejectVersion?: number | undefined;
700
- lease?: string | Uint8Array | undefined;
701
- rekeyTo?: string | algosdk.Address | undefined;
702
- staticFee?: AlgoAmount | undefined;
703
- extraFee?: AlgoAmount | undefined;
704
- validityWindow?: number | bigint | undefined;
705
- firstValidRound?: bigint | undefined;
706
- lastValidRound?: bigint | undefined;
707
- accountReferences?: (string | algosdk.Address)[] | undefined;
708
- appReferences?: bigint[] | undefined;
709
- assetReferences?: bigint[] | undefined;
710
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
711
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
712
- sender?: string | algosdk.Address | undefined;
713
- } | undefined) => AppCallParams;
714
- /** Return params for a delete call */
715
- delete: (params?: {
716
- maxFee?: AlgoAmount | undefined;
717
- note?: string | Uint8Array | undefined;
718
- args?: Uint8Array[] | undefined;
719
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
720
- rejectVersion?: number | undefined;
721
- lease?: string | Uint8Array | undefined;
722
- rekeyTo?: string | algosdk.Address | undefined;
723
- staticFee?: AlgoAmount | undefined;
724
- extraFee?: AlgoAmount | undefined;
725
- validityWindow?: number | bigint | undefined;
726
- firstValidRound?: bigint | undefined;
727
- lastValidRound?: bigint | undefined;
728
- accountReferences?: (string | algosdk.Address)[] | undefined;
729
- appReferences?: bigint[] | undefined;
730
- assetReferences?: bigint[] | undefined;
731
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
732
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
733
- sender?: string | algosdk.Address | undefined;
734
- } | undefined) => AppDeleteParams;
735
- /** Return params for a clear state call */
736
- clearState: (params?: {
737
- maxFee?: AlgoAmount | undefined;
738
- note?: string | Uint8Array | undefined;
739
- args?: Uint8Array[] | undefined;
740
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
741
- rejectVersion?: number | undefined;
742
- lease?: string | Uint8Array | undefined;
743
- rekeyTo?: string | algosdk.Address | undefined;
744
- staticFee?: AlgoAmount | undefined;
745
- extraFee?: AlgoAmount | undefined;
746
- validityWindow?: number | bigint | undefined;
747
- firstValidRound?: bigint | undefined;
748
- lastValidRound?: bigint | undefined;
749
- accountReferences?: (string | algosdk.Address)[] | undefined;
750
- appReferences?: bigint[] | undefined;
751
- assetReferences?: bigint[] | undefined;
752
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
753
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
754
- sender?: string | algosdk.Address | undefined;
755
- } | undefined) => AppCallParams;
756
- /** Return params for a close out call */
757
- closeOut: (params?: {
758
- maxFee?: AlgoAmount | undefined;
759
- note?: string | Uint8Array | undefined;
760
- args?: Uint8Array[] | undefined;
761
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
762
- rejectVersion?: number | undefined;
763
- lease?: string | Uint8Array | undefined;
764
- rekeyTo?: string | algosdk.Address | undefined;
765
- staticFee?: AlgoAmount | undefined;
766
- extraFee?: AlgoAmount | undefined;
767
- validityWindow?: number | bigint | undefined;
768
- firstValidRound?: bigint | undefined;
769
- lastValidRound?: bigint | undefined;
770
- accountReferences?: (string | algosdk.Address)[] | undefined;
771
- appReferences?: bigint[] | undefined;
772
- assetReferences?: bigint[] | undefined;
773
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
774
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
775
- sender?: string | algosdk.Address | undefined;
776
- } | undefined) => AppCallParams;
777
- /** Return params for a call (defaults to no-op) */
778
- call: (params?: ({
779
- maxFee?: AlgoAmount | undefined;
780
- note?: string | Uint8Array | undefined;
781
- args?: Uint8Array[] | undefined;
782
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
783
- rejectVersion?: number | undefined;
784
- lease?: string | Uint8Array | undefined;
785
- rekeyTo?: string | algosdk.Address | undefined;
786
- staticFee?: AlgoAmount | undefined;
787
- extraFee?: AlgoAmount | undefined;
788
- validityWindow?: number | bigint | undefined;
789
- firstValidRound?: bigint | undefined;
790
- lastValidRound?: bigint | undefined;
791
- accountReferences?: (string | algosdk.Address)[] | undefined;
792
- appReferences?: bigint[] | undefined;
793
- assetReferences?: bigint[] | undefined;
794
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
795
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
796
- sender?: string | algosdk.Address | undefined;
797
- } & CallOnComplete) | undefined) => AppCallParams;
798
- };
799
- };
800
- /** Create transactions for the current app */
801
- get createTransaction(): {
802
- /** Return transaction for a payment transaction to fund the app account
803
- * @param params The parameters for the fund app account payment transaction
804
- * @returns A transaction which can be used to fund the app account
805
- */
806
- fundAppAccount: (params: {
807
- maxFee?: AlgoAmount | undefined;
808
- note?: string | Uint8Array | undefined;
809
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
810
- lease?: string | Uint8Array | undefined;
811
- rekeyTo?: string | algosdk.Address | undefined;
812
- staticFee?: AlgoAmount | undefined;
813
- extraFee?: AlgoAmount | undefined;
814
- validityWindow?: number | bigint | undefined;
815
- firstValidRound?: bigint | undefined;
816
- lastValidRound?: bigint | undefined;
817
- amount: AlgoAmount;
818
- closeRemainderTo?: string | algosdk.Address | undefined;
819
- maxRoundsToWaitForConfirmation?: number | undefined;
820
- suppressLog?: boolean | undefined;
821
- populateAppCallResources?: boolean | undefined;
822
- coverAppCallInnerTransactionFees?: boolean | undefined;
823
- sender?: string | algosdk.Address | undefined;
824
- }) => Promise<algosdk.Transaction>;
825
- /**
826
- * Return transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
827
- * @param params The parameters for the update ABI method call
828
- * @returns The transactions which can be used to create an update ABI method call
829
- */
830
- update: (params: {
831
- maxFee?: AlgoAmount | undefined;
832
- note?: string | Uint8Array | undefined;
833
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
834
- onComplete?: algosdk.OnApplicationComplete | undefined;
835
- rejectVersion?: number | undefined;
836
- lease?: string | Uint8Array | undefined;
837
- rekeyTo?: string | algosdk.Address | undefined;
838
- staticFee?: AlgoAmount | undefined;
839
- extraFee?: AlgoAmount | undefined;
840
- validityWindow?: number | bigint | undefined;
841
- firstValidRound?: bigint | undefined;
842
- lastValidRound?: bigint | undefined;
843
- accountReferences?: (string | algosdk.Address)[] | undefined;
844
- appReferences?: bigint[] | undefined;
845
- assetReferences?: bigint[] | undefined;
846
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
847
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
848
- sender?: string | algosdk.Address | undefined;
849
- method: string;
850
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
851
- } & AppClientCompilationParams) => Promise<{
852
- transactions: algosdk.Transaction[];
853
- methodCalls: Map<number, algosdk.ABIMethod>;
854
- signers: Map<number, algosdk.TransactionSigner>;
855
- }>;
856
- /**
857
- * Return transactions for an opt-in ABI call
858
- * @param params The parameters for the opt-in ABI method call
859
- * @returns The transactions which can be used to create an opt-in ABI method call
860
- */
861
- optIn: (params: {
862
- maxFee?: AlgoAmount | undefined;
863
- note?: string | Uint8Array | undefined;
864
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
865
- onComplete?: algosdk.OnApplicationComplete | undefined;
866
- rejectVersion?: number | undefined;
867
- lease?: string | Uint8Array | undefined;
868
- rekeyTo?: string | algosdk.Address | undefined;
869
- staticFee?: AlgoAmount | undefined;
870
- extraFee?: AlgoAmount | undefined;
871
- validityWindow?: number | bigint | undefined;
872
- firstValidRound?: bigint | undefined;
873
- lastValidRound?: bigint | undefined;
874
- accountReferences?: (string | algosdk.Address)[] | undefined;
875
- appReferences?: bigint[] | undefined;
876
- assetReferences?: bigint[] | undefined;
877
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
878
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
879
- sender?: string | algosdk.Address | undefined;
880
- method: string;
881
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
882
- }) => Promise<{
883
- transactions: algosdk.Transaction[];
884
- methodCalls: Map<number, algosdk.ABIMethod>;
885
- signers: Map<number, algosdk.TransactionSigner>;
886
- }>;
887
- /**
888
- * Return transactions for a delete ABI call
889
- * @param params The parameters for the delete ABI method call
890
- * @returns The transactions which can be used to create a delete ABI method call
891
- */
892
- delete: (params: {
893
- maxFee?: AlgoAmount | undefined;
894
- note?: string | Uint8Array | undefined;
895
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
896
- onComplete?: algosdk.OnApplicationComplete | undefined;
897
- rejectVersion?: number | undefined;
898
- lease?: string | Uint8Array | undefined;
899
- rekeyTo?: string | algosdk.Address | undefined;
900
- staticFee?: AlgoAmount | undefined;
901
- extraFee?: AlgoAmount | undefined;
902
- validityWindow?: number | bigint | undefined;
903
- firstValidRound?: bigint | undefined;
904
- lastValidRound?: bigint | undefined;
905
- accountReferences?: (string | algosdk.Address)[] | undefined;
906
- appReferences?: bigint[] | undefined;
907
- assetReferences?: bigint[] | undefined;
908
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
909
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
910
- sender?: string | algosdk.Address | undefined;
911
- method: string;
912
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
913
- }) => Promise<{
914
- transactions: algosdk.Transaction[];
915
- methodCalls: Map<number, algosdk.ABIMethod>;
916
- signers: Map<number, algosdk.TransactionSigner>;
917
- }>;
918
- /**
919
- * Return transactions for a close out ABI call
920
- * @param params The parameters for the close out ABI method call
921
- * @returns The transactions which can be used to create a close out ABI method call
922
- */
923
- closeOut: (params: {
924
- maxFee?: AlgoAmount | undefined;
925
- note?: string | Uint8Array | undefined;
926
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
927
- onComplete?: algosdk.OnApplicationComplete | undefined;
928
- rejectVersion?: number | undefined;
929
- lease?: string | Uint8Array | undefined;
930
- rekeyTo?: string | algosdk.Address | undefined;
931
- staticFee?: AlgoAmount | undefined;
932
- extraFee?: AlgoAmount | undefined;
933
- validityWindow?: number | bigint | undefined;
934
- firstValidRound?: bigint | undefined;
935
- lastValidRound?: bigint | undefined;
936
- accountReferences?: (string | algosdk.Address)[] | undefined;
937
- appReferences?: bigint[] | undefined;
938
- assetReferences?: bigint[] | undefined;
939
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
940
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
941
- sender?: string | algosdk.Address | undefined;
942
- method: string;
943
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
944
- }) => Promise<{
945
- transactions: algosdk.Transaction[];
946
- methodCalls: Map<number, algosdk.ABIMethod>;
947
- signers: Map<number, algosdk.TransactionSigner>;
948
- }>;
949
- /**
950
- * Return transactions for an ABI call (defaults to no-op)
951
- * @param params The parameters for the ABI method call
952
- * @returns The transactions which can be used to create an ABI method call
953
- */
954
- call: (params: {
955
- maxFee?: AlgoAmount | undefined;
956
- note?: string | Uint8Array | undefined;
957
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
958
- onComplete?: algosdk.OnApplicationComplete | undefined;
959
- rejectVersion?: number | undefined;
960
- lease?: string | Uint8Array | undefined;
961
- rekeyTo?: string | algosdk.Address | undefined;
962
- staticFee?: AlgoAmount | undefined;
963
- extraFee?: AlgoAmount | undefined;
964
- validityWindow?: number | bigint | undefined;
965
- firstValidRound?: bigint | undefined;
966
- lastValidRound?: bigint | undefined;
967
- accountReferences?: (string | algosdk.Address)[] | undefined;
968
- appReferences?: bigint[] | undefined;
969
- assetReferences?: bigint[] | undefined;
970
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
971
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
972
- sender?: string | algosdk.Address | undefined;
973
- method: string;
974
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
975
- } & CallOnComplete) => Promise<{
976
- transactions: algosdk.Transaction[];
977
- methodCalls: Map<number, algosdk.ABIMethod>;
978
- signers: Map<number, algosdk.TransactionSigner>;
979
- }>;
980
- } & {
981
- /** Interact with bare (raw) call transactions */ bare: {
982
- /** Returns a transaction for an update call, including deploy-time TEAL template replacements and compilation if provided */
983
- update: (params?: ({
984
- maxFee?: AlgoAmount | undefined;
985
- note?: string | Uint8Array | undefined;
986
- args?: Uint8Array[] | undefined;
987
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
988
- rejectVersion?: number | undefined;
989
- lease?: string | Uint8Array | undefined;
990
- rekeyTo?: string | algosdk.Address | undefined;
991
- staticFee?: AlgoAmount | undefined;
992
- extraFee?: AlgoAmount | undefined;
993
- validityWindow?: number | bigint | undefined;
994
- firstValidRound?: bigint | undefined;
995
- lastValidRound?: bigint | undefined;
996
- accountReferences?: (string | algosdk.Address)[] | undefined;
997
- appReferences?: bigint[] | undefined;
998
- assetReferences?: bigint[] | undefined;
999
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1000
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1001
- sender?: string | algosdk.Address | undefined;
1002
- } & AppClientCompilationParams) | undefined) => Promise<algosdk.Transaction>;
1003
- /** Returns a transaction for an opt-in call */
1004
- optIn: (params?: {
1005
- maxFee?: AlgoAmount | undefined;
1006
- note?: string | Uint8Array | undefined;
1007
- args?: Uint8Array[] | undefined;
1008
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1009
- rejectVersion?: number | undefined;
1010
- lease?: string | Uint8Array | undefined;
1011
- rekeyTo?: string | algosdk.Address | undefined;
1012
- staticFee?: AlgoAmount | undefined;
1013
- extraFee?: AlgoAmount | undefined;
1014
- validityWindow?: number | bigint | undefined;
1015
- firstValidRound?: bigint | undefined;
1016
- lastValidRound?: bigint | undefined;
1017
- accountReferences?: (string | algosdk.Address)[] | undefined;
1018
- appReferences?: bigint[] | undefined;
1019
- assetReferences?: bigint[] | undefined;
1020
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1021
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1022
- sender?: string | algosdk.Address | undefined;
1023
- } | undefined) => Promise<algosdk.Transaction>;
1024
- /** Returns a transaction for a delete call */
1025
- delete: (params?: {
1026
- maxFee?: AlgoAmount | undefined;
1027
- note?: string | Uint8Array | undefined;
1028
- args?: Uint8Array[] | undefined;
1029
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1030
- rejectVersion?: number | undefined;
1031
- lease?: string | Uint8Array | undefined;
1032
- rekeyTo?: string | algosdk.Address | undefined;
1033
- staticFee?: AlgoAmount | undefined;
1034
- extraFee?: AlgoAmount | undefined;
1035
- validityWindow?: number | bigint | undefined;
1036
- firstValidRound?: bigint | undefined;
1037
- lastValidRound?: bigint | undefined;
1038
- accountReferences?: (string | algosdk.Address)[] | undefined;
1039
- appReferences?: bigint[] | undefined;
1040
- assetReferences?: bigint[] | undefined;
1041
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1042
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1043
- sender?: string | algosdk.Address | undefined;
1044
- } | undefined) => Promise<algosdk.Transaction>;
1045
- /** Returns a transaction for a clear state call */
1046
- clearState: (params?: {
1047
- maxFee?: AlgoAmount | undefined;
1048
- note?: string | Uint8Array | undefined;
1049
- args?: Uint8Array[] | undefined;
1050
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1051
- rejectVersion?: number | undefined;
1052
- lease?: string | Uint8Array | undefined;
1053
- rekeyTo?: string | algosdk.Address | undefined;
1054
- staticFee?: AlgoAmount | undefined;
1055
- extraFee?: AlgoAmount | undefined;
1056
- validityWindow?: number | bigint | undefined;
1057
- firstValidRound?: bigint | undefined;
1058
- lastValidRound?: bigint | undefined;
1059
- accountReferences?: (string | algosdk.Address)[] | undefined;
1060
- appReferences?: bigint[] | undefined;
1061
- assetReferences?: bigint[] | undefined;
1062
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1063
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1064
- sender?: string | algosdk.Address | undefined;
1065
- } | undefined) => Promise<algosdk.Transaction>;
1066
- /** Returns a transaction for a close out call */
1067
- closeOut: (params?: {
1068
- maxFee?: AlgoAmount | undefined;
1069
- note?: string | Uint8Array | undefined;
1070
- args?: Uint8Array[] | undefined;
1071
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1072
- rejectVersion?: number | undefined;
1073
- lease?: string | Uint8Array | undefined;
1074
- rekeyTo?: string | algosdk.Address | undefined;
1075
- staticFee?: AlgoAmount | undefined;
1076
- extraFee?: AlgoAmount | undefined;
1077
- validityWindow?: number | bigint | undefined;
1078
- firstValidRound?: bigint | undefined;
1079
- lastValidRound?: bigint | undefined;
1080
- accountReferences?: (string | algosdk.Address)[] | undefined;
1081
- appReferences?: bigint[] | undefined;
1082
- assetReferences?: bigint[] | undefined;
1083
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1084
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1085
- sender?: string | algosdk.Address | undefined;
1086
- } | undefined) => Promise<algosdk.Transaction>;
1087
- /** Returns a transaction for a call (defaults to no-op) */
1088
- call: (params?: ({
1089
- maxFee?: AlgoAmount | undefined;
1090
- note?: string | Uint8Array | undefined;
1091
- args?: Uint8Array[] | undefined;
1092
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1093
- rejectVersion?: number | undefined;
1094
- lease?: string | Uint8Array | undefined;
1095
- rekeyTo?: string | algosdk.Address | undefined;
1096
- staticFee?: AlgoAmount | undefined;
1097
- extraFee?: AlgoAmount | undefined;
1098
- validityWindow?: number | bigint | undefined;
1099
- firstValidRound?: bigint | undefined;
1100
- lastValidRound?: bigint | undefined;
1101
- accountReferences?: (string | algosdk.Address)[] | undefined;
1102
- appReferences?: bigint[] | undefined;
1103
- assetReferences?: bigint[] | undefined;
1104
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1105
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1106
- sender?: string | algosdk.Address | undefined;
1107
- } & CallOnComplete) | undefined) => Promise<algosdk.Transaction>;
1108
- };
1109
- };
1110
- /** Send transactions to the current app */
1111
- get send(): {
1112
- /** Sign and send transactions for a payment transaction to fund the app account
1113
- * @param params The parameters for the fund app account payment transaction
1114
- * @returns The result of send the fund app account payment transaction
1115
- */
1116
- fundAppAccount: (params: {
1117
- maxFee?: AlgoAmount | undefined;
1118
- note?: string | Uint8Array | undefined;
1119
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1120
- lease?: string | Uint8Array | undefined;
1121
- rekeyTo?: string | algosdk.Address | undefined;
1122
- staticFee?: AlgoAmount | undefined;
1123
- extraFee?: AlgoAmount | undefined;
1124
- validityWindow?: number | bigint | undefined;
1125
- firstValidRound?: bigint | undefined;
1126
- lastValidRound?: bigint | undefined;
1127
- amount: AlgoAmount;
1128
- closeRemainderTo?: string | algosdk.Address | undefined;
1129
- maxRoundsToWaitForConfirmation?: number | undefined;
1130
- suppressLog?: boolean | undefined;
1131
- populateAppCallResources?: boolean | undefined;
1132
- coverAppCallInnerTransactionFees?: boolean | undefined;
1133
- sender?: string | algosdk.Address | undefined;
1134
- } & SendParams) => Promise<{
1135
- groupId: string;
1136
- txIds: string[];
1137
- returns?: ABIReturn[] | undefined;
1138
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1139
- transactions: algosdk.Transaction[];
1140
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1141
- transaction: algosdk.Transaction;
1142
- }>;
1143
- /**
1144
- * Sign and send transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
1145
- * @param params The parameters for the update ABI method call
1146
- * @returns The result of sending the update ABI method call
1147
- */
1148
- update: (params: {
1149
- maxFee?: AlgoAmount | undefined;
1150
- note?: string | Uint8Array | undefined;
1151
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1152
- onComplete?: algosdk.OnApplicationComplete | undefined;
1153
- rejectVersion?: number | undefined;
1154
- lease?: string | Uint8Array | undefined;
1155
- rekeyTo?: string | algosdk.Address | undefined;
1156
- staticFee?: AlgoAmount | undefined;
1157
- extraFee?: AlgoAmount | undefined;
1158
- validityWindow?: number | bigint | undefined;
1159
- firstValidRound?: bigint | undefined;
1160
- lastValidRound?: bigint | undefined;
1161
- accountReferences?: (string | algosdk.Address)[] | undefined;
1162
- appReferences?: bigint[] | undefined;
1163
- assetReferences?: bigint[] | undefined;
1164
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1165
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1166
- sender?: string | algosdk.Address | undefined;
1167
- method: string;
1168
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
1169
- } & AppClientCompilationParams & SendParams) => Promise<{
1170
- compiledApproval?: import("./app").CompiledTeal | undefined;
1171
- compiledClear?: import("./app").CompiledTeal | undefined;
1172
- groupId: string;
1173
- txIds: string[];
1174
- returns?: ABIReturn[] | undefined;
1175
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1176
- transactions: algosdk.Transaction[];
1177
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1178
- transaction: algosdk.Transaction;
1179
- return?: algosdk.ABIValue | ABIStruct | undefined;
1180
- }>;
1181
- /**
1182
- * Sign and send transactions for an opt-in ABI call
1183
- * @param params The parameters for the opt-in ABI method call
1184
- * @returns The result of sending the opt-in ABI method call
1185
- */
1186
- optIn: (params: {
1187
- maxFee?: AlgoAmount | undefined;
1188
- note?: string | Uint8Array | undefined;
1189
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1190
- onComplete?: algosdk.OnApplicationComplete | undefined;
1191
- rejectVersion?: number | undefined;
1192
- lease?: string | Uint8Array | undefined;
1193
- rekeyTo?: string | algosdk.Address | undefined;
1194
- staticFee?: AlgoAmount | undefined;
1195
- extraFee?: AlgoAmount | undefined;
1196
- validityWindow?: number | bigint | undefined;
1197
- firstValidRound?: bigint | undefined;
1198
- lastValidRound?: bigint | undefined;
1199
- accountReferences?: (string | algosdk.Address)[] | undefined;
1200
- appReferences?: bigint[] | undefined;
1201
- assetReferences?: bigint[] | undefined;
1202
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1203
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1204
- sender?: string | algosdk.Address | undefined;
1205
- method: string;
1206
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
1207
- } & SendParams) => Promise<Omit<{
1208
- groupId: string;
1209
- txIds: string[];
1210
- returns?: ABIReturn[] | undefined;
1211
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1212
- transactions: algosdk.Transaction[];
1213
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1214
- transaction: algosdk.Transaction;
1215
- return?: ABIReturn | undefined;
1216
- }, "return"> & AppReturn<algosdk.ABIValue | ABIStruct | undefined>>;
1217
- /**
1218
- * Sign and send transactions for a delete ABI call
1219
- * @param params The parameters for the delete ABI method call
1220
- * @returns The result of sending the delete ABI method call
1221
- */
1222
- delete: (params: {
1223
- maxFee?: AlgoAmount | undefined;
1224
- note?: string | Uint8Array | undefined;
1225
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1226
- onComplete?: algosdk.OnApplicationComplete | undefined;
1227
- rejectVersion?: number | undefined;
1228
- lease?: string | Uint8Array | undefined;
1229
- rekeyTo?: string | algosdk.Address | undefined;
1230
- staticFee?: AlgoAmount | undefined;
1231
- extraFee?: AlgoAmount | undefined;
1232
- validityWindow?: number | bigint | undefined;
1233
- firstValidRound?: bigint | undefined;
1234
- lastValidRound?: bigint | undefined;
1235
- accountReferences?: (string | algosdk.Address)[] | undefined;
1236
- appReferences?: bigint[] | undefined;
1237
- assetReferences?: bigint[] | undefined;
1238
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1239
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1240
- sender?: string | algosdk.Address | undefined;
1241
- method: string;
1242
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
1243
- } & SendParams) => Promise<Omit<{
1244
- groupId: string;
1245
- txIds: string[];
1246
- returns?: ABIReturn[] | undefined;
1247
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1248
- transactions: algosdk.Transaction[];
1249
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1250
- transaction: algosdk.Transaction;
1251
- return?: ABIReturn | undefined;
1252
- }, "return"> & AppReturn<algosdk.ABIValue | ABIStruct | undefined>>;
1253
- /**
1254
- * Sign and send transactions for a close out ABI call
1255
- * @param params The parameters for the close out ABI method call
1256
- * @returns The result of sending the close out ABI method call
1257
- */
1258
- closeOut: (params: {
1259
- maxFee?: AlgoAmount | undefined;
1260
- note?: string | Uint8Array | undefined;
1261
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1262
- onComplete?: algosdk.OnApplicationComplete | undefined;
1263
- rejectVersion?: number | undefined;
1264
- lease?: string | Uint8Array | undefined;
1265
- rekeyTo?: string | algosdk.Address | undefined;
1266
- staticFee?: AlgoAmount | undefined;
1267
- extraFee?: AlgoAmount | undefined;
1268
- validityWindow?: number | bigint | undefined;
1269
- firstValidRound?: bigint | undefined;
1270
- lastValidRound?: bigint | undefined;
1271
- accountReferences?: (string | algosdk.Address)[] | undefined;
1272
- appReferences?: bigint[] | undefined;
1273
- assetReferences?: bigint[] | undefined;
1274
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1275
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1276
- sender?: string | algosdk.Address | undefined;
1277
- method: string;
1278
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
1279
- } & SendParams) => Promise<Omit<{
1280
- groupId: string;
1281
- txIds: string[];
1282
- returns?: ABIReturn[] | undefined;
1283
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1284
- transactions: algosdk.Transaction[];
1285
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1286
- transaction: algosdk.Transaction;
1287
- return?: ABIReturn | undefined;
1288
- }, "return"> & AppReturn<algosdk.ABIValue | ABIStruct | undefined>>;
1289
- /**
1290
- * Sign and send transactions for a call (defaults to no-op)
1291
- * @param params The parameters for the ABI method call
1292
- * @returns The result of sending the ABI method call
1293
- */
1294
- call: (params: {
1295
- maxFee?: AlgoAmount | undefined;
1296
- note?: string | Uint8Array | undefined;
1297
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1298
- onComplete?: algosdk.OnApplicationComplete | undefined;
1299
- rejectVersion?: number | undefined;
1300
- lease?: string | Uint8Array | undefined;
1301
- rekeyTo?: string | algosdk.Address | undefined;
1302
- staticFee?: AlgoAmount | undefined;
1303
- extraFee?: AlgoAmount | undefined;
1304
- validityWindow?: number | bigint | undefined;
1305
- firstValidRound?: bigint | undefined;
1306
- lastValidRound?: bigint | undefined;
1307
- accountReferences?: (string | algosdk.Address)[] | undefined;
1308
- appReferences?: bigint[] | undefined;
1309
- assetReferences?: bigint[] | undefined;
1310
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1311
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1312
- sender?: string | algosdk.Address | undefined;
1313
- method: string;
1314
- args?: (algosdk.ABIValue | AppMethodCallTransactionArgument | ABIStruct | undefined)[] | undefined;
1315
- } & CallOnComplete & SendParams) => Promise<Omit<{
1316
- groupId: string;
1317
- txIds: string[];
1318
- returns?: ABIReturn[] | undefined;
1319
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1320
- transactions: algosdk.Transaction[];
1321
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1322
- transaction: algosdk.Transaction;
1323
- return?: ABIReturn | undefined;
1324
- }, "return"> & AppReturn<algosdk.ABIValue | ABIStruct | undefined>>;
1325
- } & {
1326
- /** Interact with bare (raw) calls */ bare: {
1327
- /** Signs and sends an update call, including deploy-time TEAL template replacements and compilation if provided */
1328
- update: (params?: ({
1329
- maxFee?: AlgoAmount | undefined;
1330
- note?: string | Uint8Array | undefined;
1331
- args?: Uint8Array[] | undefined;
1332
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1333
- rejectVersion?: number | undefined;
1334
- lease?: string | Uint8Array | undefined;
1335
- rekeyTo?: string | algosdk.Address | undefined;
1336
- staticFee?: AlgoAmount | undefined;
1337
- extraFee?: AlgoAmount | undefined;
1338
- validityWindow?: number | bigint | undefined;
1339
- firstValidRound?: bigint | undefined;
1340
- lastValidRound?: bigint | undefined;
1341
- accountReferences?: (string | algosdk.Address)[] | undefined;
1342
- appReferences?: bigint[] | undefined;
1343
- assetReferences?: bigint[] | undefined;
1344
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1345
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1346
- sender?: string | algosdk.Address | undefined;
1347
- } & AppClientCompilationParams & SendParams) | undefined) => Promise<{
1348
- compiledApproval?: import("./app").CompiledTeal | undefined;
1349
- compiledClear?: import("./app").CompiledTeal | undefined;
1350
- groupId: string;
1351
- txIds: string[];
1352
- returns?: ABIReturn[] | undefined;
1353
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1354
- transactions: algosdk.Transaction[];
1355
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1356
- transaction: algosdk.Transaction;
1357
- return?: ABIReturn | undefined;
1358
- }>;
1359
- /** Signs and sends an opt-in call */
1360
- optIn: (params?: ({
1361
- maxFee?: AlgoAmount | undefined;
1362
- note?: string | Uint8Array | undefined;
1363
- args?: Uint8Array[] | undefined;
1364
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1365
- rejectVersion?: number | undefined;
1366
- lease?: string | Uint8Array | undefined;
1367
- rekeyTo?: string | algosdk.Address | undefined;
1368
- staticFee?: AlgoAmount | undefined;
1369
- extraFee?: AlgoAmount | undefined;
1370
- validityWindow?: number | bigint | undefined;
1371
- firstValidRound?: bigint | undefined;
1372
- lastValidRound?: bigint | undefined;
1373
- accountReferences?: (string | algosdk.Address)[] | undefined;
1374
- appReferences?: bigint[] | undefined;
1375
- assetReferences?: bigint[] | undefined;
1376
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1377
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1378
- sender?: string | algosdk.Address | undefined;
1379
- } & SendParams) | undefined) => Promise<{
1380
- groupId: string;
1381
- txIds: string[];
1382
- returns?: ABIReturn[] | undefined;
1383
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1384
- transactions: algosdk.Transaction[];
1385
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1386
- transaction: algosdk.Transaction;
1387
- return?: ABIReturn | undefined;
1388
- }>;
1389
- /** Signs and sends a delete call */
1390
- delete: (params?: ({
1391
- maxFee?: AlgoAmount | undefined;
1392
- note?: string | Uint8Array | undefined;
1393
- args?: Uint8Array[] | undefined;
1394
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1395
- rejectVersion?: number | undefined;
1396
- lease?: string | Uint8Array | undefined;
1397
- rekeyTo?: string | algosdk.Address | undefined;
1398
- staticFee?: AlgoAmount | undefined;
1399
- extraFee?: AlgoAmount | undefined;
1400
- validityWindow?: number | bigint | undefined;
1401
- firstValidRound?: bigint | undefined;
1402
- lastValidRound?: bigint | undefined;
1403
- accountReferences?: (string | algosdk.Address)[] | undefined;
1404
- appReferences?: bigint[] | undefined;
1405
- assetReferences?: bigint[] | undefined;
1406
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1407
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1408
- sender?: string | algosdk.Address | undefined;
1409
- } & SendParams) | undefined) => Promise<{
1410
- groupId: string;
1411
- txIds: string[];
1412
- returns?: ABIReturn[] | undefined;
1413
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1414
- transactions: algosdk.Transaction[];
1415
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1416
- transaction: algosdk.Transaction;
1417
- return?: ABIReturn | undefined;
1418
- }>;
1419
- /** Signs and sends a clear state call */
1420
- clearState: (params?: ({
1421
- maxFee?: AlgoAmount | undefined;
1422
- note?: string | Uint8Array | undefined;
1423
- args?: Uint8Array[] | undefined;
1424
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1425
- rejectVersion?: number | undefined;
1426
- lease?: string | Uint8Array | undefined;
1427
- rekeyTo?: string | algosdk.Address | undefined;
1428
- staticFee?: AlgoAmount | undefined;
1429
- extraFee?: AlgoAmount | undefined;
1430
- validityWindow?: number | bigint | undefined;
1431
- firstValidRound?: bigint | undefined;
1432
- lastValidRound?: bigint | undefined;
1433
- accountReferences?: (string | algosdk.Address)[] | undefined;
1434
- appReferences?: bigint[] | undefined;
1435
- assetReferences?: bigint[] | undefined;
1436
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1437
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1438
- sender?: string | algosdk.Address | undefined;
1439
- } & SendParams) | undefined) => Promise<{
1440
- groupId: string;
1441
- txIds: string[];
1442
- returns?: ABIReturn[] | undefined;
1443
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1444
- transactions: algosdk.Transaction[];
1445
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1446
- transaction: algosdk.Transaction;
1447
- return?: ABIReturn | undefined;
1448
- }>;
1449
- /** Signs and sends a close out call */
1450
- closeOut: (params?: ({
1451
- maxFee?: AlgoAmount | undefined;
1452
- note?: string | Uint8Array | undefined;
1453
- args?: Uint8Array[] | undefined;
1454
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1455
- rejectVersion?: number | undefined;
1456
- lease?: string | Uint8Array | undefined;
1457
- rekeyTo?: string | algosdk.Address | undefined;
1458
- staticFee?: AlgoAmount | undefined;
1459
- extraFee?: AlgoAmount | undefined;
1460
- validityWindow?: number | bigint | undefined;
1461
- firstValidRound?: bigint | undefined;
1462
- lastValidRound?: bigint | undefined;
1463
- accountReferences?: (string | algosdk.Address)[] | undefined;
1464
- appReferences?: bigint[] | undefined;
1465
- assetReferences?: bigint[] | undefined;
1466
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1467
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1468
- sender?: string | algosdk.Address | undefined;
1469
- } & SendParams) | undefined) => Promise<{
1470
- groupId: string;
1471
- txIds: string[];
1472
- returns?: ABIReturn[] | undefined;
1473
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1474
- transactions: algosdk.Transaction[];
1475
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1476
- transaction: algosdk.Transaction;
1477
- return?: ABIReturn | undefined;
1478
- }>;
1479
- /** Signs and sends a call (defaults to no-op) */
1480
- call: (params?: ({
1481
- maxFee?: AlgoAmount | undefined;
1482
- note?: string | Uint8Array | undefined;
1483
- args?: Uint8Array[] | undefined;
1484
- signer?: algosdk.TransactionSigner | TransactionSignerAccount | undefined;
1485
- rejectVersion?: number | undefined;
1486
- lease?: string | Uint8Array | undefined;
1487
- rekeyTo?: string | algosdk.Address | undefined;
1488
- staticFee?: AlgoAmount | undefined;
1489
- extraFee?: AlgoAmount | undefined;
1490
- validityWindow?: number | bigint | undefined;
1491
- firstValidRound?: bigint | undefined;
1492
- lastValidRound?: bigint | undefined;
1493
- accountReferences?: (string | algosdk.Address)[] | undefined;
1494
- appReferences?: bigint[] | undefined;
1495
- assetReferences?: bigint[] | undefined;
1496
- boxReferences?: (BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1497
- accessReferences?: import("./app-manager").ResourceReference[] | undefined;
1498
- sender?: string | algosdk.Address | undefined;
1499
- } & CallOnComplete & SendParams) | undefined) => Promise<{
1500
- groupId: string;
1501
- txIds: string[];
1502
- returns?: ABIReturn[] | undefined;
1503
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1504
- transactions: algosdk.Transaction[];
1505
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1506
- transaction: algosdk.Transaction;
1507
- return?: ABIReturn | undefined;
1508
- }>;
1509
- };
1510
- };
1511
- /** Get state (local, global, box) from the current app */
1512
- get state(): {
1513
- /**
1514
- * Methods to access local state for the current app
1515
- * @param address The address of the account to get the local state for
1516
- */
1517
- local: (address: string | algosdk.Address) => {
1518
- /**
1519
- * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.
1520
- */
1521
- getAll: () => Promise<Record<string, any>>;
1522
- /**
1523
- * Returns a single state value for the current app with the value a decoded ABI value.
1524
- * @param name The name of the state value to retrieve the value for
1525
- * @param appState Optional cached value of the current state
1526
- * @returns
1527
- */
1528
- getValue: (name: string, appState?: AppState | undefined) => Promise<algosdk.ABIValue | ABIStruct | undefined>;
1529
- /**
1530
- * Returns a single value from the given map for the current app with the value a decoded ABI value.
1531
- * @param mapName The name of the map to read from
1532
- * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value
1533
- * that will be converted to bytes by encoding it using the specified ABI key type
1534
- * in the ARC-56 spec
1535
- * @param appState Optional cached value of the current state
1536
- */
1537
- getMapValue: (mapName: string, key: any, appState?: AppState | undefined) => Promise<algosdk.ABIValue | ABIStruct | undefined>;
1538
- /**
1539
- * Returns all map values for the given map.
1540
- * @param mapName The name of the map to read from
1541
- * @param appState Optional cached value of the current state
1542
- * @returns A map of all key-value pairs in the map as a `Record<string, ABIValue>`
1543
- */
1544
- getMap: (mapName: string) => Promise<Map<algosdk.ABIValue | ABIStruct, algosdk.ABIValue | ABIStruct>>;
1545
- };
1546
- /**
1547
- * Methods to access global state for the current app
1548
- */
1549
- global: {
1550
- /**
1551
- * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.
1552
- */
1553
- getAll: () => Promise<Record<string, any>>;
1554
- /**
1555
- * Returns a single state value for the current app with the value a decoded ABI value.
1556
- * @param name The name of the state value to retrieve the value for
1557
- * @param appState Optional cached value of the current state
1558
- * @returns
1559
- */
1560
- getValue: (name: string, appState?: AppState | undefined) => Promise<algosdk.ABIValue | ABIStruct | undefined>;
1561
- /**
1562
- * Returns a single value from the given map for the current app with the value a decoded ABI value.
1563
- * @param mapName The name of the map to read from
1564
- * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value
1565
- * that will be converted to bytes by encoding it using the specified ABI key type
1566
- * in the ARC-56 spec
1567
- * @param appState Optional cached value of the current state
1568
- */
1569
- getMapValue: (mapName: string, key: any, appState?: AppState | undefined) => Promise<algosdk.ABIValue | ABIStruct | undefined>;
1570
- /**
1571
- * Returns all map values for the given map.
1572
- * @param mapName The name of the map to read from
1573
- * @param appState Optional cached value of the current state
1574
- * @returns A map of all key-value pairs in the map as a `Record<string, ABIValue>`
1575
- */
1576
- getMap: (mapName: string) => Promise<Map<algosdk.ABIValue | ABIStruct, algosdk.ABIValue | ABIStruct>>;
1577
- };
1578
- /**
1579
- * Methods to access box storage for the current app
1580
- */
1581
- box: {
1582
- /**
1583
- * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.
1584
- */
1585
- getAll: () => Promise<Record<string, any>>;
1586
- /**
1587
- * Returns a single state value for the current app with the value a decoded ABI value.
1588
- * @param name The name of the state value to retrieve the value for
1589
- * @returns
1590
- */
1591
- getValue: (name: string) => Promise<algosdk.ABIValue | ABIStruct>;
1592
- /**
1593
- *
1594
- * @param mapName The name of the map to read from
1595
- * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value
1596
- * that will be converted to bytes by encoding it using the specified ABI key type
1597
- * in the ARC-56 spec
1598
- */
1599
- getMapValue: (mapName: string, key: any) => Promise<algosdk.ABIValue | ABIStruct>;
1600
- /**
1601
- *
1602
- * @param mapName The name of the map to read from
1603
- * @param key The key within the map as either a Buffer with the bytes or a value
1604
- * that will be converted to bytes by encoding it using the specified ABI key type
1605
- * in the ARC-56 spec
1606
- * @param appState
1607
- */
1608
- getMap: (mapName: string) => Promise<Map<algosdk.ABIValue | ABIStruct, algosdk.ABIValue | ABIStruct>>;
1609
- };
1610
- };
1611
- /**
1612
- * Funds Algo into the app account for this app.
1613
- *
1614
- * An alias for `appClient.send.fundAppAccount(params)`.
1615
- * @param params The parameters for the funding transaction
1616
- * @returns The result of the funding
1617
- * @example
1618
- * ```typescript
1619
- * await appClient.fundAppAccount({ amount: algo(1) })
1620
- * ```
497
+ call: (params: AppClientMethodCallParams & CallOnComplete) => Promise<AppCallMethodCall>;
498
+ } & {
499
+ /** Interact with bare (raw) call parameters */bare: ReturnType<AppClient["getBareParamsMethods"]>;
500
+ };
501
+ /** Create transactions for the current app */
502
+ get createTransaction(): {
503
+ /** Return transaction for a payment transaction to fund the app account
504
+ * @param params The parameters for the fund app account payment transaction
505
+ * @returns A transaction which can be used to fund the app account
1621
506
  */
1622
- fundAppAccount(params: FundAppParams): Promise<{
1623
- groupId: string;
1624
- txIds: string[];
1625
- returns?: ABIReturn[] | undefined;
1626
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1627
- transactions: algosdk.Transaction[];
1628
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1629
- transaction: algosdk.Transaction;
1630
- }>;
507
+ fundAppAccount: (params: FundAppParams) => Promise<algosdk.Transaction>;
1631
508
  /**
1632
- * Returns raw global state for the current app.
1633
- * @returns The global state
1634
- * @example
1635
- * ```typescript
1636
- * const globalState = await appClient.getGlobalState()
1637
- * ```
509
+ * Return transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
510
+ * @param params The parameters for the update ABI method call
511
+ * @returns The transactions which can be used to create an update ABI method call
1638
512
  */
1639
- getGlobalState(): Promise<AppState>;
1640
- /**
1641
- * Returns raw local state for the given account address.
1642
- * @param address The address of the account to get the local state for
1643
- * @returns The local state
1644
- * @example
1645
- * ```typescript
1646
- * const localState = await appClient.getLocalState('ACCOUNT_ADDRESS')
1647
- * ```
1648
- */
1649
- getLocalState(address: Address | string): Promise<AppState>;
1650
- /**
1651
- * Returns the names of all current boxes for the current app.
1652
- * @returns The names of the boxes
1653
- * @example
1654
- * ```typescript
1655
- * const boxNames = await appClient.getBoxNames()
1656
- * ```
1657
- */
1658
- getBoxNames(): Promise<BoxName[]>;
513
+ update: (params: AppClientMethodCallParams & AppClientCompilationParams) => Promise<{
514
+ transactions: algosdk.Transaction[];
515
+ methodCalls: Map<number, algosdk.ABIMethod>;
516
+ signers: Map<number, algosdk.TransactionSigner>;
517
+ }>;
1659
518
  /**
1660
- * Returns the value of the given box for the current app.
1661
- * @param name The identifier of the box to return
1662
- * @returns The current box value as a byte array
1663
- * @example
1664
- * ```typescript
1665
- * const boxValue = await appClient.getBoxValue('boxName')
1666
- * ```
519
+ * Return transactions for an opt-in ABI call
520
+ * @param params The parameters for the opt-in ABI method call
521
+ * @returns The transactions which can be used to create an opt-in ABI method call
1667
522
  */
1668
- getBoxValue(name: BoxIdentifier): Promise<Uint8Array>;
523
+ optIn: (params: AppClientMethodCallParams) => Promise<{
524
+ transactions: algosdk.Transaction[];
525
+ methodCalls: Map<number, algosdk.ABIMethod>;
526
+ signers: Map<number, algosdk.TransactionSigner>;
527
+ }>;
1669
528
  /**
1670
- * Returns the value of the given box for the current app.
1671
- * @param name The identifier of the box to return
1672
- * @param type
1673
- * @returns The current box value as a byte array
1674
- * @example
1675
- * ```typescript
1676
- * const boxValue = await appClient.getBoxValueFromABIType('boxName', new ABIUintType(32))
1677
- * ```
529
+ * Return transactions for a delete ABI call
530
+ * @param params The parameters for the delete ABI method call
531
+ * @returns The transactions which can be used to create a delete ABI method call
1678
532
  */
1679
- getBoxValueFromABIType(name: BoxIdentifier, type: ABIType): Promise<ABIValue>;
533
+ delete: (params: AppClientMethodCallParams) => Promise<{
534
+ transactions: algosdk.Transaction[];
535
+ methodCalls: Map<number, algosdk.ABIMethod>;
536
+ signers: Map<number, algosdk.TransactionSigner>;
537
+ }>;
1680
538
  /**
1681
- * Returns the values of all current boxes for the current app.
1682
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
1683
- * @param filter Optional filter to filter which boxes' values are returned
1684
- * @returns The (name, value) pair of the boxes with values as raw byte arrays
1685
- * @example
1686
- * ```typescript
1687
- * const boxValues = await appClient.getBoxValues()
1688
- * ```
539
+ * Return transactions for a close out ABI call
540
+ * @param params The parameters for the close out ABI method call
541
+ * @returns The transactions which can be used to create a close out ABI method call
1689
542
  */
1690
- getBoxValues(filter?: (name: BoxName) => boolean): Promise<{
1691
- name: BoxName;
1692
- value: Uint8Array;
1693
- }[]>;
543
+ closeOut: (params: AppClientMethodCallParams) => Promise<{
544
+ transactions: algosdk.Transaction[];
545
+ methodCalls: Map<number, algosdk.ABIMethod>;
546
+ signers: Map<number, algosdk.TransactionSigner>;
547
+ }>;
1694
548
  /**
1695
- * Returns the values of all current boxes for the current app decoded using an ABI Type.
1696
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
1697
- * @param type The ABI type to decode the values with
1698
- * @param filter Optional filter to filter which boxes' values are returned
1699
- * @returns The (name, value) pair of the boxes with values as the ABI Value
1700
- * @example
1701
- * ```typescript
1702
- * const boxValues = await appClient.getBoxValuesFromABIType(new ABIUintType(32))
1703
- * ```
549
+ * Return transactions for an ABI call (defaults to no-op)
550
+ * @param params The parameters for the ABI method call
551
+ * @returns The transactions which can be used to create an ABI method call
1704
552
  */
1705
- getBoxValuesFromABIType(type: ABIType, filter?: (name: BoxName) => boolean): Promise<{
1706
- name: BoxName;
1707
- value: ABIValue;
1708
- }[]>;
1709
- /**
1710
- * Takes an error that may include a logic error from a call to the current app and re-exposes the
1711
- * error to include source code information via the source map and ARC-56 spec.
1712
- * @param e The error to parse
1713
- * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)
1714
- * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
553
+ call: (params: AppClientMethodCallParams & CallOnComplete) => Promise<{
554
+ transactions: algosdk.Transaction[];
555
+ methodCalls: Map<number, algosdk.ABIMethod>;
556
+ signers: Map<number, algosdk.TransactionSigner>;
557
+ }>;
558
+ } & {
559
+ /** Interact with bare (raw) call transactions */bare: ReturnType<AppClient["getBareCreateTransactionMethods"]>;
560
+ };
561
+ /** Send transactions to the current app */
562
+ get send(): {
563
+ /** Sign and send transactions for a payment transaction to fund the app account
564
+ * @param params The parameters for the fund app account payment transaction
565
+ * @returns The result of send the fund app account payment transaction
1715
566
  */
1716
- exposeLogicError(e: Error, isClearStateProgram?: boolean): Promise<Error>;
567
+ fundAppAccount: (params: FundAppParams & SendParams) => Promise<{
568
+ groupId: string;
569
+ txIds: string[];
570
+ returns?: ABIReturn[] | undefined;
571
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
572
+ transactions: algosdk.Transaction[];
573
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
574
+ transaction: algosdk.Transaction;
575
+ }>;
1717
576
  /**
1718
- * Export the current source maps for the app.
1719
- * @returns The source maps
577
+ * Sign and send transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
578
+ * @param params The parameters for the update ABI method call
579
+ * @returns The result of sending the update ABI method call
1720
580
  */
1721
- exportSourceMaps(): AppSourceMaps;
581
+ update: (params: AppClientMethodCallParams & AppClientCompilationParams & SendParams) => Promise<{
582
+ compiledApproval?: CompiledTeal | undefined;
583
+ compiledClear?: CompiledTeal | undefined;
584
+ groupId: string;
585
+ txIds: string[];
586
+ returns?: ABIReturn[] | undefined;
587
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
588
+ transactions: algosdk.Transaction[];
589
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
590
+ transaction: algosdk.Transaction;
591
+ return?: Uint8Array<ArrayBufferLike> | algosdk.ABIValue | ABIStruct | undefined;
592
+ }>;
1722
593
  /**
1723
- * Import source maps for the app.
1724
- * @param sourceMaps The source maps to import
594
+ * Sign and send transactions for an opt-in ABI call
595
+ * @param params The parameters for the opt-in ABI method call
596
+ * @returns The result of sending the opt-in ABI method call
1725
597
  */
1726
- importSourceMaps(sourceMaps: AppSourceMaps): void;
598
+ optIn: (params: AppClientMethodCallParams & SendParams) => Promise<Omit<{
599
+ groupId: string;
600
+ txIds: string[];
601
+ returns?: ABIReturn[] | undefined;
602
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
603
+ transactions: algosdk.Transaction[];
604
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
605
+ transaction: algosdk.Transaction;
606
+ return?: ABIReturn | undefined;
607
+ }, "return"> & AppReturn<Uint8Array<ArrayBufferLike> | algosdk.ABIValue | ABIStruct | undefined>>;
1727
608
  /**
1728
- * Returns the ABI Method spec for the given method string for the app represented by this application client instance
1729
- * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
1730
- * e.g. `my_method` or `my_method(unit64,string)bytes`
1731
- * @returns A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`]
609
+ * Sign and send transactions for a delete ABI call
610
+ * @param params The parameters for the delete ABI method call
611
+ * @returns The result of sending the delete ABI method call
1732
612
  */
1733
- getABIMethod(methodNameOrSignature: string): Arc56Method;
613
+ delete: (params: AppClientMethodCallParams & SendParams) => Promise<Omit<{
614
+ groupId: string;
615
+ txIds: string[];
616
+ returns?: ABIReturn[] | undefined;
617
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
618
+ transactions: algosdk.Transaction[];
619
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
620
+ transaction: algosdk.Transaction;
621
+ return?: ABIReturn | undefined;
622
+ }, "return"> & AppReturn<Uint8Array<ArrayBufferLike> | algosdk.ABIValue | ABIStruct | undefined>>;
1734
623
  /**
1735
- * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type
1736
- * on the ARC-56 method, replacing the `return` property with the decoded type.
1737
- *
1738
- * If the return type is an ARC-56 struct then the struct will be returned.
1739
- *
1740
- * @param result The SendAppTransactionResult to be mapped
1741
- * @param method The method that was called
1742
- * @returns The smart contract response with an updated return value
624
+ * Sign and send transactions for a close out ABI call
625
+ * @param params The parameters for the close out ABI method call
626
+ * @returns The result of sending the close out ABI method call
1743
627
  */
1744
- processMethodCallReturn<TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, TResult extends SendAppTransactionResult = SendAppTransactionResult>(result: Promise<TResult> | TResult, method: Arc56Method): Promise<Omit<TResult, 'return'> & AppReturn<TReturn>>;
628
+ closeOut: (params: AppClientMethodCallParams & SendParams) => Promise<Omit<{
629
+ groupId: string;
630
+ txIds: string[];
631
+ returns?: ABIReturn[] | undefined;
632
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
633
+ transactions: algosdk.Transaction[];
634
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
635
+ transaction: algosdk.Transaction;
636
+ return?: ABIReturn | undefined;
637
+ }, "return"> & AppReturn<Uint8Array<ArrayBufferLike> | algosdk.ABIValue | ABIStruct | undefined>>;
1745
638
  /**
1746
- * Compiles the approval and clear state programs (if TEAL templates provided),
1747
- * performing any provided deploy-time parameter replacement and stores
1748
- * the source maps.
1749
- *
1750
- * If no TEAL templates provided it will use any byte code provided in the app spec.
1751
- *
1752
- * Will store any generated source maps for later use in debugging.
1753
- * @param compilation Any compilation parameters to use
1754
- * @returns The compiled code and any compilation results (including source maps)
639
+ * Sign and send transactions for a call (defaults to no-op)
640
+ * @param params The parameters for the ABI method call
641
+ * @returns The result of sending the ABI method call
1755
642
  */
1756
- compile(compilation?: AppClientCompilationParams): Promise<AppClientCompilationResult>;
643
+ call: (params: AppClientMethodCallParams & CallOnComplete & SendParams) => Promise<Omit<{
644
+ groupId: string;
645
+ txIds: string[];
646
+ returns?: ABIReturn[] | undefined;
647
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
648
+ transactions: algosdk.Transaction[];
649
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
650
+ transaction: algosdk.Transaction;
651
+ return?: ABIReturn | undefined;
652
+ }, "return"> & AppReturn<Uint8Array<ArrayBufferLike> | algosdk.ABIValue | ABIStruct | undefined>>;
653
+ } & {
654
+ /** Interact with bare (raw) calls */bare: ReturnType<AppClient["getBareSendMethods"]>;
655
+ };
656
+ /** Get state (local, global, box) from the current app */
657
+ get state(): {
1757
658
  /**
1758
- * Takes an error that may include a logic error from a call to the current app and re-exposes the
1759
- * error to include source code information via the source map and ARC-56 spec.
1760
- * @param e The error to parse
1761
- * @param appSpec The app spec for the app
1762
- * @param details Additional information to inform the error
1763
- * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
659
+ * Methods to access local state for the current app
660
+ * @param address The address of the account to get the local state for
1764
661
  */
1765
- static exposeLogicError(e: Error, appSpec: Arc56Contract, details: {
1766
- /** Whether or not the code was running the clear state program (defaults to approval program) */ isClearStateProgram?: boolean;
1767
- /** Approval program source map */ approvalSourceMap?: SourceMap;
1768
- /** Clear state program source map */ clearSourceMap?: SourceMap;
1769
- /** program bytes */ program?: Uint8Array;
1770
- /** ARC56 approval source info */ approvalSourceInfo?: ProgramSourceInfo;
1771
- /** ARC56 clear source info */ clearSourceInfo?: ProgramSourceInfo;
1772
- }): Error;
662
+ local: (address: string | Address) => ReturnType<AppClient["getStateMethods"]>;
1773
663
  /**
1774
- * Compiles the approval and clear state programs (if TEAL templates provided),
1775
- * performing any provided deploy-time parameter replacement and returns
1776
- * the compiled code and any compilation results (including source maps).
1777
- *
1778
- * If no TEAL templates provided it will use any byte code provided in the app spec.
1779
- *
1780
- * Will store any generated source maps for later use in debugging.
1781
- * @param appSpec The app spec for the app
1782
- * @param appManager The app manager to use for compilation
1783
- * @param compilation Any compilation parameters to use
1784
- * @returns The compiled code and any compilation results (including source maps)
664
+ * Methods to access global state for the current app
1785
665
  */
1786
- static compile(appSpec: Arc56Contract, appManager: AppManager, compilation?: AppClientCompilationParams): Promise<AppClientCompilationResult>;
666
+ global: {
667
+ /**
668
+ * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.
669
+ */
670
+ getAll: () => Promise<Record<string, any>>;
671
+ /**
672
+ * Returns a single state value for the current app with the value a decoded ABI value.
673
+ * @param name The name of the state value to retrieve the value for
674
+ * @param appState Optional cached value of the current state
675
+ * @returns
676
+ */
677
+ getValue: (name: string, appState?: AppState) => Promise<algosdk.ABIValue | ABIStruct | undefined>;
678
+ /**
679
+ * Returns a single value from the given map for the current app with the value a decoded ABI value.
680
+ * @param mapName The name of the map to read from
681
+ * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value
682
+ * that will be converted to bytes by encoding it using the specified ABI key type
683
+ * in the ARC-56 spec
684
+ * @param appState Optional cached value of the current state
685
+ */
686
+ getMapValue: (mapName: string, key: Uint8Array | any, appState?: AppState) => Promise<algosdk.ABIValue | ABIStruct | undefined>;
687
+ /**
688
+ * Returns all map values for the given map.
689
+ * @param mapName The name of the map to read from
690
+ * @param appState Optional cached value of the current state
691
+ * @returns A map of all key-value pairs in the map as a `Record<string, ABIValue>`
692
+ */
693
+ getMap: (mapName: string) => Promise<Map<algosdk.ABIValue | ABIStruct, algosdk.ABIValue | ABIStruct>>;
694
+ };
1787
695
  /**
1788
- * Returns ABI method arguments ready for a method call params object with default values populated
1789
- * and structs replaced with tuples.
1790
- *
1791
- * It does this by replacing any `undefined` values with the equivalent default value from the given ARC-56 app spec.
1792
- * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
1793
- * e.g. `my_method` or `my_method(unit64,string)bytes`
1794
- * @param args The arguments to the method with `undefined` for any that should be populated with a default value
696
+ * Methods to access box storage for the current app
1795
697
  */
1796
- private getABIArgsWithDefaultValues;
1797
- private getBareParamsMethods;
1798
- private getBareCreateTransactionMethods;
1799
- private getBareSendMethods;
1800
- private getMethodCallParamsMethods;
1801
- private getMethodCallSendMethods;
1802
- private getMethodCallCreateTransactionMethods;
1803
- /** Returns the sender for a call, using the provided sender or using the `defaultSender`
1804
- * if none provided and throws an error if neither provided */
1805
- private getSender;
1806
- /** Returns the signer for a call, using the provided signer or the `defaultSigner`
1807
- * if no signer was provided and the sender resolves to the default sender, the call will use default signer
1808
- * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */
1809
- private getSigner;
1810
- private getBareParams;
1811
- private getABIParams;
1812
- /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */
1813
- private handleCallErrors;
1814
- private getBoxMethods;
1815
- private getStateMethods;
698
+ box: {
699
+ /**
700
+ * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.
701
+ */
702
+ getAll: () => Promise<Record<string, any>>;
703
+ /**
704
+ * Returns a single state value for the current app with the value a decoded ABI value.
705
+ * @param name The name of the state value to retrieve the value for
706
+ * @returns
707
+ */
708
+ getValue: (name: string) => Promise<algosdk.ABIValue | ABIStruct>;
709
+ /**
710
+ *
711
+ * @param mapName The name of the map to read from
712
+ * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value
713
+ * that will be converted to bytes by encoding it using the specified ABI key type
714
+ * in the ARC-56 spec
715
+ */
716
+ getMapValue: (mapName: string, key: Uint8Array | any) => Promise<algosdk.ABIValue | ABIStruct>;
717
+ /**
718
+ *
719
+ * @param mapName The name of the map to read from
720
+ * @param key The key within the map as either a Buffer with the bytes or a value
721
+ * that will be converted to bytes by encoding it using the specified ABI key type
722
+ * in the ARC-56 spec
723
+ * @param appState
724
+ */
725
+ getMap: (mapName: string) => Promise<Map<algosdk.ABIValue | ABIStruct, algosdk.ABIValue | ABIStruct>>;
726
+ };
727
+ };
728
+ /**
729
+ * Funds Algo into the app account for this app.
730
+ *
731
+ * An alias for `appClient.send.fundAppAccount(params)`.
732
+ * @param params The parameters for the funding transaction
733
+ * @returns The result of the funding
734
+ * @example
735
+ * ```typescript
736
+ * await appClient.fundAppAccount({ amount: algo(1) })
737
+ * ```
738
+ */
739
+ fundAppAccount(params: FundAppParams): Promise<{
740
+ groupId: string;
741
+ txIds: string[];
742
+ returns?: ABIReturn[] | undefined;
743
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
744
+ transactions: algosdk.Transaction[];
745
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
746
+ transaction: algosdk.Transaction;
747
+ }>;
748
+ /**
749
+ * Returns raw global state for the current app.
750
+ * @returns The global state
751
+ * @example
752
+ * ```typescript
753
+ * const globalState = await appClient.getGlobalState()
754
+ * ```
755
+ */
756
+ getGlobalState(): Promise<AppState>;
757
+ /**
758
+ * Returns raw local state for the given account address.
759
+ * @param address The address of the account to get the local state for
760
+ * @returns The local state
761
+ * @example
762
+ * ```typescript
763
+ * const localState = await appClient.getLocalState('ACCOUNT_ADDRESS')
764
+ * ```
765
+ */
766
+ getLocalState(address: Address | string): Promise<AppState>;
767
+ /**
768
+ * Returns the names of all current boxes for the current app.
769
+ * @returns The names of the boxes
770
+ * @example
771
+ * ```typescript
772
+ * const boxNames = await appClient.getBoxNames()
773
+ * ```
774
+ */
775
+ getBoxNames(): Promise<BoxName[]>;
776
+ /**
777
+ * Returns the value of the given box for the current app.
778
+ * @param name The identifier of the box to return
779
+ * @returns The current box value as a byte array
780
+ * @example
781
+ * ```typescript
782
+ * const boxValue = await appClient.getBoxValue('boxName')
783
+ * ```
784
+ */
785
+ getBoxValue(name: BoxIdentifier): Promise<Uint8Array>;
786
+ /**
787
+ * Returns the value of the given box for the current app.
788
+ * @param name The identifier of the box to return
789
+ * @param type
790
+ * @returns The current box value as a byte array
791
+ * @example
792
+ * ```typescript
793
+ * const boxValue = await appClient.getBoxValueFromABIType('boxName', new ABIUintType(32))
794
+ * ```
795
+ */
796
+ getBoxValueFromABIType(name: BoxIdentifier, type: ABIType): Promise<ABIValue>;
797
+ /**
798
+ * Returns the values of all current boxes for the current app.
799
+ * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
800
+ * @param filter Optional filter to filter which boxes' values are returned
801
+ * @returns The (name, value) pair of the boxes with values as raw byte arrays
802
+ * @example
803
+ * ```typescript
804
+ * const boxValues = await appClient.getBoxValues()
805
+ * ```
806
+ */
807
+ getBoxValues(filter?: (name: BoxName) => boolean): Promise<{
808
+ name: BoxName;
809
+ value: Uint8Array;
810
+ }[]>;
811
+ /**
812
+ * Returns the values of all current boxes for the current app decoded using an ABI Type.
813
+ * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
814
+ * @param type The ABI type to decode the values with
815
+ * @param filter Optional filter to filter which boxes' values are returned
816
+ * @returns The (name, value) pair of the boxes with values as the ABI Value
817
+ * @example
818
+ * ```typescript
819
+ * const boxValues = await appClient.getBoxValuesFromABIType(new ABIUintType(32))
820
+ * ```
821
+ */
822
+ getBoxValuesFromABIType(type: ABIType, filter?: (name: BoxName) => boolean): Promise<{
823
+ name: BoxName;
824
+ value: ABIValue;
825
+ }[]>;
826
+ /**
827
+ * Takes an error that may include a logic error from a call to the current app and re-exposes the
828
+ * error to include source code information via the source map and ARC-56 spec.
829
+ * @param e The error to parse
830
+ * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)
831
+ * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
832
+ */
833
+ exposeLogicError(e: Error, isClearStateProgram?: boolean): Promise<Error>;
834
+ /**
835
+ * Export the current source maps for the app.
836
+ * @returns The source maps
837
+ */
838
+ exportSourceMaps(): AppSourceMaps;
839
+ /**
840
+ * Import source maps for the app.
841
+ * @param sourceMaps The source maps to import
842
+ */
843
+ importSourceMaps(sourceMaps: AppSourceMaps): void;
844
+ /**
845
+ * Returns the ABI Method spec for the given method string for the app represented by this application client instance
846
+ * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
847
+ * e.g. `my_method` or `my_method(unit64,string)bytes`
848
+ * @returns A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`]
849
+ */
850
+ getABIMethod(methodNameOrSignature: string): Arc56Method;
851
+ /**
852
+ * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type
853
+ * on the ARC-56 method, replacing the `return` property with the decoded type.
854
+ *
855
+ * If the return type is an ARC-56 struct then the struct will be returned.
856
+ *
857
+ * @param result The SendAppTransactionResult to be mapped
858
+ * @param method The method that was called
859
+ * @returns The smart contract response with an updated return value
860
+ */
861
+ processMethodCallReturn<TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, TResult extends SendAppTransactionResult = SendAppTransactionResult>(result: Promise<TResult> | TResult, method: Arc56Method): Promise<Omit<TResult, 'return'> & AppReturn<TReturn>>;
862
+ /**
863
+ * Compiles the approval and clear state programs (if TEAL templates provided),
864
+ * performing any provided deploy-time parameter replacement and stores
865
+ * the source maps.
866
+ *
867
+ * If no TEAL templates provided it will use any byte code provided in the app spec.
868
+ *
869
+ * Will store any generated source maps for later use in debugging.
870
+ * @param compilation Any compilation parameters to use
871
+ * @returns The compiled code and any compilation results (including source maps)
872
+ */
873
+ compile(compilation?: AppClientCompilationParams): Promise<AppClientCompilationResult>;
874
+ /**
875
+ * Takes an error that may include a logic error from a call to the current app and re-exposes the
876
+ * error to include source code information via the source map and ARC-56 spec.
877
+ * @param e The error to parse
878
+ * @param appSpec The app spec for the app
879
+ * @param details Additional information to inform the error
880
+ * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
881
+ */
882
+ static exposeLogicError(e: Error, appSpec: Arc56Contract, details: {
883
+ /** Whether or not the code was running the clear state program (defaults to approval program) */isClearStateProgram?: boolean; /** Approval program source map */
884
+ approvalSourceMap?: SourceMap; /** Clear state program source map */
885
+ clearSourceMap?: SourceMap; /** program bytes */
886
+ program?: Uint8Array; /** ARC56 approval source info */
887
+ approvalSourceInfo?: ProgramSourceInfo; /** ARC56 clear source info */
888
+ clearSourceInfo?: ProgramSourceInfo;
889
+ }): Error;
890
+ /**
891
+ * Compiles the approval and clear state programs (if TEAL templates provided),
892
+ * performing any provided deploy-time parameter replacement and returns
893
+ * the compiled code and any compilation results (including source maps).
894
+ *
895
+ * If no TEAL templates provided it will use any byte code provided in the app spec.
896
+ *
897
+ * Will store any generated source maps for later use in debugging.
898
+ * @param appSpec The app spec for the app
899
+ * @param appManager The app manager to use for compilation
900
+ * @param compilation Any compilation parameters to use
901
+ * @returns The compiled code and any compilation results (including source maps)
902
+ */
903
+ static compile(appSpec: Arc56Contract, appManager: AppManager, compilation?: AppClientCompilationParams): Promise<AppClientCompilationResult>;
904
+ /**
905
+ * Returns ABI method arguments ready for a method call params object with default values populated
906
+ * and structs replaced with tuples.
907
+ *
908
+ * It does this by replacing any `undefined` values with the equivalent default value from the given ARC-56 app spec.
909
+ * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
910
+ * e.g. `my_method` or `my_method(unit64,string)bytes`
911
+ * @param args The arguments to the method with `undefined` for any that should be populated with a default value
912
+ */
913
+ private getABIArgsWithDefaultValues;
914
+ private getBareParamsMethods;
915
+ private getBareCreateTransactionMethods;
916
+ private getBareSendMethods;
917
+ private getMethodCallParamsMethods;
918
+ private getMethodCallSendMethods;
919
+ private getMethodCallCreateTransactionMethods;
920
+ /** Returns the sender for a call, using the provided sender or using the `defaultSender`
921
+ * if none provided and throws an error if neither provided */
922
+ private getSender;
923
+ /** Returns the signer for a call, using the provided signer or the `defaultSigner`
924
+ * if no signer was provided and the sender resolves to the default sender, the call will use default signer
925
+ * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */
926
+ private getSigner;
927
+ private getBareParams;
928
+ private getABIParams;
929
+ /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */
930
+ private handleCallErrors;
931
+ private getBoxMethods;
932
+ private getStateMethods;
1816
933
  }
1817
934
  /**
1818
935
  * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
@@ -1821,296 +938,298 @@ export declare class AppClient {
1821
938
  * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
1822
939
  *
1823
940
  * Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */
1824
- export declare class ApplicationClient {
1825
- private algod;
1826
- private indexer?;
1827
- private appSpec;
1828
- private sender;
1829
- private params;
1830
- private existingDeployments;
1831
- private deployTimeParams?;
1832
- private _appId;
1833
- private _appAddress;
1834
- private _creator;
1835
- private _appName;
1836
- private _approvalSourceMap;
1837
- private _clearSourceMap;
1838
- /**
1839
- * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
1840
- * `algorand.client.getAppClientByCreatorAndName`.
1841
- * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
1842
- * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
1843
- *
1844
- * Create a new ApplicationClient instance
1845
- * @param appDetails The details of the app
1846
- * @param algod An algod instance
1847
- */
1848
- constructor(appDetails: AppSpecAppDetails, algod: Algodv2);
1849
- /**
1850
- * @deprecated Use `AppClient.compile()` instead.
1851
- *
1852
- * Compiles the approval and clear state programs and sets up the source map.
1853
- * @param compilation The deploy-time parameters for the compilation
1854
- * @returns The compiled approval and clear state programs
1855
- */
1856
- compile(compilation?: AppClientCompilationParams): Promise<{
1857
- approvalCompiled: import("./app").CompiledTeal;
1858
- clearCompiled: import("./app").CompiledTeal;
1859
- }>;
1860
- /**
1861
- * Export the current source maps for the app.
1862
- * @returns The source maps
1863
- */
1864
- exportSourceMaps(): AppSourceMaps;
1865
- /**
1866
- * Import source maps for the app.
1867
- * @param sourceMaps The source maps to import
1868
- */
1869
- importSourceMaps(sourceMaps: AppSourceMaps): void;
1870
- /**
1871
- * @deprecated Use `deploy` from an `AppFactory` instance instead.
1872
- *
1873
- * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
1874
- *
1875
- * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
1876
- *
1877
- * **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.
1878
- *
1879
- * **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.
1880
- * @param deploy Deployment details
1881
- * @returns The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions
1882
- */
1883
- deploy(deploy?: AppClientDeployParams): Promise<(Partial<AppCompilationResult> & AppMetadata & {
1884
- operationPerformed: "nothing";
1885
- }) | {
1886
- compiledApproval: import("./app").CompiledTeal;
1887
- compiledClear: import("./app").CompiledTeal;
1888
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1889
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1890
- transaction: algosdk.Transaction;
1891
- transactions: algosdk.Transaction[];
1892
- createdRound: number;
1893
- updatedRound: number;
1894
- createdMetadata: import("./app").AppDeployMetadata;
1895
- deleted: boolean;
1896
- appId: number | bigint;
1897
- appAddress: string;
1898
- name: string;
1899
- version: string;
1900
- deletable?: boolean | undefined;
1901
- updatable?: boolean | undefined;
1902
- return?: ABIReturn | undefined;
1903
- /** The maximum opcode budget for a simulate call as per https://github.com/algorand/go-algorand/blob/807b29a91c371d225e12b9287c5d56e9b33c4e4c/ledger/simulation/trace.go#L104 */
1904
- operationPerformed: "update" | "create";
1905
- } | {
1906
- compiledApproval: import("./app").CompiledTeal;
1907
- compiledClear: import("./app").CompiledTeal;
1908
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
1909
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1910
- transaction: algosdk.Transaction;
1911
- transactions: algosdk.Transaction[];
1912
- createdRound: number;
1913
- updatedRound: number;
1914
- createdMetadata: import("./app").AppDeployMetadata;
1915
- deleted: boolean;
1916
- appId: number | bigint;
1917
- appAddress: string;
1918
- name: string;
1919
- version: string;
1920
- deletable?: boolean | undefined;
1921
- updatable?: boolean | undefined;
1922
- return?: ABIReturn | undefined;
1923
- deleteReturn?: ABIReturn | undefined;
1924
- deleteResult: import("./transaction").ConfirmedTransactionResult;
1925
- operationPerformed: "replace";
1926
- }>;
1927
- /**
1928
- * @deprecated Use `create` from an `AppFactory` instance instead.
1929
- *
1930
- * Creates a smart contract app, returns the details of the created app.
1931
- * @param create The parameters to create the app with
1932
- * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result
1933
- */
1934
- create(create?: AppClientCreateParams): Promise<{
1935
- compiledApproval: import("./app").CompiledTeal;
1936
- compiledClear: import("./app").CompiledTeal;
1937
- return?: ABIReturn | undefined;
1938
- transactions: algosdk.Transaction[];
1939
- confirmations?: algosdk.modelsv2.PendingTransactionResponse[] | undefined;
1940
- transaction: algosdk.Transaction;
1941
- confirmation?: algosdk.modelsv2.PendingTransactionResponse | undefined;
1942
- appId: number | bigint;
1943
- appAddress: string;
1944
- }>;
1945
- /**
1946
- * @deprecated Use `appClient.send.update` or `appClient.createTransaction.update` from an `AppClient` instance instead.
1947
- *
1948
- * Updates the smart contract app.
1949
- * @param update The parameters to update the app with
1950
- * @returns The transaction send result and the compilation result
1951
- */
1952
- update(update?: AppClientUpdateParams): Promise<{
1953
- compiledApproval: import("./app").CompiledTeal;
1954
- compiledClear: import("./app").CompiledTeal;
1955
- return?: ABIReturn | undefined;
1956
- transactions: algosdk.Transaction[];
1957
- confirmations?: algosdk.modelsv2.PendingTransactionResponse[] | undefined;
1958
- transaction: algosdk.Transaction;
1959
- confirmation?: algosdk.modelsv2.PendingTransactionResponse | undefined;
1960
- }>;
1961
- /**
1962
- * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
1963
- *
1964
- * Issues a no_op (normal) call to the app.
1965
- * @param call The call details.
1966
- * @returns The result of the call
1967
- */
1968
- call(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
1969
- /**
1970
- * @deprecated Use `appClient.send.optIn` or `appClient.createTransaction.optIn` from an `AppClient` instance instead.
1971
- *
1972
- * Issues a opt_in call to the app.
1973
- * @param call The call details.
1974
- * @returns The result of the call
1975
- */
1976
- optIn(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
1977
- /**
1978
- * @deprecated Use `appClient.send.closeOut` or `appClient.createTransaction.closeOut` from an `AppClient` instance instead.
1979
- *
1980
- * Issues a close_out call to the app.
1981
- * @param call The call details.
1982
- * @returns The result of the call
1983
- */
1984
- closeOut(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
1985
- /**
1986
- * @deprecated Use `appClient.send.clearState` or `appClient.createTransaction.clearState` from an `AppClient` instance instead.
1987
- *
1988
- * Issues a clear_state call to the app.
1989
- * @param call The call details.
1990
- * @returns The result of the call
1991
- */
1992
- clearState(call?: AppClientClearStateParams): Promise<AppCallTransactionResult>;
1993
- /**
1994
- * @deprecated Use `appClient.send.delete` or `appClient.createTransaction.delete` from an `AppClient` instance instead.
1995
- *
1996
- * Issues a delete_application call to the app.
1997
- * @param call The call details.
1998
- * @returns The result of the call
1999
- */
2000
- delete(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
2001
- /**
2002
- * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
2003
- *
2004
- * Issues a call to the app with the given call type.
2005
- * @param call The call details.
2006
- * @param callType The call type
2007
- * @returns The result of the call
2008
- */
2009
- callOfType(call: AppClientCallParams | undefined, callType: Exclude<AppCallType, 'update_application'> | Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>): Promise<AppCallTransactionResult>;
2010
- /**
2011
- * Funds Algo into the app account for this app.
2012
- * @param fund The parameters for the funding or the funding amount
2013
- * @returns The result of the funding
2014
- */
2015
- fundAppAccount(fund: FundAppAccountParams | AlgoAmount): Promise<(import("./transaction").SendTransactionResult | {
2016
- groupId: string;
2017
- txIds: string[];
2018
- returns?: ABIReturn[] | undefined;
2019
- confirmations: algosdk.modelsv2.PendingTransactionResponse[];
2020
- transactions: algosdk.Transaction[];
2021
- confirmation: algosdk.modelsv2.PendingTransactionResponse;
2022
- transaction: algosdk.Transaction;
2023
- }) & {
2024
- transactions: algosdk.Transaction[];
2025
- }>;
2026
- /**
2027
- * Returns global state for the current app.
2028
- * @returns The global state
2029
- */
2030
- getGlobalState(): Promise<AppState>;
2031
- /**
2032
- * Returns local state for the given account / account address.
2033
- * @returns The global state
2034
- */
2035
- getLocalState(account: string | SendTransactionFrom): Promise<AppState>;
2036
- /**
2037
- * Returns the names of all current boxes for the current app.
2038
- * @returns The names of the boxes
2039
- */
2040
- getBoxNames(): Promise<BoxName[]>;
2041
- /**
2042
- * Returns the value of the given box for the current app.
2043
- * @param name The name of the box to return either as a string, binary array or `BoxName`
2044
- * @returns The current box value as a byte array
2045
- */
2046
- getBoxValue(name: BoxName | string | Uint8Array): Promise<Uint8Array>;
2047
- /**
2048
- * Returns the value of the given box for the current app.
2049
- * @param name The name of the box to return either as a string, binary array or `BoxName`
2050
- * @param type
2051
- * @returns The current box value as a byte array
2052
- */
2053
- getBoxValueFromABIType(name: BoxName | string | Uint8Array, type: ABIType): Promise<ABIValue>;
2054
- /**
2055
- * Returns the values of all current boxes for the current app.
2056
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
2057
- * @param filter Optional filter to filter which boxes' values are returned
2058
- * @returns The (name, value) pair of the boxes with values as raw byte arrays
2059
- */
2060
- getBoxValues(filter?: (name: BoxName) => boolean): Promise<{
2061
- name: BoxName;
2062
- value: Uint8Array;
2063
- }[]>;
2064
- /**
2065
- * Returns the values of all current boxes for the current app decoded using an ABI Type.
2066
- * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
2067
- * @param type The ABI type to decode the values with
2068
- * @param filter Optional filter to filter which boxes' values are returned
2069
- * @returns The (name, value) pair of the boxes with values as the ABI Value
2070
- */
2071
- getBoxValuesFromABIType(type: ABIType, filter?: (name: BoxName) => boolean): Promise<{
2072
- name: BoxName;
2073
- value: ABIValue;
2074
- }[]>;
2075
- /**
2076
- * @deprecated Use `appClient.params.*` from an `AppClient` instance instead.
2077
- *
2078
- * Returns the arguments for an app call for the given ABI method or raw method specification.
2079
- * @param args The call args specific to this application client
2080
- * @param sender The sender of this call. Will be used to fetch any default argument values if applicable
2081
- * @returns The call args ready to pass into an app call
2082
- */
2083
- getCallArgs(args: AppClientCallArgs | undefined, sender: SendTransactionFrom): Promise<AppCallArgs | undefined>;
2084
- /**
2085
- * @deprecated Use `appClient.getABIMethod` instead.
2086
- *
2087
- * Returns the ABI Method parameters for the given method name string for the app represented by this application client instance
2088
- * @param method Either the name of the method or the ABI method spec definition string
2089
- * @returns The ABI method params for the given method
2090
- */
2091
- getABIMethodParams(method: string): ABIMethodParams | undefined;
2092
- /**
2093
- * Returns the ABI Method for the given method name string for the app represented by this application client instance
2094
- * @param method Either the name of the method or the ABI method spec definition string
2095
- * @returns The ABI method for the given method
2096
- */
2097
- getABIMethod(method: string): ABIMethod | undefined;
2098
- /**
2099
- * @deprecated Use `appClient.appId` and `appClient.appAddress` from an `AppClient` instance instead.
2100
- *
2101
- * Gets the reference information for the current application instance.
2102
- * `appId` will be 0 if it can't find an app.
2103
- * @returns The app reference, or if deployed using the `deploy` method, the app metadata too
2104
- */
2105
- getAppReference(): Promise<AppMetadata | AppReference>;
2106
- /**
2107
- * Takes an error that may include a logic error from a smart contract call and re-exposes the error to include source code information via the source map.
2108
- * This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction
2109
- * then you can use this in a try/catch block to get better debugging information.
2110
- * @param e The error to parse
2111
- * @param isClear Whether or not the code was running the clear state program
2112
- * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
2113
- */
2114
- exposeLogicError(e: Error, isClear?: boolean): Error;
2115
- private getABIMethodSignature;
941
+ declare class ApplicationClient {
942
+ private algod;
943
+ private indexer?;
944
+ private appSpec;
945
+ private sender;
946
+ private params;
947
+ private existingDeployments;
948
+ private deployTimeParams?;
949
+ private _appId;
950
+ private _appAddress;
951
+ private _creator;
952
+ private _appName;
953
+ private _approvalSourceMap;
954
+ private _clearSourceMap;
955
+ /**
956
+ * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
957
+ * `algorand.client.getAppClientByCreatorAndName`.
958
+ * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
959
+ * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
960
+ *
961
+ * Create a new ApplicationClient instance
962
+ * @param appDetails The details of the app
963
+ * @param algod An algod instance
964
+ */
965
+ constructor(appDetails: AppSpecAppDetails, algod: Algodv2);
966
+ /**
967
+ * @deprecated Use `AppClient.compile()` instead.
968
+ *
969
+ * Compiles the approval and clear state programs and sets up the source map.
970
+ * @param compilation The deploy-time parameters for the compilation
971
+ * @returns The compiled approval and clear state programs
972
+ */
973
+ compile(compilation?: AppClientCompilationParams): Promise<{
974
+ approvalCompiled: CompiledTeal;
975
+ clearCompiled: CompiledTeal;
976
+ }>;
977
+ /**
978
+ * Export the current source maps for the app.
979
+ * @returns The source maps
980
+ */
981
+ exportSourceMaps(): AppSourceMaps;
982
+ /**
983
+ * Import source maps for the app.
984
+ * @param sourceMaps The source maps to import
985
+ */
986
+ importSourceMaps(sourceMaps: AppSourceMaps): void;
987
+ /**
988
+ * @deprecated Use `deploy` from an `AppFactory` instance instead.
989
+ *
990
+ * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
991
+ *
992
+ * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/src/content/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
993
+ *
994
+ * **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.
995
+ *
996
+ * **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.
997
+ * @param deploy Deployment details
998
+ * @returns The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions
999
+ */
1000
+ deploy(deploy?: AppClientDeployParams): Promise<(Partial<AppCompilationResult> & AppMetadata & {
1001
+ operationPerformed: "nothing";
1002
+ }) | {
1003
+ compiledApproval: CompiledTeal;
1004
+ compiledClear: CompiledTeal;
1005
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
1006
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1007
+ transaction: algosdk.Transaction;
1008
+ transactions: algosdk.Transaction[];
1009
+ createdRound: number;
1010
+ updatedRound: number;
1011
+ createdMetadata: AppDeployMetadata;
1012
+ deleted: boolean;
1013
+ appId: number | bigint;
1014
+ appAddress: string;
1015
+ name: string;
1016
+ version: string;
1017
+ deletable?: boolean;
1018
+ updatable?: boolean;
1019
+ return?: ABIReturn;
1020
+ operationPerformed: "create" | "update";
1021
+ } | {
1022
+ compiledApproval: CompiledTeal;
1023
+ compiledClear: CompiledTeal;
1024
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
1025
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1026
+ transaction: algosdk.Transaction;
1027
+ transactions: algosdk.Transaction[];
1028
+ createdRound: number;
1029
+ updatedRound: number;
1030
+ createdMetadata: AppDeployMetadata;
1031
+ deleted: boolean;
1032
+ appId: number | bigint;
1033
+ appAddress: string;
1034
+ name: string;
1035
+ version: string;
1036
+ deletable?: boolean;
1037
+ updatable?: boolean;
1038
+ return?: ABIReturn;
1039
+ deleteReturn?: ABIReturn;
1040
+ deleteResult: ConfirmedTransactionResult;
1041
+ operationPerformed: "replace";
1042
+ }>;
1043
+ /**
1044
+ * @deprecated Use `create` from an `AppFactory` instance instead.
1045
+ *
1046
+ * Creates a smart contract app, returns the details of the created app.
1047
+ * @param create The parameters to create the app with
1048
+ * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result
1049
+ */
1050
+ create(create?: AppClientCreateParams): Promise<{
1051
+ compiledApproval: CompiledTeal;
1052
+ compiledClear: CompiledTeal;
1053
+ return?: ABIReturn | undefined;
1054
+ transactions: algosdk.Transaction[];
1055
+ confirmations?: algosdk.modelsv2.PendingTransactionResponse[];
1056
+ transaction: algosdk.Transaction;
1057
+ confirmation?: algosdk.modelsv2.PendingTransactionResponse;
1058
+ appId: number | bigint;
1059
+ appAddress: string;
1060
+ }>;
1061
+ /**
1062
+ * @deprecated Use `appClient.send.update` or `appClient.createTransaction.update` from an `AppClient` instance instead.
1063
+ *
1064
+ * Updates the smart contract app.
1065
+ * @param update The parameters to update the app with
1066
+ * @returns The transaction send result and the compilation result
1067
+ */
1068
+ update(update?: AppClientUpdateParams): Promise<{
1069
+ compiledApproval: CompiledTeal;
1070
+ compiledClear: CompiledTeal;
1071
+ return?: ABIReturn | undefined;
1072
+ transactions: algosdk.Transaction[];
1073
+ confirmations?: algosdk.modelsv2.PendingTransactionResponse[];
1074
+ transaction: algosdk.Transaction;
1075
+ confirmation?: algosdk.modelsv2.PendingTransactionResponse;
1076
+ }>;
1077
+ /**
1078
+ * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
1079
+ *
1080
+ * Issues a no_op (normal) call to the app.
1081
+ * @param call The call details.
1082
+ * @returns The result of the call
1083
+ */
1084
+ call(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
1085
+ /**
1086
+ * @deprecated Use `appClient.send.optIn` or `appClient.createTransaction.optIn` from an `AppClient` instance instead.
1087
+ *
1088
+ * Issues a opt_in call to the app.
1089
+ * @param call The call details.
1090
+ * @returns The result of the call
1091
+ */
1092
+ optIn(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
1093
+ /**
1094
+ * @deprecated Use `appClient.send.closeOut` or `appClient.createTransaction.closeOut` from an `AppClient` instance instead.
1095
+ *
1096
+ * Issues a close_out call to the app.
1097
+ * @param call The call details.
1098
+ * @returns The result of the call
1099
+ */
1100
+ closeOut(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
1101
+ /**
1102
+ * @deprecated Use `appClient.send.clearState` or `appClient.createTransaction.clearState` from an `AppClient` instance instead.
1103
+ *
1104
+ * Issues a clear_state call to the app.
1105
+ * @param call The call details.
1106
+ * @returns The result of the call
1107
+ */
1108
+ clearState(call?: AppClientClearStateParams): Promise<AppCallTransactionResult>;
1109
+ /**
1110
+ * @deprecated Use `appClient.send.delete` or `appClient.createTransaction.delete` from an `AppClient` instance instead.
1111
+ *
1112
+ * Issues a delete_application call to the app.
1113
+ * @param call The call details.
1114
+ * @returns The result of the call
1115
+ */
1116
+ delete(call?: AppClientCallParams): Promise<AppCallTransactionResult>;
1117
+ /**
1118
+ * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
1119
+ *
1120
+ * Issues a call to the app with the given call type.
1121
+ * @param call The call details.
1122
+ * @param callType The call type
1123
+ * @returns The result of the call
1124
+ */
1125
+ callOfType(call: AppClientCallParams | undefined, callType: Exclude<AppCallType, 'update_application'> | Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>): Promise<AppCallTransactionResult>;
1126
+ /**
1127
+ * Funds Algo into the app account for this app.
1128
+ * @param fund The parameters for the funding or the funding amount
1129
+ * @returns The result of the funding
1130
+ */
1131
+ fundAppAccount(fund: FundAppAccountParams | AlgoAmount): Promise<(SendTransactionResult | {
1132
+ groupId: string;
1133
+ txIds: string[];
1134
+ returns?: ABIReturn[] | undefined;
1135
+ confirmations: algosdk.modelsv2.PendingTransactionResponse[];
1136
+ transactions: algosdk.Transaction[];
1137
+ confirmation: algosdk.modelsv2.PendingTransactionResponse;
1138
+ transaction: algosdk.Transaction;
1139
+ }) & {
1140
+ transactions: algosdk.Transaction[];
1141
+ }>;
1142
+ /**
1143
+ * Returns global state for the current app.
1144
+ * @returns The global state
1145
+ */
1146
+ getGlobalState(): Promise<AppState>;
1147
+ /**
1148
+ * Returns local state for the given account / account address.
1149
+ * @returns The global state
1150
+ */
1151
+ getLocalState(account: string | SendTransactionFrom): Promise<AppState>;
1152
+ /**
1153
+ * Returns the names of all current boxes for the current app.
1154
+ * @returns The names of the boxes
1155
+ */
1156
+ getBoxNames(): Promise<BoxName[]>;
1157
+ /**
1158
+ * Returns the value of the given box for the current app.
1159
+ * @param name The name of the box to return either as a string, binary array or `BoxName`
1160
+ * @returns The current box value as a byte array
1161
+ */
1162
+ getBoxValue(name: BoxName | string | Uint8Array): Promise<Uint8Array>;
1163
+ /**
1164
+ * Returns the value of the given box for the current app.
1165
+ * @param name The name of the box to return either as a string, binary array or `BoxName`
1166
+ * @param type
1167
+ * @returns The current box value as a byte array
1168
+ */
1169
+ getBoxValueFromABIType(name: BoxName | string | Uint8Array, type: ABIType): Promise<ABIValue>;
1170
+ /**
1171
+ * Returns the values of all current boxes for the current app.
1172
+ * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
1173
+ * @param filter Optional filter to filter which boxes' values are returned
1174
+ * @returns The (name, value) pair of the boxes with values as raw byte arrays
1175
+ */
1176
+ getBoxValues(filter?: (name: BoxName) => boolean): Promise<{
1177
+ name: BoxName;
1178
+ value: Uint8Array;
1179
+ }[]>;
1180
+ /**
1181
+ * Returns the values of all current boxes for the current app decoded using an ABI Type.
1182
+ * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
1183
+ * @param type The ABI type to decode the values with
1184
+ * @param filter Optional filter to filter which boxes' values are returned
1185
+ * @returns The (name, value) pair of the boxes with values as the ABI Value
1186
+ */
1187
+ getBoxValuesFromABIType(type: ABIType, filter?: (name: BoxName) => boolean): Promise<{
1188
+ name: BoxName;
1189
+ value: ABIValue;
1190
+ }[]>;
1191
+ /**
1192
+ * @deprecated Use `appClient.params.*` from an `AppClient` instance instead.
1193
+ *
1194
+ * Returns the arguments for an app call for the given ABI method or raw method specification.
1195
+ * @param args The call args specific to this application client
1196
+ * @param sender The sender of this call. Will be used to fetch any default argument values if applicable
1197
+ * @returns The call args ready to pass into an app call
1198
+ */
1199
+ getCallArgs(args: AppClientCallArgs | undefined, sender: SendTransactionFrom): Promise<AppCallArgs | undefined>;
1200
+ /**
1201
+ * @deprecated Use `appClient.getABIMethod` instead.
1202
+ *
1203
+ * Returns the ABI Method parameters for the given method name string for the app represented by this application client instance
1204
+ * @param method Either the name of the method or the ABI method spec definition string
1205
+ * @returns The ABI method params for the given method
1206
+ */
1207
+ getABIMethodParams(method: string): ABIMethodParams | undefined;
1208
+ /**
1209
+ * Returns the ABI Method for the given method name string for the app represented by this application client instance
1210
+ * @param method Either the name of the method or the ABI method spec definition string
1211
+ * @returns The ABI method for the given method
1212
+ */
1213
+ getABIMethod(method: string): ABIMethod | undefined;
1214
+ /**
1215
+ * @deprecated Use `appClient.appId` and `appClient.appAddress` from an `AppClient` instance instead.
1216
+ *
1217
+ * Gets the reference information for the current application instance.
1218
+ * `appId` will be 0 if it can't find an app.
1219
+ * @returns The app reference, or if deployed using the `deploy` method, the app metadata too
1220
+ */
1221
+ getAppReference(): Promise<AppMetadata | AppReference>;
1222
+ /**
1223
+ * Takes an error that may include a logic error from a smart contract call and re-exposes the error to include source code information via the source map.
1224
+ * This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction
1225
+ * then you can use this in a try/catch block to get better debugging information.
1226
+ * @param e The error to parse
1227
+ * @param isClear Whether or not the code was running the clear state program
1228
+ * @returns The new error, or if there was no logic error or source map then the wrapped error with source details
1229
+ */
1230
+ exposeLogicError(e: Error, isClear?: boolean): Error;
1231
+ private getABIMethodSignature;
2116
1232
  }
1233
+ //#endregion
1234
+ export { AppClient, AppClientBareCallParams, AppClientCallABIArgs, AppClientCallArgs, AppClientCallCoreParams, AppClientCallParams, AppClientCallRawArgs, AppClientClearStateParams, AppClientCompilationParams, AppClientCompilationResult, AppClientCreateOnComplete, AppClientCreateParams, AppClientDeployCallInterfaceParams, AppClientDeployCoreParams, AppClientDeployParams, AppClientMethodCallParams, AppClientParams, AppClientUpdateParams, AppDetails, AppDetailsBase, AppSourceMaps, AppSpecAppDetails, AppSpecAppDetailsBase, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient, CallOnComplete, CloneAppClientParams, FundAppAccountParams, FundAppParams, ResolveAppByCreatorAndName, ResolveAppByCreatorAndNameBase, ResolveAppById, ResolveAppByIdBase, ResolveAppClientByCreatorAndName, ResolveAppClientByNetwork, SourceMapExport };
1235
+ //# sourceMappingURL=app-client.d.ts.map