@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.
- package/README.md +1 -1
- package/account/account.d.ts +7 -7
- package/account/account.js +7 -7
- package/account/account.mjs +7 -7
- package/account/get-account.d.ts +2 -2
- package/account/get-account.js +1 -1
- package/account/get-account.mjs +1 -1
- package/account/get-dispenser-account.d.ts +1 -1
- package/account/get-dispenser-account.js +1 -1
- package/account/get-dispenser-account.mjs +1 -1
- package/account/mnemonic-account.d.ts +1 -1
- package/account/mnemonic-account.js +1 -1
- package/account/mnemonic-account.mjs +1 -1
- package/app-deploy.d.ts +18 -1
- package/app-deploy.d.ts.map +1 -1
- package/app-deploy.js +142 -333
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +145 -336
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +38 -1
- package/app.d.ts.map +1 -1
- package/app.js +113 -370
- package/app.js.map +1 -1
- package/app.mjs +114 -371
- package/app.mjs.map +1 -1
- package/asset.d.ts +5 -5
- package/asset.js +5 -5
- package/asset.mjs +5 -5
- package/debugging/debugging.js +2 -2
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +2 -2
- package/debugging/debugging.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +12 -12
- package/index.mjs +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +1 -1
- package/localnet/get-kmd-wallet-account.js +1 -1
- package/localnet/get-kmd-wallet-account.mjs +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +1 -1
- package/localnet/get-localnet-dispenser-account.js +1 -1
- package/localnet/get-localnet-dispenser-account.mjs +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -1
- package/localnet/get-or-create-kmd-wallet-account.js +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +1 -1
- package/localnet/is-localnet.d.ts +1 -1
- package/localnet/is-localnet.js +1 -1
- package/localnet/is-localnet.mjs +1 -1
- package/network-client.d.ts +2 -2
- package/network-client.d.ts.map +1 -1
- package/network-client.js +2 -2
- package/network-client.mjs +2 -2
- package/package.json +1 -1
- package/testing/fixtures/algorand-fixture.js +12 -12
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +12 -12
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/transaction/legacy-bridge.d.ts +31 -5
- package/transaction/legacy-bridge.d.ts.map +1 -1
- package/transaction/legacy-bridge.js +99 -5
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +98 -7
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +1 -1
- package/transfer/transfer-algos.js +1 -1
- package/transfer/transfer-algos.mjs +1 -1
- package/transfer/transfer.d.ts +1 -1
- package/transfer/transfer.js +1 -1
- package/transfer/transfer.mjs +1 -1
- package/types/account-manager.d.ts +1 -1
- package/types/account-manager.d.ts.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +450 -20
- package/types/algorand-client-transaction-creator.d.ts.map +1 -1
- package/types/algorand-client-transaction-creator.js +406 -22
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +406 -22
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +750 -24
- package/types/algorand-client-transaction-sender.d.ts.map +1 -1
- package/types/algorand-client-transaction-sender.js +426 -12
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +426 -12
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +8 -0
- package/types/algorand-client.d.ts.map +1 -1
- package/types/algorand-client.js +14 -1
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +14 -1
- package/types/algorand-client.mjs.map +1 -1
- package/types/app-client.d.ts +13 -1
- package/types/app-client.d.ts.map +1 -1
- package/types/app-client.js +8 -5
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +9 -6
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +121 -0
- package/types/app-deployer.d.ts.map +1 -0
- package/types/app-deployer.js +354 -0
- package/types/app-deployer.js.map +1 -0
- package/types/app-deployer.mjs +352 -0
- package/types/app-deployer.mjs.map +1 -0
- package/types/app-manager.d.ts +235 -0
- package/types/app-manager.d.ts.map +1 -0
- package/types/app-manager.js +336 -0
- package/types/app-manager.js.map +1 -0
- package/types/app-manager.mjs +334 -0
- package/types/app-manager.mjs.map +1 -0
- package/types/app.d.ts +42 -7
- package/types/app.d.ts.map +1 -1
- package/types/app.js +1 -1
- package/types/app.js.map +1 -1
- package/types/app.mjs +1 -1
- package/types/app.mjs.map +1 -1
- package/types/client-manager.d.ts +2 -0
- package/types/client-manager.d.ts.map +1 -1
- package/types/client-manager.js +4 -0
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +4 -0
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +150 -39
- package/types/composer.d.ts.map +1 -1
- package/types/composer.js +218 -62
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +218 -62
- package/types/composer.mjs.map +1 -1
- package/types/expand.d.ts +8 -0
- package/types/expand.d.ts.map +1 -0
- package/types/expand.js +3 -0
- package/types/expand.js.map +1 -0
- package/types/expand.mjs +2 -0
- package/types/expand.mjs.map +1 -0
- package/types/transaction.d.ts +3 -0
- package/types/transaction.d.ts.map +1 -1
|
@@ -12,7 +12,7 @@ class AlgorandClientTransactionCreator {
|
|
|
12
12
|
* @param params The parameters for the payment transaction
|
|
13
13
|
* @example Basic example
|
|
14
14
|
* ```typescript
|
|
15
|
-
* const result = await
|
|
15
|
+
* const result = await algorand.send.payment({
|
|
16
16
|
* sender: 'SENDERADDRESS',
|
|
17
17
|
* receiver: 'RECEIVERADDRESS',
|
|
18
18
|
* amount: (4).algo(),
|
|
@@ -20,7 +20,7 @@ class AlgorandClientTransactionCreator {
|
|
|
20
20
|
* ```
|
|
21
21
|
* @example Advanced example
|
|
22
22
|
* ```typescript
|
|
23
|
-
* const result = await
|
|
23
|
+
* const result = await algorand.send.payment({
|
|
24
24
|
* amount: (4).algo(),
|
|
25
25
|
* receiver: 'RECEIVERADDRESS',
|
|
26
26
|
* sender: 'SENDERADDRESS',
|
|
@@ -52,11 +52,11 @@ class AlgorandClientTransactionCreator {
|
|
|
52
52
|
*
|
|
53
53
|
* @example Basic example
|
|
54
54
|
* ```typescript
|
|
55
|
-
* await algorand.
|
|
55
|
+
* await algorand.transactions.assetCreate({sender: "CREATORADDRESS", total: 100n})
|
|
56
56
|
* ```
|
|
57
57
|
* @example Advanced example
|
|
58
58
|
* ```typescript
|
|
59
|
-
* await algorand.
|
|
59
|
+
* await algorand.transactions.assetCreate({
|
|
60
60
|
* sender: 'CREATORADDRESS',
|
|
61
61
|
* total: 100n,
|
|
62
62
|
* decimals: 2,
|
|
@@ -94,11 +94,11 @@ class AlgorandClientTransactionCreator {
|
|
|
94
94
|
*
|
|
95
95
|
* @example Basic example
|
|
96
96
|
* ```typescript
|
|
97
|
-
* await algorand.
|
|
97
|
+
* await algorand.transactions.assetConfig({sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
98
98
|
* ```
|
|
99
99
|
* @example Advanced example
|
|
100
100
|
* ```typescript
|
|
101
|
-
* await algorand.
|
|
101
|
+
* await algorand.transactions.assetConfig({
|
|
102
102
|
* sender: 'MANAGERADDRESS',
|
|
103
103
|
* assetId: 123456n,
|
|
104
104
|
* manager: 'MANAGERADDRESS',
|
|
@@ -126,11 +126,11 @@ class AlgorandClientTransactionCreator {
|
|
|
126
126
|
*
|
|
127
127
|
* @example Basic example
|
|
128
128
|
* ```typescript
|
|
129
|
-
* await algorand.
|
|
129
|
+
* await algorand.transactions.assetFreeze({sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
130
130
|
* ```
|
|
131
131
|
* @example Advanced example
|
|
132
132
|
* ```typescript
|
|
133
|
-
* await algorand.
|
|
133
|
+
* await algorand.transactions.assetFreeze({
|
|
134
134
|
* sender: 'MANAGERADDRESS',
|
|
135
135
|
* assetId: 123456n,
|
|
136
136
|
* account: 'ACCOUNTADDRESS',
|
|
@@ -160,11 +160,11 @@ class AlgorandClientTransactionCreator {
|
|
|
160
160
|
*
|
|
161
161
|
* @example Basic example
|
|
162
162
|
* ```typescript
|
|
163
|
-
* await algorand.
|
|
163
|
+
* await algorand.transactions.assetDestroy({sender: "MANAGERADDRESS", assetId: 123456n })
|
|
164
164
|
* ```
|
|
165
165
|
* @example Advanced example
|
|
166
166
|
* ```typescript
|
|
167
|
-
* await algorand.
|
|
167
|
+
* await algorand.transactions.assetDestroy({
|
|
168
168
|
* sender: 'MANAGERADDRESS',
|
|
169
169
|
* assetId: 123456n,
|
|
170
170
|
* lease: 'lease',
|
|
@@ -188,11 +188,11 @@ class AlgorandClientTransactionCreator {
|
|
|
188
188
|
*
|
|
189
189
|
* @example Basic example
|
|
190
190
|
* ```typescript
|
|
191
|
-
* await algorand.
|
|
191
|
+
* await algorand.transactions.assetTransfer({sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
192
192
|
* ```
|
|
193
193
|
* @example Advanced example (with clawback)
|
|
194
194
|
* ```typescript
|
|
195
|
-
* await algorand.
|
|
195
|
+
* await algorand.transactions.assetTransfer({
|
|
196
196
|
* sender: 'CLAWBACKADDRESS',
|
|
197
197
|
* assetId: 123456n,
|
|
198
198
|
* amount: 1n,
|
|
@@ -221,11 +221,11 @@ class AlgorandClientTransactionCreator {
|
|
|
221
221
|
*
|
|
222
222
|
* @example Basic example
|
|
223
223
|
* ```typescript
|
|
224
|
-
* await algorand.
|
|
224
|
+
* await algorand.transactions.assetOptIn({sender: "SENDERADDRESS", assetId: 123456n })
|
|
225
225
|
* ```
|
|
226
226
|
* @example Advanced example
|
|
227
227
|
* ```typescript
|
|
228
|
-
* await algorand.
|
|
228
|
+
* await algorand.transactions.assetOptIn({
|
|
229
229
|
* sender: 'SENDERADDRESS',
|
|
230
230
|
* assetId: 123456n,
|
|
231
231
|
* lease: 'lease',
|
|
@@ -252,11 +252,11 @@ class AlgorandClientTransactionCreator {
|
|
|
252
252
|
*
|
|
253
253
|
* @example Basic example
|
|
254
254
|
* ```typescript
|
|
255
|
-
* await algorand.
|
|
255
|
+
* await algorand.transactions.assetOptOut({sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n })
|
|
256
256
|
* ```
|
|
257
257
|
* @example Advanced example
|
|
258
258
|
* ```typescript
|
|
259
|
-
* await algorand.
|
|
259
|
+
* await algorand.transactions.assetOptIn({
|
|
260
260
|
* sender: 'SENDERADDRESS',
|
|
261
261
|
* assetId: 123456n,
|
|
262
262
|
* creator: 'CREATORADDRESS',
|
|
@@ -276,12 +276,390 @@ class AlgorandClientTransactionCreator {
|
|
|
276
276
|
* @returns The asset opt-out transaction
|
|
277
277
|
*/
|
|
278
278
|
this.assetOptOut = this._transaction((c) => c.addAssetOptOut);
|
|
279
|
-
/** Create an application
|
|
279
|
+
/** Create an application create transaction.
|
|
280
|
+
*
|
|
281
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
282
|
+
*
|
|
283
|
+
* @param params The parameters for the app creation transaction
|
|
284
|
+
* @example Basic example
|
|
285
|
+
* ```typescript
|
|
286
|
+
* const result = await algorand.transactions.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
287
|
+
* const createdAppId = result.appId
|
|
288
|
+
* ```
|
|
289
|
+
* @example Advanced example
|
|
290
|
+
* ```typescript
|
|
291
|
+
* await algorand.transactions.appCreate({
|
|
292
|
+
* sender: 'CREATORADDRESS',
|
|
293
|
+
* approvalProgram: "TEALCODE",
|
|
294
|
+
* clearStateProgram: "TEALCODE",
|
|
295
|
+
* schema: {
|
|
296
|
+
* globalInts: 1,
|
|
297
|
+
* globalByteSlices: 2,
|
|
298
|
+
* localInts: 3,
|
|
299
|
+
* localByteSlices: 4
|
|
300
|
+
* },
|
|
301
|
+
* extraProgramPages: 1,
|
|
302
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
303
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
304
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
305
|
+
* appReferences: [123n, 1234n]
|
|
306
|
+
* assetReferences: [12345n]
|
|
307
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
308
|
+
* lease: 'lease',
|
|
309
|
+
* note: 'note',
|
|
310
|
+
* // You wouldn't normally set this field
|
|
311
|
+
* firstValidRound: 1000n,
|
|
312
|
+
* validityWindow: 10,
|
|
313
|
+
* extraFee: (1000).microAlgo(),
|
|
314
|
+
* staticFee: (1000).microAlgo(),
|
|
315
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
316
|
+
* // already specified, but here for completeness
|
|
317
|
+
* maxFee: (3000).microAlgo(),
|
|
318
|
+
* // Signer only needed if you want to provide one,
|
|
319
|
+
* // generally you'd register it with AlgorandClient
|
|
320
|
+
* // against the sender and not need to pass it in
|
|
321
|
+
* signer: transactionSigner,
|
|
322
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
323
|
+
* suppressLog: true,
|
|
324
|
+
*})
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
this.appCreate = this._transaction((c) => c.addAppCreate);
|
|
328
|
+
/** Create an application update transaction.
|
|
329
|
+
*
|
|
330
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
331
|
+
*
|
|
332
|
+
* @param params The parameters for the app update transaction
|
|
333
|
+
* @example Basic example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* await algorand.transactions.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
336
|
+
* ```
|
|
337
|
+
* @example Advanced example
|
|
338
|
+
* ```typescript
|
|
339
|
+
* await algorand.transactions.appUpdate({
|
|
340
|
+
* sender: 'CREATORADDRESS',
|
|
341
|
+
* approvalProgram: "TEALCODE",
|
|
342
|
+
* clearStateProgram: "TEALCODE",
|
|
343
|
+
* onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
|
|
344
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
345
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
346
|
+
* appReferences: [123n, 1234n]
|
|
347
|
+
* assetReferences: [12345n]
|
|
348
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
349
|
+
* lease: 'lease',
|
|
350
|
+
* note: 'note',
|
|
351
|
+
* // You wouldn't normally set this field
|
|
352
|
+
* firstValidRound: 1000n,
|
|
353
|
+
* validityWindow: 10,
|
|
354
|
+
* extraFee: (1000).microAlgo(),
|
|
355
|
+
* staticFee: (1000).microAlgo(),
|
|
356
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
357
|
+
* // already specified, but here for completeness
|
|
358
|
+
* maxFee: (3000).microAlgo(),
|
|
359
|
+
* // Signer only needed if you want to provide one,
|
|
360
|
+
* // generally you'd register it with AlgorandClient
|
|
361
|
+
* // against the sender and not need to pass it in
|
|
362
|
+
* signer: transactionSigner,
|
|
363
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
364
|
+
* suppressLog: true,
|
|
365
|
+
*})
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
this.appUpdate = this._transaction((c) => c.addAppUpdate);
|
|
369
|
+
/** Create an application delete transaction.
|
|
370
|
+
*
|
|
371
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
372
|
+
*
|
|
373
|
+
* @param params The parameters for the app deletion transaction
|
|
374
|
+
* @example Basic example
|
|
375
|
+
* ```typescript
|
|
376
|
+
* await algorand.transactions.appDelete({ sender: 'CREATORADDRESS' })
|
|
377
|
+
* ```
|
|
378
|
+
* @example Advanced example
|
|
379
|
+
* ```typescript
|
|
380
|
+
* await algorand.transactions.appDelete({
|
|
381
|
+
* sender: 'CREATORADDRESS',
|
|
382
|
+
* onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
|
|
383
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
384
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
385
|
+
* appReferences: [123n, 1234n]
|
|
386
|
+
* assetReferences: [12345n]
|
|
387
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
388
|
+
* lease: 'lease',
|
|
389
|
+
* note: 'note',
|
|
390
|
+
* // You wouldn't normally set this field
|
|
391
|
+
* firstValidRound: 1000n,
|
|
392
|
+
* validityWindow: 10,
|
|
393
|
+
* extraFee: (1000).microAlgo(),
|
|
394
|
+
* staticFee: (1000).microAlgo(),
|
|
395
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
396
|
+
* // already specified, but here for completeness
|
|
397
|
+
* maxFee: (3000).microAlgo(),
|
|
398
|
+
* // Signer only needed if you want to provide one,
|
|
399
|
+
* // generally you'd register it with AlgorandClient
|
|
400
|
+
* // against the sender and not need to pass it in
|
|
401
|
+
* signer: transactionSigner,
|
|
402
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
403
|
+
* suppressLog: true,
|
|
404
|
+
*})
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
this.appDelete = this._transaction((c) => c.addAppDelete);
|
|
408
|
+
/** Create an application call transaction.
|
|
409
|
+
*
|
|
410
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
411
|
+
*
|
|
412
|
+
* @param params The parameters for the app call transaction
|
|
413
|
+
* @example Basic example
|
|
414
|
+
* ```typescript
|
|
415
|
+
* await algorand.transactions.appCall({ sender: 'CREATORADDRESS' })
|
|
416
|
+
* ```
|
|
417
|
+
* @example Advanced example
|
|
418
|
+
* ```typescript
|
|
419
|
+
* await algorand.transactions.appCall({
|
|
420
|
+
* sender: 'CREATORADDRESS',
|
|
421
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
422
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
423
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
424
|
+
* appReferences: [123n, 1234n]
|
|
425
|
+
* assetReferences: [12345n]
|
|
426
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
427
|
+
* lease: 'lease',
|
|
428
|
+
* note: 'note',
|
|
429
|
+
* // You wouldn't normally set this field
|
|
430
|
+
* firstValidRound: 1000n,
|
|
431
|
+
* validityWindow: 10,
|
|
432
|
+
* extraFee: (1000).microAlgo(),
|
|
433
|
+
* staticFee: (1000).microAlgo(),
|
|
434
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
435
|
+
* // already specified, but here for completeness
|
|
436
|
+
* maxFee: (3000).microAlgo(),
|
|
437
|
+
* // Signer only needed if you want to provide one,
|
|
438
|
+
* // generally you'd register it with AlgorandClient
|
|
439
|
+
* // against the sender and not need to pass it in
|
|
440
|
+
* signer: transactionSigner,
|
|
441
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
442
|
+
* suppressLog: true,
|
|
443
|
+
*})
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
280
446
|
this.appCall = this._transaction((c) => c.addAppCall);
|
|
281
|
-
/** Create an application call with ABI method call transaction.
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
447
|
+
/** Create an application create call with ABI method call transaction.
|
|
448
|
+
*
|
|
449
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
450
|
+
*
|
|
451
|
+
* @param params The parameters for the app creation transaction
|
|
452
|
+
* @example Basic example
|
|
453
|
+
* ```typescript
|
|
454
|
+
* const method = new ABIMethod({
|
|
455
|
+
* name: 'method',
|
|
456
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
457
|
+
* returns: { type: 'string' },
|
|
458
|
+
* })
|
|
459
|
+
* const result = await algorand.transactions.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
460
|
+
* const createdAppId = result.appId
|
|
461
|
+
* ```
|
|
462
|
+
* @example Advanced example
|
|
463
|
+
* ```typescript
|
|
464
|
+
* const method = new ABIMethod({
|
|
465
|
+
* name: 'method',
|
|
466
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
467
|
+
* returns: { type: 'string' },
|
|
468
|
+
* })
|
|
469
|
+
* await algorand.transactions.appCreate({
|
|
470
|
+
* sender: 'CREATORADDRESS',
|
|
471
|
+
* method: method,
|
|
472
|
+
* args: ["arg1_value"],
|
|
473
|
+
* approvalProgram: "TEALCODE",
|
|
474
|
+
* clearStateProgram: "TEALCODE",
|
|
475
|
+
* schema: {
|
|
476
|
+
* globalInts: 1,
|
|
477
|
+
* globalByteSlices: 2,
|
|
478
|
+
* localInts: 3,
|
|
479
|
+
* localByteSlices: 4
|
|
480
|
+
* },
|
|
481
|
+
* extraProgramPages: 1,
|
|
482
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
483
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
484
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
485
|
+
* appReferences: [123n, 1234n]
|
|
486
|
+
* assetReferences: [12345n]
|
|
487
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
488
|
+
* lease: 'lease',
|
|
489
|
+
* note: 'note',
|
|
490
|
+
* // You wouldn't normally set this field
|
|
491
|
+
* firstValidRound: 1000n,
|
|
492
|
+
* validityWindow: 10,
|
|
493
|
+
* extraFee: (1000).microAlgo(),
|
|
494
|
+
* staticFee: (1000).microAlgo(),
|
|
495
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
496
|
+
* // already specified, but here for completeness
|
|
497
|
+
* maxFee: (3000).microAlgo(),
|
|
498
|
+
* // Signer only needed if you want to provide one,
|
|
499
|
+
* // generally you'd register it with AlgorandClient
|
|
500
|
+
* // against the sender and not need to pass it in
|
|
501
|
+
* signer: transactionSigner,
|
|
502
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
503
|
+
* suppressLog: true,
|
|
504
|
+
*})
|
|
505
|
+
* ```
|
|
506
|
+
*/
|
|
507
|
+
this.appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall);
|
|
508
|
+
/** Create an application update call with ABI method call transaction.
|
|
509
|
+
*
|
|
510
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
511
|
+
*
|
|
512
|
+
* @param params The parameters for the app update transaction
|
|
513
|
+
* @example Basic example
|
|
514
|
+
* ```typescript
|
|
515
|
+
* const method = new ABIMethod({
|
|
516
|
+
* name: 'method',
|
|
517
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
518
|
+
* returns: { type: 'string' },
|
|
519
|
+
* })
|
|
520
|
+
* await algorand.transactions.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
521
|
+
* ```
|
|
522
|
+
* @example Advanced example
|
|
523
|
+
* ```typescript
|
|
524
|
+
* const method = new ABIMethod({
|
|
525
|
+
* name: 'method',
|
|
526
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
527
|
+
* returns: { type: 'string' },
|
|
528
|
+
* })
|
|
529
|
+
* await algorand.transactions.appUpdateMethodCall({
|
|
530
|
+
* sender: 'CREATORADDRESS',
|
|
531
|
+
* method: method,
|
|
532
|
+
* args: ["arg1_value"],
|
|
533
|
+
* approvalProgram: "TEALCODE",
|
|
534
|
+
* clearStateProgram: "TEALCODE",
|
|
535
|
+
* onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
|
|
536
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
537
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
538
|
+
* appReferences: [123n, 1234n]
|
|
539
|
+
* assetReferences: [12345n]
|
|
540
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
541
|
+
* lease: 'lease',
|
|
542
|
+
* note: 'note',
|
|
543
|
+
* // You wouldn't normally set this field
|
|
544
|
+
* firstValidRound: 1000n,
|
|
545
|
+
* validityWindow: 10,
|
|
546
|
+
* extraFee: (1000).microAlgo(),
|
|
547
|
+
* staticFee: (1000).microAlgo(),
|
|
548
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
549
|
+
* // already specified, but here for completeness
|
|
550
|
+
* maxFee: (3000).microAlgo(),
|
|
551
|
+
* // Signer only needed if you want to provide one,
|
|
552
|
+
* // generally you'd register it with AlgorandClient
|
|
553
|
+
* // against the sender and not need to pass it in
|
|
554
|
+
* signer: transactionSigner,
|
|
555
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
556
|
+
* suppressLog: true,
|
|
557
|
+
*})
|
|
558
|
+
* ```
|
|
559
|
+
*/
|
|
560
|
+
this.appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall);
|
|
561
|
+
/** Create an application delete call with ABI method call transaction.
|
|
562
|
+
*
|
|
563
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
564
|
+
*
|
|
565
|
+
* @param params The parameters for the app deletion transaction
|
|
566
|
+
* @example Basic example
|
|
567
|
+
* ```typescript
|
|
568
|
+
* const method = new ABIMethod({
|
|
569
|
+
* name: 'method',
|
|
570
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
571
|
+
* returns: { type: 'string' },
|
|
572
|
+
* })
|
|
573
|
+
* await algorand.transactions.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
574
|
+
* ```
|
|
575
|
+
* @example Advanced example
|
|
576
|
+
* ```typescript
|
|
577
|
+
* const method = new ABIMethod({
|
|
578
|
+
* name: 'method',
|
|
579
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
580
|
+
* returns: { type: 'string' },
|
|
581
|
+
* })
|
|
582
|
+
* await algorand.transactions.appDeleteMethodCall({
|
|
583
|
+
* sender: 'CREATORADDRESS',
|
|
584
|
+
* method: method,
|
|
585
|
+
* args: ["arg1_value"],
|
|
586
|
+
* onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
|
|
587
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
588
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
589
|
+
* appReferences: [123n, 1234n]
|
|
590
|
+
* assetReferences: [12345n]
|
|
591
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
592
|
+
* lease: 'lease',
|
|
593
|
+
* note: 'note',
|
|
594
|
+
* // You wouldn't normally set this field
|
|
595
|
+
* firstValidRound: 1000n,
|
|
596
|
+
* validityWindow: 10,
|
|
597
|
+
* extraFee: (1000).microAlgo(),
|
|
598
|
+
* staticFee: (1000).microAlgo(),
|
|
599
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
600
|
+
* // already specified, but here for completeness
|
|
601
|
+
* maxFee: (3000).microAlgo(),
|
|
602
|
+
* // Signer only needed if you want to provide one,
|
|
603
|
+
* // generally you'd register it with AlgorandClient
|
|
604
|
+
* // against the sender and not need to pass it in
|
|
605
|
+
* signer: transactionSigner,
|
|
606
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
607
|
+
* suppressLog: true,
|
|
608
|
+
*})
|
|
609
|
+
* ```
|
|
610
|
+
*/
|
|
611
|
+
this.appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall);
|
|
612
|
+
/** Create an application call with ABI method call transaction.
|
|
613
|
+
*
|
|
614
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
615
|
+
*
|
|
616
|
+
* @param params The parameters for the app call transaction
|
|
617
|
+
* @example Basic example
|
|
618
|
+
* ```typescript
|
|
619
|
+
* const method = new ABIMethod({
|
|
620
|
+
* name: 'method',
|
|
621
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
622
|
+
* returns: { type: 'string' },
|
|
623
|
+
* })
|
|
624
|
+
* await algorand.transactions.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
625
|
+
* ```
|
|
626
|
+
* @example Advanced example
|
|
627
|
+
* ```typescript
|
|
628
|
+
* const method = new ABIMethod({
|
|
629
|
+
* name: 'method',
|
|
630
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
631
|
+
* returns: { type: 'string' },
|
|
632
|
+
* })
|
|
633
|
+
* await algorand.transactions.appCallMethodCall({
|
|
634
|
+
* sender: 'CREATORADDRESS',
|
|
635
|
+
* method: method,
|
|
636
|
+
* args: ["arg1_value"],
|
|
637
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
638
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
639
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
640
|
+
* appReferences: [123n, 1234n]
|
|
641
|
+
* assetReferences: [12345n]
|
|
642
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
643
|
+
* lease: 'lease',
|
|
644
|
+
* note: 'note',
|
|
645
|
+
* // You wouldn't normally set this field
|
|
646
|
+
* firstValidRound: 1000n,
|
|
647
|
+
* validityWindow: 10,
|
|
648
|
+
* extraFee: (1000).microAlgo(),
|
|
649
|
+
* staticFee: (1000).microAlgo(),
|
|
650
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
651
|
+
* // already specified, but here for completeness
|
|
652
|
+
* maxFee: (3000).microAlgo(),
|
|
653
|
+
* // Signer only needed if you want to provide one,
|
|
654
|
+
* // generally you'd register it with AlgorandClient
|
|
655
|
+
* // against the sender and not need to pass it in
|
|
656
|
+
* signer: transactionSigner,
|
|
657
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
658
|
+
* suppressLog: true,
|
|
659
|
+
*})
|
|
660
|
+
* ```
|
|
661
|
+
*/
|
|
662
|
+
this.appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall);
|
|
285
663
|
/** Create an online key registration transaction. */
|
|
286
664
|
this.onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration);
|
|
287
665
|
this._newGroup = newGroup;
|
|
@@ -290,7 +668,13 @@ class AlgorandClientTransactionCreator {
|
|
|
290
668
|
return async (params) => {
|
|
291
669
|
const composer = this._newGroup();
|
|
292
670
|
const result = await c(composer).apply(composer, [params]).buildTransactions();
|
|
293
|
-
return result
|
|
671
|
+
return result.transactions.at(-1);
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
_transactions(c) {
|
|
675
|
+
return async (params) => {
|
|
676
|
+
const composer = this._newGroup();
|
|
677
|
+
return await c(composer).apply(composer, [params]).buildTransactions();
|
|
294
678
|
};
|
|
295
679
|
}
|
|
296
680
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algorand-client-transaction-creator.js","sources":["../../src/types/algorand-client-transaction-creator.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"algorand-client-transaction-creator.js","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;;;;;;;;;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