@algorandfoundation/algokit-utils 7.0.0-beta.1 → 7.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -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
|
|
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
|
|
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.
|
|
53
|
+
* await algorand.transactions.assetCreate({sender: "CREATORADDRESS", total: 100n})
|
|
54
54
|
* ```
|
|
55
55
|
* @example Advanced example
|
|
56
56
|
* ```typescript
|
|
57
|
-
* await algorand.
|
|
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.
|
|
95
|
+
* await algorand.transactions.assetConfig({sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
96
96
|
* ```
|
|
97
97
|
* @example Advanced example
|
|
98
98
|
* ```typescript
|
|
99
|
-
* await algorand.
|
|
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.
|
|
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.
|
|
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.
|
|
161
|
+
* await algorand.transactions.assetDestroy({sender: "MANAGERADDRESS", assetId: 123456n })
|
|
162
162
|
* ```
|
|
163
163
|
* @example Advanced example
|
|
164
164
|
* ```typescript
|
|
165
|
-
* await algorand.
|
|
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.
|
|
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.
|
|
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.
|
|
222
|
+
* await algorand.transactions.assetOptIn({sender: "SENDERADDRESS", assetId: 123456n })
|
|
223
223
|
* ```
|
|
224
224
|
* @example Advanced example
|
|
225
225
|
* ```typescript
|
|
226
|
-
* await algorand.
|
|
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.
|
|
253
|
+
* await algorand.transactions.assetOptOut({sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n })
|
|
254
254
|
* ```
|
|
255
255
|
* @example Advanced example
|
|
256
256
|
* ```typescript
|
|
257
|
-
* await algorand.
|
|
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
|
|
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
|
-
|
|
281
|
-
|
|
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
|
|
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":"
|
|
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;;;;;;;;;;;;;;;;;;;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