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

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