@algorandfoundation/algokit-utils 10.0.0-alpha.31 → 10.0.0-alpha.32

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 (318) hide show
  1. package/account-manager.d.ts +448 -0
  2. package/account-manager.js +623 -0
  3. package/account-manager.js.map +1 -0
  4. package/account-manager.mjs +620 -0
  5. package/account-manager.mjs.map +1 -0
  6. package/account.d.ts +156 -0
  7. package/account.js +10 -0
  8. package/account.js.map +1 -0
  9. package/account.mjs +9 -0
  10. package/account.mjs.map +1 -0
  11. package/algorand-client-transaction-creator.d.ts +1103 -0
  12. package/algorand-client-transaction-creator.js +735 -0
  13. package/algorand-client-transaction-creator.js.map +1 -0
  14. package/algorand-client-transaction-creator.mjs +734 -0
  15. package/algorand-client-transaction-creator.mjs.map +1 -0
  16. package/algorand-client-transaction-sender.d.ts +1317 -0
  17. package/algorand-client-transaction-sender.js +933 -0
  18. package/algorand-client-transaction-sender.js.map +1 -0
  19. package/algorand-client-transaction-sender.mjs +932 -0
  20. package/algorand-client-transaction-sender.mjs.map +1 -0
  21. package/algorand-client.d.ts +246 -0
  22. package/algorand-client.js +325 -0
  23. package/algorand-client.js.map +1 -0
  24. package/algorand-client.mjs +325 -0
  25. package/algorand-client.mjs.map +1 -0
  26. package/amount.d.ts +46 -3
  27. package/amount.js +92 -13
  28. package/amount.js.map +1 -1
  29. package/amount.mjs +80 -3
  30. package/amount.mjs.map +1 -1
  31. package/app-client.d.ts +2130 -0
  32. package/app-client.js +909 -0
  33. package/app-client.js.map +1 -0
  34. package/app-client.mjs +908 -0
  35. package/app-client.mjs.map +1 -0
  36. package/app-deployer.d.ts +166 -0
  37. package/app-deployer.js +353 -0
  38. package/app-deployer.js.map +1 -0
  39. package/app-deployer.mjs +353 -0
  40. package/app-deployer.mjs.map +1 -0
  41. package/app-factory.d.ts +965 -0
  42. package/app-factory.js +448 -0
  43. package/app-factory.js.map +1 -0
  44. package/app-factory.mjs +448 -0
  45. package/app-factory.mjs.map +1 -0
  46. package/app-manager.d.ts +323 -0
  47. package/app-manager.js +468 -0
  48. package/app-manager.js.map +1 -0
  49. package/app-manager.mjs +468 -0
  50. package/app-manager.mjs.map +1 -0
  51. package/app-spec.d.ts +203 -0
  52. package/app-spec.js +137 -0
  53. package/app-spec.js.map +1 -0
  54. package/app-spec.mjs +137 -0
  55. package/app-spec.mjs.map +1 -0
  56. package/app.d.ts +257 -0
  57. package/app.js +49 -0
  58. package/app.js.map +1 -0
  59. package/app.mjs +42 -0
  60. package/app.mjs.map +1 -0
  61. package/asset-manager.d.ts +212 -0
  62. package/asset-manager.js +166 -0
  63. package/asset-manager.js.map +1 -0
  64. package/asset-manager.mjs +166 -0
  65. package/asset-manager.mjs.map +1 -0
  66. package/async-event-emitter.d.ts +16 -0
  67. package/async-event-emitter.js +38 -0
  68. package/async-event-emitter.js.map +1 -0
  69. package/async-event-emitter.mjs +37 -0
  70. package/async-event-emitter.mjs.map +1 -0
  71. package/client-manager.d.ts +475 -0
  72. package/client-manager.js +616 -0
  73. package/client-manager.js.map +1 -0
  74. package/client-manager.mjs +616 -0
  75. package/client-manager.mjs.map +1 -0
  76. package/composer.d.ts +947 -0
  77. package/composer.js +1584 -0
  78. package/composer.js.map +1 -0
  79. package/composer.mjs +1583 -0
  80. package/composer.mjs.map +1 -0
  81. package/config.d.ts +1 -1
  82. package/config.js +2 -2
  83. package/config.js.map +1 -1
  84. package/config.mjs +1 -1
  85. package/config.mjs.map +1 -1
  86. package/debugging.d.ts +47 -0
  87. package/debugging.js +20 -0
  88. package/debugging.js.map +1 -0
  89. package/debugging.mjs +15 -0
  90. package/debugging.mjs.map +1 -0
  91. package/dispenser-client.d.ts +90 -0
  92. package/dispenser-client.js +127 -0
  93. package/dispenser-client.js.map +1 -0
  94. package/dispenser-client.mjs +127 -0
  95. package/dispenser-client.mjs.map +1 -0
  96. package/expand.d.ts +2 -0
  97. package/expand.js +0 -0
  98. package/expand.mjs +0 -0
  99. package/index.d.ts +6 -5
  100. package/index.js +4 -3
  101. package/index.mjs +5 -5
  102. package/indexer-client/indexer-lookup.d.ts +1 -1
  103. package/indexer-client/indexer-lookup.js.map +1 -1
  104. package/indexer-client/indexer-lookup.mjs.map +1 -1
  105. package/indexer.d.ts +40 -0
  106. package/indexer.js +38 -0
  107. package/indexer.js.map +1 -0
  108. package/indexer.mjs +35 -0
  109. package/indexer.mjs.map +1 -0
  110. package/instance-of.d.ts +8 -0
  111. package/kmd-account-manager.d.ts +74 -0
  112. package/kmd-account-manager.js +167 -0
  113. package/kmd-account-manager.js.map +1 -0
  114. package/kmd-account-manager.mjs +165 -0
  115. package/kmd-account-manager.mjs.map +1 -0
  116. package/lifecycle-events.d.ts +14 -0
  117. package/lifecycle-events.js +11 -0
  118. package/lifecycle-events.js.map +1 -0
  119. package/lifecycle-events.mjs +10 -0
  120. package/lifecycle-events.mjs.map +1 -0
  121. package/logging.d.ts +13 -0
  122. package/logging.js +47 -0
  123. package/logging.js.map +1 -0
  124. package/logging.mjs +42 -0
  125. package/logging.mjs.map +1 -0
  126. package/logic-error.d.ts +39 -0
  127. package/logic-error.js +54 -0
  128. package/logic-error.js.map +1 -0
  129. package/logic-error.mjs +53 -0
  130. package/logic-error.mjs.map +1 -0
  131. package/network-client.d.ts +43 -0
  132. package/network-client.js +14 -0
  133. package/network-client.js.map +1 -0
  134. package/network-client.mjs +13 -0
  135. package/network-client.mjs.map +1 -0
  136. package/package.json +11 -1
  137. package/testing/account.d.ts +2 -2
  138. package/testing/account.js +1 -1
  139. package/testing/account.js.map +1 -1
  140. package/testing/account.mjs +1 -1
  141. package/testing/account.mjs.map +1 -1
  142. package/testing/fixtures/algokit-log-capture-fixture.d.ts +1 -1
  143. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  144. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  145. package/testing/fixtures/algorand-fixture.d.ts +2 -2
  146. package/testing/fixtures/algorand-fixture.js +2 -2
  147. package/testing/fixtures/algorand-fixture.js.map +1 -1
  148. package/testing/fixtures/algorand-fixture.mjs +2 -2
  149. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  150. package/testing/index.d.ts +2 -1
  151. package/testing/test-logger.d.ts +1 -1
  152. package/testing/test-logger.js.map +1 -1
  153. package/testing/test-logger.mjs.map +1 -1
  154. package/testing/types.d.ts +156 -0
  155. package/transaction/index.d.ts +4 -0
  156. package/transaction/index.js +9 -0
  157. package/transaction/index.mjs +4 -0
  158. package/transaction/perform-transaction-composer-simulate.d.ts +1 -1
  159. package/transaction/perform-transaction-composer-simulate.js.map +1 -1
  160. package/transaction/perform-transaction-composer-simulate.mjs.map +1 -1
  161. package/transaction/transaction.d.ts +2 -2
  162. package/transaction/transaction.js.map +1 -1
  163. package/transaction/transaction.mjs.map +1 -1
  164. package/transaction/types.d.ts +133 -0
  165. package/transactions/app-call.d.ts +1 -1
  166. package/transactions/app-call.js +1 -1
  167. package/transactions/app-call.js.map +1 -1
  168. package/transactions/app-call.mjs +1 -1
  169. package/transactions/app-call.mjs.map +1 -1
  170. package/transactions/common.d.ts +1 -1
  171. package/transactions/common.js.map +1 -1
  172. package/transactions/common.mjs.map +1 -1
  173. package/transactions/method-call.d.ts +1 -1
  174. package/transactions/method-call.js +1 -1
  175. package/transactions/method-call.js.map +1 -1
  176. package/transactions/method-call.mjs +1 -1
  177. package/transactions/method-call.mjs.map +1 -1
  178. package/transactions/payment.d.ts +1 -1
  179. package/transactions/payment.js.map +1 -1
  180. package/transactions/payment.mjs.map +1 -1
  181. package/types/account-manager.d.ts +11 -442
  182. package/types/account-manager.js +5 -616
  183. package/types/account-manager.js.map +1 -1
  184. package/types/account-manager.mjs +5 -614
  185. package/types/account-manager.mjs.map +1 -1
  186. package/types/account.d.ts +8 -150
  187. package/types/account.js +3 -4
  188. package/types/account.js.map +1 -1
  189. package/types/account.mjs +4 -4
  190. package/types/account.mjs.map +1 -1
  191. package/types/algorand-client-transaction-creator.d.ts +5 -1098
  192. package/types/algorand-client-transaction-creator.js +3 -729
  193. package/types/algorand-client-transaction-creator.js.map +1 -1
  194. package/types/algorand-client-transaction-creator.mjs +4 -729
  195. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  196. package/types/algorand-client-transaction-sender.d.ts +5 -1312
  197. package/types/algorand-client-transaction-sender.js +3 -927
  198. package/types/algorand-client-transaction-sender.js.map +1 -1
  199. package/types/algorand-client-transaction-sender.mjs +3 -926
  200. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  201. package/types/algorand-client.d.ts +5 -241
  202. package/types/algorand-client.js +3 -319
  203. package/types/algorand-client.js.map +1 -1
  204. package/types/algorand-client.mjs +3 -319
  205. package/types/algorand-client.mjs.map +1 -1
  206. package/types/amount.d.ts +6 -45
  207. package/types/amount.js +3 -79
  208. package/types/amount.js.map +1 -1
  209. package/types/amount.mjs +4 -79
  210. package/types/amount.mjs.map +1 -1
  211. package/types/app-client.d.ts +75 -2125
  212. package/types/app-client.js +3 -903
  213. package/types/app-client.js.map +1 -1
  214. package/types/app-client.mjs +3 -902
  215. package/types/app-client.mjs.map +1 -1
  216. package/types/app-deployer.d.ts +21 -161
  217. package/types/app-deployer.js +3 -347
  218. package/types/app-deployer.js.map +1 -1
  219. package/types/app-deployer.mjs +3 -347
  220. package/types/app-deployer.mjs.map +1 -1
  221. package/types/app-factory.d.ts +21 -960
  222. package/types/app-factory.js +3 -442
  223. package/types/app-factory.js.map +1 -1
  224. package/types/app-factory.mjs +3 -442
  225. package/types/app-factory.mjs.map +1 -1
  226. package/types/app-manager.d.ts +15 -318
  227. package/types/app-manager.js +3 -462
  228. package/types/app-manager.js.map +1 -1
  229. package/types/app-manager.mjs +3 -462
  230. package/types/app-manager.mjs.map +1 -1
  231. package/types/app-spec.d.ts +39 -198
  232. package/types/app-spec.js +3 -131
  233. package/types/app-spec.js.map +1 -1
  234. package/types/app-spec.mjs +3 -131
  235. package/types/app-spec.mjs.map +1 -1
  236. package/types/app.d.ts +62 -247
  237. package/types/app.js +15 -37
  238. package/types/app.js.map +1 -1
  239. package/types/app.mjs +16 -37
  240. package/types/app.mjs.map +1 -1
  241. package/types/asset-manager.d.ts +9 -207
  242. package/types/asset-manager.js +3 -160
  243. package/types/asset-manager.js.map +1 -1
  244. package/types/asset-manager.mjs +3 -160
  245. package/types/asset-manager.mjs.map +1 -1
  246. package/types/async-event-emitter.d.ts +7 -11
  247. package/types/async-event-emitter.js +3 -32
  248. package/types/async-event-emitter.js.map +1 -1
  249. package/types/async-event-emitter.mjs +4 -32
  250. package/types/async-event-emitter.mjs.map +1 -1
  251. package/types/client-manager.d.ts +27 -470
  252. package/types/client-manager.js +3 -610
  253. package/types/client-manager.js.map +1 -1
  254. package/types/client-manager.mjs +3 -610
  255. package/types/client-manager.mjs.map +1 -1
  256. package/types/composer.d.ts +79 -943
  257. package/types/composer.js +3 -1578
  258. package/types/composer.js.map +1 -1
  259. package/types/composer.mjs +3 -1577
  260. package/types/composer.mjs.map +1 -1
  261. package/types/config.d.ts +7 -52
  262. package/types/config.js +3 -74
  263. package/types/config.js.map +1 -1
  264. package/types/config.mjs +3 -74
  265. package/types/config.mjs.map +1 -1
  266. package/types/debugging.d.ts +12 -37
  267. package/types/debugging.js +11 -10
  268. package/types/debugging.js.map +1 -1
  269. package/types/debugging.mjs +12 -10
  270. package/types/debugging.mjs.map +1 -1
  271. package/types/dispenser-client.d.ts +11 -85
  272. package/types/dispenser-client.js +3 -121
  273. package/types/dispenser-client.js.map +1 -1
  274. package/types/dispenser-client.mjs +3 -121
  275. package/types/dispenser-client.mjs.map +1 -1
  276. package/types/expand.d.ts +8 -2
  277. package/types/indexer.d.ts +16 -36
  278. package/types/indexer.js +7 -30
  279. package/types/indexer.js.map +1 -1
  280. package/types/indexer.mjs +8 -30
  281. package/types/indexer.mjs.map +1 -1
  282. package/types/instance-of.d.ts +4 -4
  283. package/types/kmd-account-manager.d.ts +5 -69
  284. package/types/kmd-account-manager.js +3 -161
  285. package/types/kmd-account-manager.js.map +1 -1
  286. package/types/kmd-account-manager.mjs +3 -159
  287. package/types/kmd-account-manager.mjs.map +1 -1
  288. package/types/lifecycle-events.d.ts +7 -9
  289. package/types/lifecycle-events.js +3 -5
  290. package/types/lifecycle-events.js.map +1 -1
  291. package/types/lifecycle-events.mjs +4 -5
  292. package/types/lifecycle-events.mjs.map +1 -1
  293. package/types/logging.d.ts +14 -9
  294. package/types/logging.js +11 -37
  295. package/types/logging.js.map +1 -1
  296. package/types/logging.mjs +12 -37
  297. package/types/logging.mjs.map +1 -1
  298. package/types/logic-error.d.ts +8 -35
  299. package/types/logic-error.js +3 -48
  300. package/types/logic-error.js.map +1 -1
  301. package/types/logic-error.mjs +4 -48
  302. package/types/logic-error.mjs.map +1 -1
  303. package/types/network-client.d.ts +10 -39
  304. package/types/network-client.js +3 -8
  305. package/types/network-client.js.map +1 -1
  306. package/types/network-client.mjs +4 -8
  307. package/types/network-client.mjs.map +1 -1
  308. package/types/testing.d.ts +13 -151
  309. package/types/transaction.d.ts +33 -128
  310. package/updatable-config.d.ts +57 -0
  311. package/updatable-config.js +80 -0
  312. package/updatable-config.js.map +1 -0
  313. package/updatable-config.mjs +80 -0
  314. package/updatable-config.mjs.map +1 -0
  315. package/util.js +1 -1
  316. package/util.js.map +1 -1
  317. package/util.mjs +1 -1
  318. package/util.mjs.map +1 -1
@@ -1,931 +1,8 @@
1
- import { getAddress, getApplicationAddress } from "../packages/common/src/address.mjs";
2
- import { Config } from "../config.mjs";
3
- import { asJson, defaultJsonValueReplacer } from "../util.mjs";
4
- import { AppManager } from "./app-manager.mjs";
5
- import { Buffer } from "buffer";
1
+ import { AlgorandClientTransactionSender as AlgorandClientTransactionSender$1 } from "../algorand-client-transaction-sender.mjs";
6
2
 
7
3
  //#region src/types/algorand-client-transaction-sender.ts
8
- const getMethodCallForLog = ({ method, args }) => {
9
- return `${method.name}(${(args ?? []).map((a) => typeof a === "object" ? asJson(a, (k, v) => {
10
- const newV = defaultJsonValueReplacer(k, v);
11
- return newV instanceof Uint8Array ? Buffer.from(newV).toString("base64") : newV;
12
- }) : a)})`;
13
- };
14
- /** Orchestrates sending transactions for `AlgorandClient`. */
15
- var AlgorandClientTransactionSender = class {
16
- _newGroup;
17
- _assetManager;
18
- _appManager;
19
- /**
20
- * Creates a new `AlgorandClientSender`
21
- * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
22
- * @param assetManager An `AssetManager` instance
23
- * @param appManager An `AppManager` instance
24
- * @example
25
- * ```typescript
26
- * const transactionSender = new AlgorandClientTransactionSender(() => new TransactionComposer(), assetManager, appManager)
27
- * ```
28
- */
29
- constructor(newGroup, assetManager, appManager) {
30
- this._newGroup = newGroup;
31
- this._assetManager = assetManager;
32
- this._appManager = appManager;
33
- }
34
- /**
35
- * Start a new `TransactionComposer` transaction group
36
- * @returns A new instance of `TransactionComposer`.
37
- * @example
38
- * const composer = AlgorandClient.mainNet().send.newGroup();
39
- * const result = await composer.addTransaction(payment).send()
40
- */
41
- newGroup() {
42
- return this._newGroup();
43
- }
44
- _send(c, log) {
45
- return async (params) => {
46
- const composer = this._newGroup();
47
- c(composer).apply(composer, [params]);
48
- if (log?.preLog) {
49
- const transaction = (await composer.build()).transactions.at(-1).txn;
50
- Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction));
51
- }
52
- const rawResult = await composer.send(params);
53
- const result = {
54
- transaction: rawResult.transactions.at(-1),
55
- confirmation: rawResult.confirmations.at(-1),
56
- txId: rawResult.txIds.at(-1),
57
- ...rawResult
58
- };
59
- if (log?.postLog) Config.getLogger(params?.suppressLog).debug(log.postLog(params, result));
60
- return result;
61
- };
62
- }
63
- _sendAppCall(c, log) {
64
- return async (params) => {
65
- const result = await this._send(c, log)(params);
66
- return {
67
- ...result,
68
- return: AppManager.getABIReturn(result.confirmation, "method" in params ? params.method : void 0)
69
- };
70
- };
71
- }
72
- _sendAppUpdateCall(c, log) {
73
- return async (params) => {
74
- const result = await this._sendAppCall(c, log)(params);
75
- const compiledApproval = typeof params.approvalProgram === "string" ? this._appManager.getCompilationResult(params.approvalProgram) : void 0;
76
- const compiledClear = typeof params.clearStateProgram === "string" ? this._appManager.getCompilationResult(params.clearStateProgram) : void 0;
77
- return {
78
- ...result,
79
- compiledApproval,
80
- compiledClear
81
- };
82
- };
83
- }
84
- _sendAppCreateCall(c, log) {
85
- return async (params) => {
86
- const result = await this._sendAppUpdateCall(c, log)(params);
87
- return {
88
- ...result,
89
- appId: BigInt(result.confirmation.appId),
90
- appAddress: getApplicationAddress(result.confirmation.appId)
91
- };
92
- };
93
- }
94
- /**
95
- * Send a payment transaction to transfer Algo between accounts.
96
- * @param params The parameters for the payment transaction
97
- * @example Basic example
98
- * ```typescript
99
- * const result = await algorand.send.payment({
100
- * sender: 'SENDERADDRESS',
101
- * receiver: 'RECEIVERADDRESS',
102
- * amount: (4).algo(),
103
- * })
104
- * ```
105
- * @example Advanced example
106
- * ```typescript
107
- * const result = await algorand.send.payment({
108
- * amount: (4).algo(),
109
- * receiver: 'RECEIVERADDRESS',
110
- * sender: 'SENDERADDRESS',
111
- * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
112
- * lease: 'lease',
113
- * note: 'note',
114
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
115
- * rekeyTo: 'REKEYTOADDRESS',
116
- * // You wouldn't normally set this field
117
- * firstValidRound: 1000n,
118
- * validityWindow: 10,
119
- * extraFee: (1000).microAlgo(),
120
- * staticFee: (1000).microAlgo(),
121
- * // Max fee doesn't make sense with extraFee AND staticFee
122
- * // already specified, but here for completeness
123
- * maxFee: (3000).microAlgo(),
124
- * // Signer only needed if you want to provide one,
125
- * // generally you'd register it with AlgorandClient
126
- * // against the sender and not need to pass it in
127
- * signer: transactionSigner,
128
- * maxRoundsToWaitForConfirmation: 5,
129
- * suppressLog: true,
130
- * })
131
- * ```
132
- * @returns The result of the payment transaction and the transaction that was sent
133
- */
134
- payment = this._send((c) => c.addPayment, { preLog: (params, transaction) => `Sending ${params.amount.microAlgo} µALGO from ${params.sender} to ${params.receiver} via transaction ${transaction.txId()}` });
135
- /**
136
- * Create a new Algorand Standard Asset.
137
- *
138
- * The account that sends this transaction will automatically be
139
- * opted in to the asset and will hold all units after creation.
140
- *
141
- * @param params The parameters for the asset creation transaction
142
- *
143
- * @example Basic example
144
- * ```typescript
145
- * await algorand.send.assetCreate({ sender: "CREATORADDRESS", total: 100n})
146
- * ```
147
- * @example Advanced example
148
- * ```typescript
149
- * await algorand.send.assetCreate({
150
- * sender: 'CREATORADDRESS',
151
- * total: 100n,
152
- * decimals: 2,
153
- * assetName: 'asset',
154
- * unitName: 'unit',
155
- * url: 'url',
156
- * metadataHash: 'metadataHash',
157
- * defaultFrozen: false,
158
- * manager: 'MANAGERADDRESS',
159
- * reserve: 'RESERVEADDRESS',
160
- * freeze: 'FREEZEADDRESS',
161
- * clawback: 'CLAWBACKADDRESS',
162
- * lease: 'lease',
163
- * note: 'note',
164
- * // You wouldn't normally set this field
165
- * firstValidRound: 1000n,
166
- * validityWindow: 10,
167
- * extraFee: (1000).microAlgo(),
168
- * staticFee: (1000).microAlgo(),
169
- * // Max fee doesn't make sense with extraFee AND staticFee
170
- * // already specified, but here for completeness
171
- * maxFee: (3000).microAlgo(),
172
- * // Signer only needed if you want to provide one,
173
- * // generally you'd register it with AlgorandClient
174
- * // against the sender and not need to pass it in
175
- * signer: transactionSigner,
176
- * maxRoundsToWaitForConfirmation: 5,
177
- * suppressLog: true,
178
- * })
179
- * ```
180
- * @returns The result of the asset create transaction and the transaction that was sent
181
- */
182
- assetCreate = async (params) => {
183
- const result = await this._send((c) => c.addAssetCreate, { postLog: (params$1, result$1) => `Created asset${params$1.assetName ? ` ${params$1.assetName}` : ""}${params$1.unitName ? ` (${params$1.unitName})` : ""} with ${params$1.total} units and ${params$1.decimals ?? 0} decimals created by ${params$1.sender} with ID ${result$1.confirmation.assetId} via transaction ${result$1.txIds.at(-1)}` })(params);
184
- return {
185
- ...result,
186
- assetId: BigInt(result.confirmation.assetId ?? 0)
187
- };
188
- };
189
- /**
190
- * Configure an existing Algorand Standard Asset.
191
- *
192
- * **Note:** The manager, reserve, freeze, and clawback addresses
193
- * are immutably empty if they are not set. If manager is not set then
194
- * all fields are immutable from that point forward.
195
- *
196
- * @param params The parameters for the asset config transaction
197
- *
198
- * @example Basic example
199
- * ```typescript
200
- * await algorand.send.assetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
201
- * ```
202
- * @example Advanced example
203
- * ```typescript
204
- * await algorand.send.assetConfig({
205
- * sender: 'MANAGERADDRESS',
206
- * assetId: 123456n,
207
- * manager: 'MANAGERADDRESS',
208
- * reserve: 'RESERVEADDRESS',
209
- * freeze: 'FREEZEADDRESS',
210
- * clawback: 'CLAWBACKADDRESS',
211
- * lease: 'lease',
212
- * note: 'note',
213
- * // You wouldn't normally set this field
214
- * firstValidRound: 1000n,
215
- * validityWindow: 10,
216
- * extraFee: (1000).microAlgo(),
217
- * staticFee: (1000).microAlgo(),
218
- * // Max fee doesn't make sense with extraFee AND staticFee
219
- * // already specified, but here for completeness
220
- * maxFee: (3000).microAlgo(),
221
- * // Signer only needed if you want to provide one,
222
- * // generally you'd register it with AlgorandClient
223
- * // against the sender and not need to pass it in
224
- * signer: transactionSigner,
225
- * maxRoundsToWaitForConfirmation: 5,
226
- * suppressLog: true,
227
- * })
228
- * ```
229
- * @returns The result of the asset config transaction and the transaction that was sent
230
- */
231
- assetConfig = this._send((c) => c.addAssetConfig, { preLog: (params, transaction) => `Configuring asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
232
- /**
233
- * Freeze or unfreeze an Algorand Standard Asset for an account.
234
- *
235
- * @param params The parameters for the asset freeze transaction
236
- *
237
- * @example Basic example
238
- * ```typescript
239
- * await algorand.send.assetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
240
- * ```
241
- * @example Advanced example
242
- * ```typescript
243
- * await algorand.send.assetFreeze({
244
- * sender: 'MANAGERADDRESS',
245
- * assetId: 123456n,
246
- * account: 'ACCOUNTADDRESS',
247
- * frozen: true,
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
- * // Signer only needed if you want to provide one,
259
- * // generally you'd register it with AlgorandClient
260
- * // against the sender and not need to pass it in
261
- * signer: transactionSigner,
262
- * maxRoundsToWaitForConfirmation: 5,
263
- * suppressLog: true,
264
- * })
265
- * ```
266
- * @returns The result of the asset freeze transaction and the transaction that was sent
267
- */
268
- assetFreeze = this._send((c) => c.addAssetFreeze, { preLog: (params, transaction) => `Freezing asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
269
- /**
270
- * Destroys an Algorand Standard Asset.
271
- *
272
- * Created assets can be destroyed only by the asset manager account.
273
- * All of the assets must be owned by the creator of the asset before
274
- * the asset can be deleted.
275
- *
276
- * @param params The parameters for the asset destroy transaction
277
- *
278
- * @example Basic example
279
- * ```typescript
280
- * await algorand.send.assetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
281
- * ```
282
- * @example Advanced example
283
- * ```typescript
284
- * await algorand.send.assetDestroy({
285
- * sender: 'MANAGERADDRESS',
286
- * assetId: 123456n,
287
- * lease: 'lease',
288
- * note: 'note',
289
- * // You wouldn't normally set this field
290
- * firstValidRound: 1000n,
291
- * validityWindow: 10,
292
- * extraFee: (1000).microAlgo(),
293
- * staticFee: (1000).microAlgo(),
294
- * // Max fee doesn't make sense with extraFee AND staticFee
295
- * // already specified, but here for completeness
296
- * maxFee: (3000).microAlgo(),
297
- * // Signer only needed if you want to provide one,
298
- * // generally you'd register it with AlgorandClient
299
- * // against the sender and not need to pass it in
300
- * signer: transactionSigner,
301
- * maxRoundsToWaitForConfirmation: 5,
302
- * suppressLog: true,
303
- * })
304
- * ```
305
- * @returns The result of the asset destroy transaction and the transaction that was sent
306
- */
307
- assetDestroy = this._send((c) => c.addAssetDestroy, { preLog: (params, transaction) => `Destroying asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
308
- /**
309
- * Transfer an Algorand Standard Asset.
310
- *
311
- * @param params The parameters for the asset transfer transaction
312
- *
313
- * @example Basic example
314
- * ```typescript
315
- * await algorand.send.assetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
316
- * ```
317
- * @example Advanced example (with clawback)
318
- * ```typescript
319
- * await algorand.send.assetTransfer({
320
- * sender: 'CLAWBACKADDRESS',
321
- * assetId: 123456n,
322
- * amount: 1n,
323
- * receiver: 'RECEIVERADDRESS',
324
- * clawbackTarget: 'HOLDERADDRESS',
325
- * // This field needs to be used with caution
326
- * closeAssetTo: 'ADDRESSTOCLOSETO'
327
- * lease: 'lease',
328
- * note: 'note',
329
- * // You wouldn't normally set this field
330
- * firstValidRound: 1000n,
331
- * validityWindow: 10,
332
- * extraFee: (1000).microAlgo(),
333
- * staticFee: (1000).microAlgo(),
334
- * // Max fee doesn't make sense with extraFee AND staticFee
335
- * // already specified, but here for completeness
336
- * maxFee: (3000).microAlgo(),
337
- * // Signer only needed if you want to provide one,
338
- * // generally you'd register it with AlgorandClient
339
- * // against the sender and not need to pass it in
340
- * signer: transactionSigner,
341
- * maxRoundsToWaitForConfirmation: 5,
342
- * suppressLog: true,
343
- * })
344
- * ```
345
- * @returns The result of the asset transfer transaction and the transaction that was sent
346
- */
347
- assetTransfer = this._send((c) => c.addAssetTransfer, { preLog: (params, transaction) => `Transferring ${params.amount} units of asset with ID ${params.assetId} from ${params.sender} to ${params.receiver} via transaction ${transaction.txId()}` });
348
- /**
349
- * Opt an account into an Algorand Standard Asset.
350
- *
351
- * @param params The parameters for the asset opt-in transaction
352
- *
353
- * @example Basic example
354
- * ```typescript
355
- * await algorand.send.assetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
356
- * ```
357
- * @example Advanced example
358
- * ```typescript
359
- * await algorand.send.assetOptIn({
360
- * sender: 'SENDERADDRESS',
361
- * assetId: 123456n,
362
- * lease: 'lease',
363
- * note: 'note',
364
- * // You wouldn't normally set this field
365
- * firstValidRound: 1000n,
366
- * validityWindow: 10,
367
- * extraFee: (1000).microAlgo(),
368
- * staticFee: (1000).microAlgo(),
369
- * // Max fee doesn't make sense with extraFee AND staticFee
370
- * // already specified, but here for completeness
371
- * maxFee: (3000).microAlgo(),
372
- * // Signer only needed if you want to provide one,
373
- * // generally you'd register it with AlgorandClient
374
- * // against the sender and not need to pass it in
375
- * signer: transactionSigner,
376
- * maxRoundsToWaitForConfirmation: 5,
377
- * suppressLog: true,
378
- * })
379
- * ```
380
- * @returns The result of the asset opt-in transaction and the transaction that was sent
381
- */
382
- assetOptIn = this._send((c) => c.addAssetOptIn, { preLog: (params, transaction) => `Opting in ${params.sender} to asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
383
- /**
384
- * Opt an account out of an Algorand Standard Asset.
385
- *
386
- * *Note:* If the account has a balance of the asset,
387
- * it will not be able to opt-out unless `ensureZeroBalance`
388
- * is set to `false` (but then the account will lose the assets).
389
- *
390
- * @param params The parameters for the asset opt-out transaction
391
- *
392
- * @example Basic example (without creator, will be retrieved from algod)
393
- * ```typescript
394
- * await algorand.send.assetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
395
- * ```
396
- * @example Basic example (with creator)
397
- * ```typescript
398
- * await algorand.send.assetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
399
- * ```
400
- * @example Advanced example
401
- * ```typescript
402
- * await algorand.send.assetOptOut({
403
- * sender: 'SENDERADDRESS',
404
- * assetId: 123456n,
405
- * creator: 'CREATORADDRESS',
406
- * ensureZeroBalance: true,
407
- * lease: 'lease',
408
- * note: 'note',
409
- * // You wouldn't normally set this field
410
- * firstValidRound: 1000n,
411
- * validityWindow: 10,
412
- * extraFee: (1000).microAlgo(),
413
- * staticFee: (1000).microAlgo(),
414
- * // Max fee doesn't make sense with extraFee AND staticFee
415
- * // already specified, but here for completeness
416
- * maxFee: (3000).microAlgo(),
417
- * // Signer only needed if you want to provide one,
418
- * // generally you'd register it with AlgorandClient
419
- * // against the sender and not need to pass it in
420
- * signer: transactionSigner,
421
- * maxRoundsToWaitForConfirmation: 5,
422
- * suppressLog: true,
423
- * })
424
- * ```
425
- * @returns The result of the asset opt-out transaction and the transaction that was sent
426
- */
427
- assetOptOut = async (params) => {
428
- if (params.ensureZeroBalance) {
429
- let balance = 0n;
430
- try {
431
- balance = (await this._assetManager.getAccountInformation(getAddress(params.sender), params.assetId)).balance;
432
- } catch {
433
- throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`);
434
- }
435
- if (balance !== 0n) throw new Error(`Account ${params.sender} does not have a zero balance for Asset ${params.assetId}; can't opt-out.`);
436
- }
437
- params.creator = params.creator ?? (await this._assetManager.getById(params.assetId)).creator;
438
- return await this._send((c) => c.addAssetOptOut, { preLog: (params$1, transaction) => `Opting ${params$1.sender} out of asset with ID ${params$1.assetId} to creator ${params$1.creator} via transaction ${transaction.txId()}` })(params);
439
- };
440
- /**
441
- * Create a smart contract.
442
- *
443
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
444
- *
445
- * @param params The parameters for the app creation transaction
446
- * @example Basic example
447
- * ```typescript
448
- * const result = await algorand.send.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
449
- * const createdAppId = result.appId
450
- * ```
451
- * @example Advanced example
452
- * ```typescript
453
- * await algorand.send.appCreate({
454
- * sender: 'CREATORADDRESS',
455
- * approvalProgram: "TEALCODE",
456
- * clearStateProgram: "TEALCODE",
457
- * schema: {
458
- * globalInts: 1,
459
- * globalByteSlices: 2,
460
- * localInts: 3,
461
- * localByteSlices: 4
462
- * },
463
- * extraProgramPages: 1,
464
- * onComplete: OnApplicationComplete.OptIn,
465
- * args: [new Uint8Array(1, 2, 3, 4)]
466
- * accountReferences: ["ACCOUNT_1"]
467
- * appReferences: [123n, 1234n]
468
- * assetReferences: [12345n]
469
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
470
- * accessReferences: [{ appId: 1234n }]
471
- * lease: 'lease',
472
- * note: 'note',
473
- * // You wouldn't normally set this field
474
- * firstValidRound: 1000n,
475
- * validityWindow: 10,
476
- * extraFee: (1000).microAlgo(),
477
- * staticFee: (1000).microAlgo(),
478
- * // Max fee doesn't make sense with extraFee AND staticFee
479
- * // already specified, but here for completeness
480
- * maxFee: (3000).microAlgo(),
481
- * rejectVersion: 1,
482
- * // Signer only needed if you want to provide one,
483
- * // generally you'd register it with AlgorandClient
484
- * // against the sender and not need to pass it in
485
- * signer: transactionSigner,
486
- * maxRoundsToWaitForConfirmation: 5,
487
- * suppressLog: true,
488
- *})
489
- * ```
490
- * @returns The result of the app create transaction and the transaction that was sent
491
- */
492
- appCreate = this._sendAppCreateCall((c) => c.addAppCreate, { postLog: (params, result) => `App created by ${params.sender} with ID ${result.confirmation.appId} via transaction ${result.txIds.at(-1)}` });
493
- /**
494
- * Update a smart contract.
495
- *
496
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
497
- *
498
- * @param params The parameters for the app update transaction
499
- * @example Basic example
500
- * ```typescript
501
- * await algorand.send.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
502
- * ```
503
- * @example Advanced example
504
- * ```typescript
505
- * await algorand.send.appUpdate({
506
- * sender: 'CREATORADDRESS',
507
- * approvalProgram: "TEALCODE",
508
- * clearStateProgram: "TEALCODE",
509
- * onComplete: OnApplicationComplete.UpdateApplication,
510
- * args: [new Uint8Array(1, 2, 3, 4)]
511
- * accountReferences: ["ACCOUNT_1"]
512
- * appReferences: [123n, 1234n]
513
- * assetReferences: [12345n]
514
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
515
- * accessReferences: [{ appId: 1234n }]
516
- * lease: 'lease',
517
- * note: 'note',
518
- * // You wouldn't normally set this field
519
- * firstValidRound: 1000n,
520
- * validityWindow: 10,
521
- * extraFee: (1000).microAlgo(),
522
- * staticFee: (1000).microAlgo(),
523
- * // Max fee doesn't make sense with extraFee AND staticFee
524
- * // already specified, but here for completeness
525
- * maxFee: (3000).microAlgo(),
526
- * rejectVersion: 1,
527
- * // Signer only needed if you want to provide one,
528
- * // generally you'd register it with AlgorandClient
529
- * // against the sender and not need to pass it in
530
- * signer: transactionSigner,
531
- * maxRoundsToWaitForConfirmation: 5,
532
- * suppressLog: true,
533
- *})
534
- * ```
535
- * @returns The result of the app update transaction and the transaction that was sent
536
- */
537
- appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, { postLog: (params, result) => `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString("base64"))}` : ""} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
538
- /**
539
- * Delete a smart contract.
540
- *
541
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
542
- *
543
- * @param params The parameters for the app deletion transaction
544
- * @example Basic example
545
- * ```typescript
546
- * await algorand.send.appDelete({ sender: 'CREATORADDRESS' })
547
- * ```
548
- * @example Advanced example
549
- * ```typescript
550
- * await algorand.send.appDelete({
551
- * sender: 'CREATORADDRESS',
552
- * onComplete: OnApplicationComplete.DeleteApplication,
553
- * args: [new Uint8Array(1, 2, 3, 4)]
554
- * accountReferences: ["ACCOUNT_1"]
555
- * appReferences: [123n, 1234n]
556
- * assetReferences: [12345n]
557
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
558
- * accessReferences: [{ appId: 1234n }]
559
- * lease: 'lease',
560
- * note: 'note',
561
- * // You wouldn't normally set this field
562
- * firstValidRound: 1000n,
563
- * validityWindow: 10,
564
- * extraFee: (1000).microAlgo(),
565
- * staticFee: (1000).microAlgo(),
566
- * // Max fee doesn't make sense with extraFee AND staticFee
567
- * // already specified, but here for completeness
568
- * maxFee: (3000).microAlgo(),
569
- * rejectVersion: 1,
570
- * // Signer only needed if you want to provide one,
571
- * // generally you'd register it with AlgorandClient
572
- * // against the sender and not need to pass it in
573
- * signer: transactionSigner,
574
- * maxRoundsToWaitForConfirmation: 5,
575
- * suppressLog: true,
576
- *})
577
- * ```
578
- * @returns The result of the app delete transaction and the transaction that was sent
579
- */
580
- appDelete = this._sendAppCall((c) => c.addAppDelete, { postLog: (params, result) => `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString("base64"))}` : ""} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
581
- /**
582
- * Call a smart contract.
583
- *
584
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
585
- *
586
- * @param params The parameters for the app call transaction
587
- * @example Basic example
588
- * ```typescript
589
- * await algorand.send.appCall({ sender: 'CREATORADDRESS' })
590
- * ```
591
- * @example Advanced example
592
- * ```typescript
593
- * await algorand.send.appCall({
594
- * sender: 'CREATORADDRESS',
595
- * onComplete: OnApplicationComplete.OptIn,
596
- * args: [new Uint8Array(1, 2, 3, 4)]
597
- * accountReferences: ["ACCOUNT_1"]
598
- * appReferences: [123n, 1234n]
599
- * assetReferences: [12345n]
600
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
601
- * accessReferences: [{ appId: 1234n }]
602
- * lease: 'lease',
603
- * note: 'note',
604
- * // You wouldn't normally set this field
605
- * firstValidRound: 1000n,
606
- * validityWindow: 10,
607
- * extraFee: (1000).microAlgo(),
608
- * staticFee: (1000).microAlgo(),
609
- * // Max fee doesn't make sense with extraFee AND staticFee
610
- * // already specified, but here for completeness
611
- * maxFee: (3000).microAlgo(),
612
- * rejectVersion: 1,
613
- * // Signer only needed if you want to provide one,
614
- * // generally you'd register it with AlgorandClient
615
- * // against the sender and not need to pass it in
616
- * signer: transactionSigner,
617
- * maxRoundsToWaitForConfirmation: 5,
618
- * suppressLog: true,
619
- *})
620
- * ```
621
- * @returns The result of the app call transaction and the transaction that was sent
622
- */
623
- appCall = this._sendAppCall((c) => c.addAppCall, { postLog: (params, result) => `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString("base64"))}` : ""} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
624
- /**
625
- * Create a smart contract via an ABI method.
626
- *
627
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
628
- *
629
- * @param params The parameters for the app creation transaction
630
- * @example Basic example
631
- * ```typescript
632
- * const method = new ABIMethod({
633
- * name: 'method',
634
- * args: [{ name: 'arg1', type: 'string' }],
635
- * returns: { type: 'string' },
636
- * })
637
- * const result = await algorand.send.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
638
- * const createdAppId = result.appId
639
- * ```
640
- * @example Advanced example
641
- * ```typescript
642
- * const method = new ABIMethod({
643
- * name: 'method',
644
- * args: [{ name: 'arg1', type: 'string' }],
645
- * returns: { type: 'string' },
646
- * })
647
- * await algorand.send.appCreateMethodCall({
648
- * sender: 'CREATORADDRESS',
649
- * method: method,
650
- * args: ["arg1_value"],
651
- * approvalProgram: "TEALCODE",
652
- * clearStateProgram: "TEALCODE",
653
- * schema: {
654
- * globalInts: 1,
655
- * globalByteSlices: 2,
656
- * localInts: 3,
657
- * localByteSlices: 4
658
- * },
659
- * extraProgramPages: 1,
660
- * onComplete: OnApplicationComplete.OptIn,
661
- * args: [new Uint8Array(1, 2, 3, 4)]
662
- * accountReferences: ["ACCOUNT_1"]
663
- * appReferences: [123n, 1234n]
664
- * assetReferences: [12345n]
665
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
666
- * accessReferences: [{ appId: 1234n }]
667
- * lease: 'lease',
668
- * note: 'note',
669
- * // You wouldn't normally set this field
670
- * firstValidRound: 1000n,
671
- * validityWindow: 10,
672
- * extraFee: (1000).microAlgo(),
673
- * staticFee: (1000).microAlgo(),
674
- * // Max fee doesn't make sense with extraFee AND staticFee
675
- * // already specified, but here for completeness
676
- * maxFee: (3000).microAlgo(),
677
- * rejectVersion: 1,
678
- * // Signer only needed if you want to provide one,
679
- * // generally you'd register it with AlgorandClient
680
- * // against the sender and not need to pass it in
681
- * signer: transactionSigner,
682
- * maxRoundsToWaitForConfirmation: 5,
683
- * suppressLog: true,
684
- *})
685
- * ```
686
- * @returns The result of the application ABI method create transaction and the transaction that was sent
687
- */
688
- appCreateMethodCall = this._sendAppCreateCall((c) => c.addAppCreateMethodCall, { postLog: (params, result) => `App created by ${params.sender} with ID ${result.confirmation.appId} via transaction ${result.txIds.at(-1)}` });
689
- /**
690
- * Update a smart contract via an ABI method.
691
- *
692
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
693
- *
694
- * @param params The parameters for the app update transaction
695
- * @example Basic example
696
- * ```typescript
697
- * const method = new ABIMethod({
698
- * name: 'method',
699
- * args: [{ name: 'arg1', type: 'string' }],
700
- * returns: { type: 'string' },
701
- * })
702
- * await algorand.send.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
703
- * ```
704
- * @example Advanced example
705
- * ```typescript
706
- * const method = new ABIMethod({
707
- * name: 'method',
708
- * args: [{ name: 'arg1', type: 'string' }],
709
- * returns: { type: 'string' },
710
- * })
711
- * await algorand.send.appUpdateMethodCall({
712
- * sender: 'CREATORADDRESS',
713
- * method: method,
714
- * args: ["arg1_value"],
715
- * approvalProgram: "TEALCODE",
716
- * clearStateProgram: "TEALCODE",
717
- * onComplete: OnApplicationComplete.UpdateApplication,
718
- * args: [new Uint8Array(1, 2, 3, 4)]
719
- * accountReferences: ["ACCOUNT_1"]
720
- * appReferences: [123n, 1234n]
721
- * assetReferences: [12345n]
722
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
723
- * accessReferences: [{ appId: 1234n }]
724
- * lease: 'lease',
725
- * note: 'note',
726
- * // You wouldn't normally set this field
727
- * firstValidRound: 1000n,
728
- * validityWindow: 10,
729
- * extraFee: (1000).microAlgo(),
730
- * staticFee: (1000).microAlgo(),
731
- * // Max fee doesn't make sense with extraFee AND staticFee
732
- * // already specified, but here for completeness
733
- * maxFee: (3000).microAlgo(),
734
- * rejectVersion: 1,
735
- * // Signer only needed if you want to provide one,
736
- * // generally you'd register it with AlgorandClient
737
- * // against the sender and not need to pass it in
738
- * signer: transactionSigner,
739
- * maxRoundsToWaitForConfirmation: 5,
740
- * suppressLog: true,
741
- *})
742
- * ```
743
- * @returns The result of the application ABI method update transaction and the transaction that was sent
744
- */
745
- appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, { postLog: (params, result) => `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
746
- /**
747
- * Delete a smart contract via an ABI method.
748
- *
749
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
750
- *
751
- * @param params The parameters for the app deletion transaction
752
- * @example Basic example
753
- * ```typescript
754
- * const method = new ABIMethod({
755
- * name: 'method',
756
- * args: [{ name: 'arg1', type: 'string' }],
757
- * returns: { type: 'string' },
758
- * })
759
- * await algorand.send.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
760
- * ```
761
- * @example Advanced example
762
- * ```typescript
763
- * const method = new ABIMethod({
764
- * name: 'method',
765
- * args: [{ name: 'arg1', type: 'string' }],
766
- * returns: { type: 'string' },
767
- * })
768
- * await algorand.send.appDeleteMethodCall({
769
- * sender: 'CREATORADDRESS',
770
- * method: method,
771
- * args: ["arg1_value"],
772
- * onComplete: OnApplicationComplete.DeleteApplication,
773
- * args: [new Uint8Array(1, 2, 3, 4)]
774
- * accountReferences: ["ACCOUNT_1"]
775
- * appReferences: [123n, 1234n]
776
- * assetReferences: [12345n]
777
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
778
- * accessReferences: [{ appId: 1234n }]
779
- * lease: 'lease',
780
- * note: 'note',
781
- * // You wouldn't normally set this field
782
- * firstValidRound: 1000n,
783
- * validityWindow: 10,
784
- * extraFee: (1000).microAlgo(),
785
- * staticFee: (1000).microAlgo(),
786
- * // Max fee doesn't make sense with extraFee AND staticFee
787
- * // already specified, but here for completeness
788
- * maxFee: (3000).microAlgo(),
789
- * rejectVersion: 1,
790
- * // Signer only needed if you want to provide one,
791
- * // generally you'd register it with AlgorandClient
792
- * // against the sender and not need to pass it in
793
- * signer: transactionSigner,
794
- * maxRoundsToWaitForConfirmation: 5,
795
- * suppressLog: true,
796
- *})
797
- * ```
798
- * @returns The result of the application ABI method delete transaction and the transaction that was sent
799
- */
800
- appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, { postLog: (params, result) => `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
801
- /**
802
- * Call a smart contract via an ABI method.
803
- *
804
- * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
805
- *
806
- * @param params The parameters for the app call transaction
807
- * @example Basic example
808
- * ```typescript
809
- * const method = new ABIMethod({
810
- * name: 'method',
811
- * args: [{ name: 'arg1', type: 'string' }],
812
- * returns: { type: 'string' },
813
- * })
814
- * await algorand.send.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
815
- * ```
816
- * @example Advanced example
817
- * ```typescript
818
- * const method = new ABIMethod({
819
- * name: 'method',
820
- * args: [{ name: 'arg1', type: 'string' }],
821
- * returns: { type: 'string' },
822
- * })
823
- * await algorand.send.appCallMethodCall({
824
- * sender: 'CREATORADDRESS',
825
- * method: method,
826
- * args: ["arg1_value"],
827
- * onComplete: OnApplicationComplete.OptIn,
828
- * args: [new Uint8Array(1, 2, 3, 4)]
829
- * accountReferences: ["ACCOUNT_1"]
830
- * appReferences: [123n, 1234n]
831
- * assetReferences: [12345n]
832
- * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
833
- * accessReferences: [{ appId: 1234n }]
834
- * lease: 'lease',
835
- * note: 'note',
836
- * // You wouldn't normally set this field
837
- * firstValidRound: 1000n,
838
- * validityWindow: 10,
839
- * extraFee: (1000).microAlgo(),
840
- * staticFee: (1000).microAlgo(),
841
- * // Max fee doesn't make sense with extraFee AND staticFee
842
- * // already specified, but here for completeness
843
- * maxFee: (3000).microAlgo(),
844
- * rejectVersion: 1,
845
- * // Signer only needed if you want to provide one,
846
- * // generally you'd register it with AlgorandClient
847
- * // against the sender and not need to pass it in
848
- * signer: transactionSigner,
849
- * maxRoundsToWaitForConfirmation: 5,
850
- * suppressLog: true,
851
- *})
852
- * ```
853
- * @returns The result of the application ABI method call transaction and the transaction that was sent
854
- */
855
- appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, { postLog: (params, result) => `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
856
- /**
857
- * Register an online key.
858
- * @param params The parameters for the key registration transaction
859
- * @example Basic example
860
- * ```typescript
861
- * const result = await algorand.send.onlineKeyRegistration({
862
- * sender: 'SENDERADDRESS',
863
- * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
864
- * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
865
- * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
866
- * voteFirst: 1n,
867
- * voteLast: 1000n,
868
- * voteKeyDilution: 1n,
869
- * })
870
- * ```
871
- * @example Advanced example
872
- * ```typescript
873
- * const result = await algorand.send.onlineKeyRegistration({
874
- * sender: 'SENDERADDRESS',
875
- * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
876
- * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
877
- * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
878
- * voteFirst: 1n,
879
- * voteLast: 1000n,
880
- * voteKeyDilution: 1n,
881
- * lease: 'lease',
882
- * note: 'note',
883
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
884
- * rekeyTo: 'REKEYTOADDRESS',
885
- * // You wouldn't normally set this field
886
- * firstValidRound: 1000n,
887
- * validityWindow: 10,
888
- * extraFee: (1000).microAlgo(),
889
- * staticFee: (1000).microAlgo(),
890
- * // Max fee doesn't make sense with extraFee AND staticFee
891
- * // already specified, but here for completeness
892
- * maxFee: (3000).microAlgo(),
893
- * })
894
- * ```
895
- * @returns The result of the online key registration transaction and the transaction that was sent
896
- */
897
- onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, { preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txId()}` });
898
- /**
899
- * Register an offline key.
900
- * @param params The parameters for the key registration transaction
901
- * @example Basic example
902
- * ```typescript
903
- * const result = await algorand.send.offlineKeyRegistration({
904
- * sender: 'SENDERADDRESS',
905
- * })
906
- * ```
907
- * @example Advanced example
908
- * ```typescript
909
- * const result = await algorand.send.offlineKeyRegistration({
910
- * sender: 'SENDERADDRESS',
911
- * lease: 'lease',
912
- * note: 'note',
913
- * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
914
- * rekeyTo: 'REKEYTOADDRESS',
915
- * // You wouldn't normally set this field
916
- * firstValidRound: 1000n,
917
- * validityWindow: 10,
918
- * extraFee: (1000).microAlgo(),
919
- * staticFee: (1000).microAlgo(),
920
- * // Max fee doesn't make sense with extraFee AND staticFee
921
- * // already specified, but here for completeness
922
- * maxFee: (3000).microAlgo(),
923
- * })
924
- * ```
925
- * @returns The result of the offline key registration transaction and the transaction that was sent
926
- */
927
- offlineKeyRegistration = this._send((c) => c.addOfflineKeyRegistration, { preLog: (params, transaction) => `Registering offline key for ${params.sender} via transaction ${transaction.txId()}` });
928
- };
4
+ /** @deprecated Import from `@algorandfoundation/algokit-utils/algorand-client-transaction-sender` instead */
5
+ const AlgorandClientTransactionSender = AlgorandClientTransactionSender$1;
929
6
 
930
7
  //#endregion
931
8
  export { AlgorandClientTransactionSender };