@algorandfoundation/algokit-utils 8.2.0-beta.2 → 8.2.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/package.json +3 -2
- package/types/account-manager.d.ts +33 -18
- package/types/account-manager.js +33 -18
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +33 -18
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +5 -0
- package/types/account.js +5 -0
- package/types/account.js.map +1 -1
- package/types/account.mjs +5 -0
- package/types/account.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +103 -70
- package/types/algorand-client-transaction-creator.js +103 -70
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +103 -70
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +107 -20
- package/types/algorand-client-transaction-sender.js +107 -21
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +107 -21
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +108 -24
- package/types/algorand-client.js +107 -23
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +107 -23
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +10 -0
- package/types/amount.js +10 -0
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +10 -0
- package/types/amount.mjs.map +1 -1
- package/types/app-client.d.ts +128 -8
- package/types/app-client.js +128 -8
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +128 -8
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +33 -1
- package/types/app-deployer.js +33 -1
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +33 -1
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +74 -4
- package/types/app-factory.js +74 -4
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +74 -4
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +64 -0
- package/types/app-manager.js +64 -0
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +64 -0
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +9 -0
- package/types/app-spec.js +9 -0
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +9 -0
- package/types/app-spec.mjs.map +1 -1
- package/types/asset-manager.d.ts +5 -5
- package/types/asset-manager.js +5 -5
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +5 -5
- package/types/asset-manager.mjs.map +1 -1
- package/types/client-manager.d.ts +79 -18
- package/types/client-manager.js +79 -18
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +79 -18
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +599 -1
- package/types/composer.js +575 -1
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +575 -1
- package/types/composer.mjs.map +1 -1
|
@@ -8,6 +8,10 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
8
8
|
/**
|
|
9
9
|
* Creates a new `AlgorandClientTransactionCreator`
|
|
10
10
|
* @param newGroup A lambda that starts a new `TransactionComposer` transaction group
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer())
|
|
14
|
+
* ```
|
|
11
15
|
*/
|
|
12
16
|
constructor(newGroup: () => TransactionComposer);
|
|
13
17
|
private _transaction;
|
|
@@ -17,15 +21,15 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
17
21
|
* @param params The parameters for the payment transaction
|
|
18
22
|
* @example Basic example
|
|
19
23
|
* ```typescript
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* await algorand.createTransaction.payment({
|
|
25
|
+
* sender: 'SENDERADDRESS',
|
|
26
|
+
* receiver: 'RECEIVERADDRESS',
|
|
27
|
+
* amount: (4).algo(),
|
|
24
28
|
* })
|
|
25
29
|
* ```
|
|
26
30
|
* @example Advanced example
|
|
27
31
|
* ```typescript
|
|
28
|
-
*
|
|
32
|
+
* await algorand.createTransaction.payment({
|
|
29
33
|
* amount: (4).algo(),
|
|
30
34
|
* receiver: 'RECEIVERADDRESS',
|
|
31
35
|
* sender: 'SENDERADDRESS',
|
|
@@ -44,7 +48,6 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
44
48
|
* maxFee: (3000).microAlgo(),
|
|
45
49
|
* })
|
|
46
50
|
* ```
|
|
47
|
-
*
|
|
48
51
|
* @returns The payment transaction
|
|
49
52
|
*/
|
|
50
53
|
payment: (params: import("./composer").PaymentParams) => Promise<Transaction>;
|
|
@@ -57,7 +60,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
57
60
|
*
|
|
58
61
|
* @example Basic example
|
|
59
62
|
* ```typescript
|
|
60
|
-
* await algorand.createTransaction.assetCreate({sender: "CREATORADDRESS", total: 100n})
|
|
63
|
+
* await algorand.createTransaction.assetCreate({ sender: "CREATORADDRESS", total: 100n})
|
|
61
64
|
* ```
|
|
62
65
|
* @example Advanced example
|
|
63
66
|
* ```typescript
|
|
@@ -99,7 +102,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
99
102
|
*
|
|
100
103
|
* @example Basic example
|
|
101
104
|
* ```typescript
|
|
102
|
-
* await algorand.createTransaction.assetConfig({sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
105
|
+
* await algorand.createTransaction.assetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
103
106
|
* ```
|
|
104
107
|
* @example Advanced example
|
|
105
108
|
* ```typescript
|
|
@@ -131,7 +134,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
131
134
|
*
|
|
132
135
|
* @example Basic example
|
|
133
136
|
* ```typescript
|
|
134
|
-
* await algorand.createTransaction.assetFreeze({sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
137
|
+
* await algorand.createTransaction.assetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
135
138
|
* ```
|
|
136
139
|
* @example Advanced example
|
|
137
140
|
* ```typescript
|
|
@@ -165,7 +168,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
165
168
|
*
|
|
166
169
|
* @example Basic example
|
|
167
170
|
* ```typescript
|
|
168
|
-
* await algorand.createTransaction.assetDestroy({sender: "MANAGERADDRESS", assetId: 123456n })
|
|
171
|
+
* await algorand.createTransaction.assetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
|
|
169
172
|
* ```
|
|
170
173
|
* @example Advanced example
|
|
171
174
|
* ```typescript
|
|
@@ -193,7 +196,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
193
196
|
*
|
|
194
197
|
* @example Basic example
|
|
195
198
|
* ```typescript
|
|
196
|
-
* await algorand.createTransaction.assetTransfer({sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
199
|
+
* await algorand.createTransaction.assetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
197
200
|
* ```
|
|
198
201
|
* @example Advanced example (with clawback)
|
|
199
202
|
* ```typescript
|
|
@@ -226,7 +229,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
226
229
|
*
|
|
227
230
|
* @example Basic example
|
|
228
231
|
* ```typescript
|
|
229
|
-
* await algorand.createTransaction.assetOptIn({sender: "SENDERADDRESS", assetId: 123456n })
|
|
232
|
+
* await algorand.createTransaction.assetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
|
|
230
233
|
* ```
|
|
231
234
|
* @example Advanced example
|
|
232
235
|
* ```typescript
|
|
@@ -255,13 +258,17 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
255
258
|
*
|
|
256
259
|
* @param params The parameters for the asset opt-out transaction
|
|
257
260
|
*
|
|
258
|
-
* @example Basic example
|
|
261
|
+
* @example Basic example (without creator, will be retrieved from algod)
|
|
259
262
|
* ```typescript
|
|
260
|
-
* await algorand.createTransaction.assetOptOut({sender: "SENDERADDRESS",
|
|
263
|
+
* await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
264
|
+
* ```
|
|
265
|
+
* @example Basic example (with creator)
|
|
266
|
+
* ```typescript
|
|
267
|
+
* await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
261
268
|
* ```
|
|
262
269
|
* @example Advanced example
|
|
263
270
|
* ```typescript
|
|
264
|
-
* await algorand.createTransaction.
|
|
271
|
+
* await algorand.createTransaction.assetOptOut({
|
|
265
272
|
* sender: 'SENDERADDRESS',
|
|
266
273
|
* assetId: 123456n,
|
|
267
274
|
* creator: 'CREATORADDRESS',
|
|
@@ -288,8 +295,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
288
295
|
* @param params The parameters for the app creation transaction
|
|
289
296
|
* @example Basic example
|
|
290
297
|
* ```typescript
|
|
291
|
-
*
|
|
292
|
-
* const createdAppId = result.appId
|
|
298
|
+
* await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
293
299
|
* ```
|
|
294
300
|
* @example Advanced example
|
|
295
301
|
* ```typescript
|
|
@@ -320,14 +326,9 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
320
326
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
321
327
|
* // already specified, but here for completeness
|
|
322
328
|
* maxFee: (3000).microAlgo(),
|
|
323
|
-
* // Signer only needed if you want to provide one,
|
|
324
|
-
* // generally you'd register it with AlgorandClient
|
|
325
|
-
* // against the sender and not need to pass it in
|
|
326
|
-
* signer: transactionSigner,
|
|
327
|
-
* maxRoundsToWaitForConfirmation: 5,
|
|
328
|
-
* suppressLog: true,
|
|
329
329
|
*})
|
|
330
330
|
* ```
|
|
331
|
+
* @returns The application create transaction
|
|
331
332
|
*/
|
|
332
333
|
appCreate: (params: {
|
|
333
334
|
sender: string | algosdk.Address;
|
|
@@ -388,14 +389,9 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
388
389
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
389
390
|
* // already specified, but here for completeness
|
|
390
391
|
* maxFee: (3000).microAlgo(),
|
|
391
|
-
* // Signer only needed if you want to provide one,
|
|
392
|
-
* // generally you'd register it with AlgorandClient
|
|
393
|
-
* // against the sender and not need to pass it in
|
|
394
|
-
* signer: transactionSigner,
|
|
395
|
-
* maxRoundsToWaitForConfirmation: 5,
|
|
396
|
-
* suppressLog: true,
|
|
397
392
|
*})
|
|
398
393
|
* ```
|
|
394
|
+
* @returns The application update transaction
|
|
399
395
|
*/
|
|
400
396
|
appUpdate: (params: {
|
|
401
397
|
sender: string | algosdk.Address;
|
|
@@ -448,14 +444,9 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
448
444
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
449
445
|
* // already specified, but here for completeness
|
|
450
446
|
* maxFee: (3000).microAlgo(),
|
|
451
|
-
* // Signer only needed if you want to provide one,
|
|
452
|
-
* // generally you'd register it with AlgorandClient
|
|
453
|
-
* // against the sender and not need to pass it in
|
|
454
|
-
* signer: transactionSigner,
|
|
455
|
-
* maxRoundsToWaitForConfirmation: 5,
|
|
456
|
-
* suppressLog: true,
|
|
457
447
|
*})
|
|
458
448
|
* ```
|
|
449
|
+
* @returns The application delete transaction
|
|
459
450
|
*/
|
|
460
451
|
appDelete: (params: import("./composer").AppDeleteParams) => Promise<Transaction>;
|
|
461
452
|
/** Create an application call transaction.
|
|
@@ -487,14 +478,9 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
487
478
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
488
479
|
* // already specified, but here for completeness
|
|
489
480
|
* maxFee: (3000).microAlgo(),
|
|
490
|
-
* // Signer only needed if you want to provide one,
|
|
491
|
-
* // generally you'd register it with AlgorandClient
|
|
492
|
-
* // against the sender and not need to pass it in
|
|
493
|
-
* signer: transactionSigner,
|
|
494
|
-
* maxRoundsToWaitForConfirmation: 5,
|
|
495
|
-
* suppressLog: true,
|
|
496
481
|
*})
|
|
497
482
|
* ```
|
|
483
|
+
* @returns The application call transaction
|
|
498
484
|
*/
|
|
499
485
|
appCall: (params: import("./composer").AppCallParams) => Promise<Transaction>;
|
|
500
486
|
/** Create an application create call with ABI method call transaction.
|
|
@@ -509,8 +495,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
509
495
|
* args: [{ name: 'arg1', type: 'string' }],
|
|
510
496
|
* returns: { type: 'string' },
|
|
511
497
|
* })
|
|
512
|
-
*
|
|
513
|
-
* const createdAppId = result.appId
|
|
498
|
+
* await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
514
499
|
* ```
|
|
515
500
|
* @example Advanced example
|
|
516
501
|
* ```typescript
|
|
@@ -519,7 +504,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
519
504
|
* args: [{ name: 'arg1', type: 'string' }],
|
|
520
505
|
* returns: { type: 'string' },
|
|
521
506
|
* })
|
|
522
|
-
* await algorand.createTransaction.
|
|
507
|
+
* await algorand.createTransaction.appCreateMethodCall({
|
|
523
508
|
* sender: 'CREATORADDRESS',
|
|
524
509
|
* method: method,
|
|
525
510
|
* args: ["arg1_value"],
|
|
@@ -548,14 +533,9 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
548
533
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
549
534
|
* // already specified, but here for completeness
|
|
550
535
|
* 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
536
|
*})
|
|
558
537
|
* ```
|
|
538
|
+
* @returns The application ABI method create transaction
|
|
559
539
|
*/
|
|
560
540
|
appCreateMethodCall: (params: import("./composer").AppCreateMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
561
541
|
/** Create an application update call with ABI method call transaction.
|
|
@@ -601,14 +581,9 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
601
581
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
602
582
|
* // already specified, but here for completeness
|
|
603
583
|
* maxFee: (3000).microAlgo(),
|
|
604
|
-
* // Signer only needed if you want to provide one,
|
|
605
|
-
* // generally you'd register it with AlgorandClient
|
|
606
|
-
* // against the sender and not need to pass it in
|
|
607
|
-
* signer: transactionSigner,
|
|
608
|
-
* maxRoundsToWaitForConfirmation: 5,
|
|
609
|
-
* suppressLog: true,
|
|
610
584
|
*})
|
|
611
585
|
* ```
|
|
586
|
+
* @returns The application ABI method update transaction
|
|
612
587
|
*/
|
|
613
588
|
appUpdateMethodCall: (params: import("./composer").AppUpdateMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
614
589
|
/** Create an application delete call with ABI method call transaction.
|
|
@@ -652,14 +627,9 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
652
627
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
653
628
|
* // already specified, but here for completeness
|
|
654
629
|
* maxFee: (3000).microAlgo(),
|
|
655
|
-
* // Signer only needed if you want to provide one,
|
|
656
|
-
* // generally you'd register it with AlgorandClient
|
|
657
|
-
* // against the sender and not need to pass it in
|
|
658
|
-
* signer: transactionSigner,
|
|
659
|
-
* maxRoundsToWaitForConfirmation: 5,
|
|
660
|
-
* suppressLog: true,
|
|
661
630
|
*})
|
|
662
631
|
* ```
|
|
632
|
+
* @returns The application ABI method delete transaction
|
|
663
633
|
*/
|
|
664
634
|
appDeleteMethodCall: (params: import("./composer").AppDeleteMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
665
635
|
/** Create an application call with ABI method call transaction.
|
|
@@ -703,18 +673,81 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
703
673
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
704
674
|
* // already specified, but here for completeness
|
|
705
675
|
* maxFee: (3000).microAlgo(),
|
|
706
|
-
* // Signer only needed if you want to provide one,
|
|
707
|
-
* // generally you'd register it with AlgorandClient
|
|
708
|
-
* // against the sender and not need to pass it in
|
|
709
|
-
* signer: transactionSigner,
|
|
710
|
-
* maxRoundsToWaitForConfirmation: 5,
|
|
711
|
-
* suppressLog: true,
|
|
712
676
|
*})
|
|
713
677
|
* ```
|
|
678
|
+
* @returns The application ABI method call transaction
|
|
714
679
|
*/
|
|
715
680
|
appCallMethodCall: (params: import("./composer").AppCallMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
716
|
-
/**
|
|
681
|
+
/**
|
|
682
|
+
* Create an online key registration transaction.
|
|
683
|
+
* @param params The parameters for the key registration transaction
|
|
684
|
+
* @example Basic example
|
|
685
|
+
* ```typescript
|
|
686
|
+
* await algorand.createTransaction.onlineKeyRegistration({
|
|
687
|
+
* sender: 'SENDERADDRESS',
|
|
688
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
689
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
690
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
691
|
+
* voteFirst: 1n,
|
|
692
|
+
* voteLast: 1000n,
|
|
693
|
+
* voteKeyDilution: 1n,
|
|
694
|
+
* })
|
|
695
|
+
* ```
|
|
696
|
+
* @example Advanced example
|
|
697
|
+
* ```typescript
|
|
698
|
+
* await algorand.createTransaction.onlineKeyRegistration({
|
|
699
|
+
* sender: 'SENDERADDRESS',
|
|
700
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
701
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
702
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
703
|
+
* voteFirst: 1n,
|
|
704
|
+
* voteLast: 1000n,
|
|
705
|
+
* voteKeyDilution: 1n,
|
|
706
|
+
* lease: 'lease',
|
|
707
|
+
* note: 'note',
|
|
708
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
709
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
710
|
+
* // You wouldn't normally set this field
|
|
711
|
+
* firstValidRound: 1000n,
|
|
712
|
+
* validityWindow: 10,
|
|
713
|
+
* extraFee: (1000).microAlgo(),
|
|
714
|
+
* staticFee: (1000).microAlgo(),
|
|
715
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
716
|
+
* // already specified, but here for completeness
|
|
717
|
+
* maxFee: (3000).microAlgo(),
|
|
718
|
+
* })
|
|
719
|
+
* ```
|
|
720
|
+
* @returns The online key registration transaction
|
|
721
|
+
*/
|
|
717
722
|
onlineKeyRegistration: (params: import("./composer").OnlineKeyRegistrationParams) => Promise<Transaction>;
|
|
718
|
-
/**
|
|
723
|
+
/**
|
|
724
|
+
* Create an offline key registration transaction.
|
|
725
|
+
* @param params The parameters for the key registration transaction
|
|
726
|
+
* @example Basic example
|
|
727
|
+
* ```typescript
|
|
728
|
+
* await algorand.createTransaction.offlineKeyRegistration({
|
|
729
|
+
* sender: 'SENDERADDRESS',
|
|
730
|
+
* })
|
|
731
|
+
* ```
|
|
732
|
+
* @example Advanced example
|
|
733
|
+
* ```typescript
|
|
734
|
+
* await algorand.createTransaction.offlineKeyRegistration({
|
|
735
|
+
* sender: 'SENDERADDRESS',
|
|
736
|
+
* lease: 'lease',
|
|
737
|
+
* note: 'note',
|
|
738
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
739
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
740
|
+
* // You wouldn't normally set this field
|
|
741
|
+
* firstValidRound: 1000n,
|
|
742
|
+
* validityWindow: 10,
|
|
743
|
+
* extraFee: (1000).microAlgo(),
|
|
744
|
+
* staticFee: (1000).microAlgo(),
|
|
745
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
746
|
+
* // already specified, but here for completeness
|
|
747
|
+
* maxFee: (3000).microAlgo(),
|
|
748
|
+
* })
|
|
749
|
+
* ```
|
|
750
|
+
* @returns The offline key registration transaction
|
|
751
|
+
*/
|
|
719
752
|
offlineKeyRegistration: (params: import("./composer").OfflineKeyRegistrationParams) => Promise<Transaction>;
|
|
720
753
|
}
|
|
@@ -5,6 +5,10 @@ class AlgorandClientTransactionCreator {
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates a new `AlgorandClientTransactionCreator`
|
|
7
7
|
* @param newGroup A lambda that starts a new `TransactionComposer` transaction group
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer())
|
|
11
|
+
* ```
|
|
8
12
|
*/
|
|
9
13
|
constructor(newGroup) {
|
|
10
14
|
/**
|
|
@@ -12,15 +16,15 @@ class AlgorandClientTransactionCreator {
|
|
|
12
16
|
* @param params The parameters for the payment transaction
|
|
13
17
|
* @example Basic example
|
|
14
18
|
* ```typescript
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
+
* await algorand.createTransaction.payment({
|
|
20
|
+
* sender: 'SENDERADDRESS',
|
|
21
|
+
* receiver: 'RECEIVERADDRESS',
|
|
22
|
+
* amount: (4).algo(),
|
|
19
23
|
* })
|
|
20
24
|
* ```
|
|
21
25
|
* @example Advanced example
|
|
22
26
|
* ```typescript
|
|
23
|
-
*
|
|
27
|
+
* await algorand.createTransaction.payment({
|
|
24
28
|
* amount: (4).algo(),
|
|
25
29
|
* receiver: 'RECEIVERADDRESS',
|
|
26
30
|
* sender: 'SENDERADDRESS',
|
|
@@ -39,7 +43,6 @@ class AlgorandClientTransactionCreator {
|
|
|
39
43
|
* maxFee: (3000).microAlgo(),
|
|
40
44
|
* })
|
|
41
45
|
* ```
|
|
42
|
-
*
|
|
43
46
|
* @returns The payment transaction
|
|
44
47
|
*/
|
|
45
48
|
this.payment = this._transaction((c) => c.addPayment);
|
|
@@ -52,7 +55,7 @@ class AlgorandClientTransactionCreator {
|
|
|
52
55
|
*
|
|
53
56
|
* @example Basic example
|
|
54
57
|
* ```typescript
|
|
55
|
-
* await algorand.createTransaction.assetCreate({sender: "CREATORADDRESS", total: 100n})
|
|
58
|
+
* await algorand.createTransaction.assetCreate({ sender: "CREATORADDRESS", total: 100n})
|
|
56
59
|
* ```
|
|
57
60
|
* @example Advanced example
|
|
58
61
|
* ```typescript
|
|
@@ -94,7 +97,7 @@ class AlgorandClientTransactionCreator {
|
|
|
94
97
|
*
|
|
95
98
|
* @example Basic example
|
|
96
99
|
* ```typescript
|
|
97
|
-
* await algorand.createTransaction.assetConfig({sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
100
|
+
* await algorand.createTransaction.assetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
98
101
|
* ```
|
|
99
102
|
* @example Advanced example
|
|
100
103
|
* ```typescript
|
|
@@ -126,7 +129,7 @@ class AlgorandClientTransactionCreator {
|
|
|
126
129
|
*
|
|
127
130
|
* @example Basic example
|
|
128
131
|
* ```typescript
|
|
129
|
-
* await algorand.createTransaction.assetFreeze({sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
132
|
+
* await algorand.createTransaction.assetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
130
133
|
* ```
|
|
131
134
|
* @example Advanced example
|
|
132
135
|
* ```typescript
|
|
@@ -160,7 +163,7 @@ class AlgorandClientTransactionCreator {
|
|
|
160
163
|
*
|
|
161
164
|
* @example Basic example
|
|
162
165
|
* ```typescript
|
|
163
|
-
* await algorand.createTransaction.assetDestroy({sender: "MANAGERADDRESS", assetId: 123456n })
|
|
166
|
+
* await algorand.createTransaction.assetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
|
|
164
167
|
* ```
|
|
165
168
|
* @example Advanced example
|
|
166
169
|
* ```typescript
|
|
@@ -188,7 +191,7 @@ class AlgorandClientTransactionCreator {
|
|
|
188
191
|
*
|
|
189
192
|
* @example Basic example
|
|
190
193
|
* ```typescript
|
|
191
|
-
* await algorand.createTransaction.assetTransfer({sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
194
|
+
* await algorand.createTransaction.assetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
192
195
|
* ```
|
|
193
196
|
* @example Advanced example (with clawback)
|
|
194
197
|
* ```typescript
|
|
@@ -221,7 +224,7 @@ class AlgorandClientTransactionCreator {
|
|
|
221
224
|
*
|
|
222
225
|
* @example Basic example
|
|
223
226
|
* ```typescript
|
|
224
|
-
* await algorand.createTransaction.assetOptIn({sender: "SENDERADDRESS", assetId: 123456n })
|
|
227
|
+
* await algorand.createTransaction.assetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
|
|
225
228
|
* ```
|
|
226
229
|
* @example Advanced example
|
|
227
230
|
* ```typescript
|
|
@@ -250,13 +253,17 @@ class AlgorandClientTransactionCreator {
|
|
|
250
253
|
*
|
|
251
254
|
* @param params The parameters for the asset opt-out transaction
|
|
252
255
|
*
|
|
253
|
-
* @example Basic example
|
|
256
|
+
* @example Basic example (without creator, will be retrieved from algod)
|
|
257
|
+
* ```typescript
|
|
258
|
+
* await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
259
|
+
* ```
|
|
260
|
+
* @example Basic example (with creator)
|
|
254
261
|
* ```typescript
|
|
255
|
-
* await algorand.createTransaction.assetOptOut({sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n })
|
|
262
|
+
* await algorand.createTransaction.assetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
256
263
|
* ```
|
|
257
264
|
* @example Advanced example
|
|
258
265
|
* ```typescript
|
|
259
|
-
* await algorand.createTransaction.
|
|
266
|
+
* await algorand.createTransaction.assetOptOut({
|
|
260
267
|
* sender: 'SENDERADDRESS',
|
|
261
268
|
* assetId: 123456n,
|
|
262
269
|
* creator: 'CREATORADDRESS',
|
|
@@ -283,8 +290,7 @@ class AlgorandClientTransactionCreator {
|
|
|
283
290
|
* @param params The parameters for the app creation transaction
|
|
284
291
|
* @example Basic example
|
|
285
292
|
* ```typescript
|
|
286
|
-
*
|
|
287
|
-
* const createdAppId = result.appId
|
|
293
|
+
* await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
288
294
|
* ```
|
|
289
295
|
* @example Advanced example
|
|
290
296
|
* ```typescript
|
|
@@ -315,14 +321,9 @@ class AlgorandClientTransactionCreator {
|
|
|
315
321
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
316
322
|
* // already specified, but here for completeness
|
|
317
323
|
* 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
324
|
*})
|
|
325
325
|
* ```
|
|
326
|
+
* @returns The application create transaction
|
|
326
327
|
*/
|
|
327
328
|
this.appCreate = this._transaction((c) => c.addAppCreate);
|
|
328
329
|
/** Create an application update transaction.
|
|
@@ -356,14 +357,9 @@ class AlgorandClientTransactionCreator {
|
|
|
356
357
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
357
358
|
* // already specified, but here for completeness
|
|
358
359
|
* 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
360
|
*})
|
|
366
361
|
* ```
|
|
362
|
+
* @returns The application update transaction
|
|
367
363
|
*/
|
|
368
364
|
this.appUpdate = this._transaction((c) => c.addAppUpdate);
|
|
369
365
|
/** Create an application delete transaction.
|
|
@@ -395,14 +391,9 @@ class AlgorandClientTransactionCreator {
|
|
|
395
391
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
396
392
|
* // already specified, but here for completeness
|
|
397
393
|
* 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
394
|
*})
|
|
405
395
|
* ```
|
|
396
|
+
* @returns The application delete transaction
|
|
406
397
|
*/
|
|
407
398
|
this.appDelete = this._transaction((c) => c.addAppDelete);
|
|
408
399
|
/** Create an application call transaction.
|
|
@@ -434,14 +425,9 @@ class AlgorandClientTransactionCreator {
|
|
|
434
425
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
435
426
|
* // already specified, but here for completeness
|
|
436
427
|
* 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
428
|
*})
|
|
444
429
|
* ```
|
|
430
|
+
* @returns The application call transaction
|
|
445
431
|
*/
|
|
446
432
|
this.appCall = this._transaction((c) => c.addAppCall);
|
|
447
433
|
/** Create an application create call with ABI method call transaction.
|
|
@@ -456,8 +442,7 @@ class AlgorandClientTransactionCreator {
|
|
|
456
442
|
* args: [{ name: 'arg1', type: 'string' }],
|
|
457
443
|
* returns: { type: 'string' },
|
|
458
444
|
* })
|
|
459
|
-
*
|
|
460
|
-
* const createdAppId = result.appId
|
|
445
|
+
* await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
461
446
|
* ```
|
|
462
447
|
* @example Advanced example
|
|
463
448
|
* ```typescript
|
|
@@ -466,7 +451,7 @@ class AlgorandClientTransactionCreator {
|
|
|
466
451
|
* args: [{ name: 'arg1', type: 'string' }],
|
|
467
452
|
* returns: { type: 'string' },
|
|
468
453
|
* })
|
|
469
|
-
* await algorand.createTransaction.
|
|
454
|
+
* await algorand.createTransaction.appCreateMethodCall({
|
|
470
455
|
* sender: 'CREATORADDRESS',
|
|
471
456
|
* method: method,
|
|
472
457
|
* args: ["arg1_value"],
|
|
@@ -495,14 +480,9 @@ class AlgorandClientTransactionCreator {
|
|
|
495
480
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
496
481
|
* // already specified, but here for completeness
|
|
497
482
|
* 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
483
|
*})
|
|
505
484
|
* ```
|
|
485
|
+
* @returns The application ABI method create transaction
|
|
506
486
|
*/
|
|
507
487
|
this.appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall);
|
|
508
488
|
/** Create an application update call with ABI method call transaction.
|
|
@@ -548,14 +528,9 @@ class AlgorandClientTransactionCreator {
|
|
|
548
528
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
549
529
|
* // already specified, but here for completeness
|
|
550
530
|
* 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
531
|
*})
|
|
558
532
|
* ```
|
|
533
|
+
* @returns The application ABI method update transaction
|
|
559
534
|
*/
|
|
560
535
|
this.appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall);
|
|
561
536
|
/** Create an application delete call with ABI method call transaction.
|
|
@@ -599,14 +574,9 @@ class AlgorandClientTransactionCreator {
|
|
|
599
574
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
600
575
|
* // already specified, but here for completeness
|
|
601
576
|
* 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
577
|
*})
|
|
609
578
|
* ```
|
|
579
|
+
* @returns The application ABI method delete transaction
|
|
610
580
|
*/
|
|
611
581
|
this.appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall);
|
|
612
582
|
/** Create an application call with ABI method call transaction.
|
|
@@ -650,19 +620,82 @@ class AlgorandClientTransactionCreator {
|
|
|
650
620
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
651
621
|
* // already specified, but here for completeness
|
|
652
622
|
* 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
623
|
*})
|
|
660
624
|
* ```
|
|
625
|
+
* @returns The application ABI method call transaction
|
|
661
626
|
*/
|
|
662
627
|
this.appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall);
|
|
663
|
-
/**
|
|
628
|
+
/**
|
|
629
|
+
* Create an online key registration transaction.
|
|
630
|
+
* @param params The parameters for the key registration transaction
|
|
631
|
+
* @example Basic example
|
|
632
|
+
* ```typescript
|
|
633
|
+
* await algorand.createTransaction.onlineKeyRegistration({
|
|
634
|
+
* sender: 'SENDERADDRESS',
|
|
635
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
636
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
637
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
638
|
+
* voteFirst: 1n,
|
|
639
|
+
* voteLast: 1000n,
|
|
640
|
+
* voteKeyDilution: 1n,
|
|
641
|
+
* })
|
|
642
|
+
* ```
|
|
643
|
+
* @example Advanced example
|
|
644
|
+
* ```typescript
|
|
645
|
+
* await algorand.createTransaction.onlineKeyRegistration({
|
|
646
|
+
* sender: 'SENDERADDRESS',
|
|
647
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
648
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
649
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
650
|
+
* voteFirst: 1n,
|
|
651
|
+
* voteLast: 1000n,
|
|
652
|
+
* voteKeyDilution: 1n,
|
|
653
|
+
* lease: 'lease',
|
|
654
|
+
* note: 'note',
|
|
655
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
656
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
657
|
+
* // You wouldn't normally set this field
|
|
658
|
+
* firstValidRound: 1000n,
|
|
659
|
+
* validityWindow: 10,
|
|
660
|
+
* extraFee: (1000).microAlgo(),
|
|
661
|
+
* staticFee: (1000).microAlgo(),
|
|
662
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
663
|
+
* // already specified, but here for completeness
|
|
664
|
+
* maxFee: (3000).microAlgo(),
|
|
665
|
+
* })
|
|
666
|
+
* ```
|
|
667
|
+
* @returns The online key registration transaction
|
|
668
|
+
*/
|
|
664
669
|
this.onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration);
|
|
665
|
-
/**
|
|
670
|
+
/**
|
|
671
|
+
* Create an offline key registration transaction.
|
|
672
|
+
* @param params The parameters for the key registration transaction
|
|
673
|
+
* @example Basic example
|
|
674
|
+
* ```typescript
|
|
675
|
+
* await algorand.createTransaction.offlineKeyRegistration({
|
|
676
|
+
* sender: 'SENDERADDRESS',
|
|
677
|
+
* })
|
|
678
|
+
* ```
|
|
679
|
+
* @example Advanced example
|
|
680
|
+
* ```typescript
|
|
681
|
+
* await algorand.createTransaction.offlineKeyRegistration({
|
|
682
|
+
* sender: 'SENDERADDRESS',
|
|
683
|
+
* lease: 'lease',
|
|
684
|
+
* note: 'note',
|
|
685
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
686
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
687
|
+
* // You wouldn't normally set this field
|
|
688
|
+
* firstValidRound: 1000n,
|
|
689
|
+
* validityWindow: 10,
|
|
690
|
+
* extraFee: (1000).microAlgo(),
|
|
691
|
+
* staticFee: (1000).microAlgo(),
|
|
692
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
693
|
+
* // already specified, but here for completeness
|
|
694
|
+
* maxFee: (3000).microAlgo(),
|
|
695
|
+
* })
|
|
696
|
+
* ```
|
|
697
|
+
* @returns The offline key registration transaction
|
|
698
|
+
*/
|
|
666
699
|
this.offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration);
|
|
667
700
|
this._newGroup = newGroup;
|
|
668
701
|
}
|