@algorandfoundation/algokit-utils 7.0.0-beta.1 → 7.0.0-beta.3

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 (133) hide show
  1. package/README.md +1 -1
  2. package/account/account.d.ts +7 -7
  3. package/account/account.js +7 -7
  4. package/account/account.mjs +7 -7
  5. package/account/get-account.d.ts +2 -2
  6. package/account/get-account.js +1 -1
  7. package/account/get-account.mjs +1 -1
  8. package/account/get-dispenser-account.d.ts +1 -1
  9. package/account/get-dispenser-account.js +1 -1
  10. package/account/get-dispenser-account.mjs +1 -1
  11. package/account/mnemonic-account.d.ts +1 -1
  12. package/account/mnemonic-account.js +1 -1
  13. package/account/mnemonic-account.mjs +1 -1
  14. package/app-deploy.d.ts +18 -1
  15. package/app-deploy.d.ts.map +1 -1
  16. package/app-deploy.js +142 -333
  17. package/app-deploy.js.map +1 -1
  18. package/app-deploy.mjs +145 -336
  19. package/app-deploy.mjs.map +1 -1
  20. package/app.d.ts +38 -1
  21. package/app.d.ts.map +1 -1
  22. package/app.js +113 -370
  23. package/app.js.map +1 -1
  24. package/app.mjs +114 -371
  25. package/app.mjs.map +1 -1
  26. package/asset.d.ts +5 -5
  27. package/asset.js +5 -5
  28. package/asset.mjs +5 -5
  29. package/debugging/debugging.js +2 -2
  30. package/debugging/debugging.js.map +1 -1
  31. package/debugging/debugging.mjs +2 -2
  32. package/debugging/debugging.mjs.map +1 -1
  33. package/index.d.ts +1 -1
  34. package/index.d.ts.map +1 -1
  35. package/index.js +12 -12
  36. package/index.mjs +1 -1
  37. package/localnet/get-kmd-wallet-account.d.ts +1 -1
  38. package/localnet/get-kmd-wallet-account.js +1 -1
  39. package/localnet/get-kmd-wallet-account.mjs +1 -1
  40. package/localnet/get-localnet-dispenser-account.d.ts +1 -1
  41. package/localnet/get-localnet-dispenser-account.js +1 -1
  42. package/localnet/get-localnet-dispenser-account.mjs +1 -1
  43. package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -1
  44. package/localnet/get-or-create-kmd-wallet-account.js +1 -1
  45. package/localnet/get-or-create-kmd-wallet-account.mjs +1 -1
  46. package/localnet/is-localnet.d.ts +1 -1
  47. package/localnet/is-localnet.js +1 -1
  48. package/localnet/is-localnet.mjs +1 -1
  49. package/network-client.d.ts +2 -2
  50. package/network-client.d.ts.map +1 -1
  51. package/network-client.js +2 -2
  52. package/network-client.mjs +2 -2
  53. package/package.json +1 -1
  54. package/testing/fixtures/algorand-fixture.js +12 -12
  55. package/testing/fixtures/algorand-fixture.js.map +1 -1
  56. package/testing/fixtures/algorand-fixture.mjs +12 -12
  57. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  58. package/transaction/legacy-bridge.d.ts +31 -5
  59. package/transaction/legacy-bridge.d.ts.map +1 -1
  60. package/transaction/legacy-bridge.js +99 -5
  61. package/transaction/legacy-bridge.js.map +1 -1
  62. package/transaction/legacy-bridge.mjs +98 -7
  63. package/transaction/legacy-bridge.mjs.map +1 -1
  64. package/transfer/transfer-algos.d.ts +1 -1
  65. package/transfer/transfer-algos.js +1 -1
  66. package/transfer/transfer-algos.mjs +1 -1
  67. package/transfer/transfer.d.ts +1 -1
  68. package/transfer/transfer.js +1 -1
  69. package/transfer/transfer.mjs +1 -1
  70. package/types/account-manager.d.ts +1 -1
  71. package/types/account-manager.d.ts.map +1 -1
  72. package/types/algorand-client-transaction-creator.d.ts +450 -20
  73. package/types/algorand-client-transaction-creator.d.ts.map +1 -1
  74. package/types/algorand-client-transaction-creator.js +406 -22
  75. package/types/algorand-client-transaction-creator.js.map +1 -1
  76. package/types/algorand-client-transaction-creator.mjs +406 -22
  77. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  78. package/types/algorand-client-transaction-sender.d.ts +750 -24
  79. package/types/algorand-client-transaction-sender.d.ts.map +1 -1
  80. package/types/algorand-client-transaction-sender.js +426 -12
  81. package/types/algorand-client-transaction-sender.js.map +1 -1
  82. package/types/algorand-client-transaction-sender.mjs +426 -12
  83. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  84. package/types/algorand-client.d.ts +8 -0
  85. package/types/algorand-client.d.ts.map +1 -1
  86. package/types/algorand-client.js +14 -1
  87. package/types/algorand-client.js.map +1 -1
  88. package/types/algorand-client.mjs +14 -1
  89. package/types/algorand-client.mjs.map +1 -1
  90. package/types/app-client.d.ts +13 -1
  91. package/types/app-client.d.ts.map +1 -1
  92. package/types/app-client.js +8 -5
  93. package/types/app-client.js.map +1 -1
  94. package/types/app-client.mjs +9 -6
  95. package/types/app-client.mjs.map +1 -1
  96. package/types/app-deployer.d.ts +121 -0
  97. package/types/app-deployer.d.ts.map +1 -0
  98. package/types/app-deployer.js +354 -0
  99. package/types/app-deployer.js.map +1 -0
  100. package/types/app-deployer.mjs +352 -0
  101. package/types/app-deployer.mjs.map +1 -0
  102. package/types/app-manager.d.ts +235 -0
  103. package/types/app-manager.d.ts.map +1 -0
  104. package/types/app-manager.js +336 -0
  105. package/types/app-manager.js.map +1 -0
  106. package/types/app-manager.mjs +334 -0
  107. package/types/app-manager.mjs.map +1 -0
  108. package/types/app.d.ts +42 -7
  109. package/types/app.d.ts.map +1 -1
  110. package/types/app.js +1 -1
  111. package/types/app.js.map +1 -1
  112. package/types/app.mjs +1 -1
  113. package/types/app.mjs.map +1 -1
  114. package/types/client-manager.d.ts +2 -0
  115. package/types/client-manager.d.ts.map +1 -1
  116. package/types/client-manager.js +4 -0
  117. package/types/client-manager.js.map +1 -1
  118. package/types/client-manager.mjs +4 -0
  119. package/types/client-manager.mjs.map +1 -1
  120. package/types/composer.d.ts +150 -39
  121. package/types/composer.d.ts.map +1 -1
  122. package/types/composer.js +218 -62
  123. package/types/composer.js.map +1 -1
  124. package/types/composer.mjs +218 -62
  125. package/types/composer.mjs.map +1 -1
  126. package/types/expand.d.ts +8 -0
  127. package/types/expand.d.ts.map +1 -0
  128. package/types/expand.js +3 -0
  129. package/types/expand.js.map +1 -0
  130. package/types/expand.mjs +2 -0
  131. package/types/expand.mjs.map +1 -0
  132. package/types/transaction.d.ts +3 -0
  133. package/types/transaction.d.ts.map +1 -1
@@ -10,7 +10,7 @@ class AlgorandClientTransactionCreator {
10
10
  * @param params The parameters for the payment transaction
11
11
  * @example Basic example
12
12
  * ```typescript
13
- * const result = await algorandClient.send.payment({
13
+ * const result = await algorand.send.payment({
14
14
  * sender: 'SENDERADDRESS',
15
15
  * receiver: 'RECEIVERADDRESS',
16
16
  * amount: (4).algo(),
@@ -18,7 +18,7 @@ class AlgorandClientTransactionCreator {
18
18
  * ```
19
19
  * @example Advanced example
20
20
  * ```typescript
21
- * const result = await algorandClient.send.payment({
21
+ * const result = await algorand.send.payment({
22
22
  * amount: (4).algo(),
23
23
  * receiver: 'RECEIVERADDRESS',
24
24
  * sender: 'SENDERADDRESS',
@@ -50,11 +50,11 @@ class AlgorandClientTransactionCreator {
50
50
  *
51
51
  * @example Basic example
52
52
  * ```typescript
53
- * await algorand.transaction.assetCreate({sender: "CREATORADDRESS", total: 100n})
53
+ * await algorand.transactions.assetCreate({sender: "CREATORADDRESS", total: 100n})
54
54
  * ```
55
55
  * @example Advanced example
56
56
  * ```typescript
57
- * await algorand.transaction.assetCreate({
57
+ * await algorand.transactions.assetCreate({
58
58
  * sender: 'CREATORADDRESS',
59
59
  * total: 100n,
60
60
  * decimals: 2,
@@ -92,11 +92,11 @@ class AlgorandClientTransactionCreator {
92
92
  *
93
93
  * @example Basic example
94
94
  * ```typescript
95
- * await algorand.transaction.assetConfig({sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
95
+ * await algorand.transactions.assetConfig({sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
96
96
  * ```
97
97
  * @example Advanced example
98
98
  * ```typescript
99
- * await algorand.transaction.assetConfig({
99
+ * await algorand.transactions.assetConfig({
100
100
  * sender: 'MANAGERADDRESS',
101
101
  * assetId: 123456n,
102
102
  * manager: 'MANAGERADDRESS',
@@ -124,11 +124,11 @@ class AlgorandClientTransactionCreator {
124
124
  *
125
125
  * @example Basic example
126
126
  * ```typescript
127
- * await algorand.transaction.assetFreeze({sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
127
+ * await algorand.transactions.assetFreeze({sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
128
128
  * ```
129
129
  * @example Advanced example
130
130
  * ```typescript
131
- * await algorand.transaction.assetFreeze({
131
+ * await algorand.transactions.assetFreeze({
132
132
  * sender: 'MANAGERADDRESS',
133
133
  * assetId: 123456n,
134
134
  * account: 'ACCOUNTADDRESS',
@@ -158,11 +158,11 @@ class AlgorandClientTransactionCreator {
158
158
  *
159
159
  * @example Basic example
160
160
  * ```typescript
161
- * await algorand.transaction.assetDestroy({sender: "MANAGERADDRESS", assetId: 123456n })
161
+ * await algorand.transactions.assetDestroy({sender: "MANAGERADDRESS", assetId: 123456n })
162
162
  * ```
163
163
  * @example Advanced example
164
164
  * ```typescript
165
- * await algorand.transaction.assetDestroy({
165
+ * await algorand.transactions.assetDestroy({
166
166
  * sender: 'MANAGERADDRESS',
167
167
  * assetId: 123456n,
168
168
  * lease: 'lease',
@@ -186,11 +186,11 @@ class AlgorandClientTransactionCreator {
186
186
  *
187
187
  * @example Basic example
188
188
  * ```typescript
189
- * await algorand.transaction.assetTransfer({sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
189
+ * await algorand.transactions.assetTransfer({sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
190
190
  * ```
191
191
  * @example Advanced example (with clawback)
192
192
  * ```typescript
193
- * await algorand.transaction.assetTransfer({
193
+ * await algorand.transactions.assetTransfer({
194
194
  * sender: 'CLAWBACKADDRESS',
195
195
  * assetId: 123456n,
196
196
  * amount: 1n,
@@ -219,11 +219,11 @@ class AlgorandClientTransactionCreator {
219
219
  *
220
220
  * @example Basic example
221
221
  * ```typescript
222
- * await algorand.transaction.assetOptIn({sender: "SENDERADDRESS", assetId: 123456n })
222
+ * await algorand.transactions.assetOptIn({sender: "SENDERADDRESS", assetId: 123456n })
223
223
  * ```
224
224
  * @example Advanced example
225
225
  * ```typescript
226
- * await algorand.transaction.assetOptIn({
226
+ * await algorand.transactions.assetOptIn({
227
227
  * sender: 'SENDERADDRESS',
228
228
  * assetId: 123456n,
229
229
  * lease: 'lease',
@@ -250,11 +250,11 @@ class AlgorandClientTransactionCreator {
250
250
  *
251
251
  * @example Basic example
252
252
  * ```typescript
253
- * await algorand.transaction.assetOptOut({sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n })
253
+ * await algorand.transactions.assetOptOut({sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n })
254
254
  * ```
255
255
  * @example Advanced example
256
256
  * ```typescript
257
- * await algorand.transaction.assetOptIn({
257
+ * await algorand.transactions.assetOptIn({
258
258
  * sender: 'SENDERADDRESS',
259
259
  * assetId: 123456n,
260
260
  * creator: 'CREATORADDRESS',
@@ -274,12 +274,390 @@ class AlgorandClientTransactionCreator {
274
274
  * @returns The asset opt-out transaction
275
275
  */
276
276
  this.assetOptOut = this._transaction((c) => c.addAssetOptOut);
277
- /** Create an application call transaction. */
277
+ /** Create an application create transaction.
278
+ *
279
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
280
+ *
281
+ * @param params The parameters for the app creation transaction
282
+ * @example Basic example
283
+ * ```typescript
284
+ * const result = await algorand.transactions.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
285
+ * const createdAppId = result.appId
286
+ * ```
287
+ * @example Advanced example
288
+ * ```typescript
289
+ * await algorand.transactions.appCreate({
290
+ * sender: 'CREATORADDRESS',
291
+ * approvalProgram: "TEALCODE",
292
+ * clearStateProgram: "TEALCODE",
293
+ * schema: {
294
+ * globalInts: 1,
295
+ * globalByteSlices: 2,
296
+ * localInts: 3,
297
+ * localByteSlices: 4
298
+ * },
299
+ * extraProgramPages: 1,
300
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
301
+ * args: [new Uint8Array(1, 2, 3, 4)]
302
+ * accountReferences: ["ACCOUNT_1"]
303
+ * appReferences: [123n, 1234n]
304
+ * assetReferences: [12345n]
305
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
306
+ * lease: 'lease',
307
+ * note: 'note',
308
+ * // You wouldn't normally set this field
309
+ * firstValidRound: 1000n,
310
+ * validityWindow: 10,
311
+ * extraFee: (1000).microAlgo(),
312
+ * staticFee: (1000).microAlgo(),
313
+ * // Max fee doesn't make sense with extraFee AND staticFee
314
+ * // already specified, but here for completeness
315
+ * maxFee: (3000).microAlgo(),
316
+ * // Signer only needed if you want to provide one,
317
+ * // generally you'd register it with AlgorandClient
318
+ * // against the sender and not need to pass it in
319
+ * signer: transactionSigner,
320
+ * maxRoundsToWaitForConfirmation: 5,
321
+ * suppressLog: true,
322
+ *})
323
+ * ```
324
+ */
325
+ this.appCreate = this._transaction((c) => c.addAppCreate);
326
+ /** Create an application update transaction.
327
+ *
328
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
329
+ *
330
+ * @param params The parameters for the app update transaction
331
+ * @example Basic example
332
+ * ```typescript
333
+ * await algorand.transactions.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
334
+ * ```
335
+ * @example Advanced example
336
+ * ```typescript
337
+ * await algorand.transactions.appUpdate({
338
+ * sender: 'CREATORADDRESS',
339
+ * approvalProgram: "TEALCODE",
340
+ * clearStateProgram: "TEALCODE",
341
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
342
+ * args: [new Uint8Array(1, 2, 3, 4)]
343
+ * accountReferences: ["ACCOUNT_1"]
344
+ * appReferences: [123n, 1234n]
345
+ * assetReferences: [12345n]
346
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
347
+ * lease: 'lease',
348
+ * note: 'note',
349
+ * // You wouldn't normally set this field
350
+ * firstValidRound: 1000n,
351
+ * validityWindow: 10,
352
+ * extraFee: (1000).microAlgo(),
353
+ * staticFee: (1000).microAlgo(),
354
+ * // Max fee doesn't make sense with extraFee AND staticFee
355
+ * // already specified, but here for completeness
356
+ * maxFee: (3000).microAlgo(),
357
+ * // Signer only needed if you want to provide one,
358
+ * // generally you'd register it with AlgorandClient
359
+ * // against the sender and not need to pass it in
360
+ * signer: transactionSigner,
361
+ * maxRoundsToWaitForConfirmation: 5,
362
+ * suppressLog: true,
363
+ *})
364
+ * ```
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.transactions.appDelete({ sender: 'CREATORADDRESS' })
375
+ * ```
376
+ * @example Advanced example
377
+ * ```typescript
378
+ * await algorand.transactions.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
+ * lease: 'lease',
387
+ * note: 'note',
388
+ * // You wouldn't normally set this field
389
+ * firstValidRound: 1000n,
390
+ * validityWindow: 10,
391
+ * extraFee: (1000).microAlgo(),
392
+ * staticFee: (1000).microAlgo(),
393
+ * // Max fee doesn't make sense with extraFee AND staticFee
394
+ * // already specified, but here for completeness
395
+ * maxFee: (3000).microAlgo(),
396
+ * // Signer only needed if you want to provide one,
397
+ * // generally you'd register it with AlgorandClient
398
+ * // against the sender and not need to pass it in
399
+ * signer: transactionSigner,
400
+ * maxRoundsToWaitForConfirmation: 5,
401
+ * suppressLog: true,
402
+ *})
403
+ * ```
404
+ */
405
+ this.appDelete = this._transaction((c) => c.addAppDelete);
406
+ /** Create an application call transaction.
407
+ *
408
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
409
+ *
410
+ * @param params The parameters for the app call transaction
411
+ * @example Basic example
412
+ * ```typescript
413
+ * await algorand.transactions.appCall({ sender: 'CREATORADDRESS' })
414
+ * ```
415
+ * @example Advanced example
416
+ * ```typescript
417
+ * await algorand.transactions.appCall({
418
+ * sender: 'CREATORADDRESS',
419
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
420
+ * args: [new Uint8Array(1, 2, 3, 4)]
421
+ * accountReferences: ["ACCOUNT_1"]
422
+ * appReferences: [123n, 1234n]
423
+ * assetReferences: [12345n]
424
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
425
+ * lease: 'lease',
426
+ * note: 'note',
427
+ * // You wouldn't normally set this field
428
+ * firstValidRound: 1000n,
429
+ * validityWindow: 10,
430
+ * extraFee: (1000).microAlgo(),
431
+ * staticFee: (1000).microAlgo(),
432
+ * // Max fee doesn't make sense with extraFee AND staticFee
433
+ * // already specified, but here for completeness
434
+ * maxFee: (3000).microAlgo(),
435
+ * // Signer only needed if you want to provide one,
436
+ * // generally you'd register it with AlgorandClient
437
+ * // against the sender and not need to pass it in
438
+ * signer: transactionSigner,
439
+ * maxRoundsToWaitForConfirmation: 5,
440
+ * suppressLog: true,
441
+ *})
442
+ * ```
443
+ */
278
444
  this.appCall = this._transaction((c) => c.addAppCall);
279
- /** Create an application call with ABI method call transaction. */
280
- this.methodCall = async (params) => {
281
- return await this._newGroup().addMethodCall(params).buildTransactions();
282
- };
445
+ /** Create an application create call with ABI method call transaction.
446
+ *
447
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
448
+ *
449
+ * @param params The parameters for the app creation transaction
450
+ * @example Basic example
451
+ * ```typescript
452
+ * const method = new ABIMethod({
453
+ * name: 'method',
454
+ * args: [{ name: 'arg1', type: 'string' }],
455
+ * returns: { type: 'string' },
456
+ * })
457
+ * const result = await algorand.transactions.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
458
+ * const createdAppId = result.appId
459
+ * ```
460
+ * @example Advanced 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.transactions.appCreate({
468
+ * sender: 'CREATORADDRESS',
469
+ * method: method,
470
+ * args: ["arg1_value"],
471
+ * approvalProgram: "TEALCODE",
472
+ * clearStateProgram: "TEALCODE",
473
+ * schema: {
474
+ * globalInts: 1,
475
+ * globalByteSlices: 2,
476
+ * localInts: 3,
477
+ * localByteSlices: 4
478
+ * },
479
+ * extraProgramPages: 1,
480
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
481
+ * args: [new Uint8Array(1, 2, 3, 4)]
482
+ * accountReferences: ["ACCOUNT_1"]
483
+ * appReferences: [123n, 1234n]
484
+ * assetReferences: [12345n]
485
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
486
+ * lease: 'lease',
487
+ * note: 'note',
488
+ * // You wouldn't normally set this field
489
+ * firstValidRound: 1000n,
490
+ * validityWindow: 10,
491
+ * extraFee: (1000).microAlgo(),
492
+ * staticFee: (1000).microAlgo(),
493
+ * // Max fee doesn't make sense with extraFee AND staticFee
494
+ * // already specified, but here for completeness
495
+ * maxFee: (3000).microAlgo(),
496
+ * // Signer only needed if you want to provide one,
497
+ * // generally you'd register it with AlgorandClient
498
+ * // against the sender and not need to pass it in
499
+ * signer: transactionSigner,
500
+ * maxRoundsToWaitForConfirmation: 5,
501
+ * suppressLog: true,
502
+ *})
503
+ * ```
504
+ */
505
+ this.appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall);
506
+ /** Create an application update call with ABI method call transaction.
507
+ *
508
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
509
+ *
510
+ * @param params The parameters for the app update transaction
511
+ * @example Basic example
512
+ * ```typescript
513
+ * const method = new ABIMethod({
514
+ * name: 'method',
515
+ * args: [{ name: 'arg1', type: 'string' }],
516
+ * returns: { type: 'string' },
517
+ * })
518
+ * await algorand.transactions.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
519
+ * ```
520
+ * @example Advanced example
521
+ * ```typescript
522
+ * const method = new ABIMethod({
523
+ * name: 'method',
524
+ * args: [{ name: 'arg1', type: 'string' }],
525
+ * returns: { type: 'string' },
526
+ * })
527
+ * await algorand.transactions.appUpdateMethodCall({
528
+ * sender: 'CREATORADDRESS',
529
+ * method: method,
530
+ * args: ["arg1_value"],
531
+ * approvalProgram: "TEALCODE",
532
+ * clearStateProgram: "TEALCODE",
533
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
534
+ * args: [new Uint8Array(1, 2, 3, 4)]
535
+ * accountReferences: ["ACCOUNT_1"]
536
+ * appReferences: [123n, 1234n]
537
+ * assetReferences: [12345n]
538
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
539
+ * lease: 'lease',
540
+ * note: 'note',
541
+ * // You wouldn't normally set this field
542
+ * firstValidRound: 1000n,
543
+ * validityWindow: 10,
544
+ * extraFee: (1000).microAlgo(),
545
+ * staticFee: (1000).microAlgo(),
546
+ * // Max fee doesn't make sense with extraFee AND staticFee
547
+ * // already specified, but here for completeness
548
+ * maxFee: (3000).microAlgo(),
549
+ * // Signer only needed if you want to provide one,
550
+ * // generally you'd register it with AlgorandClient
551
+ * // against the sender and not need to pass it in
552
+ * signer: transactionSigner,
553
+ * maxRoundsToWaitForConfirmation: 5,
554
+ * suppressLog: true,
555
+ *})
556
+ * ```
557
+ */
558
+ this.appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall);
559
+ /** Create an application delete call with ABI method call transaction.
560
+ *
561
+ * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
562
+ *
563
+ * @param params The parameters for the app deletion transaction
564
+ * @example Basic example
565
+ * ```typescript
566
+ * const method = new ABIMethod({
567
+ * name: 'method',
568
+ * args: [{ name: 'arg1', type: 'string' }],
569
+ * returns: { type: 'string' },
570
+ * })
571
+ * await algorand.transactions.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
572
+ * ```
573
+ * @example Advanced example
574
+ * ```typescript
575
+ * const method = new ABIMethod({
576
+ * name: 'method',
577
+ * args: [{ name: 'arg1', type: 'string' }],
578
+ * returns: { type: 'string' },
579
+ * })
580
+ * await algorand.transactions.appDeleteMethodCall({
581
+ * sender: 'CREATORADDRESS',
582
+ * method: method,
583
+ * args: ["arg1_value"],
584
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
585
+ * args: [new Uint8Array(1, 2, 3, 4)]
586
+ * accountReferences: ["ACCOUNT_1"]
587
+ * appReferences: [123n, 1234n]
588
+ * assetReferences: [12345n]
589
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
590
+ * lease: 'lease',
591
+ * note: 'note',
592
+ * // You wouldn't normally set this field
593
+ * firstValidRound: 1000n,
594
+ * validityWindow: 10,
595
+ * extraFee: (1000).microAlgo(),
596
+ * staticFee: (1000).microAlgo(),
597
+ * // Max fee doesn't make sense with extraFee AND staticFee
598
+ * // already specified, but here for completeness
599
+ * maxFee: (3000).microAlgo(),
600
+ * // Signer only needed if you want to provide one,
601
+ * // generally you'd register it with AlgorandClient
602
+ * // against the sender and not need to pass it in
603
+ * signer: transactionSigner,
604
+ * maxRoundsToWaitForConfirmation: 5,
605
+ * suppressLog: true,
606
+ *})
607
+ * ```
608
+ */
609
+ this.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.transactions.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.transactions.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
+ * lease: 'lease',
642
+ * note: 'note',
643
+ * // You wouldn't normally set this field
644
+ * firstValidRound: 1000n,
645
+ * validityWindow: 10,
646
+ * extraFee: (1000).microAlgo(),
647
+ * staticFee: (1000).microAlgo(),
648
+ * // Max fee doesn't make sense with extraFee AND staticFee
649
+ * // already specified, but here for completeness
650
+ * maxFee: (3000).microAlgo(),
651
+ * // Signer only needed if you want to provide one,
652
+ * // generally you'd register it with AlgorandClient
653
+ * // against the sender and not need to pass it in
654
+ * signer: transactionSigner,
655
+ * maxRoundsToWaitForConfirmation: 5,
656
+ * suppressLog: true,
657
+ *})
658
+ * ```
659
+ */
660
+ this.appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall);
283
661
  /** Create an online key registration transaction. */
284
662
  this.onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration);
285
663
  this._newGroup = newGroup;
@@ -288,7 +666,13 @@ class AlgorandClientTransactionCreator {
288
666
  return async (params) => {
289
667
  const composer = this._newGroup();
290
668
  const result = await c(composer).apply(composer, [params]).buildTransactions();
291
- return result[result.length - 1];
669
+ return result.transactions.at(-1);
670
+ };
671
+ }
672
+ _transactions(c) {
673
+ return async (params) => {
674
+ const composer = this._newGroup();
675
+ return await c(composer).apply(composer, [params]).buildTransactions();
292
676
  };
293
677
  }
294
678
  }
@@ -1 +1 @@
1
- {"version":3,"file":"algorand-client-transaction-creator.mjs","sources":["../../src/types/algorand-client-transaction-creator.ts"],"sourcesContent":[null],"names":[],"mappings":"AAKA;MACa,gCAAgC,CAAA;AAG3C;;;AAGG;AACH,IAAA,WAAA,CAAY,QAA+B,EAAA;AAY3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAA;AAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CAAA;AAC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAA;AAClC,SAAC,CAAA;KACF;AAuRF;;;;"}
1
+ {"version":3,"file":"algorand-client-transaction-creator.mjs","sources":["../../src/types/algorand-client-transaction-creator.ts"],"sourcesContent":[null],"names":[],"mappings":"AAMA;MACa,gCAAgC,CAAA;AAG3C;;;AAGG;AACH,IAAA,WAAA,CAAY,QAA+B,EAAA;AAmB3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAA;AAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CAAA;AAC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAA;AAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACH,QAAA,IAA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