@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,724 +1,734 @@
1
+ //#region src/types/algorand-client-transaction-creator.ts
1
2
  /** Orchestrates creating transactions for `AlgorandClient`. */
2
- class AlgorandClientTransactionCreator {
3
- /**
4
- * Creates a new `AlgorandClientTransactionCreator`
5
- * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
6
- * @example
7
- * ```typescript
8
- * const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer())
9
- * ```
10
- */
11
- constructor(newGroup) {
12
- /**
13
- * Create a payment transaction to transfer Algo between accounts.
14
- * @param params The parameters for the payment transaction
15
- * @example Basic example
16
- * ```typescript
17
- * await algorand.createTransaction.payment({
18
- * sender: 'SENDERADDRESS',
19
- * receiver: 'RECEIVERADDRESS',
20
- * amount: (4).algo(),
21
- * })
22
- * ```
23
- * @example Advanced example
24
- * ```typescript
25
- * await algorand.createTransaction.payment({
26
- * amount: (4).algo(),
27
- * receiver: 'RECEIVERADDRESS',
28
- * sender: 'SENDERADDRESS',
29
- * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
30
- * lease: 'lease',
31
- * note: 'note',
32
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
33
- * rekeyTo: 'REKEYTOADDRESS',
34
- * // You wouldn't normally set this field
35
- * firstValidRound: 1000n,
36
- * validityWindow: 10,
37
- * extraFee: (1000).microAlgo(),
38
- * staticFee: (1000).microAlgo(),
39
- * // Max fee doesn't make sense with extraFee AND staticFee
40
- * // already specified, but here for completeness
41
- * maxFee: (3000).microAlgo(),
42
- * })
43
- * ```
44
- * @returns The payment transaction
45
- */
46
- this.payment = this._transaction((c) => c.addPayment);
47
- /** Create a create Algorand Standard Asset transaction.
48
- *
49
- * The account that sends this transaction will automatically be
50
- * opted in to the asset and will hold all units after creation.
51
- *
52
- * @param params The parameters for the asset creation transaction
53
- *
54
- * @example Basic example
55
- * ```typescript
56
- * await algorand.createTransaction.assetCreate({ sender: "CREATORADDRESS", total: 100n})
57
- * ```
58
- * @example Advanced example
59
- * ```typescript
60
- * await algorand.createTransaction.assetCreate({
61
- * sender: 'CREATORADDRESS',
62
- * total: 100n,
63
- * decimals: 2,
64
- * assetName: 'asset',
65
- * unitName: 'unit',
66
- * url: 'url',
67
- * metadataHash: 'metadataHash',
68
- * defaultFrozen: false,
69
- * manager: 'MANAGERADDRESS',
70
- * reserve: 'RESERVEADDRESS',
71
- * freeze: 'FREEZEADDRESS',
72
- * clawback: 'CLAWBACKADDRESS',
73
- * lease: 'lease',
74
- * note: 'note',
75
- * // You wouldn't normally set this field
76
- * firstValidRound: 1000n,
77
- * validityWindow: 10,
78
- * extraFee: (1000).microAlgo(),
79
- * staticFee: (1000).microAlgo(),
80
- * // Max fee doesn't make sense with extraFee AND staticFee
81
- * // already specified, but here for completeness
82
- * maxFee: (3000).microAlgo(),
83
- * })
84
- * ```
85
- * @returns The asset create transaction
86
- */
87
- this.assetCreate = this._transaction((c) => c.addAssetCreate);
88
- /** Create an asset config transaction to reconfigure an existing Algorand Standard Asset.
89
- *
90
- * **Note:** The manager, reserve, freeze, and clawback addresses
91
- * are immutably empty if they are not set. If manager is not set then
92
- * all fields are immutable from that point forward.
93
- *
94
- * @param params The parameters for the asset config transaction
95
- *
96
- * @example Basic example
97
- * ```typescript
98
- * await algorand.createTransaction.assetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
99
- * ```
100
- * @example Advanced example
101
- * ```typescript
102
- * await algorand.createTransaction.assetConfig({
103
- * sender: 'MANAGERADDRESS',
104
- * assetId: 123456n,
105
- * manager: 'MANAGERADDRESS',
106
- * reserve: 'RESERVEADDRESS',
107
- * freeze: 'FREEZEADDRESS',
108
- * clawback: 'CLAWBACKADDRESS',
109
- * lease: 'lease',
110
- * note: 'note',
111
- * // You wouldn't normally set this field
112
- * firstValidRound: 1000n,
113
- * validityWindow: 10,
114
- * extraFee: (1000).microAlgo(),
115
- * staticFee: (1000).microAlgo(),
116
- * // Max fee doesn't make sense with extraFee AND staticFee
117
- * // already specified, but here for completeness
118
- * maxFee: (3000).microAlgo(),
119
- * })
120
- * ```
121
- * @returns The asset config transaction
122
- */
123
- this.assetConfig = this._transaction((c) => c.addAssetConfig);
124
- /** Create an Algorand Standard Asset freeze transaction.
125
- *
126
- * @param params The parameters for the asset freeze transaction
127
- *
128
- * @example Basic example
129
- * ```typescript
130
- * await algorand.createTransaction.assetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
131
- * ```
132
- * @example Advanced example
133
- * ```typescript
134
- * await algorand.createTransaction.assetFreeze({
135
- * sender: 'MANAGERADDRESS',
136
- * assetId: 123456n,
137
- * account: 'ACCOUNTADDRESS',
138
- * frozen: true,
139
- * lease: 'lease',
140
- * note: 'note',
141
- * // You wouldn't normally set this field
142
- * firstValidRound: 1000n,
143
- * validityWindow: 10,
144
- * extraFee: (1000).microAlgo(),
145
- * staticFee: (1000).microAlgo(),
146
- * // Max fee doesn't make sense with extraFee AND staticFee
147
- * // already specified, but here for completeness
148
- * maxFee: (3000).microAlgo(),
149
- * })
150
- * ```
151
- * @returns The asset freeze transaction
152
- */
153
- this.assetFreeze = this._transaction((c) => c.addAssetFreeze);
154
- /** Create an Algorand Standard Asset destroy transaction.
155
- *
156
- * Created assets can be destroyed only by the asset manager account.
157
- * All of the assets must be owned by the creator of the asset before
158
- * the asset can be deleted.
159
- *
160
- * @param params The parameters for the asset destroy transaction
161
- *
162
- * @example Basic example
163
- * ```typescript
164
- * await algorand.createTransaction.assetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
165
- * ```
166
- * @example Advanced example
167
- * ```typescript
168
- * await algorand.createTransaction.assetDestroy({
169
- * sender: 'MANAGERADDRESS',
170
- * assetId: 123456n,
171
- * lease: 'lease',
172
- * note: 'note',
173
- * // You wouldn't normally set this field
174
- * firstValidRound: 1000n,
175
- * validityWindow: 10,
176
- * extraFee: (1000).microAlgo(),
177
- * staticFee: (1000).microAlgo(),
178
- * // Max fee doesn't make sense with extraFee AND staticFee
179
- * // already specified, but here for completeness
180
- * maxFee: (3000).microAlgo(),
181
- * })
182
- * ```
183
- * @returns The asset destroy transaction
184
- */
185
- this.assetDestroy = this._transaction((c) => c.addAssetDestroy);
186
- /** Create an Algorand Standard Asset transfer transaction.
187
- *
188
- * @param params The parameters for the asset transfer transaction
189
- *
190
- * @example Basic example
191
- * ```typescript
192
- * await algorand.createTransaction.assetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
193
- * ```
194
- * @example Advanced example (with clawback)
195
- * ```typescript
196
- * await algorand.createTransaction.assetTransfer({
197
- * sender: 'CLAWBACKADDRESS',
198
- * assetId: 123456n,
199
- * amount: 1n,
200
- * receiver: 'RECEIVERADDRESS',
201
- * clawbackTarget: 'HOLDERADDRESS',
202
- * // This field needs to be used with caution
203
- * closeAssetTo: 'ADDRESSTOCLOSETO'
204
- * lease: 'lease',
205
- * note: 'note',
206
- * // You wouldn't normally set this field
207
- * firstValidRound: 1000n,
208
- * validityWindow: 10,
209
- * extraFee: (1000).microAlgo(),
210
- * staticFee: (1000).microAlgo(),
211
- * // Max fee doesn't make sense with extraFee AND staticFee
212
- * // already specified, but here for completeness
213
- * maxFee: (3000).microAlgo(),
214
- * })
215
- * ```
216
- * @returns The result of the asset transfer transaction
217
- */
218
- this.assetTransfer = this._transaction((c) => c.addAssetTransfer);
219
- /** Create an Algorand Standard Asset opt-in transaction.
220
- *
221
- * @param params The parameters for the asset opt-in transaction
222
- *
223
- * @example Basic example
224
- * ```typescript
225
- * await algorand.createTransaction.assetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
226
- * ```
227
- * @example Advanced example
228
- * ```typescript
229
- * await algorand.createTransaction.assetOptIn({
230
- * sender: 'SENDERADDRESS',
231
- * assetId: 123456n,
232
- * lease: 'lease',
233
- * note: 'note',
234
- * // You wouldn't normally set this field
235
- * firstValidRound: 1000n,
236
- * validityWindow: 10,
237
- * extraFee: (1000).microAlgo(),
238
- * staticFee: (1000).microAlgo(),
239
- * // Max fee doesn't make sense with extraFee AND staticFee
240
- * // already specified, but here for completeness
241
- * maxFee: (3000).microAlgo(),
242
- * })
243
- * ```
244
- * @returns The asset opt-in transaction
245
- */
246
- this.assetOptIn = this._transaction((c) => c.addAssetOptIn);
247
- /** Create an asset opt-out transaction.
248
- *
249
- * *Note:* If the account has a balance of the asset,
250
- * it will lose those assets
251
- *
252
- * @param params The parameters for the asset opt-out transaction
253
- *
254
- * @example Basic example (without creator, will be retrieved from algod)
255
- * ```typescript
256
- * await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
257
- * ```
258
- * @example Basic example (with creator)
259
- * ```typescript
260
- * await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
261
- * ```
262
- * @example Advanced example
263
- * ```typescript
264
- * await algorand.createTransaction.assetOptOut({
265
- * sender: 'SENDERADDRESS',
266
- * assetId: 123456n,
267
- * creator: 'CREATORADDRESS',
268
- * ensureZeroBalance: true,
269
- * lease: 'lease',
270
- * note: 'note',
271
- * // You wouldn't normally set this field
272
- * firstValidRound: 1000n,
273
- * validityWindow: 10,
274
- * extraFee: (1000).microAlgo(),
275
- * staticFee: (1000).microAlgo(),
276
- * // Max fee doesn't make sense with extraFee AND staticFee
277
- * // already specified, but here for completeness
278
- * maxFee: (3000).microAlgo(),
279
- * })
280
- * ```
281
- * @returns The asset opt-out transaction
282
- */
283
- this.assetOptOut = this._transaction((c) => c.addAssetOptOut);
284
- /** Create an application create transaction.
285
- *
286
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
287
- *
288
- * @param params The parameters for the app creation transaction
289
- * @example Basic example
290
- * ```typescript
291
- * await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
292
- * ```
293
- * @example Advanced example
294
- * ```typescript
295
- * await algorand.createTransaction.appCreate({
296
- * sender: 'CREATORADDRESS',
297
- * approvalProgram: "TEALCODE",
298
- * clearStateProgram: "TEALCODE",
299
- * schema: {
300
- * globalInts: 1,
301
- * globalByteSlices: 2,
302
- * localInts: 3,
303
- * localByteSlices: 4
304
- * },
305
- * extraProgramPages: 1,
306
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
307
- * args: [new Uint8Array(1, 2, 3, 4)]
308
- * accountReferences: ["ACCOUNT_1"]
309
- * appReferences: [123n, 1234n]
310
- * assetReferences: [12345n]
311
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
312
- * accessReferences: [{ appId: 1234n }]
313
- * lease: 'lease',
314
- * note: 'note',
315
- * // You wouldn't normally set this field
316
- * firstValidRound: 1000n,
317
- * validityWindow: 10,
318
- * extraFee: (1000).microAlgo(),
319
- * staticFee: (1000).microAlgo(),
320
- * // Max fee doesn't make sense with extraFee AND staticFee
321
- * // already specified, but here for completeness
322
- * maxFee: (3000).microAlgo(),
323
- *})
324
- * ```
325
- * @returns The application create transaction
326
- */
327
- this.appCreate = this._transaction((c) => c.addAppCreate);
328
- /** Create an application update transaction.
329
- *
330
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
331
- *
332
- * @param params The parameters for the app update transaction
333
- * @example Basic example
334
- * ```typescript
335
- * await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
336
- * ```
337
- * @example Advanced example
338
- * ```typescript
339
- * await algorand.createTransaction.appUpdate({
340
- * sender: 'CREATORADDRESS',
341
- * approvalProgram: "TEALCODE",
342
- * clearStateProgram: "TEALCODE",
343
- * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
344
- * args: [new Uint8Array(1, 2, 3, 4)]
345
- * accountReferences: ["ACCOUNT_1"]
346
- * appReferences: [123n, 1234n]
347
- * assetReferences: [12345n]
348
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
349
- * accessReferences: [{ appId: 1234n }]
350
- * lease: 'lease',
351
- * note: 'note',
352
- * // You wouldn't normally set this field
353
- * firstValidRound: 1000n,
354
- * validityWindow: 10,
355
- * extraFee: (1000).microAlgo(),
356
- * staticFee: (1000).microAlgo(),
357
- * // Max fee doesn't make sense with extraFee AND staticFee
358
- * // already specified, but here for completeness
359
- * maxFee: (3000).microAlgo(),
360
- *})
361
- * ```
362
- * @returns The application update transaction
363
- */
364
- this.appUpdate = this._transaction((c) => c.addAppUpdate);
365
- /** Create an application delete transaction.
366
- *
367
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
368
- *
369
- * @param params The parameters for the app deletion transaction
370
- * @example Basic example
371
- * ```typescript
372
- * await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })
373
- * ```
374
- * @example Advanced example
375
- * ```typescript
376
- * await algorand.createTransaction.appDelete({
377
- * sender: 'CREATORADDRESS',
378
- * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
379
- * args: [new Uint8Array(1, 2, 3, 4)]
380
- * accountReferences: ["ACCOUNT_1"]
381
- * appReferences: [123n, 1234n]
382
- * assetReferences: [12345n]
383
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
384
- * accessReferences: [{ appId: 1234n }]
385
- * lease: 'lease',
386
- * note: 'note',
387
- * // You wouldn't normally set this field
388
- * firstValidRound: 1000n,
389
- * validityWindow: 10,
390
- * extraFee: (1000).microAlgo(),
391
- * staticFee: (1000).microAlgo(),
392
- * // Max fee doesn't make sense with extraFee AND staticFee
393
- * // already specified, but here for completeness
394
- * maxFee: (3000).microAlgo(),
395
- *})
396
- * ```
397
- * @returns The application delete transaction
398
- */
399
- this.appDelete = this._transaction((c) => c.addAppDelete);
400
- /** Create an application call transaction.
401
- *
402
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
403
- *
404
- * @param params The parameters for the app call transaction
405
- * @example Basic example
406
- * ```typescript
407
- * await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })
408
- * ```
409
- * @example Advanced example
410
- * ```typescript
411
- * await algorand.createTransaction.appCall({
412
- * sender: 'CREATORADDRESS',
413
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
414
- * args: [new Uint8Array(1, 2, 3, 4)]
415
- * accountReferences: ["ACCOUNT_1"]
416
- * appReferences: [123n, 1234n]
417
- * assetReferences: [12345n]
418
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
419
- * accessReferences: [{ appId: 1234n }]
420
- * lease: 'lease',
421
- * note: 'note',
422
- * // You wouldn't normally set this field
423
- * firstValidRound: 1000n,
424
- * validityWindow: 10,
425
- * extraFee: (1000).microAlgo(),
426
- * staticFee: (1000).microAlgo(),
427
- * // Max fee doesn't make sense with extraFee AND staticFee
428
- * // already specified, but here for completeness
429
- * maxFee: (3000).microAlgo(),
430
- *})
431
- * ```
432
- * @returns The application call transaction
433
- */
434
- this.appCall = this._transaction((c) => c.addAppCall);
435
- /** Create an application create call with ABI method call transaction.
436
- *
437
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
438
- *
439
- * @param params The parameters for the app creation transaction
440
- * @example Basic example
441
- * ```typescript
442
- * const method = new ABIMethod({
443
- * name: 'method',
444
- * args: [{ name: 'arg1', type: 'string' }],
445
- * returns: { type: 'string' },
446
- * })
447
- * await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
448
- * ```
449
- * @example Advanced example
450
- * ```typescript
451
- * const method = new ABIMethod({
452
- * name: 'method',
453
- * args: [{ name: 'arg1', type: 'string' }],
454
- * returns: { type: 'string' },
455
- * })
456
- * await algorand.createTransaction.appCreateMethodCall({
457
- * sender: 'CREATORADDRESS',
458
- * method: method,
459
- * args: ["arg1_value"],
460
- * approvalProgram: "TEALCODE",
461
- * clearStateProgram: "TEALCODE",
462
- * schema: {
463
- * globalInts: 1,
464
- * globalByteSlices: 2,
465
- * localInts: 3,
466
- * localByteSlices: 4
467
- * },
468
- * extraProgramPages: 1,
469
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
470
- * args: [new Uint8Array(1, 2, 3, 4)]
471
- * accountReferences: ["ACCOUNT_1"]
472
- * appReferences: [123n, 1234n]
473
- * assetReferences: [12345n]
474
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
475
- * accessReferences: [{ appId: 1234n }]
476
- * lease: 'lease',
477
- * note: 'note',
478
- * // You wouldn't normally set this field
479
- * firstValidRound: 1000n,
480
- * validityWindow: 10,
481
- * extraFee: (1000).microAlgo(),
482
- * staticFee: (1000).microAlgo(),
483
- * // Max fee doesn't make sense with extraFee AND staticFee
484
- * // already specified, but here for completeness
485
- * maxFee: (3000).microAlgo(),
486
- *})
487
- * ```
488
- * @returns The application ABI method create transaction
489
- */
490
- this.appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall);
491
- /** Create an application update call with ABI method call transaction.
492
- *
493
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
494
- *
495
- * @param params The parameters for the app update transaction
496
- * @example Basic example
497
- * ```typescript
498
- * const method = new ABIMethod({
499
- * name: 'method',
500
- * args: [{ name: 'arg1', type: 'string' }],
501
- * returns: { type: 'string' },
502
- * })
503
- * await algorand.createTransaction.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
504
- * ```
505
- * @example Advanced example
506
- * ```typescript
507
- * const method = new ABIMethod({
508
- * name: 'method',
509
- * args: [{ name: 'arg1', type: 'string' }],
510
- * returns: { type: 'string' },
511
- * })
512
- * await algorand.createTransaction.appUpdateMethodCall({
513
- * sender: 'CREATORADDRESS',
514
- * method: method,
515
- * args: ["arg1_value"],
516
- * approvalProgram: "TEALCODE",
517
- * clearStateProgram: "TEALCODE",
518
- * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
519
- * args: [new Uint8Array(1, 2, 3, 4)]
520
- * accountReferences: ["ACCOUNT_1"]
521
- * appReferences: [123n, 1234n]
522
- * assetReferences: [12345n]
523
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
524
- * accessReferences: [{ appId: 1234n }]
525
- * lease: 'lease',
526
- * note: 'note',
527
- * // You wouldn't normally set this field
528
- * firstValidRound: 1000n,
529
- * validityWindow: 10,
530
- * extraFee: (1000).microAlgo(),
531
- * staticFee: (1000).microAlgo(),
532
- * // Max fee doesn't make sense with extraFee AND staticFee
533
- * // already specified, but here for completeness
534
- * maxFee: (3000).microAlgo(),
535
- *})
536
- * ```
537
- * @returns The application ABI method update transaction
538
- */
539
- this.appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall);
540
- /** Create an application delete call with ABI method call transaction.
541
- *
542
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
543
- *
544
- * @param params The parameters for the app deletion transaction
545
- * @example Basic example
546
- * ```typescript
547
- * const method = new ABIMethod({
548
- * name: 'method',
549
- * args: [{ name: 'arg1', type: 'string' }],
550
- * returns: { type: 'string' },
551
- * })
552
- * await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
553
- * ```
554
- * @example Advanced example
555
- * ```typescript
556
- * const method = new ABIMethod({
557
- * name: 'method',
558
- * args: [{ name: 'arg1', type: 'string' }],
559
- * returns: { type: 'string' },
560
- * })
561
- * await algorand.createTransaction.appDeleteMethodCall({
562
- * sender: 'CREATORADDRESS',
563
- * method: method,
564
- * args: ["arg1_value"],
565
- * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
566
- * args: [new Uint8Array(1, 2, 3, 4)]
567
- * accountReferences: ["ACCOUNT_1"]
568
- * appReferences: [123n, 1234n]
569
- * assetReferences: [12345n]
570
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
571
- * accessReferences: [{ appId: 1234n }]
572
- * lease: 'lease',
573
- * note: 'note',
574
- * // You wouldn't normally set this field
575
- * firstValidRound: 1000n,
576
- * validityWindow: 10,
577
- * extraFee: (1000).microAlgo(),
578
- * staticFee: (1000).microAlgo(),
579
- * // Max fee doesn't make sense with extraFee AND staticFee
580
- * // already specified, but here for completeness
581
- * maxFee: (3000).microAlgo(),
582
- *})
583
- * ```
584
- * @returns The application ABI method delete transaction
585
- */
586
- this.appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall);
587
- /** Create an application call with ABI method call transaction.
588
- *
589
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
590
- *
591
- * @param params The parameters for the app call transaction
592
- * @example Basic example
593
- * ```typescript
594
- * const method = new ABIMethod({
595
- * name: 'method',
596
- * args: [{ name: 'arg1', type: 'string' }],
597
- * returns: { type: 'string' },
598
- * })
599
- * await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
600
- * ```
601
- * @example Advanced example
602
- * ```typescript
603
- * const method = new ABIMethod({
604
- * name: 'method',
605
- * args: [{ name: 'arg1', type: 'string' }],
606
- * returns: { type: 'string' },
607
- * })
608
- * await algorand.createTransaction.appCallMethodCall({
609
- * sender: 'CREATORADDRESS',
610
- * method: method,
611
- * args: ["arg1_value"],
612
- * onComplete: algosdk.OnApplicationComplete.OptInOC,
613
- * args: [new Uint8Array(1, 2, 3, 4)]
614
- * accountReferences: ["ACCOUNT_1"]
615
- * appReferences: [123n, 1234n]
616
- * assetReferences: [12345n]
617
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
618
- * accessReferences: [{ appId: 1234n }]
619
- * lease: 'lease',
620
- * note: 'note',
621
- * // You wouldn't normally set this field
622
- * firstValidRound: 1000n,
623
- * validityWindow: 10,
624
- * extraFee: (1000).microAlgo(),
625
- * staticFee: (1000).microAlgo(),
626
- * // Max fee doesn't make sense with extraFee AND staticFee
627
- * // already specified, but here for completeness
628
- * maxFee: (3000).microAlgo(),
629
- *})
630
- * ```
631
- * @returns The application ABI method call transaction
632
- */
633
- this.appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall);
634
- /**
635
- * Create an online key registration transaction.
636
- * @param params The parameters for the key registration transaction
637
- * @example Basic example
638
- * ```typescript
639
- * await algorand.createTransaction.onlineKeyRegistration({
640
- * sender: 'SENDERADDRESS',
641
- * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
642
- * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
643
- * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
644
- * voteFirst: 1n,
645
- * voteLast: 1000n,
646
- * voteKeyDilution: 1n,
647
- * })
648
- * ```
649
- * @example Advanced example
650
- * ```typescript
651
- * await algorand.createTransaction.onlineKeyRegistration({
652
- * sender: 'SENDERADDRESS',
653
- * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
654
- * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
655
- * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
656
- * voteFirst: 1n,
657
- * voteLast: 1000n,
658
- * voteKeyDilution: 1n,
659
- * lease: 'lease',
660
- * note: 'note',
661
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
662
- * rekeyTo: 'REKEYTOADDRESS',
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
- * @returns The online key registration transaction
674
- */
675
- this.onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration);
676
- /**
677
- * Create an offline key registration transaction.
678
- * @param params The parameters for the key registration transaction
679
- * @example Basic example
680
- * ```typescript
681
- * await algorand.createTransaction.offlineKeyRegistration({
682
- * sender: 'SENDERADDRESS',
683
- * })
684
- * ```
685
- * @example Advanced example
686
- * ```typescript
687
- * await algorand.createTransaction.offlineKeyRegistration({
688
- * sender: 'SENDERADDRESS',
689
- * lease: 'lease',
690
- * note: 'note',
691
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
692
- * rekeyTo: 'REKEYTOADDRESS',
693
- * // You wouldn't normally set this field
694
- * firstValidRound: 1000n,
695
- * validityWindow: 10,
696
- * extraFee: (1000).microAlgo(),
697
- * staticFee: (1000).microAlgo(),
698
- * // Max fee doesn't make sense with extraFee AND staticFee
699
- * // already specified, but here for completeness
700
- * maxFee: (3000).microAlgo(),
701
- * })
702
- * ```
703
- * @returns The offline key registration transaction
704
- */
705
- this.offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration);
706
- this._newGroup = newGroup;
707
- }
708
- _transaction(c) {
709
- return async (params) => {
710
- const composer = this._newGroup();
711
- const result = await c(composer).apply(composer, [params]).buildTransactions();
712
- return result.transactions.at(-1);
713
- };
714
- }
715
- _transactions(c) {
716
- return async (params) => {
717
- const composer = this._newGroup();
718
- return await c(composer).apply(composer, [params]).buildTransactions();
719
- };
720
- }
721
- }
722
-
3
+ var AlgorandClientTransactionCreator = class {
4
+ _newGroup;
5
+ /**
6
+ * Creates a new `AlgorandClientTransactionCreator`
7
+ * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
8
+ * @example
9
+ * ```typescript
10
+ * const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer())
11
+ * ```
12
+ */
13
+ constructor(newGroup) {
14
+ this._newGroup = newGroup;
15
+ }
16
+ _transaction(c) {
17
+ return async (params) => {
18
+ const composer = this._newGroup();
19
+ return (await c(composer).apply(composer, [params]).buildTransactions()).transactions.at(-1);
20
+ };
21
+ }
22
+ _transactions(c) {
23
+ return async (params) => {
24
+ const composer = this._newGroup();
25
+ return await c(composer).apply(composer, [params]).buildTransactions();
26
+ };
27
+ }
28
+ /**
29
+ * Create a payment transaction to transfer Algo between accounts.
30
+ * @param params The parameters for the payment transaction
31
+ * @example Basic example
32
+ * ```typescript
33
+ * await algorand.createTransaction.payment({
34
+ * sender: 'SENDERADDRESS',
35
+ * receiver: 'RECEIVERADDRESS',
36
+ * amount: (4).algo(),
37
+ * })
38
+ * ```
39
+ * @example Advanced example
40
+ * ```typescript
41
+ * await algorand.createTransaction.payment({
42
+ * amount: (4).algo(),
43
+ * receiver: 'RECEIVERADDRESS',
44
+ * sender: 'SENDERADDRESS',
45
+ * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
46
+ * lease: 'lease',
47
+ * note: 'note',
48
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
49
+ * rekeyTo: 'REKEYTOADDRESS',
50
+ * // You wouldn't normally set this field
51
+ * firstValidRound: 1000n,
52
+ * validityWindow: 10,
53
+ * extraFee: (1000).microAlgo(),
54
+ * staticFee: (1000).microAlgo(),
55
+ * // Max fee doesn't make sense with extraFee AND staticFee
56
+ * // already specified, but here for completeness
57
+ * maxFee: (3000).microAlgo(),
58
+ * })
59
+ * ```
60
+ * @returns The payment transaction
61
+ */
62
+ payment = this._transaction((c) => c.addPayment);
63
+ /** Create a create Algorand Standard Asset transaction.
64
+ *
65
+ * The account that sends this transaction will automatically be
66
+ * opted in to the asset and will hold all units after creation.
67
+ *
68
+ * @param params The parameters for the asset creation transaction
69
+ *
70
+ * @example Basic example
71
+ * ```typescript
72
+ * await algorand.createTransaction.assetCreate({ sender: "CREATORADDRESS", total: 100n})
73
+ * ```
74
+ * @example Advanced example
75
+ * ```typescript
76
+ * await algorand.createTransaction.assetCreate({
77
+ * sender: 'CREATORADDRESS',
78
+ * total: 100n,
79
+ * decimals: 2,
80
+ * assetName: 'asset',
81
+ * unitName: 'unit',
82
+ * url: 'url',
83
+ * metadataHash: 'metadataHash',
84
+ * defaultFrozen: false,
85
+ * manager: 'MANAGERADDRESS',
86
+ * reserve: 'RESERVEADDRESS',
87
+ * freeze: 'FREEZEADDRESS',
88
+ * clawback: 'CLAWBACKADDRESS',
89
+ * lease: 'lease',
90
+ * note: 'note',
91
+ * // You wouldn't normally set this field
92
+ * firstValidRound: 1000n,
93
+ * validityWindow: 10,
94
+ * extraFee: (1000).microAlgo(),
95
+ * staticFee: (1000).microAlgo(),
96
+ * // Max fee doesn't make sense with extraFee AND staticFee
97
+ * // already specified, but here for completeness
98
+ * maxFee: (3000).microAlgo(),
99
+ * })
100
+ * ```
101
+ * @returns The asset create transaction
102
+ */
103
+ assetCreate = this._transaction((c) => c.addAssetCreate);
104
+ /** Create an asset config transaction to reconfigure an existing Algorand Standard Asset.
105
+ *
106
+ * **Note:** The manager, reserve, freeze, and clawback addresses
107
+ * are immutably empty if they are not set. If manager is not set then
108
+ * all fields are immutable from that point forward.
109
+ *
110
+ * @param params The parameters for the asset config transaction
111
+ *
112
+ * @example Basic example
113
+ * ```typescript
114
+ * await algorand.createTransaction.assetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
115
+ * ```
116
+ * @example Advanced example
117
+ * ```typescript
118
+ * await algorand.createTransaction.assetConfig({
119
+ * sender: 'MANAGERADDRESS',
120
+ * assetId: 123456n,
121
+ * manager: 'MANAGERADDRESS',
122
+ * reserve: 'RESERVEADDRESS',
123
+ * freeze: 'FREEZEADDRESS',
124
+ * clawback: 'CLAWBACKADDRESS',
125
+ * lease: 'lease',
126
+ * note: 'note',
127
+ * // You wouldn't normally set this field
128
+ * firstValidRound: 1000n,
129
+ * validityWindow: 10,
130
+ * extraFee: (1000).microAlgo(),
131
+ * staticFee: (1000).microAlgo(),
132
+ * // Max fee doesn't make sense with extraFee AND staticFee
133
+ * // already specified, but here for completeness
134
+ * maxFee: (3000).microAlgo(),
135
+ * })
136
+ * ```
137
+ * @returns The asset config transaction
138
+ */
139
+ assetConfig = this._transaction((c) => c.addAssetConfig);
140
+ /** Create an Algorand Standard Asset freeze transaction.
141
+ *
142
+ * @param params The parameters for the asset freeze transaction
143
+ *
144
+ * @example Basic example
145
+ * ```typescript
146
+ * await algorand.createTransaction.assetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
147
+ * ```
148
+ * @example Advanced example
149
+ * ```typescript
150
+ * await algorand.createTransaction.assetFreeze({
151
+ * sender: 'MANAGERADDRESS',
152
+ * assetId: 123456n,
153
+ * account: 'ACCOUNTADDRESS',
154
+ * frozen: true,
155
+ * lease: 'lease',
156
+ * note: 'note',
157
+ * // You wouldn't normally set this field
158
+ * firstValidRound: 1000n,
159
+ * validityWindow: 10,
160
+ * extraFee: (1000).microAlgo(),
161
+ * staticFee: (1000).microAlgo(),
162
+ * // Max fee doesn't make sense with extraFee AND staticFee
163
+ * // already specified, but here for completeness
164
+ * maxFee: (3000).microAlgo(),
165
+ * })
166
+ * ```
167
+ * @returns The asset freeze transaction
168
+ */
169
+ assetFreeze = this._transaction((c) => c.addAssetFreeze);
170
+ /** Create an Algorand Standard Asset destroy transaction.
171
+ *
172
+ * Created assets can be destroyed only by the asset manager account.
173
+ * All of the assets must be owned by the creator of the asset before
174
+ * the asset can be deleted.
175
+ *
176
+ * @param params The parameters for the asset destroy transaction
177
+ *
178
+ * @example Basic example
179
+ * ```typescript
180
+ * await algorand.createTransaction.assetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
181
+ * ```
182
+ * @example Advanced example
183
+ * ```typescript
184
+ * await algorand.createTransaction.assetDestroy({
185
+ * sender: 'MANAGERADDRESS',
186
+ * assetId: 123456n,
187
+ * lease: 'lease',
188
+ * note: 'note',
189
+ * // You wouldn't normally set this field
190
+ * firstValidRound: 1000n,
191
+ * validityWindow: 10,
192
+ * extraFee: (1000).microAlgo(),
193
+ * staticFee: (1000).microAlgo(),
194
+ * // Max fee doesn't make sense with extraFee AND staticFee
195
+ * // already specified, but here for completeness
196
+ * maxFee: (3000).microAlgo(),
197
+ * })
198
+ * ```
199
+ * @returns The asset destroy transaction
200
+ */
201
+ assetDestroy = this._transaction((c) => c.addAssetDestroy);
202
+ /** Create an Algorand Standard Asset transfer transaction.
203
+ *
204
+ * @param params The parameters for the asset transfer transaction
205
+ *
206
+ * @example Basic example
207
+ * ```typescript
208
+ * await algorand.createTransaction.assetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
209
+ * ```
210
+ * @example Advanced example (with clawback)
211
+ * ```typescript
212
+ * await algorand.createTransaction.assetTransfer({
213
+ * sender: 'CLAWBACKADDRESS',
214
+ * assetId: 123456n,
215
+ * amount: 1n,
216
+ * receiver: 'RECEIVERADDRESS',
217
+ * clawbackTarget: 'HOLDERADDRESS',
218
+ * // This field needs to be used with caution
219
+ * closeAssetTo: 'ADDRESSTOCLOSETO'
220
+ * lease: 'lease',
221
+ * note: 'note',
222
+ * // You wouldn't normally set this field
223
+ * firstValidRound: 1000n,
224
+ * validityWindow: 10,
225
+ * extraFee: (1000).microAlgo(),
226
+ * staticFee: (1000).microAlgo(),
227
+ * // Max fee doesn't make sense with extraFee AND staticFee
228
+ * // already specified, but here for completeness
229
+ * maxFee: (3000).microAlgo(),
230
+ * })
231
+ * ```
232
+ * @returns The result of the asset transfer transaction
233
+ */
234
+ assetTransfer = this._transaction((c) => c.addAssetTransfer);
235
+ /** Create an Algorand Standard Asset opt-in transaction.
236
+ *
237
+ * @param params The parameters for the asset opt-in transaction
238
+ *
239
+ * @example Basic example
240
+ * ```typescript
241
+ * await algorand.createTransaction.assetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
242
+ * ```
243
+ * @example Advanced example
244
+ * ```typescript
245
+ * await algorand.createTransaction.assetOptIn({
246
+ * sender: 'SENDERADDRESS',
247
+ * assetId: 123456n,
248
+ * lease: 'lease',
249
+ * note: 'note',
250
+ * // You wouldn't normally set this field
251
+ * firstValidRound: 1000n,
252
+ * validityWindow: 10,
253
+ * extraFee: (1000).microAlgo(),
254
+ * staticFee: (1000).microAlgo(),
255
+ * // Max fee doesn't make sense with extraFee AND staticFee
256
+ * // already specified, but here for completeness
257
+ * maxFee: (3000).microAlgo(),
258
+ * })
259
+ * ```
260
+ * @returns The asset opt-in transaction
261
+ */
262
+ assetOptIn = this._transaction((c) => c.addAssetOptIn);
263
+ /** Create an asset opt-out transaction.
264
+ *
265
+ * *Note:* If the account has a balance of the asset,
266
+ * it will lose those assets
267
+ *
268
+ * @param params The parameters for the asset opt-out transaction
269
+ *
270
+ * @example Basic example (without creator, will be retrieved from algod)
271
+ * ```typescript
272
+ * await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
273
+ * ```
274
+ * @example Basic example (with creator)
275
+ * ```typescript
276
+ * await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
277
+ * ```
278
+ * @example Advanced example
279
+ * ```typescript
280
+ * await algorand.createTransaction.assetOptOut({
281
+ * sender: 'SENDERADDRESS',
282
+ * assetId: 123456n,
283
+ * creator: 'CREATORADDRESS',
284
+ * ensureZeroBalance: true,
285
+ * lease: 'lease',
286
+ * note: 'note',
287
+ * // You wouldn't normally set this field
288
+ * firstValidRound: 1000n,
289
+ * validityWindow: 10,
290
+ * extraFee: (1000).microAlgo(),
291
+ * staticFee: (1000).microAlgo(),
292
+ * // Max fee doesn't make sense with extraFee AND staticFee
293
+ * // already specified, but here for completeness
294
+ * maxFee: (3000).microAlgo(),
295
+ * })
296
+ * ```
297
+ * @returns The asset opt-out transaction
298
+ */
299
+ assetOptOut = this._transaction((c) => c.addAssetOptOut);
300
+ /** Create an application create transaction.
301
+ *
302
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
303
+ *
304
+ * @param params The parameters for the app creation transaction
305
+ * @example Basic example
306
+ * ```typescript
307
+ * await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
308
+ * ```
309
+ * @example Advanced example
310
+ * ```typescript
311
+ * await algorand.createTransaction.appCreate({
312
+ * sender: 'CREATORADDRESS',
313
+ * approvalProgram: "TEALCODE",
314
+ * clearStateProgram: "TEALCODE",
315
+ * schema: {
316
+ * globalInts: 1,
317
+ * globalByteSlices: 2,
318
+ * localInts: 3,
319
+ * localByteSlices: 4
320
+ * },
321
+ * extraProgramPages: 1,
322
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
323
+ * args: [new Uint8Array(1, 2, 3, 4)]
324
+ * accountReferences: ["ACCOUNT_1"]
325
+ * appReferences: [123n, 1234n]
326
+ * assetReferences: [12345n]
327
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
328
+ * accessReferences: [{ appId: 1234n }]
329
+ * lease: 'lease',
330
+ * note: 'note',
331
+ * // You wouldn't normally set this field
332
+ * firstValidRound: 1000n,
333
+ * validityWindow: 10,
334
+ * extraFee: (1000).microAlgo(),
335
+ * staticFee: (1000).microAlgo(),
336
+ * // Max fee doesn't make sense with extraFee AND staticFee
337
+ * // already specified, but here for completeness
338
+ * maxFee: (3000).microAlgo(),
339
+ * rejectVersion: 1,
340
+ *})
341
+ * ```
342
+ * @returns The application create transaction
343
+ */
344
+ appCreate = this._transaction((c) => c.addAppCreate);
345
+ /** Create an application update transaction.
346
+ *
347
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
348
+ *
349
+ * @param params The parameters for the app update transaction
350
+ * @example Basic example
351
+ * ```typescript
352
+ * await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
353
+ * ```
354
+ * @example Advanced example
355
+ * ```typescript
356
+ * await algorand.createTransaction.appUpdate({
357
+ * sender: 'CREATORADDRESS',
358
+ * approvalProgram: "TEALCODE",
359
+ * clearStateProgram: "TEALCODE",
360
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
361
+ * args: [new Uint8Array(1, 2, 3, 4)]
362
+ * accountReferences: ["ACCOUNT_1"]
363
+ * appReferences: [123n, 1234n]
364
+ * assetReferences: [12345n]
365
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
366
+ * accessReferences: [{ appId: 1234n }]
367
+ * lease: 'lease',
368
+ * note: 'note',
369
+ * // You wouldn't normally set this field
370
+ * firstValidRound: 1000n,
371
+ * validityWindow: 10,
372
+ * extraFee: (1000).microAlgo(),
373
+ * staticFee: (1000).microAlgo(),
374
+ * // Max fee doesn't make sense with extraFee AND staticFee
375
+ * // already specified, but here for completeness
376
+ * maxFee: (3000).microAlgo(),
377
+ * rejectVersion: 1,
378
+ *})
379
+ * ```
380
+ * @returns The application update transaction
381
+ */
382
+ appUpdate = this._transaction((c) => c.addAppUpdate);
383
+ /** Create an application delete transaction.
384
+ *
385
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
386
+ *
387
+ * @param params The parameters for the app deletion transaction
388
+ * @example Basic example
389
+ * ```typescript
390
+ * await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })
391
+ * ```
392
+ * @example Advanced example
393
+ * ```typescript
394
+ * await algorand.createTransaction.appDelete({
395
+ * sender: 'CREATORADDRESS',
396
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
397
+ * args: [new Uint8Array(1, 2, 3, 4)]
398
+ * accountReferences: ["ACCOUNT_1"]
399
+ * appReferences: [123n, 1234n]
400
+ * assetReferences: [12345n]
401
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
402
+ * accessReferences: [{ appId: 1234n }]
403
+ * lease: 'lease',
404
+ * note: 'note',
405
+ * // You wouldn't normally set this field
406
+ * firstValidRound: 1000n,
407
+ * validityWindow: 10,
408
+ * extraFee: (1000).microAlgo(),
409
+ * staticFee: (1000).microAlgo(),
410
+ * // Max fee doesn't make sense with extraFee AND staticFee
411
+ * // already specified, but here for completeness
412
+ * maxFee: (3000).microAlgo(),
413
+ * rejectVersion: 1,
414
+ *})
415
+ * ```
416
+ * @returns The application delete transaction
417
+ */
418
+ appDelete = this._transaction((c) => c.addAppDelete);
419
+ /** Create an application call transaction.
420
+ *
421
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
422
+ *
423
+ * @param params The parameters for the app call transaction
424
+ * @example Basic example
425
+ * ```typescript
426
+ * await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })
427
+ * ```
428
+ * @example Advanced example
429
+ * ```typescript
430
+ * await algorand.createTransaction.appCall({
431
+ * sender: 'CREATORADDRESS',
432
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
433
+ * args: [new Uint8Array(1, 2, 3, 4)]
434
+ * accountReferences: ["ACCOUNT_1"]
435
+ * appReferences: [123n, 1234n]
436
+ * assetReferences: [12345n]
437
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
438
+ * accessReferences: [{ appId: 1234n }]
439
+ * lease: 'lease',
440
+ * note: 'note',
441
+ * // You wouldn't normally set this field
442
+ * firstValidRound: 1000n,
443
+ * validityWindow: 10,
444
+ * extraFee: (1000).microAlgo(),
445
+ * staticFee: (1000).microAlgo(),
446
+ * // Max fee doesn't make sense with extraFee AND staticFee
447
+ * // already specified, but here for completeness
448
+ * maxFee: (3000).microAlgo(),
449
+ * rejectVersion: 1,
450
+ *})
451
+ * ```
452
+ * @returns The application call transaction
453
+ */
454
+ appCall = this._transaction((c) => c.addAppCall);
455
+ /** Create an application create call with ABI method call transaction.
456
+ *
457
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
458
+ *
459
+ * @param params The parameters for the app creation transaction
460
+ * @example Basic example
461
+ * ```typescript
462
+ * const method = new ABIMethod({
463
+ * name: 'method',
464
+ * args: [{ name: 'arg1', type: 'string' }],
465
+ * returns: { type: 'string' },
466
+ * })
467
+ * await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
468
+ * ```
469
+ * @example Advanced example
470
+ * ```typescript
471
+ * const method = new ABIMethod({
472
+ * name: 'method',
473
+ * args: [{ name: 'arg1', type: 'string' }],
474
+ * returns: { type: 'string' },
475
+ * })
476
+ * await algorand.createTransaction.appCreateMethodCall({
477
+ * sender: 'CREATORADDRESS',
478
+ * method: method,
479
+ * args: ["arg1_value"],
480
+ * approvalProgram: "TEALCODE",
481
+ * clearStateProgram: "TEALCODE",
482
+ * schema: {
483
+ * globalInts: 1,
484
+ * globalByteSlices: 2,
485
+ * localInts: 3,
486
+ * localByteSlices: 4
487
+ * },
488
+ * extraProgramPages: 1,
489
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
490
+ * args: [new Uint8Array(1, 2, 3, 4)]
491
+ * accountReferences: ["ACCOUNT_1"]
492
+ * appReferences: [123n, 1234n]
493
+ * assetReferences: [12345n]
494
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
495
+ * accessReferences: [{ appId: 1234n }]
496
+ * lease: 'lease',
497
+ * note: 'note',
498
+ * // You wouldn't normally set this field
499
+ * firstValidRound: 1000n,
500
+ * validityWindow: 10,
501
+ * extraFee: (1000).microAlgo(),
502
+ * staticFee: (1000).microAlgo(),
503
+ * // Max fee doesn't make sense with extraFee AND staticFee
504
+ * // already specified, but here for completeness
505
+ * maxFee: (3000).microAlgo(),
506
+ * rejectVersion: 1,
507
+ *})
508
+ * ```
509
+ * @returns The application ABI method create transaction
510
+ */
511
+ appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall);
512
+ /** Create an application update call with ABI method call transaction.
513
+ *
514
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
515
+ *
516
+ * @param params The parameters for the app update transaction
517
+ * @example Basic example
518
+ * ```typescript
519
+ * const method = new ABIMethod({
520
+ * name: 'method',
521
+ * args: [{ name: 'arg1', type: 'string' }],
522
+ * returns: { type: 'string' },
523
+ * })
524
+ * await algorand.createTransaction.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
525
+ * ```
526
+ * @example Advanced example
527
+ * ```typescript
528
+ * const method = new ABIMethod({
529
+ * name: 'method',
530
+ * args: [{ name: 'arg1', type: 'string' }],
531
+ * returns: { type: 'string' },
532
+ * })
533
+ * await algorand.createTransaction.appUpdateMethodCall({
534
+ * sender: 'CREATORADDRESS',
535
+ * method: method,
536
+ * args: ["arg1_value"],
537
+ * approvalProgram: "TEALCODE",
538
+ * clearStateProgram: "TEALCODE",
539
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
540
+ * args: [new Uint8Array(1, 2, 3, 4)]
541
+ * accountReferences: ["ACCOUNT_1"]
542
+ * appReferences: [123n, 1234n]
543
+ * assetReferences: [12345n]
544
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
545
+ * accessReferences: [{ appId: 1234n }]
546
+ * lease: 'lease',
547
+ * note: 'note',
548
+ * // You wouldn't normally set this field
549
+ * firstValidRound: 1000n,
550
+ * validityWindow: 10,
551
+ * extraFee: (1000).microAlgo(),
552
+ * staticFee: (1000).microAlgo(),
553
+ * // Max fee doesn't make sense with extraFee AND staticFee
554
+ * // already specified, but here for completeness
555
+ * maxFee: (3000).microAlgo(),
556
+ * rejectVersion: 1,
557
+ *})
558
+ * ```
559
+ * @returns The application ABI method update transaction
560
+ */
561
+ appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall);
562
+ /** Create an application delete call with ABI method call transaction.
563
+ *
564
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
565
+ *
566
+ * @param params The parameters for the app deletion transaction
567
+ * @example Basic example
568
+ * ```typescript
569
+ * const method = new ABIMethod({
570
+ * name: 'method',
571
+ * args: [{ name: 'arg1', type: 'string' }],
572
+ * returns: { type: 'string' },
573
+ * })
574
+ * await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
575
+ * ```
576
+ * @example Advanced example
577
+ * ```typescript
578
+ * const method = new ABIMethod({
579
+ * name: 'method',
580
+ * args: [{ name: 'arg1', type: 'string' }],
581
+ * returns: { type: 'string' },
582
+ * })
583
+ * await algorand.createTransaction.appDeleteMethodCall({
584
+ * sender: 'CREATORADDRESS',
585
+ * method: method,
586
+ * args: ["arg1_value"],
587
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
588
+ * args: [new Uint8Array(1, 2, 3, 4)]
589
+ * accountReferences: ["ACCOUNT_1"]
590
+ * appReferences: [123n, 1234n]
591
+ * assetReferences: [12345n]
592
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
593
+ * accessReferences: [{ appId: 1234n }]
594
+ * lease: 'lease',
595
+ * note: 'note',
596
+ * // You wouldn't normally set this field
597
+ * firstValidRound: 1000n,
598
+ * validityWindow: 10,
599
+ * extraFee: (1000).microAlgo(),
600
+ * staticFee: (1000).microAlgo(),
601
+ * // Max fee doesn't make sense with extraFee AND staticFee
602
+ * // already specified, but here for completeness
603
+ * maxFee: (3000).microAlgo(),
604
+ * rejectVersion: 1,
605
+ *})
606
+ * ```
607
+ * @returns The application ABI method delete transaction
608
+ */
609
+ appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall);
610
+ /** Create an application call with ABI method call transaction.
611
+ *
612
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
613
+ *
614
+ * @param params The parameters for the app call transaction
615
+ * @example Basic example
616
+ * ```typescript
617
+ * const method = new ABIMethod({
618
+ * name: 'method',
619
+ * args: [{ name: 'arg1', type: 'string' }],
620
+ * returns: { type: 'string' },
621
+ * })
622
+ * await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
623
+ * ```
624
+ * @example Advanced example
625
+ * ```typescript
626
+ * const method = new ABIMethod({
627
+ * name: 'method',
628
+ * args: [{ name: 'arg1', type: 'string' }],
629
+ * returns: { type: 'string' },
630
+ * })
631
+ * await algorand.createTransaction.appCallMethodCall({
632
+ * sender: 'CREATORADDRESS',
633
+ * method: method,
634
+ * args: ["arg1_value"],
635
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
636
+ * args: [new Uint8Array(1, 2, 3, 4)]
637
+ * accountReferences: ["ACCOUNT_1"]
638
+ * appReferences: [123n, 1234n]
639
+ * assetReferences: [12345n]
640
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
641
+ * accessReferences: [{ appId: 1234n }]
642
+ * lease: 'lease',
643
+ * note: 'note',
644
+ * // You wouldn't normally set this field
645
+ * firstValidRound: 1000n,
646
+ * validityWindow: 10,
647
+ * extraFee: (1000).microAlgo(),
648
+ * staticFee: (1000).microAlgo(),
649
+ * // Max fee doesn't make sense with extraFee AND staticFee
650
+ * // already specified, but here for completeness
651
+ * maxFee: (3000).microAlgo(),
652
+ * rejectVersion: 1,
653
+ *})
654
+ * ```
655
+ * @returns The application ABI method call transaction
656
+ */
657
+ appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall);
658
+ /**
659
+ * Create an online key registration transaction.
660
+ * @param params The parameters for the key registration transaction
661
+ * @example Basic example
662
+ * ```typescript
663
+ * await algorand.createTransaction.onlineKeyRegistration({
664
+ * sender: 'SENDERADDRESS',
665
+ * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
666
+ * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
667
+ * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
668
+ * voteFirst: 1n,
669
+ * voteLast: 1000n,
670
+ * voteKeyDilution: 1n,
671
+ * })
672
+ * ```
673
+ * @example Advanced example
674
+ * ```typescript
675
+ * await algorand.createTransaction.onlineKeyRegistration({
676
+ * sender: 'SENDERADDRESS',
677
+ * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
678
+ * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
679
+ * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
680
+ * voteFirst: 1n,
681
+ * voteLast: 1000n,
682
+ * voteKeyDilution: 1n,
683
+ * lease: 'lease',
684
+ * note: 'note',
685
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
686
+ * rekeyTo: 'REKEYTOADDRESS',
687
+ * // You wouldn't normally set this field
688
+ * firstValidRound: 1000n,
689
+ * validityWindow: 10,
690
+ * extraFee: (1000).microAlgo(),
691
+ * staticFee: (1000).microAlgo(),
692
+ * // Max fee doesn't make sense with extraFee AND staticFee
693
+ * // already specified, but here for completeness
694
+ * maxFee: (3000).microAlgo(),
695
+ * })
696
+ * ```
697
+ * @returns The online key registration transaction
698
+ */
699
+ onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration);
700
+ /**
701
+ * Create an offline key registration transaction.
702
+ * @param params The parameters for the key registration transaction
703
+ * @example Basic example
704
+ * ```typescript
705
+ * await algorand.createTransaction.offlineKeyRegistration({
706
+ * sender: 'SENDERADDRESS',
707
+ * })
708
+ * ```
709
+ * @example Advanced example
710
+ * ```typescript
711
+ * await algorand.createTransaction.offlineKeyRegistration({
712
+ * sender: 'SENDERADDRESS',
713
+ * lease: 'lease',
714
+ * note: 'note',
715
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
716
+ * rekeyTo: 'REKEYTOADDRESS',
717
+ * // You wouldn't normally set this field
718
+ * firstValidRound: 1000n,
719
+ * validityWindow: 10,
720
+ * extraFee: (1000).microAlgo(),
721
+ * staticFee: (1000).microAlgo(),
722
+ * // Max fee doesn't make sense with extraFee AND staticFee
723
+ * // already specified, but here for completeness
724
+ * maxFee: (3000).microAlgo(),
725
+ * })
726
+ * ```
727
+ * @returns The offline key registration transaction
728
+ */
729
+ offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration);
730
+ };
731
+ //#endregion
723
732
  export { AlgorandClientTransactionCreator };
724
- //# sourceMappingURL=algorand-client-transaction-creator.mjs.map
733
+
734
+ //# sourceMappingURL=algorand-client-transaction-creator.mjs.map