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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/_virtual/_rolldown/runtime.js +33 -0
  2. package/_virtual/_rolldown/runtime.mjs +13 -0
  3. package/account/account.d.ts +25 -30
  4. package/account/account.js +151 -146
  5. package/account/account.js.map +1 -1
  6. package/account/account.mjs +149 -144
  7. package/account/account.mjs.map +1 -1
  8. package/account/get-account-config-from-environment.d.ts +7 -2
  9. package/account/get-account-config-from-environment.js +19 -21
  10. package/account/get-account-config-from-environment.js.map +1 -1
  11. package/account/get-account-config-from-environment.mjs +19 -19
  12. package/account/get-account-config-from-environment.mjs.map +1 -1
  13. package/account/get-account.d.ts +14 -12
  14. package/account/get-account.js +56 -59
  15. package/account/get-account.js.map +1 -1
  16. package/account/get-account.mjs +56 -57
  17. package/account/get-account.mjs.map +1 -1
  18. package/account/get-dispenser-account.d.ts +9 -5
  19. package/account/get-dispenser-account.js +20 -18
  20. package/account/get-dispenser-account.js.map +1 -1
  21. package/account/get-dispenser-account.mjs +20 -16
  22. package/account/get-dispenser-account.mjs.map +1 -1
  23. package/account/mnemonic-account.d.ts +7 -3
  24. package/account/mnemonic-account.js +17 -17
  25. package/account/mnemonic-account.js.map +1 -1
  26. package/account/mnemonic-account.mjs +15 -15
  27. package/account/mnemonic-account.mjs.map +1 -1
  28. package/amount.d.ts +40 -35
  29. package/amount.js +33 -34
  30. package/amount.js.map +1 -1
  31. package/amount.mjs +33 -32
  32. package/amount.mjs.map +1 -1
  33. package/app-client.d.ts +10 -6
  34. package/app-client.js +91 -86
  35. package/app-client.js.map +1 -1
  36. package/app-client.mjs +91 -84
  37. package/app-client.mjs.map +1 -1
  38. package/app-deploy.d.ts +26 -24
  39. package/app-deploy.js +235 -253
  40. package/app-deploy.js.map +1 -1
  41. package/app-deploy.mjs +233 -251
  42. package/app-deploy.mjs.map +1 -1
  43. package/app.d.ts +45 -46
  44. package/app.js +253 -271
  45. package/app.js.map +1 -1
  46. package/app.mjs +249 -267
  47. package/app.mjs.map +1 -1
  48. package/asset.d.ts +16 -12
  49. package/asset.js +116 -122
  50. package/asset.js.map +1 -1
  51. package/asset.mjs +116 -120
  52. package/asset.mjs.map +1 -1
  53. package/config.d.ts +7 -2
  54. package/config.js +5 -7
  55. package/config.js.map +1 -1
  56. package/config.mjs +5 -4
  57. package/config.mjs.map +1 -1
  58. package/debugging/debugging.d.ts +5 -1
  59. package/debugging/debugging.js +11 -11
  60. package/debugging/debugging.js.map +1 -1
  61. package/debugging/debugging.mjs +11 -9
  62. package/debugging/debugging.mjs.map +1 -1
  63. package/dispenser-client.d.ts +7 -2
  64. package/dispenser-client.js +23 -24
  65. package/dispenser-client.js.map +1 -1
  66. package/dispenser-client.mjs +23 -22
  67. package/dispenser-client.mjs.map +1 -1
  68. package/index.d.ts +27 -18
  69. package/index.js +140 -143
  70. package/index.mjs +27 -29
  71. package/indexer-lookup.d.ts +18 -11
  72. package/indexer-lookup.js +112 -120
  73. package/indexer-lookup.js.map +1 -1
  74. package/indexer-lookup.mjs +105 -118
  75. package/indexer-lookup.mjs.map +1 -1
  76. package/localnet/get-kmd-wallet-account.d.ts +9 -7
  77. package/localnet/get-kmd-wallet-account.js +28 -26
  78. package/localnet/get-kmd-wallet-account.js.map +1 -1
  79. package/localnet/get-kmd-wallet-account.mjs +28 -24
  80. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  81. package/localnet/get-localnet-dispenser-account.d.ts +7 -5
  82. package/localnet/get-localnet-dispenser-account.js +17 -15
  83. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  84. package/localnet/get-localnet-dispenser-account.mjs +17 -13
  85. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  86. package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
  87. package/localnet/get-or-create-kmd-wallet-account.js +28 -26
  88. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  89. package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
  90. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  91. package/localnet/is-localnet.d.ts +7 -3
  92. package/localnet/is-localnet.js +9 -10
  93. package/localnet/is-localnet.js.map +1 -1
  94. package/localnet/is-localnet.mjs +9 -8
  95. package/localnet/is-localnet.mjs.map +1 -1
  96. package/network-client.d.ts +17 -15
  97. package/network-client.js +115 -116
  98. package/network-client.js.map +1 -1
  99. package/network-client.mjs +115 -114
  100. package/network-client.mjs.map +1 -1
  101. package/package.json +12 -3
  102. package/testing/account.d.ts +11 -9
  103. package/testing/account.js +31 -33
  104. package/testing/account.js.map +1 -1
  105. package/testing/account.mjs +29 -31
  106. package/testing/account.mjs.map +1 -1
  107. package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
  108. package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
  109. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  110. package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
  111. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  112. package/testing/fixtures/algorand-fixture.d.ts +9 -4
  113. package/testing/fixtures/algorand-fixture.js +67 -62
  114. package/testing/fixtures/algorand-fixture.js.map +1 -1
  115. package/testing/fixtures/algorand-fixture.mjs +66 -59
  116. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  117. package/testing/index.d.ts +7 -5
  118. package/testing/index.js +13 -18
  119. package/testing/index.mjs +7 -7
  120. package/testing/indexer.d.ts +5 -1
  121. package/testing/indexer.js +28 -37
  122. package/testing/indexer.js.map +1 -1
  123. package/testing/indexer.mjs +28 -35
  124. package/testing/indexer.mjs.map +1 -1
  125. package/testing/test-logger.d.ts +41 -36
  126. package/testing/test-logger.js +71 -76
  127. package/testing/test-logger.js.map +1 -1
  128. package/testing/test-logger.mjs +71 -74
  129. package/testing/test-logger.mjs.map +1 -1
  130. package/testing/transaction-logger.d.ts +30 -27
  131. package/testing/transaction-logger.js +77 -93
  132. package/testing/transaction-logger.js.map +1 -1
  133. package/testing/transaction-logger.mjs +74 -90
  134. package/testing/transaction-logger.mjs.map +1 -1
  135. package/transaction/legacy-bridge.js +100 -111
  136. package/transaction/legacy-bridge.js.map +1 -1
  137. package/transaction/legacy-bridge.mjs +97 -108
  138. package/transaction/legacy-bridge.mjs.map +1 -1
  139. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
  140. package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
  141. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  142. package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
  143. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  144. package/transaction/transaction.d.ts +34 -35
  145. package/transaction/transaction.js +716 -914
  146. package/transaction/transaction.js.map +1 -1
  147. package/transaction/transaction.mjs +713 -911
  148. package/transaction/transaction.mjs.map +1 -1
  149. package/transfer/transfer-algos.d.ts +9 -5
  150. package/transfer/transfer-algos.js +26 -27
  151. package/transfer/transfer-algos.js.map +1 -1
  152. package/transfer/transfer-algos.mjs +26 -25
  153. package/transfer/transfer-algos.mjs.map +1 -1
  154. package/transfer/transfer.d.ts +11 -8
  155. package/transfer/transfer.js +94 -100
  156. package/transfer/transfer.js.map +1 -1
  157. package/transfer/transfer.mjs +94 -98
  158. package/transfer/transfer.mjs.map +1 -1
  159. package/types/account-manager.d.ts +432 -429
  160. package/types/account-manager.js +591 -602
  161. package/types/account-manager.js.map +1 -1
  162. package/types/account-manager.mjs +587 -599
  163. package/types/account-manager.mjs.map +1 -1
  164. package/types/account.d.ts +192 -202
  165. package/types/account.js +91 -88
  166. package/types/account.js.map +1 -1
  167. package/types/account.mjs +88 -86
  168. package/types/account.mjs.map +1 -1
  169. package/types/algo-http-client-with-retry.d.ts +15 -10
  170. package/types/algo-http-client-with-retry.js +70 -92
  171. package/types/algo-http-client-with-retry.js.map +1 -1
  172. package/types/algo-http-client-with-retry.mjs +69 -90
  173. package/types/algo-http-client-with-retry.mjs.map +1 -1
  174. package/types/algorand-client-transaction-creator.d.ts +778 -771
  175. package/types/algorand-client-transaction-creator.js +733 -732
  176. package/types/algorand-client-transaction-creator.js.map +1 -1
  177. package/types/algorand-client-transaction-creator.mjs +732 -730
  178. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  179. package/types/algorand-client-transaction-sender.d.ts +1090 -1360
  180. package/types/algorand-client-transaction-sender.js +930 -961
  181. package/types/algorand-client-transaction-sender.js.map +1 -1
  182. package/types/algorand-client-transaction-sender.mjs +927 -959
  183. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  184. package/types/algorand-client.d.ts +239 -236
  185. package/types/algorand-client.js +322 -320
  186. package/types/algorand-client.js.map +1 -1
  187. package/types/algorand-client.mjs +321 -318
  188. package/types/algorand-client.mjs.map +1 -1
  189. package/types/amount.d.ts +47 -43
  190. package/types/amount.js +66 -70
  191. package/types/amount.js.map +1 -1
  192. package/types/amount.mjs +63 -68
  193. package/types/amount.mjs.map +1 -1
  194. package/types/app-arc56.d.ts +235 -272
  195. package/types/app-arc56.js +124 -170
  196. package/types/app-arc56.js.map +1 -1
  197. package/types/app-arc56.mjs +121 -168
  198. package/types/app-arc56.mjs.map +1 -1
  199. package/types/app-client.d.ts +1128 -2009
  200. package/types/app-client.js +1633 -1791
  201. package/types/app-client.js.map +1 -1
  202. package/types/app-client.mjs +1624 -1783
  203. package/types/app-client.mjs.map +1 -1
  204. package/types/app-deployer.d.ts +139 -141
  205. package/types/app-deployer.js +344 -384
  206. package/types/app-deployer.js.map +1 -1
  207. package/types/app-deployer.mjs +341 -382
  208. package/types/app-deployer.mjs.map +1 -1
  209. package/types/app-factory.d.ts +762 -932
  210. package/types/app-factory.js +496 -488
  211. package/types/app-factory.js.map +1 -1
  212. package/types/app-factory.mjs +491 -484
  213. package/types/app-factory.mjs.map +1 -1
  214. package/types/app-manager.d.ts +304 -310
  215. package/types/app-manager.js +422 -475
  216. package/types/app-manager.js.map +1 -1
  217. package/types/app-manager.mjs +419 -473
  218. package/types/app-manager.mjs.map +1 -1
  219. package/types/app-spec.d.ts +118 -117
  220. package/types/app-spec.js +125 -135
  221. package/types/app-spec.js.map +1 -1
  222. package/types/app-spec.mjs +121 -132
  223. package/types/app-spec.mjs.map +1 -1
  224. package/types/app.d.ts +229 -241
  225. package/types/app.js +36 -28
  226. package/types/app.js.map +1 -1
  227. package/types/app.mjs +33 -26
  228. package/types/app.mjs.map +1 -1
  229. package/types/asset-manager.d.ts +204 -199
  230. package/types/asset-manager.js +165 -174
  231. package/types/asset-manager.js.map +1 -1
  232. package/types/asset-manager.mjs +164 -172
  233. package/types/asset-manager.mjs.map +1 -1
  234. package/types/asset.d.ts +95 -91
  235. package/types/asset.js +0 -3
  236. package/types/asset.mjs +0 -2
  237. package/types/async-event-emitter.d.ts +18 -13
  238. package/types/async-event-emitter.js +37 -49
  239. package/types/async-event-emitter.js.map +1 -1
  240. package/types/async-event-emitter.mjs +36 -47
  241. package/types/async-event-emitter.mjs.map +1 -1
  242. package/types/client-manager.d.ts +453 -451
  243. package/types/client-manager.js +602 -598
  244. package/types/client-manager.js.map +1 -1
  245. package/types/client-manager.mjs +597 -594
  246. package/types/client-manager.mjs.map +1 -1
  247. package/types/composer.d.ts +1211 -1258
  248. package/types/composer.js +1436 -1498
  249. package/types/composer.js.map +1 -1
  250. package/types/composer.mjs +1430 -1493
  251. package/types/composer.mjs.map +1 -1
  252. package/types/config.d.ts +53 -48
  253. package/types/config.js +78 -77
  254. package/types/config.js.map +1 -1
  255. package/types/config.mjs +77 -75
  256. package/types/config.mjs.map +1 -1
  257. package/types/debugging.d.ts +25 -23
  258. package/types/debugging.js +9 -11
  259. package/types/debugging.js.map +1 -1
  260. package/types/debugging.mjs +8 -9
  261. package/types/debugging.mjs.map +1 -1
  262. package/types/dispenser-client.d.ts +57 -52
  263. package/types/dispenser-client.js +120 -141
  264. package/types/dispenser-client.js.map +1 -1
  265. package/types/dispenser-client.mjs +119 -139
  266. package/types/dispenser-client.mjs.map +1 -1
  267. package/types/expand.d.ts +5 -3
  268. package/types/expand.js +0 -3
  269. package/types/expand.mjs +0 -2
  270. package/types/indexer.d.ts +104 -100
  271. package/types/indexer.js +36 -31
  272. package/types/indexer.js.map +1 -1
  273. package/types/indexer.mjs +32 -30
  274. package/types/indexer.mjs.map +1 -1
  275. package/types/instance-of.d.ts +5 -3
  276. package/types/instance-of.js +0 -3
  277. package/types/instance-of.mjs +0 -2
  278. package/types/kmd-account-manager.d.ts +75 -70
  279. package/types/kmd-account-manager.js +150 -184
  280. package/types/kmd-account-manager.js.map +1 -1
  281. package/types/kmd-account-manager.mjs +147 -182
  282. package/types/kmd-account-manager.mjs.map +1 -1
  283. package/types/lifecycle-events.d.ts +13 -8
  284. package/types/lifecycle-events.js +10 -7
  285. package/types/lifecycle-events.js.map +1 -1
  286. package/types/lifecycle-events.mjs +9 -7
  287. package/types/lifecycle-events.mjs.map +1 -1
  288. package/types/logging.d.ts +15 -11
  289. package/types/logging.js +30 -31
  290. package/types/logging.js.map +1 -1
  291. package/types/logging.mjs +29 -29
  292. package/types/logging.mjs.map +1 -1
  293. package/types/logic-error.d.ts +33 -29
  294. package/types/logic-error.js +50 -49
  295. package/types/logic-error.js.map +1 -1
  296. package/types/logic-error.mjs +49 -47
  297. package/types/logic-error.mjs.map +1 -1
  298. package/types/network-client.d.ts +32 -27
  299. package/types/network-client.js +10 -9
  300. package/types/network-client.js.map +1 -1
  301. package/types/network-client.mjs +9 -7
  302. package/types/network-client.mjs.map +1 -1
  303. package/types/testing.d.ts +131 -132
  304. package/types/testing.js +0 -3
  305. package/types/testing.mjs +0 -2
  306. package/types/transaction.d.ts +110 -110
  307. package/types/transaction.js +0 -3
  308. package/types/transaction.mjs +0 -2
  309. package/types/transfer.d.ts +70 -66
  310. package/types/transfer.js +0 -3
  311. package/types/transfer.mjs +0 -2
  312. package/util.js +73 -118
  313. package/util.js.map +1 -1
  314. package/util.mjs +73 -116
  315. package/util.mjs.map +1 -1
  316. package/account/index.d.ts +0 -5
  317. package/debugging/index.d.ts +0 -1
  318. package/index.js.map +0 -1
  319. package/index.mjs.map +0 -1
  320. package/localnet/index.d.ts +0 -4
  321. package/testing/_asset.d.ts +0 -3
  322. package/testing/fixtures/index.d.ts +0 -2
  323. package/testing/index.js.map +0 -1
  324. package/testing/index.mjs.map +0 -1
  325. package/transaction/index.d.ts +0 -2
  326. package/transaction/legacy-bridge.d.ts +0 -35
  327. package/transfer/index.d.ts +0 -2
  328. package/types/asset.js.map +0 -1
  329. package/types/asset.mjs.map +0 -1
  330. package/types/expand.js.map +0 -1
  331. package/types/expand.mjs.map +0 -1
  332. package/types/instance-of.js.map +0 -1
  333. package/types/instance-of.mjs.map +0 -1
  334. package/types/testing.js.map +0 -1
  335. package/types/testing.mjs.map +0 -1
  336. package/types/transaction.js.map +0 -1
  337. package/types/transaction.mjs.map +0 -1
  338. package/types/transfer.js.map +0 -1
  339. package/types/transfer.mjs.map +0 -1
  340. package/util.d.ts +0 -48
@@ -1,182 +1,170 @@
1
- import algosdk, { Address } from 'algosdk';
2
- import { TransactionSignerAccount } from './account';
3
- import { AlgoAmount } from './amount';
4
- import { AppManager, BoxIdentifier, BoxReference, ResourceReference } from './app-manager';
5
- import { Expand } from './expand';
6
- import { Arc2TransactionNote, SendAtomicTransactionComposerResults, SendParams } from './transaction';
7
- import Transaction = algosdk.Transaction;
8
- import TransactionSigner = algosdk.TransactionSigner;
9
- import TransactionWithSigner = algosdk.TransactionWithSigner;
10
- import SimulateResponse = algosdk.modelsv2.SimulateResponse;
11
- import modelsv2 = algosdk.modelsv2;
12
- export declare const MAX_TRANSACTION_GROUP_SIZE = 16;
1
+ import { AlgoAmount } from "./amount.js";
2
+ import { TransactionSignerAccount } from "./account.js";
3
+ import { Expand } from "./expand.js";
4
+ import { Arc2TransactionNote, SendAtomicTransactionComposerResults, SendParams } from "./transaction.js";
5
+ import { AppManager, BoxIdentifier, BoxReference, ResourceReference } from "./app-manager.js";
6
+ import algosdk, { Address } from "algosdk";
7
+
8
+ //#region src/types/composer.d.ts
9
+ declare const MAX_TRANSACTION_GROUP_SIZE = 16;
13
10
  /** Options to control a simulate request, that does not require transaction signing */
14
- export type SkipSignaturesSimulateOptions = Expand<Omit<RawSimulateOptions, 'fixSigners' | 'allowEmptySignatures'> & {
15
- /** Whether or not to skip signatures for all built transactions and use an empty signer instead.
16
- * This will set `fixSigners` and `allowEmptySignatures` when sending the request to the algod API.
17
- */
18
- skipSignatures: boolean;
11
+ type SkipSignaturesSimulateOptions = Expand<Omit<RawSimulateOptions, 'fixSigners' | 'allowEmptySignatures'> & {
12
+ /** Whether or not to skip signatures for all built transactions and use an empty signer instead.
13
+ * This will set `fixSigners` and `allowEmptySignatures` when sending the request to the algod API.
14
+ */
15
+ skipSignatures: boolean;
19
16
  }>;
20
17
  /** The raw API options to control a simulate request.
21
- * See algod API docs for more information: https://dev.algorand.co/reference/rest-apis/algod/#simulatetransaction
18
+ * See algod API docs for more information: https://dev.algorand.co/reference/rest-api/algod/operations/simulatetransaction/
22
19
  */
23
- export type RawSimulateOptions = Expand<Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>>;
20
+ type RawSimulateOptions = Expand<Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>>;
24
21
  /** All options to control a simulate request */
25
- export type SimulateOptions = Expand<Partial<SkipSignaturesSimulateOptions> & RawSimulateOptions>;
22
+ type SimulateOptions = Expand<Partial<SkipSignaturesSimulateOptions> & RawSimulateOptions>;
26
23
  /** Common parameters for defining a transaction. */
27
- export type CommonTransactionParams = {
28
- /** The address of the account sending the transaction. */
29
- sender: string | Address;
30
- /** The function used to sign transaction(s); if not specified then
31
- * an attempt will be made to find a registered signer for the
32
- * given `sender` or use a default signer (if configured).
33
- */
34
- signer?: algosdk.TransactionSigner | TransactionSignerAccount;
35
- /** Change the signing key of the sender to the given address.
36
- *
37
- * **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://dev.algorand.co/concepts/accounts/rekeying).
38
- */
39
- rekeyTo?: string | Address;
40
- /** Note to attach to the transaction. Max of 1000 bytes. */
41
- note?: Uint8Array | string;
42
- /** Prevent multiple transactions with the same lease being included within the validity window.
43
- *
44
- * A [lease](https://dev.algorand.co/concepts/transactions/leases)
45
- * enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
46
- */
47
- lease?: Uint8Array | string;
48
- /** The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction. */
49
- staticFee?: AlgoAmount;
50
- /** The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees. */
51
- extraFee?: AlgoAmount;
52
- /** Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. */
53
- maxFee?: AlgoAmount;
54
- /** How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. */
55
- validityWindow?: number | bigint;
56
- /**
57
- * Set the first round this transaction is valid.
58
- * If left undefined, the value from algod will be used.
59
- *
60
- * We recommend you only set this when you intentionally want this to be some time in the future.
61
- */
62
- firstValidRound?: bigint;
63
- /** The last round this transaction is valid. It is recommended to use `validityWindow` instead. */
64
- lastValidRound?: bigint;
24
+ type CommonTransactionParams = {
25
+ /** The address of the account sending the transaction. */sender: string | Address;
26
+ /** The function used to sign transaction(s); if not specified then
27
+ * an attempt will be made to find a registered signer for the
28
+ * given `sender` or use a default signer (if configured).
29
+ */
30
+ signer?: algosdk.TransactionSigner | TransactionSignerAccount;
31
+ /** Change the signing key of the sender to the given address.
32
+ *
33
+ * **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://dev.algorand.co/concepts/accounts/rekeying).
34
+ */
35
+ rekeyTo?: string | Address; /** Note to attach to the transaction. Max of 1000 bytes. */
36
+ note?: Uint8Array | string;
37
+ /** Prevent multiple transactions with the same lease being included within the validity window.
38
+ *
39
+ * A [lease](https://dev.algorand.co/concepts/transactions/leases)
40
+ * enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
41
+ */
42
+ lease?: Uint8Array | string; /** The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction. */
43
+ staticFee?: AlgoAmount; /** The fee to pay IN ADDITION to the suggested fee. Useful for manually covering inner transaction fees. */
44
+ extraFee?: AlgoAmount; /** Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. */
45
+ maxFee?: AlgoAmount; /** How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. */
46
+ validityWindow?: number | bigint;
47
+ /**
48
+ * Set the first round this transaction is valid.
49
+ * If left undefined, the value from algod will be used.
50
+ *
51
+ * We recommend you only set this when you intentionally want this to be some time in the future.
52
+ */
53
+ firstValidRound?: bigint; /** The last round this transaction is valid. It is recommended to use `validityWindow` instead. */
54
+ lastValidRound?: bigint;
65
55
  };
66
56
  /** Parameters to define a payment transaction. */
67
- export type PaymentParams = CommonTransactionParams & {
68
- /** The address of the account that will receive the Algo */
69
- receiver: string | Address;
70
- /** Amount to send */
71
- amount: AlgoAmount;
72
- /** If given, close the sender account and send the remaining balance to this address
73
- *
74
- * *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly.
75
- */
76
- closeRemainderTo?: string | Address;
57
+ type PaymentParams = CommonTransactionParams & {
58
+ /** The address of the account that will receive the Algo */receiver: string | Address; /** Amount to send */
59
+ amount: AlgoAmount;
60
+ /** If given, close the sender account and send the remaining balance to this address
61
+ *
62
+ * *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly.
63
+ */
64
+ closeRemainderTo?: string | Address;
77
65
  };
78
66
  /** Parameters to define an asset create transaction.
79
67
  *
80
68
  * The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.
81
69
  */
82
- export type AssetCreateParams = CommonTransactionParams & {
83
- /** The total amount of the smallest divisible (decimal) unit to create.
84
- *
85
- * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.
86
- *
87
- * This field can only be specified upon asset creation.
88
- */
89
- total: bigint;
90
- /** The amount of decimal places the asset should have.
91
- *
92
- * If unspecified then the asset will be in whole units (i.e. `0`).
93
- *
94
- * * If 0, the asset is not divisible;
95
- * * If 1, the base unit of the asset is in tenths;
96
- * * If 2, the base unit of the asset is in hundredths;
97
- * * If 3, the base unit of the asset is in thousandths;
98
- * * and so on up to 19 decimal places.
99
- *
100
- * This field can only be specified upon asset creation.
101
- */
102
- decimals?: number;
103
- /** The optional name of the asset.
104
- *
105
- * Max size is 32 bytes.
106
- *
107
- * This field can only be specified upon asset creation.
108
- */
109
- assetName?: string;
110
- /** The optional name of the unit of this asset (e.g. ticker name).
111
- *
112
- * Max size is 8 bytes.
113
- *
114
- * This field can only be specified upon asset creation.
115
- */
116
- unitName?: string;
117
- /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).
118
- *
119
- * Max size is 96 bytes.
120
- *
121
- * This field can only be specified upon asset creation.
122
- */
123
- url?: string;
124
- /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.
125
- *
126
- * The format of this metadata is up to the application.
127
- *
128
- * This field can only be specified upon asset creation.
129
- */
130
- metadataHash?: string | Uint8Array;
131
- /** Whether the asset is frozen by default for all accounts.
132
- * Defaults to `false`.
133
- *
134
- * If `true` then for anyone apart from the creator to hold the
135
- * asset it needs to be unfrozen per account using an asset freeze
136
- * transaction from the `freeze` account, which must be set on creation.
137
- *
138
- * This field can only be specified upon asset creation.
139
- */
140
- defaultFrozen?: boolean;
141
- /** The address of the optional account that can manage the configuration of the asset and destroy it.
142
- *
143
- * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
144
- *
145
- * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.
146
- */
147
- manager?: string | Address;
148
- /**
149
- * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
150
- *
151
- * This address has no specific authority in the protocol itself and is informational only.
152
- *
153
- * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
154
- * rely on this field to hold meaningful data.
155
- *
156
- * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
157
- * of the asset reside in an account that is different from the default creator account.
158
- *
159
- * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
160
- */
161
- reserve?: string | Address;
162
- /**
163
- * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
164
- *
165
- * If empty, freezing is not permitted.
166
- *
167
- * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
168
- */
169
- freeze?: string | Address;
170
- /**
171
- * The address of the optional account that can clawback holdings of this asset from any account.
172
- *
173
- * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
174
- *
175
- * If empty, clawback is not permitted.
176
- *
177
- * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
178
- */
179
- clawback?: string | Address;
70
+ type AssetCreateParams = CommonTransactionParams & {
71
+ /** The total amount of the smallest divisible (decimal) unit to create.
72
+ *
73
+ * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.
74
+ *
75
+ * This field can only be specified upon asset creation.
76
+ */
77
+ total: bigint;
78
+ /** The amount of decimal places the asset should have.
79
+ *
80
+ * If unspecified then the asset will be in whole units (i.e. `0`).
81
+ *
82
+ * * If 0, the asset is not divisible;
83
+ * * If 1, the base unit of the asset is in tenths;
84
+ * * If 2, the base unit of the asset is in hundredths;
85
+ * * If 3, the base unit of the asset is in thousandths;
86
+ * * and so on up to 19 decimal places.
87
+ *
88
+ * This field can only be specified upon asset creation.
89
+ */
90
+ decimals?: number;
91
+ /** The optional name of the asset.
92
+ *
93
+ * Max size is 32 bytes.
94
+ *
95
+ * This field can only be specified upon asset creation.
96
+ */
97
+ assetName?: string;
98
+ /** The optional name of the unit of this asset (e.g. ticker name).
99
+ *
100
+ * Max size is 8 bytes.
101
+ *
102
+ * This field can only be specified upon asset creation.
103
+ */
104
+ unitName?: string;
105
+ /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).
106
+ *
107
+ * Max size is 96 bytes.
108
+ *
109
+ * This field can only be specified upon asset creation.
110
+ */
111
+ url?: string;
112
+ /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.
113
+ *
114
+ * The format of this metadata is up to the application.
115
+ *
116
+ * This field can only be specified upon asset creation.
117
+ */
118
+ metadataHash?: string | Uint8Array;
119
+ /** Whether the asset is frozen by default for all accounts.
120
+ * Defaults to `false`.
121
+ *
122
+ * If `true` then for anyone apart from the creator to hold the
123
+ * asset it needs to be unfrozen per account using an asset freeze
124
+ * transaction from the `freeze` account, which must be set on creation.
125
+ *
126
+ * This field can only be specified upon asset creation.
127
+ */
128
+ defaultFrozen?: boolean;
129
+ /** The address of the optional account that can manage the configuration of the asset and destroy it.
130
+ *
131
+ * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
132
+ *
133
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.
134
+ */
135
+ manager?: string | Address;
136
+ /**
137
+ * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
138
+ *
139
+ * This address has no specific authority in the protocol itself and is informational only.
140
+ *
141
+ * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
142
+ * rely on this field to hold meaningful data.
143
+ *
144
+ * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
145
+ * of the asset reside in an account that is different from the default creator account.
146
+ *
147
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
148
+ */
149
+ reserve?: string | Address;
150
+ /**
151
+ * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
152
+ *
153
+ * If empty, freezing is not permitted.
154
+ *
155
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
156
+ */
157
+ freeze?: string | Address;
158
+ /**
159
+ * The address of the optional account that can clawback holdings of this asset from any account.
160
+ *
161
+ * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
162
+ *
163
+ * If empty, clawback is not permitted.
164
+ *
165
+ * If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
166
+ */
167
+ clawback?: string | Address;
180
168
  };
181
169
  /** Parameters to define an asset reconfiguration transaction.
182
170
  *
@@ -184,241 +172,206 @@ export type AssetCreateParams = CommonTransactionParams & {
184
172
  * are immutably empty if they are not set. If manager is not set then
185
173
  * all fields are immutable from that point forward.
186
174
  */
187
- export type AssetConfigParams = CommonTransactionParams & {
188
- /** ID of the asset to reconfigure */
189
- assetId: bigint;
190
- /** The address of the optional account that can manage the configuration of the asset and destroy it.
191
- *
192
- * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
193
- *
194
- * If not set (`undefined` or `""`) the asset will become permanently immutable.
195
- */
196
- manager: string | Address | undefined;
197
- /**
198
- * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
199
- *
200
- * This address has no specific authority in the protocol itself and is informational only.
201
- *
202
- * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
203
- * rely on this field to hold meaningful data.
204
- *
205
- * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
206
- * of the asset reside in an account that is different from the default creator account.
207
- *
208
- * If not set (`undefined` or `""`) the field will become permanently empty.
209
- */
210
- reserve?: string | Address;
211
- /**
212
- * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
213
- *
214
- * If empty, freezing is not permitted.
215
- *
216
- * If not set (`undefined` or `""`) the field will become permanently empty.
217
- */
218
- freeze?: string | Address;
219
- /**
220
- * The address of the optional account that can clawback holdings of this asset from any account.
221
- *
222
- * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
223
- *
224
- * If empty, clawback is not permitted.
225
- *
226
- * If not set (`undefined` or `""`) the field will become permanently empty.
227
- */
228
- clawback?: string | Address;
175
+ type AssetConfigParams = CommonTransactionParams & {
176
+ /** ID of the asset to reconfigure */assetId: bigint;
177
+ /** The address of the optional account that can manage the configuration of the asset and destroy it.
178
+ *
179
+ * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
180
+ *
181
+ * If not set (`undefined` or `""`) the asset will become permanently immutable.
182
+ */
183
+ manager: string | Address | undefined;
184
+ /**
185
+ * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
186
+ *
187
+ * This address has no specific authority in the protocol itself and is informational only.
188
+ *
189
+ * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
190
+ * rely on this field to hold meaningful data.
191
+ *
192
+ * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
193
+ * of the asset reside in an account that is different from the default creator account.
194
+ *
195
+ * If not set (`undefined` or `""`) the field will become permanently empty.
196
+ */
197
+ reserve?: string | Address;
198
+ /**
199
+ * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
200
+ *
201
+ * If empty, freezing is not permitted.
202
+ *
203
+ * If not set (`undefined` or `""`) the field will become permanently empty.
204
+ */
205
+ freeze?: string | Address;
206
+ /**
207
+ * The address of the optional account that can clawback holdings of this asset from any account.
208
+ *
209
+ * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
210
+ *
211
+ * If empty, clawback is not permitted.
212
+ *
213
+ * If not set (`undefined` or `""`) the field will become permanently empty.
214
+ */
215
+ clawback?: string | Address;
229
216
  };
230
217
  /** Parameters to define an asset freeze transaction. */
231
- export type AssetFreezeParams = CommonTransactionParams & {
232
- /** The ID of the asset to freeze/unfreeze */
233
- assetId: bigint;
234
- /** The address of the account to freeze or unfreeze */
235
- account: string | Address;
236
- /** Whether the assets in the account should be frozen */
237
- frozen: boolean;
218
+ type AssetFreezeParams = CommonTransactionParams & {
219
+ /** The ID of the asset to freeze/unfreeze */assetId: bigint; /** The address of the account to freeze or unfreeze */
220
+ account: string | Address; /** Whether the assets in the account should be frozen */
221
+ frozen: boolean;
238
222
  };
239
223
  /** Parameters to define an asset destroy transaction.
240
224
  *
241
225
  * Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.
242
226
  */
243
- export type AssetDestroyParams = CommonTransactionParams & {
244
- /** ID of the asset to destroy */
245
- assetId: bigint;
227
+ type AssetDestroyParams = CommonTransactionParams & {
228
+ /** ID of the asset to destroy */assetId: bigint;
246
229
  };
247
230
  /** Parameters to define an asset transfer transaction. */
248
- export type AssetTransferParams = CommonTransactionParams & {
249
- /** ID of the asset to transfer. */
250
- assetId: bigint;
251
- /** Amount of the asset to transfer (in smallest divisible (decimal) units). */
252
- amount: bigint;
253
- /** The address of the account that will receive the asset unit(s). */
254
- receiver: string | Address;
255
- /** Optional address of an account to clawback the asset from.
256
- *
257
- * Requires the sender to be the clawback account.
258
- *
259
- * **Warning:** Be careful with this parameter as it can lead to unexpected loss of funds if not used correctly.
260
- */
261
- clawbackTarget?: string | Address;
262
- /** Optional address of an account to close the asset position to.
263
- *
264
- * **Warning:** Be careful with this parameter as it can lead to loss of funds if not used correctly.
265
- */
266
- closeAssetTo?: string | Address;
231
+ type AssetTransferParams = CommonTransactionParams & {
232
+ /** ID of the asset to transfer. */assetId: bigint; /** Amount of the asset to transfer (in smallest divisible (decimal) units). */
233
+ amount: bigint; /** The address of the account that will receive the asset unit(s). */
234
+ receiver: string | Address;
235
+ /** Optional address of an account to clawback the asset from.
236
+ *
237
+ * Requires the sender to be the clawback account.
238
+ *
239
+ * **Warning:** Be careful with this parameter as it can lead to unexpected loss of funds if not used correctly.
240
+ */
241
+ clawbackTarget?: string | Address;
242
+ /** Optional address of an account to close the asset position to.
243
+ *
244
+ * **Warning:** Be careful with this parameter as it can lead to loss of funds if not used correctly.
245
+ */
246
+ closeAssetTo?: string | Address;
267
247
  };
268
248
  /** Parameters to define an asset opt-in transaction. */
269
- export type AssetOptInParams = CommonTransactionParams & {
270
- /** ID of the asset that will be opted-in to. */
271
- assetId: bigint;
249
+ type AssetOptInParams = CommonTransactionParams & {
250
+ /** ID of the asset that will be opted-in to. */assetId: bigint;
272
251
  };
273
252
  /** Parameters to define an asset opt-out transaction. */
274
- export type AssetOptOutParams = CommonTransactionParams & {
275
- /** ID of the asset that will be opted-out of. */
276
- assetId: bigint;
277
- /**
278
- * The address of the asset creator account to close the asset
279
- * position to (any remaining asset units will be sent to this account).
280
- */
281
- creator: string | Address;
253
+ type AssetOptOutParams = CommonTransactionParams & {
254
+ /** ID of the asset that will be opted-out of. */assetId: bigint;
255
+ /**
256
+ * The address of the asset creator account to close the asset
257
+ * position to (any remaining asset units will be sent to this account).
258
+ */
259
+ creator: string | Address;
282
260
  };
283
261
  /** Parameters to define an online key registration transaction. */
284
- export type OnlineKeyRegistrationParams = CommonTransactionParams & {
285
- /** The root participation public key */
286
- voteKey: Uint8Array;
287
- /** The VRF public key */
288
- selectionKey: Uint8Array;
289
- /** The first round that the participation key is valid. Not to be confused with the `firstValid` round of the keyreg transaction */
290
- voteFirst: bigint;
291
- /** The last round that the participation key is valid. Not to be confused with the `lastValid` round of the keyreg transaction */
292
- voteLast: bigint;
293
- /** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */
294
- voteKeyDilution: bigint;
295
- /** The 64 byte state proof public key commitment */
296
- stateProofKey?: Uint8Array;
262
+ type OnlineKeyRegistrationParams = CommonTransactionParams & {
263
+ /** The root participation public key */voteKey: Uint8Array; /** The VRF public key */
264
+ selectionKey: Uint8Array; /** The first round that the participation key is valid. Not to be confused with the `firstValid` round of the keyreg transaction */
265
+ voteFirst: bigint; /** The last round that the participation key is valid. Not to be confused with the `lastValid` round of the keyreg transaction */
266
+ voteLast: bigint; /** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */
267
+ voteKeyDilution: bigint; /** The 64 byte state proof public key commitment */
268
+ stateProofKey?: Uint8Array;
297
269
  };
298
270
  /** Parameters to define an offline key registration transaction. */
299
- export type OfflineKeyRegistrationParams = CommonTransactionParams & {
300
- /** Prevent this account from ever participating again. The account will also no longer earn rewards */
301
- preventAccountFromEverParticipatingAgain?: boolean;
271
+ type OfflineKeyRegistrationParams = CommonTransactionParams & {
272
+ /** Prevent this account from ever participating again. The account will also no longer earn rewards */preventAccountFromEverParticipatingAgain?: boolean;
302
273
  };
303
274
  /** Common parameters for defining an application call transaction. */
304
- export type CommonAppCallParams = CommonTransactionParams & {
305
- /** ID of the application; 0 if the application is being created. */
306
- appId: bigint;
307
- /** The [on-complete](https://dev.algorand.co/concepts/smart-contracts/avm#oncomplete) action of the call; defaults to no-op. */
308
- onComplete?: algosdk.OnApplicationComplete;
309
- /** Any [arguments to pass to the smart contract call](/concepts/smart-contracts/languages/teal/#argument-passing). */
310
- args?: Uint8Array[];
311
- /** Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */
312
- accountReferences?: (string | Address)[];
313
- /** The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */
314
- appReferences?: bigint[];
315
- /** The ID of any assets to load to the [foreign assets array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */
316
- assetReferences?: bigint[];
317
- /** Any boxes to load to the [boxes array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
318
- *
319
- * Either the name identifier (which will be set against app ID of `0` i.e.
320
- * the current app), or a box identifier with the name identifier and app ID.
321
- */
322
- boxReferences?: (BoxReference | BoxIdentifier)[];
323
- /** Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty. */
324
- accessReferences?: ResourceReference[];
325
- /** If set, the transaction will be rejected when the app's version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check. */
326
- rejectVersion?: number;
275
+ type CommonAppCallParams = CommonTransactionParams & {
276
+ /** ID of the application; 0 if the application is being created. */appId: bigint; /** The [on-complete](https://dev.algorand.co/concepts/smart-contracts/avm#oncomplete) action of the call; defaults to no-op. */
277
+ onComplete?: algosdk.OnApplicationComplete; /** Any [arguments to pass to the smart contract call](https://dev.algorand.co/concepts/smart-contracts/languages/teal/#argument-passing). */
278
+ args?: Uint8Array[]; /** Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */
279
+ accountReferences?: (string | Address)[]; /** The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */
280
+ appReferences?: bigint[]; /** The ID of any assets to load to the [foreign assets array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */
281
+ assetReferences?: bigint[];
282
+ /** Any boxes to load to the [boxes array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
283
+ *
284
+ * Either the name identifier (which will be set against app ID of `0` i.e.
285
+ * the current app), or a box identifier with the name identifier and app ID.
286
+ */
287
+ boxReferences?: (BoxReference | BoxIdentifier)[]; /** Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty. */
288
+ accessReferences?: ResourceReference[]; /** If set, the transaction will be rejected when the app's version is greater than or equal to this value. This can be used to prevent calling an app after it has been updated. Set to 0 or leave undefined to skip the version check. */
289
+ rejectVersion?: number;
327
290
  };
328
291
  /** Parameters to define an app create transaction */
329
- export type AppCreateParams = Expand<Omit<CommonAppCallParams, 'appId'> & {
330
- onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.ClearStateOC>;
331
- /** The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
332
- approvalProgram: string | Uint8Array;
333
- /** The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
334
- clearStateProgram: string | Uint8Array;
335
- /** The state schema for the app. This is immutable once the app is created. */
336
- schema?: {
337
- /** The number of integers saved in global state. */
338
- globalInts: number;
339
- /** The number of byte slices saved in global state. */
340
- globalByteSlices: number;
341
- /** The number of integers saved in local state. */
342
- localInts: number;
343
- /** The number of byte slices saved in local state. */
344
- localByteSlices: number;
345
- };
346
- /** Number of extra pages required for the programs.
347
- * Defaults to the number needed for the programs in this call if not specified.
348
- * This is immutable once the app is created. */
349
- extraProgramPages?: number;
292
+ type AppCreateParams = Expand<Omit<CommonAppCallParams, 'appId'> & {
293
+ onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.ClearStateOC>; /** The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
294
+ approvalProgram: string | Uint8Array; /** The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
295
+ clearStateProgram: string | Uint8Array; /** The state schema for the app. This is immutable once the app is created. */
296
+ schema?: {
297
+ /** The number of integers saved in global state. */globalInts: number; /** The number of byte slices saved in global state. */
298
+ globalByteSlices: number; /** The number of integers saved in local state. */
299
+ localInts: number; /** The number of byte slices saved in local state. */
300
+ localByteSlices: number;
301
+ };
302
+ /** Number of extra pages required for the programs.
303
+ * Defaults to the number needed for the programs in this call if not specified.
304
+ * This is immutable once the app is created. */
305
+ extraProgramPages?: number;
350
306
  }>;
351
307
  /** Parameters to define an app update transaction */
352
- export type AppUpdateParams = Expand<CommonAppCallParams & {
353
- onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC;
354
- /** The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
355
- approvalProgram: string | Uint8Array;
356
- /** The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
357
- clearStateProgram: string | Uint8Array;
308
+ type AppUpdateParams = Expand<CommonAppCallParams & {
309
+ onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC; /** The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
310
+ approvalProgram: string | Uint8Array; /** The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
311
+ clearStateProgram: string | Uint8Array;
358
312
  }>;
359
313
  /** Parameters to define an application call transaction. */
360
- export type AppCallParams = CommonAppCallParams & {
361
- onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC>;
314
+ type AppCallParams = CommonAppCallParams & {
315
+ onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC>;
362
316
  };
363
317
  /** Common parameters to define an ABI method call transaction. */
364
- export type AppMethodCallParams = CommonAppCallParams & {
365
- onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC>;
318
+ type AppMethodCallParams = CommonAppCallParams & {
319
+ onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC>;
366
320
  };
367
321
  /** Parameters to define an application delete call transaction. */
368
- export type AppDeleteParams = CommonAppCallParams & {
369
- onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC;
322
+ type AppDeleteParams = CommonAppCallParams & {
323
+ onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC;
370
324
  };
371
325
  /** Parameters to define an ABI method call create transaction. */
372
- export type AppCreateMethodCall = AppMethodCall<AppCreateParams>;
326
+ type AppCreateMethodCall = AppMethodCall<AppCreateParams>;
373
327
  /** Parameters to define an ABI method call update transaction. */
374
- export type AppUpdateMethodCall = AppMethodCall<AppUpdateParams>;
328
+ type AppUpdateMethodCall = AppMethodCall<AppUpdateParams>;
375
329
  /** Parameters to define an ABI method call delete transaction. */
376
- export type AppDeleteMethodCall = AppMethodCall<AppDeleteParams>;
330
+ type AppDeleteMethodCall = AppMethodCall<AppDeleteParams>;
377
331
  /** Parameters to define an ABI method call transaction. */
378
- export type AppCallMethodCall = AppMethodCall<AppMethodCallParams>;
332
+ type AppCallMethodCall = AppMethodCall<AppMethodCallParams>;
379
333
  /** Types that can be used to define a transaction argument for an ABI call transaction. */
380
- export type AppMethodCallTransactionArgument = TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>;
334
+ type AppMethodCallTransactionArgument = TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>;
381
335
  /** Parameters to define an ABI method call. */
382
- export type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {
383
- /** The ABI method to call */
384
- method: algosdk.ABIMethod;
385
- /** Arguments to the ABI method, either:
386
- * * An ABI value
387
- * * A transaction with explicit signer
388
- * * A transaction (where the signer will be automatically assigned)
389
- * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
390
- * * Another method call (via method call params object)
391
- * * undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
392
- */
393
- args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> | undefined)[];
336
+ type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {
337
+ /** The ABI method to call */method: algosdk.ABIMethod;
338
+ /** Arguments to the ABI method, either:
339
+ * * An ABI value
340
+ * * A transaction with explicit signer
341
+ * * A transaction (where the signer will be automatically assigned)
342
+ * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
343
+ * * Another method call (via method call params object)
344
+ * * undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
345
+ */
346
+ args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> | undefined)[];
394
347
  };
395
- export type Txn = (PaymentParams & {
396
- type: 'pay';
348
+ type Txn = (PaymentParams & {
349
+ type: 'pay';
397
350
  }) | (AssetCreateParams & {
398
- type: 'assetCreate';
351
+ type: 'assetCreate';
399
352
  }) | (AssetConfigParams & {
400
- type: 'assetConfig';
353
+ type: 'assetConfig';
401
354
  }) | (AssetFreezeParams & {
402
- type: 'assetFreeze';
355
+ type: 'assetFreeze';
403
356
  }) | (AssetDestroyParams & {
404
- type: 'assetDestroy';
357
+ type: 'assetDestroy';
405
358
  }) | (AssetTransferParams & {
406
- type: 'assetTransfer';
359
+ type: 'assetTransfer';
407
360
  }) | (AssetOptInParams & {
408
- type: 'assetOptIn';
361
+ type: 'assetOptIn';
409
362
  }) | (AssetOptOutParams & {
410
- type: 'assetOptOut';
363
+ type: 'assetOptOut';
411
364
  }) | ((AppCallParams | AppCreateParams | AppUpdateParams) & {
412
- type: 'appCall';
365
+ type: 'appCall';
413
366
  }) | ((OnlineKeyRegistrationParams | OfflineKeyRegistrationParams) & {
414
- type: 'keyReg';
367
+ type: 'keyReg';
415
368
  }) | (algosdk.TransactionWithSigner & {
416
- type: 'txnWithSigner';
369
+ type: 'txnWithSigner';
417
370
  }) | {
418
- atc: algosdk.AtomicTransactionComposer;
419
- type: 'atc';
371
+ atc: algosdk.AtomicTransactionComposer;
372
+ type: 'atc';
420
373
  } | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & {
421
- type: 'methodCall';
374
+ type: 'methodCall';
422
375
  });
423
376
  /**
424
377
  * A function that transforms an error into a new error.
@@ -426,915 +379,915 @@ export type Txn = (PaymentParams & {
426
379
  * In most cases, an ErrorTransformer should first check if it can or should transform the error
427
380
  * and return the input error if it cannot or should not transform it.
428
381
  */
429
- export type ErrorTransformer = (error: Error) => Promise<Error>;
382
+ type ErrorTransformer = (error: Error) => Promise<Error>;
430
383
  /** Parameters to create an `TransactionComposer`. */
431
- export type TransactionComposerParams = {
432
- /** The algod client to use to get suggestedParams and send the transaction group */
433
- algod: algosdk.Algodv2;
434
- /** The function used to get the TransactionSigner for a given address */
435
- getSigner: (address: string | Address) => algosdk.TransactionSigner;
436
- /** The method used to get SuggestedParams for transactions in the group */
437
- getSuggestedParams?: () => Promise<algosdk.SuggestedParams>;
438
- /** How many rounds a transaction should be valid for by default; if not specified
439
- * then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).
440
- */
441
- defaultValidityWindow?: bigint;
442
- /** An existing `AppManager` to use to manage app compilation and cache compilation results.
443
- *
444
- * If not specified then an ephemeral one will be created.
445
- */
446
- appManager?: AppManager;
447
- /**
448
- * An array of error transformers to use when an error is caught in simulate or execute
449
- * callbacks can later be registered with `registerErrorTransformer`
450
- */
451
- errorTransformers?: ErrorTransformer[];
384
+ type TransactionComposerParams = {
385
+ /** The algod client to use to get suggestedParams and send the transaction group */algod: algosdk.Algodv2; /** The function used to get the TransactionSigner for a given address */
386
+ getSigner: (address: string | Address) => algosdk.TransactionSigner; /** The method used to get SuggestedParams for transactions in the group */
387
+ getSuggestedParams?: () => Promise<algosdk.SuggestedParams>;
388
+ /** How many rounds a transaction should be valid for by default; if not specified
389
+ * then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).
390
+ */
391
+ defaultValidityWindow?: bigint;
392
+ /** An existing `AppManager` to use to manage app compilation and cache compilation results.
393
+ *
394
+ * If not specified then an ephemeral one will be created.
395
+ */
396
+ appManager?: AppManager;
397
+ /**
398
+ * An array of error transformers to use when an error is caught in simulate or execute
399
+ * callbacks can later be registered with `registerErrorTransformer`
400
+ */
401
+ errorTransformers?: ErrorTransformer[];
452
402
  };
453
403
  /** Set of transactions built by `TransactionComposer`. */
454
- export interface BuiltTransactions {
455
- /** The built transactions */
456
- transactions: algosdk.Transaction[];
457
- /** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */
458
- methodCalls: Map<number, algosdk.ABIMethod>;
459
- /** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */
460
- signers: Map<number, algosdk.TransactionSigner>;
404
+ interface BuiltTransactions {
405
+ /** The built transactions */
406
+ transactions: algosdk.Transaction[];
407
+ /** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */
408
+ methodCalls: Map<number, algosdk.ABIMethod>;
409
+ /** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */
410
+ signers: Map<number, algosdk.TransactionSigner>;
461
411
  }
462
412
  /** TransactionComposer helps you compose and execute transactions as a transaction group. */
463
- export declare class TransactionComposer {
464
- /** Signer used to represent a lack of signer */
465
- private static NULL_SIGNER;
466
- /** The ATC used to compose the group */
467
- private atc;
468
- /** Map of transaction index in the atc to a max logical fee.
469
- * This is set using the value of either maxFee or staticFee.
470
- */
471
- private txnMaxFees;
472
- /** Transactions that have not yet been composed */
473
- private txns;
474
- /** The algod client used by the composer. */
475
- private algod;
476
- /** An async function that will return suggested params for the transaction. */
477
- private getSuggestedParams;
478
- /** A function that takes in an address and return a signer function for that address. */
479
- private getSigner;
480
- /** The default transaction validity window */
481
- private defaultValidityWindow;
482
- /** Whether the validity window was explicitly set on construction */
483
- private defaultValidityWindowIsExplicit;
484
- private appManager;
485
- private errorTransformers;
486
- private transformError;
487
- /**
488
- * Create a `TransactionComposer`.
489
- * @param params The configuration for this composer
490
- * @returns The `TransactionComposer` instance
491
- */
492
- constructor(params: TransactionComposerParams);
493
- /**
494
- * Register a function that will be used to transform an error caught when simulating or executing
495
- *
496
- * @returns The composer so you can chain method calls
497
- */
498
- registerErrorTransformer(transformer: ErrorTransformer): this;
499
- /**
500
- * Add a pre-built transaction to the transaction group.
501
- * @param transaction The pre-built transaction
502
- * @param signer Optional signer override for the transaction
503
- * @returns The composer so you can chain method calls
504
- * @example
505
- * ```typescript
506
- * composer.addTransaction(txn)
507
- * ```
508
- */
509
- addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer;
510
- /**
511
- * Add a payment transaction to the transaction group.
512
- * @param params The payment transaction parameters
513
- * @returns The composer so you can chain method calls
514
- * @example Basic example
515
- * ```typescript
516
- * composer.addPayment({
517
- * sender: 'SENDERADDRESS',
518
- * receiver: 'RECEIVERADDRESS',
519
- * amount: (4).algo(),
520
- * })
521
- * ```
522
- * @example Advanced example
523
- * ```typescript
524
- * composer.addPayment({
525
- * amount: (4).algo(),
526
- * receiver: 'RECEIVERADDRESS',
527
- * sender: 'SENDERADDRESS',
528
- * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
529
- * lease: 'lease',
530
- * note: 'note',
531
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
532
- * rekeyTo: 'REKEYTOADDRESS',
533
- * // You wouldn't normally set this field
534
- * firstValidRound: 1000n,
535
- * validityWindow: 10,
536
- * extraFee: (1000).microAlgo(),
537
- * staticFee: (1000).microAlgo(),
538
- * // Max fee doesn't make sense with extraFee AND staticFee
539
- * // already specified, but here for completeness
540
- * maxFee: (3000).microAlgo(),
541
- * })
542
- */
543
- addPayment(params: PaymentParams): TransactionComposer;
544
- /**
545
- * Add an asset create transaction to the transaction group.
546
- * @param params The asset create transaction parameters
547
- * @returns The composer so you can chain method calls
548
- * @example Basic example
549
- * ```typescript
550
- * composer.addAssetCreate({ sender: "CREATORADDRESS", total: 100n})
551
- * ```
552
- * @example Advanced example
553
- * ```typescript
554
- * composer.addAssetCreate({
555
- * sender: 'CREATORADDRESS',
556
- * total: 100n,
557
- * decimals: 2,
558
- * assetName: 'asset',
559
- * unitName: 'unit',
560
- * url: 'url',
561
- * metadataHash: 'metadataHash',
562
- * defaultFrozen: false,
563
- * manager: 'MANAGERADDRESS',
564
- * reserve: 'RESERVEADDRESS',
565
- * freeze: 'FREEZEADDRESS',
566
- * clawback: 'CLAWBACKADDRESS',
567
- * lease: 'lease',
568
- * note: 'note',
569
- * // You wouldn't normally set this field
570
- * firstValidRound: 1000n,
571
- * validityWindow: 10,
572
- * extraFee: (1000).microAlgo(),
573
- * staticFee: (1000).microAlgo(),
574
- * // Max fee doesn't make sense with extraFee AND staticFee
575
- * // already specified, but here for completeness
576
- * maxFee: (3000).microAlgo(),
577
- * })
578
- */
579
- addAssetCreate(params: AssetCreateParams): TransactionComposer;
580
- /**
581
- * Add an asset config transaction to the transaction group.
582
- * @param params The asset config transaction parameters
583
- * @returns The composer so you can chain method calls
584
- * @example Basic example
585
- * ```typescript
586
- * composer.addAssetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
587
- * ```
588
- * @example Advanced example
589
- * ```typescript
590
- * composer.addAssetConfig({
591
- * sender: 'MANAGERADDRESS',
592
- * assetId: 123456n,
593
- * manager: 'MANAGERADDRESS',
594
- * reserve: 'RESERVEADDRESS',
595
- * freeze: 'FREEZEADDRESS',
596
- * clawback: 'CLAWBACKADDRESS',
597
- * lease: 'lease',
598
- * note: 'note',
599
- * // You wouldn't normally set this field
600
- * firstValidRound: 1000n,
601
- * validityWindow: 10,
602
- * extraFee: (1000).microAlgo(),
603
- * staticFee: (1000).microAlgo(),
604
- * // Max fee doesn't make sense with extraFee AND staticFee
605
- * // already specified, but here for completeness
606
- * maxFee: (3000).microAlgo(),
607
- * })
608
- */
609
- addAssetConfig(params: AssetConfigParams): TransactionComposer;
610
- /**
611
- * Add an asset freeze transaction to the transaction group.
612
- * @param params The asset freeze transaction parameters
613
- * @returns The composer so you can chain method calls
614
- * @example Basic example
615
- * ```typescript
616
- * composer.addAssetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
617
- * ```
618
- * @example Advanced example
619
- * ```typescript
620
- * composer.addAssetFreeze({
621
- * sender: 'MANAGERADDRESS',
622
- * assetId: 123456n,
623
- * account: 'ACCOUNTADDRESS',
624
- * frozen: true,
625
- * lease: 'lease',
626
- * note: 'note',
627
- * // You wouldn't normally set this field
628
- * firstValidRound: 1000n,
629
- * validityWindow: 10,
630
- * extraFee: (1000).microAlgo(),
631
- * staticFee: (1000).microAlgo(),
632
- * // Max fee doesn't make sense with extraFee AND staticFee
633
- * // already specified, but here for completeness
634
- * maxFee: (3000).microAlgo(),
635
- * })
636
- * ```
637
- */
638
- addAssetFreeze(params: AssetFreezeParams): TransactionComposer;
639
- /**
640
- * Add an asset destroy transaction to the transaction group.
641
- * @param params The asset destroy transaction parameters
642
- * @returns The composer so you can chain method calls
643
- * @example Basic example
644
- * ```typescript
645
- * composer.addAssetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
646
- * ```
647
- * @example Advanced example
648
- * ```typescript
649
- * composer.addAssetDestroy({
650
- * sender: 'MANAGERADDRESS',
651
- * assetId: 123456n,
652
- * lease: 'lease',
653
- * note: 'note',
654
- * // You wouldn't normally set this field
655
- * firstValidRound: 1000n,
656
- * validityWindow: 10,
657
- * extraFee: (1000).microAlgo(),
658
- * staticFee: (1000).microAlgo(),
659
- * // Max fee doesn't make sense with extraFee AND staticFee
660
- * // already specified, but here for completeness
661
- * maxFee: (3000).microAlgo(),
662
- * })
663
- * ```
664
- */
665
- addAssetDestroy(params: AssetDestroyParams): TransactionComposer;
666
- /**
667
- * Add an asset transfer transaction to the transaction group.
668
- * @param params The asset transfer transaction parameters
669
- * @returns The composer so you can chain method calls
670
- * @example Basic example
671
- * ```typescript
672
- * composer.addAssetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
673
- * ```
674
- * @example Advanced example (with clawback)
675
- * ```typescript
676
- * composer.addAssetTransfer({
677
- * sender: 'CLAWBACKADDRESS',
678
- * assetId: 123456n,
679
- * amount: 1n,
680
- * receiver: 'RECEIVERADDRESS',
681
- * clawbackTarget: 'HOLDERADDRESS',
682
- * // This field needs to be used with caution
683
- * closeAssetTo: 'ADDRESSTOCLOSETO'
684
- * lease: 'lease',
685
- * note: 'note',
686
- * // You wouldn't normally set this field
687
- * firstValidRound: 1000n,
688
- * validityWindow: 10,
689
- * extraFee: (1000).microAlgo(),
690
- * staticFee: (1000).microAlgo(),
691
- * // Max fee doesn't make sense with extraFee AND staticFee
692
- * // already specified, but here for completeness
693
- * maxFee: (3000).microAlgo(),
694
- * })
695
- * ```
696
- */
697
- addAssetTransfer(params: AssetTransferParams): TransactionComposer;
698
- /**
699
- * Add an asset opt-in transaction to the transaction group.
700
- * @param params The asset opt-in transaction parameters
701
- * @returns The composer so you can chain method calls
702
- * @example Basic example
703
- * ```typescript
704
- * composer.addAssetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
705
- * ```
706
- * @example Advanced example
707
- * ```typescript
708
- * composer.addAssetOptIn({
709
- * sender: 'SENDERADDRESS',
710
- * assetId: 123456n,
711
- * lease: 'lease',
712
- * note: 'note',
713
- * // You wouldn't normally set this field
714
- * firstValidRound: 1000n,
715
- * validityWindow: 10,
716
- * extraFee: (1000).microAlgo(),
717
- * staticFee: (1000).microAlgo(),
718
- * // Max fee doesn't make sense with extraFee AND staticFee
719
- * // already specified, but here for completeness
720
- * maxFee: (3000).microAlgo(),
721
- * })
722
- * ```
723
- */
724
- addAssetOptIn(params: AssetOptInParams): TransactionComposer;
725
- /**
726
- * Add an asset opt-out transaction to the transaction group.
727
- * @param params The asset opt-out transaction parameters
728
- * @returns The composer so you can chain method calls
729
- * @example Basic example (without creator, will be retrieved from algod)
730
- * ```typescript
731
- * composer.addAssetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
732
- * ```
733
- * @example Basic example (with creator)
734
- * ```typescript
735
- * composer.addAssetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
736
- * ```
737
- * @example Advanced example
738
- * ```typescript
739
- * composer.addAssetOptOut({
740
- * sender: 'SENDERADDRESS',
741
- * assetId: 123456n,
742
- * creator: 'CREATORADDRESS',
743
- * ensureZeroBalance: true,
744
- * lease: 'lease',
745
- * note: 'note',
746
- * // You wouldn't normally set this field
747
- * firstValidRound: 1000n,
748
- * validityWindow: 10,
749
- * extraFee: (1000).microAlgo(),
750
- * staticFee: (1000).microAlgo(),
751
- * // Max fee doesn't make sense with extraFee AND staticFee
752
- * // already specified, but here for completeness
753
- * maxFee: (3000).microAlgo(),
754
- * })
755
- * ```
756
- */
757
- addAssetOptOut(params: AssetOptOutParams): TransactionComposer;
758
- /**
759
- * Add an application create transaction to the transaction group.
760
- *
761
- * Note: we recommend using app clients to make it easier to make app calls.
762
- * @param params The application create transaction parameters
763
- * @returns The composer so you can chain method calls
764
- * @example Basic example
765
- * ```typescript
766
- * composer.addAppCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
767
- * ```
768
- * @example Advanced example
769
- * ```typescript
770
- * composer.addAppCreate({
771
- * sender: 'CREATORADDRESS',
772
- * approvalProgram: "TEALCODE",
773
- * clearStateProgram: "TEALCODE",
774
- * schema: {
775
- * globalInts: 1,
776
- * globalByteSlices: 2,
777
- * localInts: 3,
778
- * localByteSlices: 4
779
- * },
780
- * extraProgramPages: 1,
781
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
782
- * args: [new Uint8Array(1, 2, 3, 4)]
783
- * accountReferences: ["ACCOUNT_1"]
784
- * appReferences: [123n, 1234n]
785
- * assetReferences: [12345n]
786
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
787
- * accessReferences: [{ appId: 1234n }]
788
- * lease: 'lease',
789
- * note: 'note',
790
- * // You wouldn't normally set this field
791
- * firstValidRound: 1000n,
792
- * validityWindow: 10,
793
- * extraFee: (1000).microAlgo(),
794
- * staticFee: (1000).microAlgo(),
795
- * // Max fee doesn't make sense with extraFee AND staticFee
796
- * // already specified, but here for completeness
797
- * maxFee: (3000).microAlgo(),
798
- * rejectVersion: 1,
799
- * // Signer only needed if you want to provide one,
800
- * // generally you'd register it with AlgorandClient
801
- * // against the sender and not need to pass it in
802
- * signer: transactionSigner,
803
- * maxRoundsToWaitForConfirmation: 5,
804
- * suppressLog: true,
805
- *})
806
- * ```
807
- */
808
- addAppCreate(params: AppCreateParams): TransactionComposer;
809
- /**
810
- * Add an application update transaction to the transaction group.
811
- *
812
- * Note: we recommend using app clients to make it easier to make app calls.
813
- * @param params The application update transaction parameters
814
- * @returns The composer so you can chain method calls
815
- * @example Basic example
816
- * ```typescript
817
- * composer.addAppUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
818
- * ```
819
- * @example Advanced example
820
- * ```typescript
821
- * composer.addAppUpdate({
822
- * sender: 'CREATORADDRESS',
823
- * approvalProgram: "TEALCODE",
824
- * clearStateProgram: "TEALCODE",
825
- * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
826
- * args: [new Uint8Array(1, 2, 3, 4)]
827
- * accountReferences: ["ACCOUNT_1"]
828
- * appReferences: [123n, 1234n]
829
- * assetReferences: [12345n]
830
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
831
- * accessReferences: [{ appId: 1234n }]
832
- * lease: 'lease',
833
- * note: 'note',
834
- * // You wouldn't normally set this field
835
- * firstValidRound: 1000n,
836
- * validityWindow: 10,
837
- * extraFee: (1000).microAlgo(),
838
- * staticFee: (1000).microAlgo(),
839
- * // Max fee doesn't make sense with extraFee AND staticFee
840
- * // already specified, but here for completeness
841
- * maxFee: (3000).microAlgo(),
842
- * rejectVersion: 1,
843
- *})
844
- * ```
845
- */
846
- addAppUpdate(params: AppUpdateParams): TransactionComposer;
847
- /**
848
- * Add an application delete transaction to the transaction group.
849
- *
850
- * Note: we recommend using app clients to make it easier to make app calls.
851
- * @param params The application delete transaction parameters
852
- * @returns The composer so you can chain method calls
853
- * @example Basic example
854
- * ```typescript
855
- * composer.addAppDelete({ sender: 'CREATORADDRESS' })
856
- * ```
857
- * @example Advanced example
858
- * ```typescript
859
- * composer.addAppDelete({
860
- * sender: 'CREATORADDRESS',
861
- * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
862
- * args: [new Uint8Array(1, 2, 3, 4)]
863
- * accountReferences: ["ACCOUNT_1"]
864
- * appReferences: [123n, 1234n]
865
- * assetReferences: [12345n]
866
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
867
- * accessReferences: [{ appId: 1234n }]
868
- * lease: 'lease',
869
- * note: 'note',
870
- * // You wouldn't normally set this field
871
- * firstValidRound: 1000n,
872
- * validityWindow: 10,
873
- * extraFee: (1000).microAlgo(),
874
- * staticFee: (1000).microAlgo(),
875
- * // Max fee doesn't make sense with extraFee AND staticFee
876
- * // already specified, but here for completeness
877
- * maxFee: (3000).microAlgo(),
878
- * rejectVersion: 1,
879
- *})
880
- * ```
881
- */
882
- addAppDelete(params: AppDeleteParams): TransactionComposer;
883
- /**
884
- * Add an application call transaction to the transaction group.
885
- *
886
- * If you want to create or update an app use `addAppCreate` or `addAppUpdate`.
887
- *
888
- * Note: we recommend using app clients to make it easier to make app calls.
889
- * @param params The application call transaction parameters
890
- * @returns The composer so you can chain method calls
891
- * @example Basic example
892
- * ```typescript
893
- * composer.addAppCall({ sender: 'CREATORADDRESS' })
894
- * ```
895
- * @example Advanced example
896
- * ```typescript
897
- * composer.addAppCall({
898
- * sender: 'CREATORADDRESS',
899
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
900
- * args: [new Uint8Array(1, 2, 3, 4)]
901
- * accountReferences: ["ACCOUNT_1"]
902
- * appReferences: [123n, 1234n]
903
- * assetReferences: [12345n]
904
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
905
- * accessReferences: [{ appId: 1234n }]
906
- * lease: 'lease',
907
- * note: 'note',
908
- * // You wouldn't normally set this field
909
- * firstValidRound: 1000n,
910
- * validityWindow: 10,
911
- * extraFee: (1000).microAlgo(),
912
- * staticFee: (1000).microAlgo(),
913
- * // Max fee doesn't make sense with extraFee AND staticFee
914
- * // already specified, but here for completeness
915
- * maxFee: (3000).microAlgo(),
916
- * rejectVersion: 1,
917
- *})
918
- * ```
919
- */
920
- addAppCall(params: AppCallParams): TransactionComposer;
921
- /**
922
- * Add an ABI method create application call transaction to the transaction group.
923
- *
924
- * Note: we recommend using app clients to make it easier to make app calls.
925
- * @param params The ABI create method application call transaction parameters
926
- * @returns The composer so you can chain method calls
927
- * @example Basic example
928
- * ```typescript
929
- * const method = new ABIMethod({
930
- * name: 'method',
931
- * args: [{ name: 'arg1', type: 'string' }],
932
- * returns: { type: 'string' },
933
- * })
934
- * composer.addAppCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
935
- * ```
936
- * @example Advanced example
937
- * ```typescript
938
- * const method = new ABIMethod({
939
- * name: 'method',
940
- * args: [{ name: 'arg1', type: 'string' }],
941
- * returns: { type: 'string' },
942
- * })
943
- * composer.addAppCreateMethodCall({
944
- * sender: 'CREATORADDRESS',
945
- * method: method,
946
- * args: ["arg1_value"],
947
- * approvalProgram: "TEALCODE",
948
- * clearStateProgram: "TEALCODE",
949
- * schema: {
950
- * globalInts: 1,
951
- * globalByteSlices: 2,
952
- * localInts: 3,
953
- * localByteSlices: 4
954
- * },
955
- * extraProgramPages: 1,
956
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
957
- * args: [new Uint8Array(1, 2, 3, 4)]
958
- * accountReferences: ["ACCOUNT_1"]
959
- * appReferences: [123n, 1234n]
960
- * assetReferences: [12345n]
961
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
962
- * accessReferences: [{ appId: 1234n }]
963
- * lease: 'lease',
964
- * note: 'note',
965
- * // You wouldn't normally set this field
966
- * firstValidRound: 1000n,
967
- * validityWindow: 10,
968
- * extraFee: (1000).microAlgo(),
969
- * staticFee: (1000).microAlgo(),
970
- * // Max fee doesn't make sense with extraFee AND staticFee
971
- * // already specified, but here for completeness
972
- * maxFee: (3000).microAlgo(),
973
- * rejectVersion: 1,
974
- *})
975
- * ```
976
- */
977
- addAppCreateMethodCall(params: AppCreateMethodCall): this;
978
- /**
979
- * Add an ABI method update application call transaction to the transaction group.
980
- *
981
- * Note: we recommend using app clients to make it easier to make app calls.
982
- * @param params The ABI update method application call transaction parameters
983
- * @returns The composer so you can chain method calls
984
- * @example Basic example
985
- * ```typescript
986
- * const method = new ABIMethod({
987
- * name: 'method',
988
- * args: [{ name: 'arg1', type: 'string' }],
989
- * returns: { type: 'string' },
990
- * })
991
- * composer.addAppUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
992
- * ```
993
- * @example Advanced example
994
- * ```typescript
995
- * const method = new ABIMethod({
996
- * name: 'method',
997
- * args: [{ name: 'arg1', type: 'string' }],
998
- * returns: { type: 'string' },
999
- * })
1000
- * composer.addAppUpdateMethodCall({
1001
- * sender: 'CREATORADDRESS',
1002
- * method: method,
1003
- * args: ["arg1_value"],
1004
- * approvalProgram: "TEALCODE",
1005
- * clearStateProgram: "TEALCODE",
1006
- * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
1007
- * args: [new Uint8Array(1, 2, 3, 4)]
1008
- * accountReferences: ["ACCOUNT_1"]
1009
- * appReferences: [123n, 1234n]
1010
- * assetReferences: [12345n]
1011
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
1012
- * accessReferences: [{ appId: 1234n }]
1013
- * lease: 'lease',
1014
- * note: 'note',
1015
- * // You wouldn't normally set this field
1016
- * firstValidRound: 1000n,
1017
- * validityWindow: 10,
1018
- * extraFee: (1000).microAlgo(),
1019
- * staticFee: (1000).microAlgo(),
1020
- * // Max fee doesn't make sense with extraFee AND staticFee
1021
- * // already specified, but here for completeness
1022
- * maxFee: (3000).microAlgo(),
1023
- * rejectVersion: 1,
1024
- *})
1025
- * ```
1026
- */
1027
- addAppUpdateMethodCall(params: AppUpdateMethodCall): this;
1028
- /**
1029
- * Add an ABI method delete application call transaction to the transaction group.
1030
- *
1031
- * Note: we recommend using app clients to make it easier to make app calls.
1032
- * @param params The ABI delete method application call transaction parameters
1033
- * @returns The composer so you can chain method calls
1034
- * @example Basic example
1035
- * ```typescript
1036
- * const method = new ABIMethod({
1037
- * name: 'method',
1038
- * args: [{ name: 'arg1', type: 'string' }],
1039
- * returns: { type: 'string' },
1040
- * })
1041
- * composer.addAppDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
1042
- * ```
1043
- * @example Advanced example
1044
- * ```typescript
1045
- * const method = new ABIMethod({
1046
- * name: 'method',
1047
- * args: [{ name: 'arg1', type: 'string' }],
1048
- * returns: { type: 'string' },
1049
- * })
1050
- * composer.addAppDeleteMethodCall({
1051
- * sender: 'CREATORADDRESS',
1052
- * method: method,
1053
- * args: ["arg1_value"],
1054
- * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
1055
- * args: [new Uint8Array(1, 2, 3, 4)]
1056
- * accountReferences: ["ACCOUNT_1"]
1057
- * appReferences: [123n, 1234n]
1058
- * assetReferences: [12345n]
1059
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
1060
- * accessReferences: [{ appId: 1234n }]
1061
- * lease: 'lease',
1062
- * note: 'note',
1063
- * // You wouldn't normally set this field
1064
- * firstValidRound: 1000n,
1065
- * validityWindow: 10,
1066
- * extraFee: (1000).microAlgo(),
1067
- * staticFee: (1000).microAlgo(),
1068
- * // Max fee doesn't make sense with extraFee AND staticFee
1069
- * // already specified, but here for completeness
1070
- * maxFee: (3000).microAlgo(),
1071
- * rejectVersion: 1,
1072
- *})
1073
- * ```
1074
- */
1075
- addAppDeleteMethodCall(params: AppDeleteMethodCall): this;
1076
- /**
1077
- * Add a non-create/non-update ABI method application call transaction to the transaction group.
1078
- *
1079
- * Note: we recommend using app clients to make it easier to make app calls.
1080
- * @param params The ABI method application call transaction parameters
1081
- * @returns The composer so you can chain method calls
1082
- * @example Basic example
1083
- * ```typescript
1084
- * const method = new ABIMethod({
1085
- * name: 'method',
1086
- * args: [{ name: 'arg1', type: 'string' }],
1087
- * returns: { type: 'string' },
1088
- * })
1089
- * composer.addAppCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
1090
- * ```
1091
- * @example Advanced example
1092
- * ```typescript
1093
- * const method = new ABIMethod({
1094
- * name: 'method',
1095
- * args: [{ name: 'arg1', type: 'string' }],
1096
- * returns: { type: 'string' },
1097
- * })
1098
- * composer.addAppCallMethodCall({
1099
- * sender: 'CREATORADDRESS',
1100
- * method: method,
1101
- * args: ["arg1_value"],
1102
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
1103
- * args: [new Uint8Array(1, 2, 3, 4)]
1104
- * accountReferences: ["ACCOUNT_1"]
1105
- * appReferences: [123n, 1234n]
1106
- * assetReferences: [12345n]
1107
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
1108
- * accessReferences: [{ appId: 1234n }]
1109
- * lease: 'lease',
1110
- * note: 'note',
1111
- * // You wouldn't normally set this field
1112
- * firstValidRound: 1000n,
1113
- * validityWindow: 10,
1114
- * extraFee: (1000).microAlgo(),
1115
- * staticFee: (1000).microAlgo(),
1116
- * // Max fee doesn't make sense with extraFee AND staticFee
1117
- * // already specified, but here for completeness
1118
- * maxFee: (3000).microAlgo(),
1119
- * rejectVersion: 1,
1120
- *})
1121
- * ```
1122
- */
1123
- addAppCallMethodCall(params: AppCallMethodCall): this;
1124
- /**
1125
- * Add an online key registration transaction to the transaction group.
1126
- * @param params The online key registration transaction parameters
1127
- * @returns The composer so you can chain method calls
1128
- * @example Basic example
1129
- * ```typescript
1130
- * composer.addOnlineKeyRegistration({
1131
- * sender: 'SENDERADDRESS',
1132
- * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
1133
- * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
1134
- * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
1135
- * voteFirst: 1n,
1136
- * voteLast: 1000n,
1137
- * voteKeyDilution: 1n,
1138
- * })
1139
- * ```
1140
- * @example Advanced example
1141
- * ```typescript
1142
- * composer.addOnlineKeyRegistration({
1143
- * sender: 'SENDERADDRESS',
1144
- * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
1145
- * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
1146
- * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
1147
- * voteFirst: 1n,
1148
- * voteLast: 1000n,
1149
- * voteKeyDilution: 1n,
1150
- * lease: 'lease',
1151
- * note: 'note',
1152
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
1153
- * rekeyTo: 'REKEYTOADDRESS',
1154
- * // You wouldn't normally set this field
1155
- * firstValidRound: 1000n,
1156
- * validityWindow: 10,
1157
- * extraFee: (1000).microAlgo(),
1158
- * staticFee: (1000).microAlgo(),
1159
- * // Max fee doesn't make sense with extraFee AND staticFee
1160
- * // already specified, but here for completeness
1161
- * maxFee: (3000).microAlgo(),
1162
- * })
1163
- * ```
1164
- */
1165
- addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer;
1166
- /**
1167
- * Add an offline key registration transaction to the transaction group.
1168
- * @param params The offline key registration transaction parameters
1169
- * @returns The composer so you can chain method calls
1170
- * @example Basic example
1171
- * ```typescript
1172
- * composer.addOfflineKeyRegistration({
1173
- * sender: 'SENDERADDRESS',
1174
- * })
1175
- * ```
1176
- * @example Advanced example
1177
- * ```typescript
1178
- * composer.addOfflineKeyRegistration({
1179
- * sender: 'SENDERADDRESS',
1180
- * lease: 'lease',
1181
- * note: 'note',
1182
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
1183
- * rekeyTo: 'REKEYTOADDRESS',
1184
- * // You wouldn't normally set this field
1185
- * firstValidRound: 1000n,
1186
- * validityWindow: 10,
1187
- * extraFee: (1000).microAlgo(),
1188
- * staticFee: (1000).microAlgo(),
1189
- * // Max fee doesn't make sense with extraFee AND staticFee
1190
- * // already specified, but here for completeness
1191
- * maxFee: (3000).microAlgo(),
1192
- * })
1193
- * ```
1194
- */
1195
- addOfflineKeyRegistration(params: OfflineKeyRegistrationParams): TransactionComposer;
1196
- /**
1197
- * Add the transactions within an `AtomicTransactionComposer` to the transaction group.
1198
- * @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
1199
- * @returns The composer so you can chain method calls
1200
- * @example
1201
- * ```typescript
1202
- * const atc = new AtomicTransactionComposer()
1203
- * .addPayment({ sender: 'SENDERADDRESS', receiver: 'RECEIVERADDRESS', amount: 1000n })
1204
- * composer.addAtc(atc)
1205
- * ```
1206
- */
1207
- addAtc(atc: algosdk.AtomicTransactionComposer): TransactionComposer;
1208
- /** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */
1209
- private buildAtc;
1210
- private commonTxnBuildStep;
1211
- /**
1212
- * Builds an ABI method call transaction and any other associated transactions represented in the ABI args.
1213
- * @param includeSigner Whether to include the actual signer for the transactions.
1214
- * If you are just building transactions without signers yet then set this to `false`.
1215
- */
1216
- private buildMethodCall;
1217
- private buildPayment;
1218
- private buildAssetCreate;
1219
- private buildAssetConfig;
1220
- private buildAssetDestroy;
1221
- private buildAssetFreeze;
1222
- private buildAssetTransfer;
1223
- private buildAppCall;
1224
- private buildKeyReg;
1225
- /** Builds all transaction types apart from `txnWithSigner`, `atc` and `methodCall` since those ones can have custom signers that need to be retrieved. */
1226
- private buildTxn;
1227
- private buildTxnWithSigner;
1228
- /**
1229
- * Compose all of the transactions without signers and return the transaction objects directly along with any ABI method calls.
1230
- *
1231
- * @returns The array of built transactions and any corresponding method calls
1232
- * @example
1233
- * ```typescript
1234
- * const { transactions, methodCalls, signers } = await composer.buildTransactions()
1235
- * ```
1236
- */
1237
- buildTransactions(): Promise<BuiltTransactions>;
1238
- /**
1239
- * Get the number of transactions currently added to this composer.
1240
- * @returns The number of transactions currently added to this composer
1241
- */
1242
- count(): Promise<number>;
1243
- /**
1244
- * Compose all of the transactions in a single atomic transaction group and an atomic transaction composer.
1245
- *
1246
- * You can then use the transactions standalone, or use the composer to execute or simulate the transactions.
1247
- *
1248
- * Once this method is called, no further transactions will be able to be added.
1249
- * You can safely call this method multiple times to get the same result.
1250
- * @returns The built atomic transaction composer, the transactions and any corresponding method calls
1251
- * @example
1252
- * ```typescript
1253
- * const { atc, transactions, methodCalls } = await composer.build()
1254
- * ```
1255
- */
1256
- build(): Promise<{
1257
- atc: algosdk.AtomicTransactionComposer;
1258
- transactions: algosdk.TransactionWithSigner[];
1259
- methodCalls: any;
1260
- }>;
1261
- /**
1262
- * Rebuild the group, discarding any previously built transactions.
1263
- * This will potentially cause new signers and suggested params to be used if the callbacks return a new value compared to the first build.
1264
- * @returns The newly built atomic transaction composer and the transactions
1265
- * @example
1266
- * ```typescript
1267
- * const { atc, transactions, methodCalls } = await composer.rebuild()
1268
- * ```
1269
- */
1270
- rebuild(): Promise<{
1271
- atc: algosdk.AtomicTransactionComposer;
1272
- transactions: algosdk.TransactionWithSigner[];
1273
- methodCalls: any;
1274
- }>;
1275
- /**
1276
- * Compose the atomic transaction group and send it to the network.
1277
- * @param params The parameters to control execution with
1278
- * @returns The execution result
1279
- * @example
1280
- * ```typescript
1281
- * const result = await composer.send()
1282
- * ```
1283
- */
1284
- send(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
1285
- /**
1286
- * @deprecated Use `send` instead.
1287
- *
1288
- * Compose the atomic transaction group and send it to the network
1289
- *
1290
- * An alias for `composer.send(params)`.
1291
- * @param params The parameters to control execution with
1292
- * @returns The execution result
1293
- */
1294
- execute(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
1295
- /**
1296
- * Compose the atomic transaction group and simulate sending it to the network
1297
- * @returns The simulation result
1298
- * @example
1299
- * ```typescript
1300
- * const result = await composer.simulate()
1301
- * ```
1302
- */
1303
- simulate(): Promise<SendAtomicTransactionComposerResults & {
1304
- simulateResponse: SimulateResponse;
1305
- }>;
1306
- /**
1307
- * Compose the atomic transaction group and simulate sending it to the network
1308
- * @returns The simulation result
1309
- * @example
1310
- * ```typescript
1311
- * const result = await composer.simulate({
1312
- * skipSignatures: true,
1313
- * })
1314
- * ```
1315
- */
1316
- simulate(options: SkipSignaturesSimulateOptions): Promise<SendAtomicTransactionComposerResults & {
1317
- simulateResponse: SimulateResponse;
1318
- }>;
1319
- /**
1320
- * Compose the atomic transaction group and simulate sending it to the network
1321
- * @returns The simulation result
1322
- * @example
1323
- * ```typescript
1324
- * const result = await composer.simulate({
1325
- * extraOpcodeBudget: 1000,
1326
- * })
1327
- * ```
1328
- */
1329
- simulate(options: RawSimulateOptions): Promise<SendAtomicTransactionComposerResults & {
1330
- simulateResponse: SimulateResponse;
1331
- }>;
1332
- /**
1333
- * Create an encoded transaction note that follows the ARC-2 spec.
1334
- *
1335
- * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
1336
- * @param note The ARC-2 transaction note data
1337
- * @returns The binary encoded transaction note
1338
- */
1339
- static arc2Note(note: Arc2TransactionNote): Uint8Array;
413
+ declare class TransactionComposer {
414
+ /** Signer used to represent a lack of signer */
415
+ private static NULL_SIGNER;
416
+ /** The ATC used to compose the group */
417
+ private atc;
418
+ /** Map of transaction index in the atc to a max logical fee.
419
+ * This is set using the value of either maxFee or staticFee.
420
+ */
421
+ private txnMaxFees;
422
+ /** Transactions that have not yet been composed */
423
+ private txns;
424
+ /** The algod client used by the composer. */
425
+ private algod;
426
+ /** An async function that will return suggested params for the transaction. */
427
+ private getSuggestedParams;
428
+ /** A function that takes in an address and return a signer function for that address. */
429
+ private getSigner;
430
+ /** The default transaction validity window */
431
+ private defaultValidityWindow;
432
+ /** Whether the validity window was explicitly set on construction */
433
+ private defaultValidityWindowIsExplicit;
434
+ private appManager;
435
+ private errorTransformers;
436
+ private transformError;
437
+ /**
438
+ * Create a `TransactionComposer`.
439
+ * @param params The configuration for this composer
440
+ * @returns The `TransactionComposer` instance
441
+ */
442
+ constructor(params: TransactionComposerParams);
443
+ /**
444
+ * Register a function that will be used to transform an error caught when simulating or executing
445
+ *
446
+ * @returns The composer so you can chain method calls
447
+ */
448
+ registerErrorTransformer(transformer: ErrorTransformer): this;
449
+ /**
450
+ * Add a pre-built transaction to the transaction group.
451
+ * @param transaction The pre-built transaction
452
+ * @param signer Optional signer override for the transaction
453
+ * @returns The composer so you can chain method calls
454
+ * @example
455
+ * ```typescript
456
+ * composer.addTransaction(txn)
457
+ * ```
458
+ */
459
+ addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer;
460
+ /**
461
+ * Add a payment transaction to the transaction group.
462
+ * @param params The payment transaction parameters
463
+ * @returns The composer so you can chain method calls
464
+ * @example Basic example
465
+ * ```typescript
466
+ * composer.addPayment({
467
+ * sender: 'SENDERADDRESS',
468
+ * receiver: 'RECEIVERADDRESS',
469
+ * amount: (4).algo(),
470
+ * })
471
+ * ```
472
+ * @example Advanced example
473
+ * ```typescript
474
+ * composer.addPayment({
475
+ * amount: (4).algo(),
476
+ * receiver: 'RECEIVERADDRESS',
477
+ * sender: 'SENDERADDRESS',
478
+ * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
479
+ * lease: 'lease',
480
+ * note: 'note',
481
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
482
+ * rekeyTo: 'REKEYTOADDRESS',
483
+ * // You wouldn't normally set this field
484
+ * firstValidRound: 1000n,
485
+ * validityWindow: 10,
486
+ * extraFee: (1000).microAlgo(),
487
+ * staticFee: (1000).microAlgo(),
488
+ * // Max fee doesn't make sense with extraFee AND staticFee
489
+ * // already specified, but here for completeness
490
+ * maxFee: (3000).microAlgo(),
491
+ * })
492
+ */
493
+ addPayment(params: PaymentParams): TransactionComposer;
494
+ /**
495
+ * Add an asset create transaction to the transaction group.
496
+ * @param params The asset create transaction parameters
497
+ * @returns The composer so you can chain method calls
498
+ * @example Basic example
499
+ * ```typescript
500
+ * composer.addAssetCreate({ sender: "CREATORADDRESS", total: 100n})
501
+ * ```
502
+ * @example Advanced example
503
+ * ```typescript
504
+ * composer.addAssetCreate({
505
+ * sender: 'CREATORADDRESS',
506
+ * total: 100n,
507
+ * decimals: 2,
508
+ * assetName: 'asset',
509
+ * unitName: 'unit',
510
+ * url: 'url',
511
+ * metadataHash: 'metadataHash',
512
+ * defaultFrozen: false,
513
+ * manager: 'MANAGERADDRESS',
514
+ * reserve: 'RESERVEADDRESS',
515
+ * freeze: 'FREEZEADDRESS',
516
+ * clawback: 'CLAWBACKADDRESS',
517
+ * lease: 'lease',
518
+ * note: 'note',
519
+ * // You wouldn't normally set this field
520
+ * firstValidRound: 1000n,
521
+ * validityWindow: 10,
522
+ * extraFee: (1000).microAlgo(),
523
+ * staticFee: (1000).microAlgo(),
524
+ * // Max fee doesn't make sense with extraFee AND staticFee
525
+ * // already specified, but here for completeness
526
+ * maxFee: (3000).microAlgo(),
527
+ * })
528
+ */
529
+ addAssetCreate(params: AssetCreateParams): TransactionComposer;
530
+ /**
531
+ * Add an asset config transaction to the transaction group.
532
+ * @param params The asset config transaction parameters
533
+ * @returns The composer so you can chain method calls
534
+ * @example Basic example
535
+ * ```typescript
536
+ * composer.addAssetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
537
+ * ```
538
+ * @example Advanced example
539
+ * ```typescript
540
+ * composer.addAssetConfig({
541
+ * sender: 'MANAGERADDRESS',
542
+ * assetId: 123456n,
543
+ * manager: 'MANAGERADDRESS',
544
+ * reserve: 'RESERVEADDRESS',
545
+ * freeze: 'FREEZEADDRESS',
546
+ * clawback: 'CLAWBACKADDRESS',
547
+ * lease: 'lease',
548
+ * note: 'note',
549
+ * // You wouldn't normally set this field
550
+ * firstValidRound: 1000n,
551
+ * validityWindow: 10,
552
+ * extraFee: (1000).microAlgo(),
553
+ * staticFee: (1000).microAlgo(),
554
+ * // Max fee doesn't make sense with extraFee AND staticFee
555
+ * // already specified, but here for completeness
556
+ * maxFee: (3000).microAlgo(),
557
+ * })
558
+ */
559
+ addAssetConfig(params: AssetConfigParams): TransactionComposer;
560
+ /**
561
+ * Add an asset freeze transaction to the transaction group.
562
+ * @param params The asset freeze transaction parameters
563
+ * @returns The composer so you can chain method calls
564
+ * @example Basic example
565
+ * ```typescript
566
+ * composer.addAssetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
567
+ * ```
568
+ * @example Advanced example
569
+ * ```typescript
570
+ * composer.addAssetFreeze({
571
+ * sender: 'MANAGERADDRESS',
572
+ * assetId: 123456n,
573
+ * account: 'ACCOUNTADDRESS',
574
+ * frozen: true,
575
+ * lease: 'lease',
576
+ * note: 'note',
577
+ * // You wouldn't normally set this field
578
+ * firstValidRound: 1000n,
579
+ * validityWindow: 10,
580
+ * extraFee: (1000).microAlgo(),
581
+ * staticFee: (1000).microAlgo(),
582
+ * // Max fee doesn't make sense with extraFee AND staticFee
583
+ * // already specified, but here for completeness
584
+ * maxFee: (3000).microAlgo(),
585
+ * })
586
+ * ```
587
+ */
588
+ addAssetFreeze(params: AssetFreezeParams): TransactionComposer;
589
+ /**
590
+ * Add an asset destroy transaction to the transaction group.
591
+ * @param params The asset destroy transaction parameters
592
+ * @returns The composer so you can chain method calls
593
+ * @example Basic example
594
+ * ```typescript
595
+ * composer.addAssetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
596
+ * ```
597
+ * @example Advanced example
598
+ * ```typescript
599
+ * composer.addAssetDestroy({
600
+ * sender: 'MANAGERADDRESS',
601
+ * assetId: 123456n,
602
+ * lease: 'lease',
603
+ * note: 'note',
604
+ * // You wouldn't normally set this field
605
+ * firstValidRound: 1000n,
606
+ * validityWindow: 10,
607
+ * extraFee: (1000).microAlgo(),
608
+ * staticFee: (1000).microAlgo(),
609
+ * // Max fee doesn't make sense with extraFee AND staticFee
610
+ * // already specified, but here for completeness
611
+ * maxFee: (3000).microAlgo(),
612
+ * })
613
+ * ```
614
+ */
615
+ addAssetDestroy(params: AssetDestroyParams): TransactionComposer;
616
+ /**
617
+ * Add an asset transfer transaction to the transaction group.
618
+ * @param params The asset transfer transaction parameters
619
+ * @returns The composer so you can chain method calls
620
+ * @example Basic example
621
+ * ```typescript
622
+ * composer.addAssetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
623
+ * ```
624
+ * @example Advanced example (with clawback)
625
+ * ```typescript
626
+ * composer.addAssetTransfer({
627
+ * sender: 'CLAWBACKADDRESS',
628
+ * assetId: 123456n,
629
+ * amount: 1n,
630
+ * receiver: 'RECEIVERADDRESS',
631
+ * clawbackTarget: 'HOLDERADDRESS',
632
+ * // This field needs to be used with caution
633
+ * closeAssetTo: 'ADDRESSTOCLOSETO'
634
+ * lease: 'lease',
635
+ * note: 'note',
636
+ * // You wouldn't normally set this field
637
+ * firstValidRound: 1000n,
638
+ * validityWindow: 10,
639
+ * extraFee: (1000).microAlgo(),
640
+ * staticFee: (1000).microAlgo(),
641
+ * // Max fee doesn't make sense with extraFee AND staticFee
642
+ * // already specified, but here for completeness
643
+ * maxFee: (3000).microAlgo(),
644
+ * })
645
+ * ```
646
+ */
647
+ addAssetTransfer(params: AssetTransferParams): TransactionComposer;
648
+ /**
649
+ * Add an asset opt-in transaction to the transaction group.
650
+ * @param params The asset opt-in transaction parameters
651
+ * @returns The composer so you can chain method calls
652
+ * @example Basic example
653
+ * ```typescript
654
+ * composer.addAssetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
655
+ * ```
656
+ * @example Advanced example
657
+ * ```typescript
658
+ * composer.addAssetOptIn({
659
+ * sender: 'SENDERADDRESS',
660
+ * assetId: 123456n,
661
+ * lease: 'lease',
662
+ * note: 'note',
663
+ * // You wouldn't normally set this field
664
+ * firstValidRound: 1000n,
665
+ * validityWindow: 10,
666
+ * extraFee: (1000).microAlgo(),
667
+ * staticFee: (1000).microAlgo(),
668
+ * // Max fee doesn't make sense with extraFee AND staticFee
669
+ * // already specified, but here for completeness
670
+ * maxFee: (3000).microAlgo(),
671
+ * })
672
+ * ```
673
+ */
674
+ addAssetOptIn(params: AssetOptInParams): TransactionComposer;
675
+ /**
676
+ * Add an asset opt-out transaction to the transaction group.
677
+ * @param params The asset opt-out transaction parameters
678
+ * @returns The composer so you can chain method calls
679
+ * @example Basic example (without creator, will be retrieved from algod)
680
+ * ```typescript
681
+ * composer.addAssetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
682
+ * ```
683
+ * @example Basic example (with creator)
684
+ * ```typescript
685
+ * composer.addAssetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
686
+ * ```
687
+ * @example Advanced example
688
+ * ```typescript
689
+ * composer.addAssetOptOut({
690
+ * sender: 'SENDERADDRESS',
691
+ * assetId: 123456n,
692
+ * creator: 'CREATORADDRESS',
693
+ * ensureZeroBalance: true,
694
+ * lease: 'lease',
695
+ * note: 'note',
696
+ * // You wouldn't normally set this field
697
+ * firstValidRound: 1000n,
698
+ * validityWindow: 10,
699
+ * extraFee: (1000).microAlgo(),
700
+ * staticFee: (1000).microAlgo(),
701
+ * // Max fee doesn't make sense with extraFee AND staticFee
702
+ * // already specified, but here for completeness
703
+ * maxFee: (3000).microAlgo(),
704
+ * })
705
+ * ```
706
+ */
707
+ addAssetOptOut(params: AssetOptOutParams): TransactionComposer;
708
+ /**
709
+ * Add an application create transaction to the transaction group.
710
+ *
711
+ * Note: we recommend using app clients to make it easier to make app calls.
712
+ * @param params The application create transaction parameters
713
+ * @returns The composer so you can chain method calls
714
+ * @example Basic example
715
+ * ```typescript
716
+ * composer.addAppCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
717
+ * ```
718
+ * @example Advanced example
719
+ * ```typescript
720
+ * composer.addAppCreate({
721
+ * sender: 'CREATORADDRESS',
722
+ * approvalProgram: "TEALCODE",
723
+ * clearStateProgram: "TEALCODE",
724
+ * schema: {
725
+ * globalInts: 1,
726
+ * globalByteSlices: 2,
727
+ * localInts: 3,
728
+ * localByteSlices: 4
729
+ * },
730
+ * extraProgramPages: 1,
731
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
732
+ * args: [new Uint8Array(1, 2, 3, 4)]
733
+ * accountReferences: ["ACCOUNT_1"]
734
+ * appReferences: [123n, 1234n]
735
+ * assetReferences: [12345n]
736
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
737
+ * accessReferences: [{ appId: 1234n }]
738
+ * lease: 'lease',
739
+ * note: 'note',
740
+ * // You wouldn't normally set this field
741
+ * firstValidRound: 1000n,
742
+ * validityWindow: 10,
743
+ * extraFee: (1000).microAlgo(),
744
+ * staticFee: (1000).microAlgo(),
745
+ * // Max fee doesn't make sense with extraFee AND staticFee
746
+ * // already specified, but here for completeness
747
+ * maxFee: (3000).microAlgo(),
748
+ * rejectVersion: 1,
749
+ * // Signer only needed if you want to provide one,
750
+ * // generally you'd register it with AlgorandClient
751
+ * // against the sender and not need to pass it in
752
+ * signer: transactionSigner,
753
+ * maxRoundsToWaitForConfirmation: 5,
754
+ * suppressLog: true,
755
+ *})
756
+ * ```
757
+ */
758
+ addAppCreate(params: AppCreateParams): TransactionComposer;
759
+ /**
760
+ * Add an application update transaction to the transaction group.
761
+ *
762
+ * Note: we recommend using app clients to make it easier to make app calls.
763
+ * @param params The application update transaction parameters
764
+ * @returns The composer so you can chain method calls
765
+ * @example Basic example
766
+ * ```typescript
767
+ * composer.addAppUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
768
+ * ```
769
+ * @example Advanced example
770
+ * ```typescript
771
+ * composer.addAppUpdate({
772
+ * sender: 'CREATORADDRESS',
773
+ * approvalProgram: "TEALCODE",
774
+ * clearStateProgram: "TEALCODE",
775
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
776
+ * args: [new Uint8Array(1, 2, 3, 4)]
777
+ * accountReferences: ["ACCOUNT_1"]
778
+ * appReferences: [123n, 1234n]
779
+ * assetReferences: [12345n]
780
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
781
+ * accessReferences: [{ appId: 1234n }]
782
+ * lease: 'lease',
783
+ * note: 'note',
784
+ * // You wouldn't normally set this field
785
+ * firstValidRound: 1000n,
786
+ * validityWindow: 10,
787
+ * extraFee: (1000).microAlgo(),
788
+ * staticFee: (1000).microAlgo(),
789
+ * // Max fee doesn't make sense with extraFee AND staticFee
790
+ * // already specified, but here for completeness
791
+ * maxFee: (3000).microAlgo(),
792
+ * rejectVersion: 1,
793
+ *})
794
+ * ```
795
+ */
796
+ addAppUpdate(params: AppUpdateParams): TransactionComposer;
797
+ /**
798
+ * Add an application delete transaction to the transaction group.
799
+ *
800
+ * Note: we recommend using app clients to make it easier to make app calls.
801
+ * @param params The application delete transaction parameters
802
+ * @returns The composer so you can chain method calls
803
+ * @example Basic example
804
+ * ```typescript
805
+ * composer.addAppDelete({ sender: 'CREATORADDRESS' })
806
+ * ```
807
+ * @example Advanced example
808
+ * ```typescript
809
+ * composer.addAppDelete({
810
+ * sender: 'CREATORADDRESS',
811
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
812
+ * args: [new Uint8Array(1, 2, 3, 4)]
813
+ * accountReferences: ["ACCOUNT_1"]
814
+ * appReferences: [123n, 1234n]
815
+ * assetReferences: [12345n]
816
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
817
+ * accessReferences: [{ appId: 1234n }]
818
+ * lease: 'lease',
819
+ * note: 'note',
820
+ * // You wouldn't normally set this field
821
+ * firstValidRound: 1000n,
822
+ * validityWindow: 10,
823
+ * extraFee: (1000).microAlgo(),
824
+ * staticFee: (1000).microAlgo(),
825
+ * // Max fee doesn't make sense with extraFee AND staticFee
826
+ * // already specified, but here for completeness
827
+ * maxFee: (3000).microAlgo(),
828
+ * rejectVersion: 1,
829
+ *})
830
+ * ```
831
+ */
832
+ addAppDelete(params: AppDeleteParams): TransactionComposer;
833
+ /**
834
+ * Add an application call transaction to the transaction group.
835
+ *
836
+ * If you want to create or update an app use `addAppCreate` or `addAppUpdate`.
837
+ *
838
+ * Note: we recommend using app clients to make it easier to make app calls.
839
+ * @param params The application call transaction parameters
840
+ * @returns The composer so you can chain method calls
841
+ * @example Basic example
842
+ * ```typescript
843
+ * composer.addAppCall({ sender: 'CREATORADDRESS' })
844
+ * ```
845
+ * @example Advanced example
846
+ * ```typescript
847
+ * composer.addAppCall({
848
+ * sender: 'CREATORADDRESS',
849
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
850
+ * args: [new Uint8Array(1, 2, 3, 4)]
851
+ * accountReferences: ["ACCOUNT_1"]
852
+ * appReferences: [123n, 1234n]
853
+ * assetReferences: [12345n]
854
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
855
+ * accessReferences: [{ appId: 1234n }]
856
+ * lease: 'lease',
857
+ * note: 'note',
858
+ * // You wouldn't normally set this field
859
+ * firstValidRound: 1000n,
860
+ * validityWindow: 10,
861
+ * extraFee: (1000).microAlgo(),
862
+ * staticFee: (1000).microAlgo(),
863
+ * // Max fee doesn't make sense with extraFee AND staticFee
864
+ * // already specified, but here for completeness
865
+ * maxFee: (3000).microAlgo(),
866
+ * rejectVersion: 1,
867
+ *})
868
+ * ```
869
+ */
870
+ addAppCall(params: AppCallParams): TransactionComposer;
871
+ /**
872
+ * Add an ABI method create application call transaction to the transaction group.
873
+ *
874
+ * Note: we recommend using app clients to make it easier to make app calls.
875
+ * @param params The ABI create method application call transaction parameters
876
+ * @returns The composer so you can chain method calls
877
+ * @example Basic example
878
+ * ```typescript
879
+ * const method = new ABIMethod({
880
+ * name: 'method',
881
+ * args: [{ name: 'arg1', type: 'string' }],
882
+ * returns: { type: 'string' },
883
+ * })
884
+ * composer.addAppCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
885
+ * ```
886
+ * @example Advanced example
887
+ * ```typescript
888
+ * const method = new ABIMethod({
889
+ * name: 'method',
890
+ * args: [{ name: 'arg1', type: 'string' }],
891
+ * returns: { type: 'string' },
892
+ * })
893
+ * composer.addAppCreateMethodCall({
894
+ * sender: 'CREATORADDRESS',
895
+ * method: method,
896
+ * args: ["arg1_value"],
897
+ * approvalProgram: "TEALCODE",
898
+ * clearStateProgram: "TEALCODE",
899
+ * schema: {
900
+ * globalInts: 1,
901
+ * globalByteSlices: 2,
902
+ * localInts: 3,
903
+ * localByteSlices: 4
904
+ * },
905
+ * extraProgramPages: 1,
906
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
907
+ * args: [new Uint8Array(1, 2, 3, 4)]
908
+ * accountReferences: ["ACCOUNT_1"]
909
+ * appReferences: [123n, 1234n]
910
+ * assetReferences: [12345n]
911
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
912
+ * accessReferences: [{ appId: 1234n }]
913
+ * lease: 'lease',
914
+ * note: 'note',
915
+ * // You wouldn't normally set this field
916
+ * firstValidRound: 1000n,
917
+ * validityWindow: 10,
918
+ * extraFee: (1000).microAlgo(),
919
+ * staticFee: (1000).microAlgo(),
920
+ * // Max fee doesn't make sense with extraFee AND staticFee
921
+ * // already specified, but here for completeness
922
+ * maxFee: (3000).microAlgo(),
923
+ * rejectVersion: 1,
924
+ *})
925
+ * ```
926
+ */
927
+ addAppCreateMethodCall(params: AppCreateMethodCall): this;
928
+ /**
929
+ * Add an ABI method update application call transaction to the transaction group.
930
+ *
931
+ * Note: we recommend using app clients to make it easier to make app calls.
932
+ * @param params The ABI update method application call transaction parameters
933
+ * @returns The composer so you can chain method calls
934
+ * @example Basic example
935
+ * ```typescript
936
+ * const method = new ABIMethod({
937
+ * name: 'method',
938
+ * args: [{ name: 'arg1', type: 'string' }],
939
+ * returns: { type: 'string' },
940
+ * })
941
+ * composer.addAppUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
942
+ * ```
943
+ * @example Advanced example
944
+ * ```typescript
945
+ * const method = new ABIMethod({
946
+ * name: 'method',
947
+ * args: [{ name: 'arg1', type: 'string' }],
948
+ * returns: { type: 'string' },
949
+ * })
950
+ * composer.addAppUpdateMethodCall({
951
+ * sender: 'CREATORADDRESS',
952
+ * method: method,
953
+ * args: ["arg1_value"],
954
+ * approvalProgram: "TEALCODE",
955
+ * clearStateProgram: "TEALCODE",
956
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
957
+ * args: [new Uint8Array(1, 2, 3, 4)]
958
+ * accountReferences: ["ACCOUNT_1"]
959
+ * appReferences: [123n, 1234n]
960
+ * assetReferences: [12345n]
961
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
962
+ * accessReferences: [{ appId: 1234n }]
963
+ * lease: 'lease',
964
+ * note: 'note',
965
+ * // You wouldn't normally set this field
966
+ * firstValidRound: 1000n,
967
+ * validityWindow: 10,
968
+ * extraFee: (1000).microAlgo(),
969
+ * staticFee: (1000).microAlgo(),
970
+ * // Max fee doesn't make sense with extraFee AND staticFee
971
+ * // already specified, but here for completeness
972
+ * maxFee: (3000).microAlgo(),
973
+ * rejectVersion: 1,
974
+ *})
975
+ * ```
976
+ */
977
+ addAppUpdateMethodCall(params: AppUpdateMethodCall): this;
978
+ /**
979
+ * Add an ABI method delete application call transaction to the transaction group.
980
+ *
981
+ * Note: we recommend using app clients to make it easier to make app calls.
982
+ * @param params The ABI delete method application call transaction parameters
983
+ * @returns The composer so you can chain method calls
984
+ * @example Basic example
985
+ * ```typescript
986
+ * const method = new ABIMethod({
987
+ * name: 'method',
988
+ * args: [{ name: 'arg1', type: 'string' }],
989
+ * returns: { type: 'string' },
990
+ * })
991
+ * composer.addAppDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
992
+ * ```
993
+ * @example Advanced example
994
+ * ```typescript
995
+ * const method = new ABIMethod({
996
+ * name: 'method',
997
+ * args: [{ name: 'arg1', type: 'string' }],
998
+ * returns: { type: 'string' },
999
+ * })
1000
+ * composer.addAppDeleteMethodCall({
1001
+ * sender: 'CREATORADDRESS',
1002
+ * method: method,
1003
+ * args: ["arg1_value"],
1004
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
1005
+ * args: [new Uint8Array(1, 2, 3, 4)]
1006
+ * accountReferences: ["ACCOUNT_1"]
1007
+ * appReferences: [123n, 1234n]
1008
+ * assetReferences: [12345n]
1009
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
1010
+ * accessReferences: [{ appId: 1234n }]
1011
+ * lease: 'lease',
1012
+ * note: 'note',
1013
+ * // You wouldn't normally set this field
1014
+ * firstValidRound: 1000n,
1015
+ * validityWindow: 10,
1016
+ * extraFee: (1000).microAlgo(),
1017
+ * staticFee: (1000).microAlgo(),
1018
+ * // Max fee doesn't make sense with extraFee AND staticFee
1019
+ * // already specified, but here for completeness
1020
+ * maxFee: (3000).microAlgo(),
1021
+ * rejectVersion: 1,
1022
+ *})
1023
+ * ```
1024
+ */
1025
+ addAppDeleteMethodCall(params: AppDeleteMethodCall): this;
1026
+ /**
1027
+ * Add a non-create/non-update ABI method application call transaction to the transaction group.
1028
+ *
1029
+ * Note: we recommend using app clients to make it easier to make app calls.
1030
+ * @param params The ABI method application call transaction parameters
1031
+ * @returns The composer so you can chain method calls
1032
+ * @example Basic example
1033
+ * ```typescript
1034
+ * const method = new ABIMethod({
1035
+ * name: 'method',
1036
+ * args: [{ name: 'arg1', type: 'string' }],
1037
+ * returns: { type: 'string' },
1038
+ * })
1039
+ * composer.addAppCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
1040
+ * ```
1041
+ * @example Advanced example
1042
+ * ```typescript
1043
+ * const method = new ABIMethod({
1044
+ * name: 'method',
1045
+ * args: [{ name: 'arg1', type: 'string' }],
1046
+ * returns: { type: 'string' },
1047
+ * })
1048
+ * composer.addAppCallMethodCall({
1049
+ * sender: 'CREATORADDRESS',
1050
+ * method: method,
1051
+ * args: ["arg1_value"],
1052
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
1053
+ * args: [new Uint8Array(1, 2, 3, 4)]
1054
+ * accountReferences: ["ACCOUNT_1"]
1055
+ * appReferences: [123n, 1234n]
1056
+ * assetReferences: [12345n]
1057
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
1058
+ * accessReferences: [{ appId: 1234n }]
1059
+ * lease: 'lease',
1060
+ * note: 'note',
1061
+ * // You wouldn't normally set this field
1062
+ * firstValidRound: 1000n,
1063
+ * validityWindow: 10,
1064
+ * extraFee: (1000).microAlgo(),
1065
+ * staticFee: (1000).microAlgo(),
1066
+ * // Max fee doesn't make sense with extraFee AND staticFee
1067
+ * // already specified, but here for completeness
1068
+ * maxFee: (3000).microAlgo(),
1069
+ * rejectVersion: 1,
1070
+ *})
1071
+ * ```
1072
+ */
1073
+ addAppCallMethodCall(params: AppCallMethodCall): this;
1074
+ /**
1075
+ * Add an online key registration transaction to the transaction group.
1076
+ * @param params The online key registration transaction parameters
1077
+ * @returns The composer so you can chain method calls
1078
+ * @example Basic example
1079
+ * ```typescript
1080
+ * composer.addOnlineKeyRegistration({
1081
+ * sender: 'SENDERADDRESS',
1082
+ * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
1083
+ * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
1084
+ * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
1085
+ * voteFirst: 1n,
1086
+ * voteLast: 1000n,
1087
+ * voteKeyDilution: 1n,
1088
+ * })
1089
+ * ```
1090
+ * @example Advanced example
1091
+ * ```typescript
1092
+ * composer.addOnlineKeyRegistration({
1093
+ * sender: 'SENDERADDRESS',
1094
+ * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
1095
+ * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
1096
+ * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
1097
+ * voteFirst: 1n,
1098
+ * voteLast: 1000n,
1099
+ * voteKeyDilution: 1n,
1100
+ * lease: 'lease',
1101
+ * note: 'note',
1102
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
1103
+ * rekeyTo: 'REKEYTOADDRESS',
1104
+ * // You wouldn't normally set this field
1105
+ * firstValidRound: 1000n,
1106
+ * validityWindow: 10,
1107
+ * extraFee: (1000).microAlgo(),
1108
+ * staticFee: (1000).microAlgo(),
1109
+ * // Max fee doesn't make sense with extraFee AND staticFee
1110
+ * // already specified, but here for completeness
1111
+ * maxFee: (3000).microAlgo(),
1112
+ * })
1113
+ * ```
1114
+ */
1115
+ addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer;
1116
+ /**
1117
+ * Add an offline key registration transaction to the transaction group.
1118
+ * @param params The offline key registration transaction parameters
1119
+ * @returns The composer so you can chain method calls
1120
+ * @example Basic example
1121
+ * ```typescript
1122
+ * composer.addOfflineKeyRegistration({
1123
+ * sender: 'SENDERADDRESS',
1124
+ * })
1125
+ * ```
1126
+ * @example Advanced example
1127
+ * ```typescript
1128
+ * composer.addOfflineKeyRegistration({
1129
+ * sender: 'SENDERADDRESS',
1130
+ * lease: 'lease',
1131
+ * note: 'note',
1132
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
1133
+ * rekeyTo: 'REKEYTOADDRESS',
1134
+ * // You wouldn't normally set this field
1135
+ * firstValidRound: 1000n,
1136
+ * validityWindow: 10,
1137
+ * extraFee: (1000).microAlgo(),
1138
+ * staticFee: (1000).microAlgo(),
1139
+ * // Max fee doesn't make sense with extraFee AND staticFee
1140
+ * // already specified, but here for completeness
1141
+ * maxFee: (3000).microAlgo(),
1142
+ * })
1143
+ * ```
1144
+ */
1145
+ addOfflineKeyRegistration(params: OfflineKeyRegistrationParams): TransactionComposer;
1146
+ /**
1147
+ * Add the transactions within an `AtomicTransactionComposer` to the transaction group.
1148
+ * @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
1149
+ * @returns The composer so you can chain method calls
1150
+ * @example
1151
+ * ```typescript
1152
+ * const atc = new AtomicTransactionComposer()
1153
+ * .addPayment({ sender: 'SENDERADDRESS', receiver: 'RECEIVERADDRESS', amount: 1000n })
1154
+ * composer.addAtc(atc)
1155
+ * ```
1156
+ */
1157
+ addAtc(atc: algosdk.AtomicTransactionComposer): TransactionComposer;
1158
+ /** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */
1159
+ private buildAtc;
1160
+ private commonTxnBuildStep;
1161
+ /**
1162
+ * Builds an ABI method call transaction and any other associated transactions represented in the ABI args.
1163
+ * @param includeSigner Whether to include the actual signer for the transactions.
1164
+ * If you are just building transactions without signers yet then set this to `false`.
1165
+ */
1166
+ private buildMethodCall;
1167
+ private buildPayment;
1168
+ private buildAssetCreate;
1169
+ private buildAssetConfig;
1170
+ private buildAssetDestroy;
1171
+ private buildAssetFreeze;
1172
+ private buildAssetTransfer;
1173
+ private buildAppCall;
1174
+ private buildKeyReg;
1175
+ /** Builds all transaction types apart from `txnWithSigner`, `atc` and `methodCall` since those ones can have custom signers that need to be retrieved. */
1176
+ private buildTxn;
1177
+ private buildTxnWithSigner;
1178
+ /**
1179
+ * Compose all of the transactions without signers and return the transaction objects directly along with any ABI method calls.
1180
+ *
1181
+ * @returns The array of built transactions and any corresponding method calls
1182
+ * @example
1183
+ * ```typescript
1184
+ * const { transactions, methodCalls, signers } = await composer.buildTransactions()
1185
+ * ```
1186
+ */
1187
+ buildTransactions(): Promise<BuiltTransactions>;
1188
+ /**
1189
+ * Get the number of transactions currently added to this composer.
1190
+ * @returns The number of transactions currently added to this composer
1191
+ */
1192
+ count(): Promise<number>;
1193
+ /**
1194
+ * Compose all of the transactions in a single atomic transaction group and an atomic transaction composer.
1195
+ *
1196
+ * You can then use the transactions standalone, or use the composer to execute or simulate the transactions.
1197
+ *
1198
+ * Once this method is called, no further transactions will be able to be added.
1199
+ * You can safely call this method multiple times to get the same result.
1200
+ * @returns The built atomic transaction composer, the transactions and any corresponding method calls
1201
+ * @example
1202
+ * ```typescript
1203
+ * const { atc, transactions, methodCalls } = await composer.build()
1204
+ * ```
1205
+ */
1206
+ build(): Promise<{
1207
+ atc: algosdk.AtomicTransactionComposer;
1208
+ transactions: algosdk.TransactionWithSigner[];
1209
+ methodCalls: any;
1210
+ }>;
1211
+ /**
1212
+ * Rebuild the group, discarding any previously built transactions.
1213
+ * This will potentially cause new signers and suggested params to be used if the callbacks return a new value compared to the first build.
1214
+ * @returns The newly built atomic transaction composer and the transactions
1215
+ * @example
1216
+ * ```typescript
1217
+ * const { atc, transactions, methodCalls } = await composer.rebuild()
1218
+ * ```
1219
+ */
1220
+ rebuild(): Promise<{
1221
+ atc: algosdk.AtomicTransactionComposer;
1222
+ transactions: algosdk.TransactionWithSigner[];
1223
+ methodCalls: any;
1224
+ }>;
1225
+ /**
1226
+ * Compose the atomic transaction group and send it to the network.
1227
+ * @param params The parameters to control execution with
1228
+ * @returns The execution result
1229
+ * @example
1230
+ * ```typescript
1231
+ * const result = await composer.send()
1232
+ * ```
1233
+ */
1234
+ send(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
1235
+ /**
1236
+ * @deprecated Use `send` instead.
1237
+ *
1238
+ * Compose the atomic transaction group and send it to the network
1239
+ *
1240
+ * An alias for `composer.send(params)`.
1241
+ * @param params The parameters to control execution with
1242
+ * @returns The execution result
1243
+ */
1244
+ execute(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
1245
+ /**
1246
+ * Compose the atomic transaction group and simulate sending it to the network
1247
+ * @returns The simulation result
1248
+ * @example
1249
+ * ```typescript
1250
+ * const result = await composer.simulate()
1251
+ * ```
1252
+ */
1253
+ simulate(): Promise<SendAtomicTransactionComposerResults & {
1254
+ simulateResponse: SimulateResponse;
1255
+ }>;
1256
+ /**
1257
+ * Compose the atomic transaction group and simulate sending it to the network
1258
+ * @returns The simulation result
1259
+ * @example
1260
+ * ```typescript
1261
+ * const result = await composer.simulate({
1262
+ * skipSignatures: true,
1263
+ * })
1264
+ * ```
1265
+ */
1266
+ simulate(options: SkipSignaturesSimulateOptions): Promise<SendAtomicTransactionComposerResults & {
1267
+ simulateResponse: SimulateResponse;
1268
+ }>;
1269
+ /**
1270
+ * Compose the atomic transaction group and simulate sending it to the network
1271
+ * @returns The simulation result
1272
+ * @example
1273
+ * ```typescript
1274
+ * const result = await composer.simulate({
1275
+ * extraOpcodeBudget: 1000,
1276
+ * })
1277
+ * ```
1278
+ */
1279
+ simulate(options: RawSimulateOptions): Promise<SendAtomicTransactionComposerResults & {
1280
+ simulateResponse: SimulateResponse;
1281
+ }>;
1282
+ /**
1283
+ * Create an encoded transaction note that follows the ARC-2 spec.
1284
+ *
1285
+ * https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
1286
+ * @param note The ARC-2 transaction note data
1287
+ * @returns The binary encoded transaction note
1288
+ */
1289
+ static arc2Note(note: Arc2TransactionNote): Uint8Array;
1340
1290
  }
1291
+ //#endregion
1292
+ export { AppCallMethodCall, AppCallParams, AppCreateMethodCall, AppCreateParams, AppDeleteMethodCall, AppDeleteParams, AppMethodCall, AppMethodCallParams, AppMethodCallTransactionArgument, AppUpdateMethodCall, AppUpdateParams, AssetConfigParams, AssetCreateParams, AssetDestroyParams, AssetFreezeParams, AssetOptInParams, AssetOptOutParams, AssetTransferParams, BuiltTransactions, CommonAppCallParams, CommonTransactionParams, ErrorTransformer, MAX_TRANSACTION_GROUP_SIZE, OfflineKeyRegistrationParams, OnlineKeyRegistrationParams, PaymentParams, RawSimulateOptions, SimulateOptions, SkipSignaturesSimulateOptions, TransactionComposer, TransactionComposerParams, Txn };
1293
+ //# sourceMappingURL=composer.d.ts.map