@algorandfoundation/algokit-utils 8.2.0-beta.1 → 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.
Files changed (71) hide show
  1. package/package.json +3 -2
  2. package/types/account-manager.d.ts +33 -18
  3. package/types/account-manager.js +33 -18
  4. package/types/account-manager.js.map +1 -1
  5. package/types/account-manager.mjs +33 -18
  6. package/types/account-manager.mjs.map +1 -1
  7. package/types/account.d.ts +5 -0
  8. package/types/account.js +5 -0
  9. package/types/account.js.map +1 -1
  10. package/types/account.mjs +5 -0
  11. package/types/account.mjs.map +1 -1
  12. package/types/algorand-client-transaction-creator.d.ts +103 -70
  13. package/types/algorand-client-transaction-creator.js +103 -70
  14. package/types/algorand-client-transaction-creator.js.map +1 -1
  15. package/types/algorand-client-transaction-creator.mjs +103 -70
  16. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  17. package/types/algorand-client-transaction-sender.d.ts +107 -20
  18. package/types/algorand-client-transaction-sender.js +107 -21
  19. package/types/algorand-client-transaction-sender.js.map +1 -1
  20. package/types/algorand-client-transaction-sender.mjs +107 -21
  21. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  22. package/types/algorand-client.d.ts +108 -24
  23. package/types/algorand-client.js +107 -23
  24. package/types/algorand-client.js.map +1 -1
  25. package/types/algorand-client.mjs +107 -23
  26. package/types/algorand-client.mjs.map +1 -1
  27. package/types/amount.d.ts +10 -0
  28. package/types/amount.js +10 -0
  29. package/types/amount.js.map +1 -1
  30. package/types/amount.mjs +10 -0
  31. package/types/amount.mjs.map +1 -1
  32. package/types/app-client.d.ts +128 -8
  33. package/types/app-client.js +131 -8
  34. package/types/app-client.js.map +1 -1
  35. package/types/app-client.mjs +131 -8
  36. package/types/app-client.mjs.map +1 -1
  37. package/types/app-deployer.d.ts +33 -1
  38. package/types/app-deployer.js +33 -1
  39. package/types/app-deployer.js.map +1 -1
  40. package/types/app-deployer.mjs +33 -1
  41. package/types/app-deployer.mjs.map +1 -1
  42. package/types/app-factory.d.ts +74 -4
  43. package/types/app-factory.js +74 -4
  44. package/types/app-factory.js.map +1 -1
  45. package/types/app-factory.mjs +74 -4
  46. package/types/app-factory.mjs.map +1 -1
  47. package/types/app-manager.d.ts +64 -0
  48. package/types/app-manager.js +64 -0
  49. package/types/app-manager.js.map +1 -1
  50. package/types/app-manager.mjs +64 -0
  51. package/types/app-manager.mjs.map +1 -1
  52. package/types/app-spec.d.ts +9 -0
  53. package/types/app-spec.js +9 -0
  54. package/types/app-spec.js.map +1 -1
  55. package/types/app-spec.mjs +9 -0
  56. package/types/app-spec.mjs.map +1 -1
  57. package/types/asset-manager.d.ts +5 -5
  58. package/types/asset-manager.js +5 -5
  59. package/types/asset-manager.js.map +1 -1
  60. package/types/asset-manager.mjs +5 -5
  61. package/types/asset-manager.mjs.map +1 -1
  62. package/types/client-manager.d.ts +79 -18
  63. package/types/client-manager.js +79 -18
  64. package/types/client-manager.js.map +1 -1
  65. package/types/client-manager.mjs +79 -18
  66. package/types/client-manager.mjs.map +1 -1
  67. package/types/composer.d.ts +599 -1
  68. package/types/composer.js +575 -1
  69. package/types/composer.js.map +1 -1
  70. package/types/composer.mjs +575 -1
  71. package/types/composer.mjs.map +1 -1
@@ -469,6 +469,7 @@ export declare class TransactionComposer {
469
469
  /**
470
470
  * Create a `TransactionComposer`.
471
471
  * @param params The configuration for this composer
472
+ * @returns The `TransactionComposer` instance
472
473
  */
473
474
  constructor(params: TransactionComposerParams);
474
475
  /**
@@ -476,54 +477,258 @@ export declare class TransactionComposer {
476
477
  * @param transaction The pre-built transaction
477
478
  * @param signer Optional signer override for the transaction
478
479
  * @returns The composer so you can chain method calls
480
+ * @example
481
+ * ```typescript
482
+ * composer.addTransaction(txn)
483
+ * ```
479
484
  */
480
485
  addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer;
481
486
  /**
482
487
  * Add a payment transaction to the transaction group.
483
488
  * @param params The payment transaction parameters
484
489
  * @returns The composer so you can chain method calls
490
+ * @example Basic example
491
+ * ```typescript
492
+ * composer.addPayment({
493
+ * sender: 'SENDERADDRESS',
494
+ * receiver: 'RECEIVERADDRESS',
495
+ * amount: (4).algo(),
496
+ * })
497
+ * ```
498
+ * @example Advanced example
499
+ * ```typescript
500
+ * composer.addPayment({
501
+ * amount: (4).algo(),
502
+ * receiver: 'RECEIVERADDRESS',
503
+ * sender: 'SENDERADDRESS',
504
+ * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
505
+ * lease: 'lease',
506
+ * note: 'note',
507
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
508
+ * rekeyTo: 'REKEYTOADDRESS',
509
+ * // You wouldn't normally set this field
510
+ * firstValidRound: 1000n,
511
+ * validityWindow: 10,
512
+ * extraFee: (1000).microAlgo(),
513
+ * staticFee: (1000).microAlgo(),
514
+ * // Max fee doesn't make sense with extraFee AND staticFee
515
+ * // already specified, but here for completeness
516
+ * maxFee: (3000).microAlgo(),
517
+ * })
485
518
  */
486
519
  addPayment(params: PaymentParams): TransactionComposer;
487
520
  /**
488
521
  * Add an asset create transaction to the transaction group.
489
522
  * @param params The asset create transaction parameters
490
523
  * @returns The composer so you can chain method calls
524
+ * @example Basic example
525
+ * ```typescript
526
+ * composer.addAssetCreate({ sender: "CREATORADDRESS", total: 100n})
527
+ * ```
528
+ * @example Advanced example
529
+ * ```typescript
530
+ * composer.addAssetCreate({
531
+ * sender: 'CREATORADDRESS',
532
+ * total: 100n,
533
+ * decimals: 2,
534
+ * assetName: 'asset',
535
+ * unitName: 'unit',
536
+ * url: 'url',
537
+ * metadataHash: 'metadataHash',
538
+ * defaultFrozen: false,
539
+ * manager: 'MANAGERADDRESS',
540
+ * reserve: 'RESERVEADDRESS',
541
+ * freeze: 'FREEZEADDRESS',
542
+ * clawback: 'CLAWBACKADDRESS',
543
+ * lease: 'lease',
544
+ * note: 'note',
545
+ * // You wouldn't normally set this field
546
+ * firstValidRound: 1000n,
547
+ * validityWindow: 10,
548
+ * extraFee: (1000).microAlgo(),
549
+ * staticFee: (1000).microAlgo(),
550
+ * // Max fee doesn't make sense with extraFee AND staticFee
551
+ * // already specified, but here for completeness
552
+ * maxFee: (3000).microAlgo(),
553
+ * })
491
554
  */
492
555
  addAssetCreate(params: AssetCreateParams): TransactionComposer;
493
556
  /**
494
557
  * Add an asset config transaction to the transaction group.
495
558
  * @param params The asset config transaction parameters
496
559
  * @returns The composer so you can chain method calls
560
+ * @example Basic example
561
+ * ```typescript
562
+ * composer.addAssetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
563
+ * ```
564
+ * @example Advanced example
565
+ * ```typescript
566
+ * composer.addAssetConfig({
567
+ * sender: 'MANAGERADDRESS',
568
+ * assetId: 123456n,
569
+ * manager: 'MANAGERADDRESS',
570
+ * reserve: 'RESERVEADDRESS',
571
+ * freeze: 'FREEZEADDRESS',
572
+ * clawback: 'CLAWBACKADDRESS',
573
+ * lease: 'lease',
574
+ * note: 'note',
575
+ * // You wouldn't normally set this field
576
+ * firstValidRound: 1000n,
577
+ * validityWindow: 10,
578
+ * extraFee: (1000).microAlgo(),
579
+ * staticFee: (1000).microAlgo(),
580
+ * // Max fee doesn't make sense with extraFee AND staticFee
581
+ * // already specified, but here for completeness
582
+ * maxFee: (3000).microAlgo(),
583
+ * })
497
584
  */
498
585
  addAssetConfig(params: AssetConfigParams): TransactionComposer;
499
586
  /**
500
587
  * Add an asset freeze transaction to the transaction group.
501
588
  * @param params The asset freeze transaction parameters
502
589
  * @returns The composer so you can chain method calls
590
+ * @example Basic example
591
+ * ```typescript
592
+ * composer.addAssetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
593
+ * ```
594
+ * @example Advanced example
595
+ * ```typescript
596
+ * composer.addAssetFreeze({
597
+ * sender: 'MANAGERADDRESS',
598
+ * assetId: 123456n,
599
+ * account: 'ACCOUNTADDRESS',
600
+ * frozen: true,
601
+ * lease: 'lease',
602
+ * note: 'note',
603
+ * // You wouldn't normally set this field
604
+ * firstValidRound: 1000n,
605
+ * validityWindow: 10,
606
+ * extraFee: (1000).microAlgo(),
607
+ * staticFee: (1000).microAlgo(),
608
+ * // Max fee doesn't make sense with extraFee AND staticFee
609
+ * // already specified, but here for completeness
610
+ * maxFee: (3000).microAlgo(),
611
+ * })
612
+ * ```
503
613
  */
504
614
  addAssetFreeze(params: AssetFreezeParams): TransactionComposer;
505
615
  /**
506
616
  * Add an asset destroy transaction to the transaction group.
507
617
  * @param params The asset destroy transaction parameters
508
618
  * @returns The composer so you can chain method calls
619
+ * @example Basic example
620
+ * ```typescript
621
+ * composer.addAssetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
622
+ * ```
623
+ * @example Advanced example
624
+ * ```typescript
625
+ * composer.addAssetDestroy({
626
+ * sender: 'MANAGERADDRESS',
627
+ * assetId: 123456n,
628
+ * lease: 'lease',
629
+ * note: 'note',
630
+ * // You wouldn't normally set this field
631
+ * firstValidRound: 1000n,
632
+ * validityWindow: 10,
633
+ * extraFee: (1000).microAlgo(),
634
+ * staticFee: (1000).microAlgo(),
635
+ * // Max fee doesn't make sense with extraFee AND staticFee
636
+ * // already specified, but here for completeness
637
+ * maxFee: (3000).microAlgo(),
638
+ * })
639
+ * ```
509
640
  */
510
641
  addAssetDestroy(params: AssetDestroyParams): TransactionComposer;
511
642
  /**
512
643
  * Add an asset transfer transaction to the transaction group.
513
644
  * @param params The asset transfer transaction parameters
514
645
  * @returns The composer so you can chain method calls
646
+ * @example Basic example
647
+ * ```typescript
648
+ * composer.addAssetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
649
+ * ```
650
+ * @example Advanced example (with clawback)
651
+ * ```typescript
652
+ * composer.addAssetTransfer({
653
+ * sender: 'CLAWBACKADDRESS',
654
+ * assetId: 123456n,
655
+ * amount: 1n,
656
+ * receiver: 'RECEIVERADDRESS',
657
+ * clawbackTarget: 'HOLDERADDRESS',
658
+ * // This field needs to be used with caution
659
+ * closeAssetTo: 'ADDRESSTOCLOSETO'
660
+ * lease: 'lease',
661
+ * note: 'note',
662
+ * // You wouldn't normally set this field
663
+ * firstValidRound: 1000n,
664
+ * validityWindow: 10,
665
+ * extraFee: (1000).microAlgo(),
666
+ * staticFee: (1000).microAlgo(),
667
+ * // Max fee doesn't make sense with extraFee AND staticFee
668
+ * // already specified, but here for completeness
669
+ * maxFee: (3000).microAlgo(),
670
+ * })
671
+ * ```
515
672
  */
516
673
  addAssetTransfer(params: AssetTransferParams): TransactionComposer;
517
674
  /**
518
675
  * Add an asset opt-in transaction to the transaction group.
519
676
  * @param params The asset opt-in transaction parameters
520
677
  * @returns The composer so you can chain method calls
678
+ * @example Basic example
679
+ * ```typescript
680
+ * composer.addAssetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
681
+ * ```
682
+ * @example Advanced example
683
+ * ```typescript
684
+ * composer.addAssetOptIn({
685
+ * sender: 'SENDERADDRESS',
686
+ * assetId: 123456n,
687
+ * lease: 'lease',
688
+ * note: 'note',
689
+ * // You wouldn't normally set this field
690
+ * firstValidRound: 1000n,
691
+ * validityWindow: 10,
692
+ * extraFee: (1000).microAlgo(),
693
+ * staticFee: (1000).microAlgo(),
694
+ * // Max fee doesn't make sense with extraFee AND staticFee
695
+ * // already specified, but here for completeness
696
+ * maxFee: (3000).microAlgo(),
697
+ * })
698
+ * ```
521
699
  */
522
700
  addAssetOptIn(params: AssetOptInParams): TransactionComposer;
523
701
  /**
524
702
  * Add an asset opt-out transaction to the transaction group.
525
703
  * @param params The asset opt-out transaction parameters
526
704
  * @returns The composer so you can chain method calls
705
+ * @example Basic example (without creator, will be retrieved from algod)
706
+ * ```typescript
707
+ * composer.addAssetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
708
+ * ```
709
+ * @example Basic example (with creator)
710
+ * ```typescript
711
+ * composer.addAssetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
712
+ * ```
713
+ * @example Advanced example
714
+ * ```typescript
715
+ * composer.addAssetOptOut({
716
+ * sender: 'SENDERADDRESS',
717
+ * assetId: 123456n,
718
+ * creator: 'CREATORADDRESS',
719
+ * ensureZeroBalance: true,
720
+ * lease: 'lease',
721
+ * note: 'note',
722
+ * // You wouldn't normally set this field
723
+ * firstValidRound: 1000n,
724
+ * validityWindow: 10,
725
+ * extraFee: (1000).microAlgo(),
726
+ * staticFee: (1000).microAlgo(),
727
+ * // Max fee doesn't make sense with extraFee AND staticFee
728
+ * // already specified, but here for completeness
729
+ * maxFee: (3000).microAlgo(),
730
+ * })
731
+ * ```
527
732
  */
528
733
  addAssetOptOut(params: AssetOptOutParams): TransactionComposer;
529
734
  /**
@@ -532,6 +737,47 @@ export declare class TransactionComposer {
532
737
  * Note: we recommend using app clients to make it easier to make app calls.
533
738
  * @param params The application create transaction parameters
534
739
  * @returns The composer so you can chain method calls
740
+ * @example Basic example
741
+ * ```typescript
742
+ * composer.addAppCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
743
+ * ```
744
+ * @example Advanced example
745
+ * ```typescript
746
+ * composer.addAppCreate({
747
+ * sender: 'CREATORADDRESS',
748
+ * approvalProgram: "TEALCODE",
749
+ * clearStateProgram: "TEALCODE",
750
+ * schema: {
751
+ * globalInts: 1,
752
+ * globalByteSlices: 2,
753
+ * localInts: 3,
754
+ * localByteSlices: 4
755
+ * },
756
+ * extraProgramPages: 1,
757
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
758
+ * args: [new Uint8Array(1, 2, 3, 4)]
759
+ * accountReferences: ["ACCOUNT_1"]
760
+ * appReferences: [123n, 1234n]
761
+ * assetReferences: [12345n]
762
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
763
+ * lease: 'lease',
764
+ * note: 'note',
765
+ * // You wouldn't normally set this field
766
+ * firstValidRound: 1000n,
767
+ * validityWindow: 10,
768
+ * extraFee: (1000).microAlgo(),
769
+ * staticFee: (1000).microAlgo(),
770
+ * // Max fee doesn't make sense with extraFee AND staticFee
771
+ * // already specified, but here for completeness
772
+ * maxFee: (3000).microAlgo(),
773
+ * // Signer only needed if you want to provide one,
774
+ * // generally you'd register it with AlgorandClient
775
+ * // against the sender and not need to pass it in
776
+ * signer: transactionSigner,
777
+ * maxRoundsToWaitForConfirmation: 5,
778
+ * suppressLog: true,
779
+ *})
780
+ * ```
535
781
  */
536
782
  addAppCreate(params: AppCreateParams): TransactionComposer;
537
783
  /**
@@ -540,6 +786,34 @@ export declare class TransactionComposer {
540
786
  * Note: we recommend using app clients to make it easier to make app calls.
541
787
  * @param params The application update transaction parameters
542
788
  * @returns The composer so you can chain method calls
789
+ * @example Basic example
790
+ * ```typescript
791
+ * composer.addAppUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
792
+ * ```
793
+ * @example Advanced example
794
+ * ```typescript
795
+ * composer.addAppUpdate({
796
+ * sender: 'CREATORADDRESS',
797
+ * approvalProgram: "TEALCODE",
798
+ * clearStateProgram: "TEALCODE",
799
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
800
+ * args: [new Uint8Array(1, 2, 3, 4)]
801
+ * accountReferences: ["ACCOUNT_1"]
802
+ * appReferences: [123n, 1234n]
803
+ * assetReferences: [12345n]
804
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
805
+ * lease: 'lease',
806
+ * note: 'note',
807
+ * // You wouldn't normally set this field
808
+ * firstValidRound: 1000n,
809
+ * validityWindow: 10,
810
+ * extraFee: (1000).microAlgo(),
811
+ * staticFee: (1000).microAlgo(),
812
+ * // Max fee doesn't make sense with extraFee AND staticFee
813
+ * // already specified, but here for completeness
814
+ * maxFee: (3000).microAlgo(),
815
+ *})
816
+ * ```
543
817
  */
544
818
  addAppUpdate(params: AppUpdateParams): TransactionComposer;
545
819
  /**
@@ -548,6 +822,32 @@ export declare class TransactionComposer {
548
822
  * Note: we recommend using app clients to make it easier to make app calls.
549
823
  * @param params The application delete transaction parameters
550
824
  * @returns The composer so you can chain method calls
825
+ * @example Basic example
826
+ * ```typescript
827
+ * composer.addAppDelete({ sender: 'CREATORADDRESS' })
828
+ * ```
829
+ * @example Advanced example
830
+ * ```typescript
831
+ * composer.addAppDelete({
832
+ * sender: 'CREATORADDRESS',
833
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
834
+ * args: [new Uint8Array(1, 2, 3, 4)]
835
+ * accountReferences: ["ACCOUNT_1"]
836
+ * appReferences: [123n, 1234n]
837
+ * assetReferences: [12345n]
838
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
839
+ * lease: 'lease',
840
+ * note: 'note',
841
+ * // You wouldn't normally set this field
842
+ * firstValidRound: 1000n,
843
+ * validityWindow: 10,
844
+ * extraFee: (1000).microAlgo(),
845
+ * staticFee: (1000).microAlgo(),
846
+ * // Max fee doesn't make sense with extraFee AND staticFee
847
+ * // already specified, but here for completeness
848
+ * maxFee: (3000).microAlgo(),
849
+ *})
850
+ * ```
551
851
  */
552
852
  addAppDelete(params: AppDeleteParams): TransactionComposer;
553
853
  /**
@@ -558,6 +858,32 @@ export declare class TransactionComposer {
558
858
  * Note: we recommend using app clients to make it easier to make app calls.
559
859
  * @param params The application call transaction parameters
560
860
  * @returns The composer so you can chain method calls
861
+ * @example Basic example
862
+ * ```typescript
863
+ * composer.addAppCall({ sender: 'CREATORADDRESS' })
864
+ * ```
865
+ * @example Advanced example
866
+ * ```typescript
867
+ * composer.addAppCall({
868
+ * sender: 'CREATORADDRESS',
869
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
870
+ * args: [new Uint8Array(1, 2, 3, 4)]
871
+ * accountReferences: ["ACCOUNT_1"]
872
+ * appReferences: [123n, 1234n]
873
+ * assetReferences: [12345n]
874
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
875
+ * lease: 'lease',
876
+ * note: 'note',
877
+ * // You wouldn't normally set this field
878
+ * firstValidRound: 1000n,
879
+ * validityWindow: 10,
880
+ * extraFee: (1000).microAlgo(),
881
+ * staticFee: (1000).microAlgo(),
882
+ * // Max fee doesn't make sense with extraFee AND staticFee
883
+ * // already specified, but here for completeness
884
+ * maxFee: (3000).microAlgo(),
885
+ *})
886
+ * ```
561
887
  */
562
888
  addAppCall(params: AppCallParams): TransactionComposer;
563
889
  /**
@@ -566,6 +892,53 @@ export declare class TransactionComposer {
566
892
  * Note: we recommend using app clients to make it easier to make app calls.
567
893
  * @param params The ABI create method application call transaction parameters
568
894
  * @returns The composer so you can chain method calls
895
+ * @example Basic example
896
+ * ```typescript
897
+ * const method = new ABIMethod({
898
+ * name: 'method',
899
+ * args: [{ name: 'arg1', type: 'string' }],
900
+ * returns: { type: 'string' },
901
+ * })
902
+ * composer.addAppCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
903
+ * ```
904
+ * @example Advanced example
905
+ * ```typescript
906
+ * const method = new ABIMethod({
907
+ * name: 'method',
908
+ * args: [{ name: 'arg1', type: 'string' }],
909
+ * returns: { type: 'string' },
910
+ * })
911
+ * composer.addAppCreateMethodCall({
912
+ * sender: 'CREATORADDRESS',
913
+ * method: method,
914
+ * args: ["arg1_value"],
915
+ * approvalProgram: "TEALCODE",
916
+ * clearStateProgram: "TEALCODE",
917
+ * schema: {
918
+ * globalInts: 1,
919
+ * globalByteSlices: 2,
920
+ * localInts: 3,
921
+ * localByteSlices: 4
922
+ * },
923
+ * extraProgramPages: 1,
924
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
925
+ * args: [new Uint8Array(1, 2, 3, 4)]
926
+ * accountReferences: ["ACCOUNT_1"]
927
+ * appReferences: [123n, 1234n]
928
+ * assetReferences: [12345n]
929
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
930
+ * lease: 'lease',
931
+ * note: 'note',
932
+ * // You wouldn't normally set this field
933
+ * firstValidRound: 1000n,
934
+ * validityWindow: 10,
935
+ * extraFee: (1000).microAlgo(),
936
+ * staticFee: (1000).microAlgo(),
937
+ * // Max fee doesn't make sense with extraFee AND staticFee
938
+ * // already specified, but here for completeness
939
+ * maxFee: (3000).microAlgo(),
940
+ *})
941
+ * ```
569
942
  */
570
943
  addAppCreateMethodCall(params: AppCreateMethodCall): this;
571
944
  /**
@@ -574,6 +947,46 @@ export declare class TransactionComposer {
574
947
  * Note: we recommend using app clients to make it easier to make app calls.
575
948
  * @param params The ABI update method application call transaction parameters
576
949
  * @returns The composer so you can chain method calls
950
+ * @example Basic example
951
+ * ```typescript
952
+ * const method = new ABIMethod({
953
+ * name: 'method',
954
+ * args: [{ name: 'arg1', type: 'string' }],
955
+ * returns: { type: 'string' },
956
+ * })
957
+ * composer.addAppUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
958
+ * ```
959
+ * @example Advanced example
960
+ * ```typescript
961
+ * const method = new ABIMethod({
962
+ * name: 'method',
963
+ * args: [{ name: 'arg1', type: 'string' }],
964
+ * returns: { type: 'string' },
965
+ * })
966
+ * composer.addAppUpdateMethodCall({
967
+ * sender: 'CREATORADDRESS',
968
+ * method: method,
969
+ * args: ["arg1_value"],
970
+ * approvalProgram: "TEALCODE",
971
+ * clearStateProgram: "TEALCODE",
972
+ * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
973
+ * args: [new Uint8Array(1, 2, 3, 4)]
974
+ * accountReferences: ["ACCOUNT_1"]
975
+ * appReferences: [123n, 1234n]
976
+ * assetReferences: [12345n]
977
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
978
+ * lease: 'lease',
979
+ * note: 'note',
980
+ * // You wouldn't normally set this field
981
+ * firstValidRound: 1000n,
982
+ * validityWindow: 10,
983
+ * extraFee: (1000).microAlgo(),
984
+ * staticFee: (1000).microAlgo(),
985
+ * // Max fee doesn't make sense with extraFee AND staticFee
986
+ * // already specified, but here for completeness
987
+ * maxFee: (3000).microAlgo(),
988
+ *})
989
+ * ```
577
990
  */
578
991
  addAppUpdateMethodCall(params: AppUpdateMethodCall): this;
579
992
  /**
@@ -582,6 +995,44 @@ export declare class TransactionComposer {
582
995
  * Note: we recommend using app clients to make it easier to make app calls.
583
996
  * @param params The ABI delete method application call transaction parameters
584
997
  * @returns The composer so you can chain method calls
998
+ * @example Basic example
999
+ * ```typescript
1000
+ * const method = new ABIMethod({
1001
+ * name: 'method',
1002
+ * args: [{ name: 'arg1', type: 'string' }],
1003
+ * returns: { type: 'string' },
1004
+ * })
1005
+ * composer.addAppDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
1006
+ * ```
1007
+ * @example Advanced example
1008
+ * ```typescript
1009
+ * const method = new ABIMethod({
1010
+ * name: 'method',
1011
+ * args: [{ name: 'arg1', type: 'string' }],
1012
+ * returns: { type: 'string' },
1013
+ * })
1014
+ * composer.addAppDeleteMethodCall({
1015
+ * sender: 'CREATORADDRESS',
1016
+ * method: method,
1017
+ * args: ["arg1_value"],
1018
+ * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
1019
+ * args: [new Uint8Array(1, 2, 3, 4)]
1020
+ * accountReferences: ["ACCOUNT_1"]
1021
+ * appReferences: [123n, 1234n]
1022
+ * assetReferences: [12345n]
1023
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
1024
+ * lease: 'lease',
1025
+ * note: 'note',
1026
+ * // You wouldn't normally set this field
1027
+ * firstValidRound: 1000n,
1028
+ * validityWindow: 10,
1029
+ * extraFee: (1000).microAlgo(),
1030
+ * staticFee: (1000).microAlgo(),
1031
+ * // Max fee doesn't make sense with extraFee AND staticFee
1032
+ * // already specified, but here for completeness
1033
+ * maxFee: (3000).microAlgo(),
1034
+ *})
1035
+ * ```
585
1036
  */
586
1037
  addAppDeleteMethodCall(params: AppDeleteMethodCall): this;
587
1038
  /**
@@ -590,24 +1041,128 @@ export declare class TransactionComposer {
590
1041
  * Note: we recommend using app clients to make it easier to make app calls.
591
1042
  * @param params The ABI method application call transaction parameters
592
1043
  * @returns The composer so you can chain method calls
1044
+ * @example Basic example
1045
+ * ```typescript
1046
+ * const method = new ABIMethod({
1047
+ * name: 'method',
1048
+ * args: [{ name: 'arg1', type: 'string' }],
1049
+ * returns: { type: 'string' },
1050
+ * })
1051
+ * composer.addAppCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
1052
+ * ```
1053
+ * @example Advanced example
1054
+ * ```typescript
1055
+ * const method = new ABIMethod({
1056
+ * name: 'method',
1057
+ * args: [{ name: 'arg1', type: 'string' }],
1058
+ * returns: { type: 'string' },
1059
+ * })
1060
+ * composer.addAppCallMethodCall({
1061
+ * sender: 'CREATORADDRESS',
1062
+ * method: method,
1063
+ * args: ["arg1_value"],
1064
+ * onComplete: algosdk.OnApplicationComplete.OptInOC,
1065
+ * args: [new Uint8Array(1, 2, 3, 4)]
1066
+ * accountReferences: ["ACCOUNT_1"]
1067
+ * appReferences: [123n, 1234n]
1068
+ * assetReferences: [12345n]
1069
+ * boxReferences: ["box1", {appId: 1234n, name: "box2"}]
1070
+ * lease: 'lease',
1071
+ * note: 'note',
1072
+ * // You wouldn't normally set this field
1073
+ * firstValidRound: 1000n,
1074
+ * validityWindow: 10,
1075
+ * extraFee: (1000).microAlgo(),
1076
+ * staticFee: (1000).microAlgo(),
1077
+ * // Max fee doesn't make sense with extraFee AND staticFee
1078
+ * // already specified, but here for completeness
1079
+ * maxFee: (3000).microAlgo(),
1080
+ *})
1081
+ * ```
593
1082
  */
594
1083
  addAppCallMethodCall(params: AppCallMethodCall): this;
595
1084
  /**
596
1085
  * Add an online key registration transaction to the transaction group.
597
1086
  * @param params The online key registration transaction parameters
598
1087
  * @returns The composer so you can chain method calls
1088
+ * @example Basic example
1089
+ * ```typescript
1090
+ * composer.addOnlineKeyRegistration({
1091
+ * sender: 'SENDERADDRESS',
1092
+ * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
1093
+ * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
1094
+ * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
1095
+ * voteFirst: 1n,
1096
+ * voteLast: 1000n,
1097
+ * voteKeyDilution: 1n,
1098
+ * })
1099
+ * ```
1100
+ * @example Advanced example
1101
+ * ```typescript
1102
+ * composer.addOnlineKeyRegistration({
1103
+ * sender: 'SENDERADDRESS',
1104
+ * voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
1105
+ * selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
1106
+ * stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
1107
+ * voteFirst: 1n,
1108
+ * voteLast: 1000n,
1109
+ * voteKeyDilution: 1n,
1110
+ * lease: 'lease',
1111
+ * note: 'note',
1112
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
1113
+ * rekeyTo: 'REKEYTOADDRESS',
1114
+ * // You wouldn't normally set this field
1115
+ * firstValidRound: 1000n,
1116
+ * validityWindow: 10,
1117
+ * extraFee: (1000).microAlgo(),
1118
+ * staticFee: (1000).microAlgo(),
1119
+ * // Max fee doesn't make sense with extraFee AND staticFee
1120
+ * // already specified, but here for completeness
1121
+ * maxFee: (3000).microAlgo(),
1122
+ * })
1123
+ * ```
599
1124
  */
600
1125
  addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer;
601
1126
  /**
602
1127
  * Add an offline key registration transaction to the transaction group.
603
1128
  * @param params The offline key registration transaction parameters
604
1129
  * @returns The composer so you can chain method calls
1130
+ * @example Basic example
1131
+ * ```typescript
1132
+ * composer.addOfflineKeyRegistration({
1133
+ * sender: 'SENDERADDRESS',
1134
+ * })
1135
+ * ```
1136
+ * @example Advanced example
1137
+ * ```typescript
1138
+ * composer.addOfflineKeyRegistration({
1139
+ * sender: 'SENDERADDRESS',
1140
+ * lease: 'lease',
1141
+ * note: 'note',
1142
+ * // Use this with caution, it's generally better to use algorand.account.rekeyAccount
1143
+ * rekeyTo: 'REKEYTOADDRESS',
1144
+ * // You wouldn't normally set this field
1145
+ * firstValidRound: 1000n,
1146
+ * validityWindow: 10,
1147
+ * extraFee: (1000).microAlgo(),
1148
+ * staticFee: (1000).microAlgo(),
1149
+ * // Max fee doesn't make sense with extraFee AND staticFee
1150
+ * // already specified, but here for completeness
1151
+ * maxFee: (3000).microAlgo(),
1152
+ * })
1153
+ * ```
605
1154
  */
606
1155
  addOfflineKeyRegistration(params: OfflineKeyRegistrationParams): TransactionComposer;
607
1156
  /**
608
1157
  * Add the transactions within an `AtomicTransactionComposer` to the transaction group.
609
1158
  * @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
610
1159
  * @returns The composer so you can chain method calls
1160
+ * @example
1161
+ * ```typescript
1162
+ * const atc = new AtomicTransactionComposer()
1163
+ * .addPayment({ sender: 'SENDERADDRESS', receiver: 'RECEIVERADDRESS', amount: 1000n })
1164
+ * composer.addAtc(atc)
1165
+ * ```
611
1166
  */
612
1167
  addAtc(atc: algosdk.AtomicTransactionComposer): TransactionComposer;
613
1168
  /** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */
@@ -634,10 +1189,15 @@ export declare class TransactionComposer {
634
1189
  * Compose all of the transactions without signers and return the transaction objects directly along with any ABI method calls.
635
1190
  *
636
1191
  * @returns The array of built transactions and any corresponding method calls
1192
+ * @example
1193
+ * ```typescript
1194
+ * const { transactions, methodCalls, signers } = await composer.buildTransactions()
1195
+ * ```
637
1196
  */
638
1197
  buildTransactions(): Promise<BuiltTransactions>;
639
1198
  /**
640
1199
  * Get the number of transactions currently added to this composer.
1200
+ * @returns The number of transactions currently added to this composer
641
1201
  */
642
1202
  count(): Promise<number>;
643
1203
  /**
@@ -647,7 +1207,11 @@ export declare class TransactionComposer {
647
1207
  *
648
1208
  * Once this method is called, no further transactions will be able to be added.
649
1209
  * You can safely call this method multiple times to get the same result.
650
- * @returns The built atomic transaction composer and the transactions
1210
+ * @returns The built atomic transaction composer, the transactions and any corresponding method calls
1211
+ * @example
1212
+ * ```typescript
1213
+ * const { atc, transactions, methodCalls } = await composer.build()
1214
+ * ```
651
1215
  */
652
1216
  build(): Promise<{
653
1217
  atc: algosdk.AtomicTransactionComposer;
@@ -658,6 +1222,10 @@ export declare class TransactionComposer {
658
1222
  * Rebuild the group, discarding any previously built transactions.
659
1223
  * This will potentially cause new signers and suggested params to be used if the callbacks return a new value compared to the first build.
660
1224
  * @returns The newly built atomic transaction composer and the transactions
1225
+ * @example
1226
+ * ```typescript
1227
+ * const { atc, transactions, methodCalls } = await composer.rebuild()
1228
+ * ```
661
1229
  */
662
1230
  rebuild(): Promise<{
663
1231
  atc: algosdk.AtomicTransactionComposer;
@@ -668,6 +1236,12 @@ export declare class TransactionComposer {
668
1236
  * Compose the atomic transaction group and send it to the network.
669
1237
  * @param params The parameters to control execution with
670
1238
  * @returns The execution result
1239
+ * @example
1240
+ * ```typescript
1241
+ * const result = await composer.send({
1242
+ * populateAppCallResources: true,
1243
+ * })
1244
+ * ```
671
1245
  */
672
1246
  send(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
673
1247
  /**
@@ -683,13 +1257,37 @@ export declare class TransactionComposer {
683
1257
  /**
684
1258
  * Compose the atomic transaction group and simulate sending it to the network
685
1259
  * @returns The simulation result
1260
+ * @example
1261
+ * ```typescript
1262
+ * const result = await composer.simulate()
1263
+ * ```
686
1264
  */
687
1265
  simulate(): Promise<SendAtomicTransactionComposerResults & {
688
1266
  simulateResponse: SimulateResponse;
689
1267
  }>;
1268
+ /**
1269
+ * Compose the atomic transaction group and simulate sending it to the network
1270
+ * @returns The simulation result
1271
+ * @example
1272
+ * ```typescript
1273
+ * const result = await composer.simulate({
1274
+ * skipSignatures: true,
1275
+ * })
1276
+ * ```
1277
+ */
690
1278
  simulate(options: SkipSignaturesSimulateOptions): Promise<SendAtomicTransactionComposerResults & {
691
1279
  simulateResponse: SimulateResponse;
692
1280
  }>;
1281
+ /**
1282
+ * Compose the atomic transaction group and simulate sending it to the network
1283
+ * @returns The simulation result
1284
+ * @example
1285
+ * ```typescript
1286
+ * const result = await composer.simulate({
1287
+ * extraOpcodeBudget: 1000,
1288
+ * })
1289
+ * ```
1290
+ */
693
1291
  simulate(options: RawSimulateOptions): Promise<SendAtomicTransactionComposerResults & {
694
1292
  simulateResponse: SimulateResponse;
695
1293
  }>;