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

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