algosdk 2.2.0 → 2.4.0

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 (116) hide show
  1. package/README.md +5 -7
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/client/v2/algod/algod.js +252 -25
  5. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +1 -1
  7. package/dist/cjs/client/v2/algod/getApplicationBoxes.js +1 -1
  8. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +19 -0
  9. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
  10. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +20 -0
  11. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -0
  12. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +20 -0
  13. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
  14. package/dist/cjs/client/v2/algod/getSyncRound.js +19 -0
  15. package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -0
  16. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +25 -0
  17. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
  18. package/dist/cjs/client/v2/algod/models/types.js +327 -23
  19. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  20. package/dist/cjs/client/v2/algod/ready.js +14 -0
  21. package/dist/cjs/client/v2/algod/ready.js.map +1 -0
  22. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +22 -0
  23. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  24. package/dist/cjs/client/v2/algod/setSyncRound.js +22 -0
  25. package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -0
  26. package/dist/cjs/client/v2/algod/simulateTransaction.js +4 -19
  27. package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
  28. package/dist/cjs/client/v2/algod/suggestedParams.js +1 -0
  29. package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
  30. package/dist/cjs/client/v2/algod/unsetSyncRound.js +18 -0
  31. package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -0
  32. package/dist/cjs/client/v2/serviceClient.js +3 -0
  33. package/dist/cjs/client/v2/serviceClient.js.map +1 -1
  34. package/dist/cjs/composer.js +40 -3
  35. package/dist/cjs/composer.js.map +1 -1
  36. package/dist/cjs/main.js.map +1 -1
  37. package/dist/cjs/makeTxn.js.map +1 -1
  38. package/dist/cjs/transaction.js +1 -2
  39. package/dist/cjs/transaction.js.map +1 -1
  40. package/dist/esm/client/v2/algod/algod.js +229 -25
  41. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  42. package/dist/esm/client/v2/algod/getApplicationBoxByName.js +1 -1
  43. package/dist/esm/client/v2/algod/getApplicationBoxes.js +1 -1
  44. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +13 -0
  45. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
  46. package/dist/esm/client/v2/algod/getLedgerStateDelta.js +14 -0
  47. package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -0
  48. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +14 -0
  49. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
  50. package/dist/esm/client/v2/algod/getSyncRound.js +13 -0
  51. package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -0
  52. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +19 -0
  53. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
  54. package/dist/esm/client/v2/algod/models/types.js +317 -22
  55. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  56. package/dist/esm/client/v2/algod/ready.js +8 -0
  57. package/dist/esm/client/v2/algod/ready.js.map +1 -0
  58. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +16 -0
  59. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  60. package/dist/esm/client/v2/algod/setSyncRound.js +16 -0
  61. package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -0
  62. package/dist/esm/client/v2/algod/simulateTransaction.js +4 -19
  63. package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
  64. package/dist/esm/client/v2/algod/suggestedParams.js +1 -0
  65. package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
  66. package/dist/esm/client/v2/algod/unsetSyncRound.js +12 -0
  67. package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -0
  68. package/dist/esm/client/v2/serviceClient.js +3 -0
  69. package/dist/esm/client/v2/serviceClient.js.map +1 -1
  70. package/dist/esm/composer.js +17 -3
  71. package/dist/esm/composer.js.map +1 -1
  72. package/dist/esm/main.js.map +1 -1
  73. package/dist/esm/makeTxn.js.map +1 -1
  74. package/dist/esm/transaction.js +1 -2
  75. package/dist/esm/transaction.js.map +1 -1
  76. package/dist/types/client/v2/algod/algod.d.ts +190 -24
  77. package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +1 -1
  78. package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +1 -1
  79. package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +6 -0
  80. package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +8 -0
  81. package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +8 -0
  82. package/dist/types/client/v2/algod/getSyncRound.d.ts +6 -0
  83. package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +10 -0
  84. package/dist/types/client/v2/algod/models/types.d.ts +283 -29
  85. package/dist/types/client/v2/algod/ready.d.ts +4 -0
  86. package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +9 -0
  87. package/dist/types/client/v2/algod/setSyncRound.d.ts +9 -0
  88. package/dist/types/client/v2/algod/simulateTransaction.d.ts +3 -3
  89. package/dist/types/client/v2/algod/suggestedParams.d.ts +3 -3
  90. package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -0
  91. package/dist/types/composer.d.ts +5 -2
  92. package/dist/types/main.d.ts +1 -0
  93. package/dist/types/makeTxn.d.ts +1 -3
  94. package/dist/types/types/transactions/base.d.ts +6 -0
  95. package/package.json +2 -4
  96. package/src/client/v2/algod/algod.ts +246 -25
  97. package/src/client/v2/algod/getApplicationBoxByName.ts +1 -1
  98. package/src/client/v2/algod/getApplicationBoxes.ts +1 -1
  99. package/src/client/v2/algod/getBlockOffsetTimestamp.ts +17 -0
  100. package/src/client/v2/algod/getLedgerStateDelta.ts +16 -0
  101. package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -0
  102. package/src/client/v2/algod/getSyncRound.ts +17 -0
  103. package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +29 -0
  104. package/src/client/v2/algod/models/types.ts +560 -36
  105. package/src/client/v2/algod/ready.ts +8 -0
  106. package/src/client/v2/algod/setBlockOffsetTimestamp.ts +20 -0
  107. package/src/client/v2/algod/setSyncRound.ts +20 -0
  108. package/src/client/v2/algod/simulateTransaction.ts +6 -22
  109. package/src/client/v2/algod/suggestedParams.ts +4 -3
  110. package/src/client/v2/algod/unsetSyncRound.ts +13 -0
  111. package/src/client/v2/serviceClient.ts +3 -0
  112. package/src/composer.ts +28 -4
  113. package/src/main.ts +7 -0
  114. package/src/makeTxn.ts +2 -4
  115. package/src/transaction.ts +1 -2
  116. package/src/types/transactions/base.ts +7 -0
@@ -877,17 +877,17 @@ export class ApplicationParams extends BaseModel {
877
877
  public extraProgramPages?: number | bigint;
878
878
 
879
879
  /**
880
- * [\gs) global schema
880
+ * (gs) global state
881
881
  */
882
882
  public globalState?: TealKeyValue[];
883
883
 
884
884
  /**
885
- * [\gsch) global schema
885
+ * (gsch) global schema
886
886
  */
887
887
  public globalStateSchema?: ApplicationStateSchema;
888
888
 
889
889
  /**
890
- * [\lsch) local schema
890
+ * (lsch) local schema
891
891
  */
892
892
  public localStateSchema?: ApplicationStateSchema;
893
893
 
@@ -898,9 +898,9 @@ export class ApplicationParams extends BaseModel {
898
898
  * @param creator - The address that created this application. This is the address where the
899
899
  * parameters and global state for this application can be found.
900
900
  * @param extraProgramPages - (epp) the amount of extra program pages available to this app.
901
- * @param globalState - [\gs) global schema
902
- * @param globalStateSchema - [\gsch) global schema
903
- * @param localStateSchema - [\lsch) local schema
901
+ * @param globalState - (gs) global state
902
+ * @param globalStateSchema - (gsch) global schema
903
+ * @param localStateSchema - (lsch) local schema
904
904
  */
905
905
  constructor({
906
906
  approvalProgram,
@@ -2432,6 +2432,178 @@ export class EvalDeltaKeyValue extends BaseModel {
2432
2432
  }
2433
2433
  }
2434
2434
 
2435
+ /**
2436
+ * Response containing the timestamp offset in seconds
2437
+ */
2438
+ export class GetBlockTimeStampOffsetResponse extends BaseModel {
2439
+ /**
2440
+ * Timestamp offset in seconds.
2441
+ */
2442
+ public offset: number | bigint;
2443
+
2444
+ /**
2445
+ * Creates a new `GetBlockTimeStampOffsetResponse` object.
2446
+ * @param offset - Timestamp offset in seconds.
2447
+ */
2448
+ constructor({ offset }: { offset: number | bigint }) {
2449
+ super();
2450
+ this.offset = offset;
2451
+
2452
+ this.attribute_map = {
2453
+ offset: 'offset',
2454
+ };
2455
+ }
2456
+
2457
+ // eslint-disable-next-line camelcase
2458
+ static from_obj_for_encoding(
2459
+ data: Record<string, any>
2460
+ ): GetBlockTimeStampOffsetResponse {
2461
+ /* eslint-disable dot-notation */
2462
+ if (typeof data['offset'] === 'undefined')
2463
+ throw new Error(`Response is missing required field 'offset': ${data}`);
2464
+ return new GetBlockTimeStampOffsetResponse({
2465
+ offset: data['offset'],
2466
+ });
2467
+ /* eslint-enable dot-notation */
2468
+ }
2469
+ }
2470
+
2471
+ /**
2472
+ * Response containing the ledger's minimum sync round
2473
+ */
2474
+ export class GetSyncRoundResponse extends BaseModel {
2475
+ /**
2476
+ * The minimum sync round for the ledger.
2477
+ */
2478
+ public round: number | bigint;
2479
+
2480
+ /**
2481
+ * Creates a new `GetSyncRoundResponse` object.
2482
+ * @param round - The minimum sync round for the ledger.
2483
+ */
2484
+ constructor({ round }: { round: number | bigint }) {
2485
+ super();
2486
+ this.round = round;
2487
+
2488
+ this.attribute_map = {
2489
+ round: 'round',
2490
+ };
2491
+ }
2492
+
2493
+ // eslint-disable-next-line camelcase
2494
+ static from_obj_for_encoding(
2495
+ data: Record<string, any>
2496
+ ): GetSyncRoundResponse {
2497
+ /* eslint-disable dot-notation */
2498
+ if (typeof data['round'] === 'undefined')
2499
+ throw new Error(`Response is missing required field 'round': ${data}`);
2500
+ return new GetSyncRoundResponse({
2501
+ round: data['round'],
2502
+ });
2503
+ /* eslint-enable dot-notation */
2504
+ }
2505
+ }
2506
+
2507
+ /**
2508
+ * A single Delta containing the key, the previous value and the current value for
2509
+ * a single round.
2510
+ */
2511
+ export class KvDelta extends BaseModel {
2512
+ /**
2513
+ * The key, base64 encoded.
2514
+ */
2515
+ public key?: Uint8Array;
2516
+
2517
+ /**
2518
+ * The new value of the KV store entry, base64 encoded.
2519
+ */
2520
+ public value?: Uint8Array;
2521
+
2522
+ /**
2523
+ * Creates a new `KvDelta` object.
2524
+ * @param key - The key, base64 encoded.
2525
+ * @param value - The new value of the KV store entry, base64 encoded.
2526
+ */
2527
+ constructor({
2528
+ key,
2529
+ value,
2530
+ }: {
2531
+ key?: string | Uint8Array;
2532
+ value?: string | Uint8Array;
2533
+ }) {
2534
+ super();
2535
+ this.key =
2536
+ typeof key === 'string'
2537
+ ? new Uint8Array(Buffer.from(key, 'base64'))
2538
+ : key;
2539
+ this.value =
2540
+ typeof value === 'string'
2541
+ ? new Uint8Array(Buffer.from(value, 'base64'))
2542
+ : value;
2543
+
2544
+ this.attribute_map = {
2545
+ key: 'key',
2546
+ value: 'value',
2547
+ };
2548
+ }
2549
+
2550
+ // eslint-disable-next-line camelcase
2551
+ static from_obj_for_encoding(data: Record<string, any>): KvDelta {
2552
+ /* eslint-disable dot-notation */
2553
+ return new KvDelta({
2554
+ key: data['key'],
2555
+ value: data['value'],
2556
+ });
2557
+ /* eslint-enable dot-notation */
2558
+ }
2559
+ }
2560
+
2561
+ /**
2562
+ * Contains a ledger delta for a single transaction group
2563
+ */
2564
+ export class LedgerStateDeltaForTransactionGroup extends BaseModel {
2565
+ /**
2566
+ * Ledger StateDelta object
2567
+ */
2568
+ public delta: Record<string, any>;
2569
+
2570
+ public ids: string[];
2571
+
2572
+ /**
2573
+ * Creates a new `LedgerStateDeltaForTransactionGroup` object.
2574
+ * @param delta - Ledger StateDelta object
2575
+ * @param ids -
2576
+ */
2577
+ constructor({ delta, ids }: { delta: Record<string, any>; ids: string[] }) {
2578
+ super();
2579
+ this.delta = delta;
2580
+ this.ids = ids;
2581
+
2582
+ this.attribute_map = {
2583
+ delta: 'delta',
2584
+ ids: 'ids',
2585
+ };
2586
+ }
2587
+
2588
+ // eslint-disable-next-line camelcase
2589
+ static from_obj_for_encoding(
2590
+ data: Record<string, any>
2591
+ ): LedgerStateDeltaForTransactionGroup {
2592
+ /* eslint-disable dot-notation */
2593
+ if (typeof data['delta'] === 'undefined')
2594
+ throw new Error(`Response is missing required field 'delta': ${data}`);
2595
+ if (!Array.isArray(data['ids']))
2596
+ throw new Error(
2597
+ `Response is missing required array field 'ids': ${data}`
2598
+ );
2599
+ return new LedgerStateDeltaForTransactionGroup({
2600
+ delta: data['delta'],
2601
+ ids: data['ids'],
2602
+ });
2603
+ /* eslint-enable dot-notation */
2604
+ }
2605
+ }
2606
+
2435
2607
  /**
2436
2608
  * Proof of membership and position of a light block header.
2437
2609
  */
@@ -2607,6 +2779,46 @@ export class NodeStatusResponse extends BaseModel {
2607
2779
  */
2608
2780
  public lastCatchpoint?: string;
2609
2781
 
2782
+ /**
2783
+ * Upgrade delay
2784
+ */
2785
+ public upgradeDelay?: number | bigint;
2786
+
2787
+ /**
2788
+ * Next protocol round
2789
+ */
2790
+ public upgradeNextProtocolVoteBefore?: number | bigint;
2791
+
2792
+ /**
2793
+ * No votes cast for consensus upgrade
2794
+ */
2795
+ public upgradeNoVotes?: number | bigint;
2796
+
2797
+ /**
2798
+ * This node's upgrade vote
2799
+ */
2800
+ public upgradeNodeVote?: boolean;
2801
+
2802
+ /**
2803
+ * Total voting rounds for current upgrade
2804
+ */
2805
+ public upgradeVoteRounds?: number | bigint;
2806
+
2807
+ /**
2808
+ * Total votes cast for consensus upgrade
2809
+ */
2810
+ public upgradeVotes?: number | bigint;
2811
+
2812
+ /**
2813
+ * Yes votes required for consensus upgrade
2814
+ */
2815
+ public upgradeVotesRequired?: number | bigint;
2816
+
2817
+ /**
2818
+ * Yes votes cast for consensus upgrade
2819
+ */
2820
+ public upgradeYesVotes?: number | bigint;
2821
+
2610
2822
  /**
2611
2823
  * Creates a new `NodeStatusResponse` object.
2612
2824
  * @param catchupTime - CatchupTime in nanoseconds
@@ -2635,6 +2847,14 @@ export class NodeStatusResponse extends BaseModel {
2635
2847
  * @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been
2636
2848
  * verified so far as part of the catchup
2637
2849
  * @param lastCatchpoint - The last catchpoint seen by the node
2850
+ * @param upgradeDelay - Upgrade delay
2851
+ * @param upgradeNextProtocolVoteBefore - Next protocol round
2852
+ * @param upgradeNoVotes - No votes cast for consensus upgrade
2853
+ * @param upgradeNodeVote - This node's upgrade vote
2854
+ * @param upgradeVoteRounds - Total voting rounds for current upgrade
2855
+ * @param upgradeVotes - Total votes cast for consensus upgrade
2856
+ * @param upgradeVotesRequired - Yes votes required for consensus upgrade
2857
+ * @param upgradeYesVotes - Yes votes cast for consensus upgrade
2638
2858
  */
2639
2859
  constructor({
2640
2860
  catchupTime,
@@ -2655,6 +2875,14 @@ export class NodeStatusResponse extends BaseModel {
2655
2875
  catchpointVerifiedAccounts,
2656
2876
  catchpointVerifiedKvs,
2657
2877
  lastCatchpoint,
2878
+ upgradeDelay,
2879
+ upgradeNextProtocolVoteBefore,
2880
+ upgradeNoVotes,
2881
+ upgradeNodeVote,
2882
+ upgradeVoteRounds,
2883
+ upgradeVotes,
2884
+ upgradeVotesRequired,
2885
+ upgradeYesVotes,
2658
2886
  }: {
2659
2887
  catchupTime: number | bigint;
2660
2888
  lastRound: number | bigint;
@@ -2674,6 +2902,14 @@ export class NodeStatusResponse extends BaseModel {
2674
2902
  catchpointVerifiedAccounts?: number | bigint;
2675
2903
  catchpointVerifiedKvs?: number | bigint;
2676
2904
  lastCatchpoint?: string;
2905
+ upgradeDelay?: number | bigint;
2906
+ upgradeNextProtocolVoteBefore?: number | bigint;
2907
+ upgradeNoVotes?: number | bigint;
2908
+ upgradeNodeVote?: boolean;
2909
+ upgradeVoteRounds?: number | bigint;
2910
+ upgradeVotes?: number | bigint;
2911
+ upgradeVotesRequired?: number | bigint;
2912
+ upgradeYesVotes?: number | bigint;
2677
2913
  }) {
2678
2914
  super();
2679
2915
  this.catchupTime = catchupTime;
@@ -2694,6 +2930,14 @@ export class NodeStatusResponse extends BaseModel {
2694
2930
  this.catchpointVerifiedAccounts = catchpointVerifiedAccounts;
2695
2931
  this.catchpointVerifiedKvs = catchpointVerifiedKvs;
2696
2932
  this.lastCatchpoint = lastCatchpoint;
2933
+ this.upgradeDelay = upgradeDelay;
2934
+ this.upgradeNextProtocolVoteBefore = upgradeNextProtocolVoteBefore;
2935
+ this.upgradeNoVotes = upgradeNoVotes;
2936
+ this.upgradeNodeVote = upgradeNodeVote;
2937
+ this.upgradeVoteRounds = upgradeVoteRounds;
2938
+ this.upgradeVotes = upgradeVotes;
2939
+ this.upgradeVotesRequired = upgradeVotesRequired;
2940
+ this.upgradeYesVotes = upgradeYesVotes;
2697
2941
 
2698
2942
  this.attribute_map = {
2699
2943
  catchupTime: 'catchup-time',
@@ -2714,6 +2958,14 @@ export class NodeStatusResponse extends BaseModel {
2714
2958
  catchpointVerifiedAccounts: 'catchpoint-verified-accounts',
2715
2959
  catchpointVerifiedKvs: 'catchpoint-verified-kvs',
2716
2960
  lastCatchpoint: 'last-catchpoint',
2961
+ upgradeDelay: 'upgrade-delay',
2962
+ upgradeNextProtocolVoteBefore: 'upgrade-next-protocol-vote-before',
2963
+ upgradeNoVotes: 'upgrade-no-votes',
2964
+ upgradeNodeVote: 'upgrade-node-vote',
2965
+ upgradeVoteRounds: 'upgrade-vote-rounds',
2966
+ upgradeVotes: 'upgrade-votes',
2967
+ upgradeVotesRequired: 'upgrade-votes-required',
2968
+ upgradeYesVotes: 'upgrade-yes-votes',
2717
2969
  };
2718
2970
  }
2719
2971
 
@@ -2771,6 +3023,14 @@ export class NodeStatusResponse extends BaseModel {
2771
3023
  catchpointVerifiedAccounts: data['catchpoint-verified-accounts'],
2772
3024
  catchpointVerifiedKvs: data['catchpoint-verified-kvs'],
2773
3025
  lastCatchpoint: data['last-catchpoint'],
3026
+ upgradeDelay: data['upgrade-delay'],
3027
+ upgradeNextProtocolVoteBefore: data['upgrade-next-protocol-vote-before'],
3028
+ upgradeNoVotes: data['upgrade-no-votes'],
3029
+ upgradeNodeVote: data['upgrade-node-vote'],
3030
+ upgradeVoteRounds: data['upgrade-vote-rounds'],
3031
+ upgradeVotes: data['upgrade-votes'],
3032
+ upgradeVotesRequired: data['upgrade-votes-required'],
3033
+ upgradeYesVotes: data['upgrade-yes-votes'],
2774
3034
  });
2775
3035
  /* eslint-enable dot-notation */
2776
3036
  }
@@ -2825,7 +3085,7 @@ export class PendingTransactionResponse extends BaseModel {
2825
3085
  public confirmedRound?: number | bigint;
2826
3086
 
2827
3087
  /**
2828
- * (gd) Global state key/value changes for the application being executed by this
3088
+ * Global state key/value changes for the application being executed by this
2829
3089
  * transaction.
2830
3090
  */
2831
3091
  public globalStateDelta?: EvalDeltaKeyValue[];
@@ -2836,13 +3096,13 @@ export class PendingTransactionResponse extends BaseModel {
2836
3096
  public innerTxns?: PendingTransactionResponse[];
2837
3097
 
2838
3098
  /**
2839
- * (ld) Local state key/value changes for the application being executed by this
3099
+ * Local state key/value changes for the application being executed by this
2840
3100
  * transaction.
2841
3101
  */
2842
3102
  public localStateDelta?: AccountStateDelta[];
2843
3103
 
2844
3104
  /**
2845
- * (lg) Logs for the application being executed by this transaction.
3105
+ * Logs for the application being executed by this transaction.
2846
3106
  */
2847
3107
  public logs?: Uint8Array[];
2848
3108
 
@@ -2869,12 +3129,12 @@ export class PendingTransactionResponse extends BaseModel {
2869
3129
  * @param closeRewards - Rewards in microalgos applied to the close remainder to account.
2870
3130
  * @param closingAmount - Closing amount for the transaction.
2871
3131
  * @param confirmedRound - The round where this transaction was confirmed, if present.
2872
- * @param globalStateDelta - (gd) Global state key/value changes for the application being executed by this
3132
+ * @param globalStateDelta - Global state key/value changes for the application being executed by this
2873
3133
  * transaction.
2874
3134
  * @param innerTxns - Inner transactions produced by application execution.
2875
- * @param localStateDelta - (ld) Local state key/value changes for the application being executed by this
3135
+ * @param localStateDelta - Local state key/value changes for the application being executed by this
2876
3136
  * transaction.
2877
- * @param logs - (lg) Logs for the application being executed by this transaction.
3137
+ * @param logs - Logs for the application being executed by this transaction.
2878
3138
  * @param receiverRewards - Rewards in microalgos applied to the receiver account.
2879
3139
  * @param senderRewards - Rewards in microalgos applied to the sender account.
2880
3140
  */
@@ -3084,6 +3344,121 @@ export class PostTransactionsResponse extends BaseModel {
3084
3344
  }
3085
3345
  }
3086
3346
 
3347
+ /**
3348
+ * Request type for simulation endpoint.
3349
+ */
3350
+ export class SimulateRequest extends BaseModel {
3351
+ /**
3352
+ * The transaction groups to simulate.
3353
+ */
3354
+ public txnGroups: SimulateRequestTransactionGroup[];
3355
+
3356
+ /**
3357
+ * Allow transactions without signatures to be simulated as if they had correct
3358
+ * signatures.
3359
+ */
3360
+ public allowEmptySignatures?: boolean;
3361
+
3362
+ /**
3363
+ * Lifts limits on log opcode usage during simulation.
3364
+ */
3365
+ public allowMoreLogging?: boolean;
3366
+
3367
+ /**
3368
+ * Applies extra opcode budget during simulation for each transaction group.
3369
+ */
3370
+ public extraOpcodeBudget?: number | bigint;
3371
+
3372
+ /**
3373
+ * Creates a new `SimulateRequest` object.
3374
+ * @param txnGroups - The transaction groups to simulate.
3375
+ * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
3376
+ * signatures.
3377
+ * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
3378
+ * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
3379
+ */
3380
+ constructor({
3381
+ txnGroups,
3382
+ allowEmptySignatures,
3383
+ allowMoreLogging,
3384
+ extraOpcodeBudget,
3385
+ }: {
3386
+ txnGroups: SimulateRequestTransactionGroup[];
3387
+ allowEmptySignatures?: boolean;
3388
+ allowMoreLogging?: boolean;
3389
+ extraOpcodeBudget?: number | bigint;
3390
+ }) {
3391
+ super();
3392
+ this.txnGroups = txnGroups;
3393
+ this.allowEmptySignatures = allowEmptySignatures;
3394
+ this.allowMoreLogging = allowMoreLogging;
3395
+ this.extraOpcodeBudget = extraOpcodeBudget;
3396
+
3397
+ this.attribute_map = {
3398
+ txnGroups: 'txn-groups',
3399
+ allowEmptySignatures: 'allow-empty-signatures',
3400
+ allowMoreLogging: 'allow-more-logging',
3401
+ extraOpcodeBudget: 'extra-opcode-budget',
3402
+ };
3403
+ }
3404
+
3405
+ // eslint-disable-next-line camelcase
3406
+ static from_obj_for_encoding(data: Record<string, any>): SimulateRequest {
3407
+ /* eslint-disable dot-notation */
3408
+ if (!Array.isArray(data['txn-groups']))
3409
+ throw new Error(
3410
+ `Response is missing required array field 'txn-groups': ${data}`
3411
+ );
3412
+ return new SimulateRequest({
3413
+ txnGroups: data['txn-groups'].map(
3414
+ SimulateRequestTransactionGroup.from_obj_for_encoding
3415
+ ),
3416
+ allowEmptySignatures: data['allow-empty-signatures'],
3417
+ allowMoreLogging: data['allow-more-logging'],
3418
+ extraOpcodeBudget: data['extra-opcode-budget'],
3419
+ });
3420
+ /* eslint-enable dot-notation */
3421
+ }
3422
+ }
3423
+
3424
+ /**
3425
+ * A transaction group to simulate.
3426
+ */
3427
+ export class SimulateRequestTransactionGroup extends BaseModel {
3428
+ /**
3429
+ * An atomic transaction group.
3430
+ */
3431
+ public txns: EncodedSignedTransaction[];
3432
+
3433
+ /**
3434
+ * Creates a new `SimulateRequestTransactionGroup` object.
3435
+ * @param txns - An atomic transaction group.
3436
+ */
3437
+ constructor({ txns }: { txns: EncodedSignedTransaction[] }) {
3438
+ super();
3439
+ this.txns = txns;
3440
+
3441
+ this.attribute_map = {
3442
+ txns: 'txns',
3443
+ };
3444
+ }
3445
+
3446
+ // eslint-disable-next-line camelcase
3447
+ static from_obj_for_encoding(
3448
+ data: Record<string, any>
3449
+ ): SimulateRequestTransactionGroup {
3450
+ /* eslint-disable dot-notation */
3451
+ if (!Array.isArray(data['txns']))
3452
+ throw new Error(
3453
+ `Response is missing required array field 'txns': ${data}`
3454
+ );
3455
+ return new SimulateRequestTransactionGroup({
3456
+ txns: data['txns'],
3457
+ });
3458
+ /* eslint-enable dot-notation */
3459
+ }
3460
+ }
3461
+
3087
3462
  /**
3088
3463
  * Result of a transaction group simulation.
3089
3464
  */
@@ -3105,11 +3480,11 @@ export class SimulateResponse extends BaseModel {
3105
3480
  public version: number | bigint;
3106
3481
 
3107
3482
  /**
3108
- * Indicates whether the simulated transactions would have succeeded during an
3109
- * actual submission. If any transaction fails or is missing a signature, this will
3110
- * be false.
3483
+ * The set of parameters and limits override during simulation. If this set of
3484
+ * parameters is present, then evaluation parameters may differ from standard
3485
+ * evaluation in certain ways.
3111
3486
  */
3112
- public wouldSucceed: boolean;
3487
+ public evalOverrides?: SimulationEvalOverrides;
3113
3488
 
3114
3489
  /**
3115
3490
  * Creates a new `SimulateResponse` object.
@@ -3117,32 +3492,32 @@ export class SimulateResponse extends BaseModel {
3117
3492
  * round were used to run this simulation.
3118
3493
  * @param txnGroups - A result object for each transaction group that was simulated.
3119
3494
  * @param version - The version of this response object.
3120
- * @param wouldSucceed - Indicates whether the simulated transactions would have succeeded during an
3121
- * actual submission. If any transaction fails or is missing a signature, this will
3122
- * be false.
3495
+ * @param evalOverrides - The set of parameters and limits override during simulation. If this set of
3496
+ * parameters is present, then evaluation parameters may differ from standard
3497
+ * evaluation in certain ways.
3123
3498
  */
3124
3499
  constructor({
3125
3500
  lastRound,
3126
3501
  txnGroups,
3127
3502
  version,
3128
- wouldSucceed,
3503
+ evalOverrides,
3129
3504
  }: {
3130
3505
  lastRound: number | bigint;
3131
3506
  txnGroups: SimulateTransactionGroupResult[];
3132
3507
  version: number | bigint;
3133
- wouldSucceed: boolean;
3508
+ evalOverrides?: SimulationEvalOverrides;
3134
3509
  }) {
3135
3510
  super();
3136
3511
  this.lastRound = lastRound;
3137
3512
  this.txnGroups = txnGroups;
3138
3513
  this.version = version;
3139
- this.wouldSucceed = wouldSucceed;
3514
+ this.evalOverrides = evalOverrides;
3140
3515
 
3141
3516
  this.attribute_map = {
3142
3517
  lastRound: 'last-round',
3143
3518
  txnGroups: 'txn-groups',
3144
3519
  version: 'version',
3145
- wouldSucceed: 'would-succeed',
3520
+ evalOverrides: 'eval-overrides',
3146
3521
  };
3147
3522
  }
3148
3523
 
@@ -3159,17 +3534,18 @@ export class SimulateResponse extends BaseModel {
3159
3534
  );
3160
3535
  if (typeof data['version'] === 'undefined')
3161
3536
  throw new Error(`Response is missing required field 'version': ${data}`);
3162
- if (typeof data['would-succeed'] === 'undefined')
3163
- throw new Error(
3164
- `Response is missing required field 'would-succeed': ${data}`
3165
- );
3166
3537
  return new SimulateResponse({
3167
3538
  lastRound: data['last-round'],
3168
3539
  txnGroups: data['txn-groups'].map(
3169
3540
  SimulateTransactionGroupResult.from_obj_for_encoding
3170
3541
  ),
3171
3542
  version: data['version'],
3172
- wouldSucceed: data['would-succeed'],
3543
+ evalOverrides:
3544
+ typeof data['eval-overrides'] !== 'undefined'
3545
+ ? SimulationEvalOverrides.from_obj_for_encoding(
3546
+ data['eval-overrides']
3547
+ )
3548
+ : undefined,
3173
3549
  });
3174
3550
  /* eslint-enable dot-notation */
3175
3551
  }
@@ -3184,6 +3560,16 @@ export class SimulateTransactionGroupResult extends BaseModel {
3184
3560
  */
3185
3561
  public txnResults: SimulateTransactionResult[];
3186
3562
 
3563
+ /**
3564
+ * Total budget added during execution of app calls in the transaction group.
3565
+ */
3566
+ public appBudgetAdded?: number | bigint;
3567
+
3568
+ /**
3569
+ * Total budget consumed during execution of app calls in the transaction group.
3570
+ */
3571
+ public appBudgetConsumed?: number | bigint;
3572
+
3187
3573
  /**
3188
3574
  * If present, indicates which transaction in this group caused the failure. This
3189
3575
  * array represents the path to the failing transaction. Indexes are zero based,
@@ -3201,6 +3587,8 @@ export class SimulateTransactionGroupResult extends BaseModel {
3201
3587
  /**
3202
3588
  * Creates a new `SimulateTransactionGroupResult` object.
3203
3589
  * @param txnResults - Simulation result for individual transactions
3590
+ * @param appBudgetAdded - Total budget added during execution of app calls in the transaction group.
3591
+ * @param appBudgetConsumed - Total budget consumed during execution of app calls in the transaction group.
3204
3592
  * @param failedAt - If present, indicates which transaction in this group caused the failure. This
3205
3593
  * array represents the path to the failing transaction. Indexes are zero based,
3206
3594
  * the first element indicates the top-level transaction, and successive elements
@@ -3210,20 +3598,28 @@ export class SimulateTransactionGroupResult extends BaseModel {
3210
3598
  */
3211
3599
  constructor({
3212
3600
  txnResults,
3601
+ appBudgetAdded,
3602
+ appBudgetConsumed,
3213
3603
  failedAt,
3214
3604
  failureMessage,
3215
3605
  }: {
3216
3606
  txnResults: SimulateTransactionResult[];
3607
+ appBudgetAdded?: number | bigint;
3608
+ appBudgetConsumed?: number | bigint;
3217
3609
  failedAt?: (number | bigint)[];
3218
3610
  failureMessage?: string;
3219
3611
  }) {
3220
3612
  super();
3221
3613
  this.txnResults = txnResults;
3614
+ this.appBudgetAdded = appBudgetAdded;
3615
+ this.appBudgetConsumed = appBudgetConsumed;
3222
3616
  this.failedAt = failedAt;
3223
3617
  this.failureMessage = failureMessage;
3224
3618
 
3225
3619
  this.attribute_map = {
3226
3620
  txnResults: 'txn-results',
3621
+ appBudgetAdded: 'app-budget-added',
3622
+ appBudgetConsumed: 'app-budget-consumed',
3227
3623
  failedAt: 'failed-at',
3228
3624
  failureMessage: 'failure-message',
3229
3625
  };
@@ -3242,6 +3638,8 @@ export class SimulateTransactionGroupResult extends BaseModel {
3242
3638
  txnResults: data['txn-results'].map(
3243
3639
  SimulateTransactionResult.from_obj_for_encoding
3244
3640
  ),
3641
+ appBudgetAdded: data['app-budget-added'],
3642
+ appBudgetConsumed: data['app-budget-consumed'],
3245
3643
  failedAt: data['failed-at'],
3246
3644
  failureMessage: data['failure-message'],
3247
3645
  });
@@ -3260,30 +3658,42 @@ export class SimulateTransactionResult extends BaseModel {
3260
3658
  public txnResult: PendingTransactionResponse;
3261
3659
 
3262
3660
  /**
3263
- * A boolean indicating whether this transaction is missing signatures
3661
+ * Budget used during execution of an app call transaction. This value includes
3662
+ * budged used by inner app calls spawned by this transaction.
3264
3663
  */
3265
- public missingSignature?: boolean;
3664
+ public appBudgetConsumed?: number | bigint;
3665
+
3666
+ /**
3667
+ * Budget used during execution of a logic sig transaction.
3668
+ */
3669
+ public logicSigBudgetConsumed?: number | bigint;
3266
3670
 
3267
3671
  /**
3268
3672
  * Creates a new `SimulateTransactionResult` object.
3269
3673
  * @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
3270
3674
  * includes confirmation details like the round and reward details.
3271
- * @param missingSignature - A boolean indicating whether this transaction is missing signatures
3675
+ * @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
3676
+ * budged used by inner app calls spawned by this transaction.
3677
+ * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
3272
3678
  */
3273
3679
  constructor({
3274
3680
  txnResult,
3275
- missingSignature,
3681
+ appBudgetConsumed,
3682
+ logicSigBudgetConsumed,
3276
3683
  }: {
3277
3684
  txnResult: PendingTransactionResponse;
3278
- missingSignature?: boolean;
3685
+ appBudgetConsumed?: number | bigint;
3686
+ logicSigBudgetConsumed?: number | bigint;
3279
3687
  }) {
3280
3688
  super();
3281
3689
  this.txnResult = txnResult;
3282
- this.missingSignature = missingSignature;
3690
+ this.appBudgetConsumed = appBudgetConsumed;
3691
+ this.logicSigBudgetConsumed = logicSigBudgetConsumed;
3283
3692
 
3284
3693
  this.attribute_map = {
3285
3694
  txnResult: 'txn-result',
3286
- missingSignature: 'missing-signature',
3695
+ appBudgetConsumed: 'app-budget-consumed',
3696
+ logicSigBudgetConsumed: 'logic-sig-budget-consumed',
3287
3697
  };
3288
3698
  }
3289
3699
 
@@ -3300,7 +3710,83 @@ export class SimulateTransactionResult extends BaseModel {
3300
3710
  txnResult: PendingTransactionResponse.from_obj_for_encoding(
3301
3711
  data['txn-result']
3302
3712
  ),
3303
- missingSignature: data['missing-signature'],
3713
+ appBudgetConsumed: data['app-budget-consumed'],
3714
+ logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
3715
+ });
3716
+ /* eslint-enable dot-notation */
3717
+ }
3718
+ }
3719
+
3720
+ /**
3721
+ * The set of parameters and limits override during simulation. If this set of
3722
+ * parameters is present, then evaluation parameters may differ from standard
3723
+ * evaluation in certain ways.
3724
+ */
3725
+ export class SimulationEvalOverrides extends BaseModel {
3726
+ /**
3727
+ * If true, transactions without signatures are allowed and simulated as if they
3728
+ * were properly signed.
3729
+ */
3730
+ public allowEmptySignatures?: boolean;
3731
+
3732
+ /**
3733
+ * The extra opcode budget added to each transaction group during simulation
3734
+ */
3735
+ public extraOpcodeBudget?: number | bigint;
3736
+
3737
+ /**
3738
+ * The maximum log calls one can make during simulation
3739
+ */
3740
+ public maxLogCalls?: number | bigint;
3741
+
3742
+ /**
3743
+ * The maximum byte number to log during simulation
3744
+ */
3745
+ public maxLogSize?: number | bigint;
3746
+
3747
+ /**
3748
+ * Creates a new `SimulationEvalOverrides` object.
3749
+ * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
3750
+ * were properly signed.
3751
+ * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
3752
+ * @param maxLogCalls - The maximum log calls one can make during simulation
3753
+ * @param maxLogSize - The maximum byte number to log during simulation
3754
+ */
3755
+ constructor({
3756
+ allowEmptySignatures,
3757
+ extraOpcodeBudget,
3758
+ maxLogCalls,
3759
+ maxLogSize,
3760
+ }: {
3761
+ allowEmptySignatures?: boolean;
3762
+ extraOpcodeBudget?: number | bigint;
3763
+ maxLogCalls?: number | bigint;
3764
+ maxLogSize?: number | bigint;
3765
+ }) {
3766
+ super();
3767
+ this.allowEmptySignatures = allowEmptySignatures;
3768
+ this.extraOpcodeBudget = extraOpcodeBudget;
3769
+ this.maxLogCalls = maxLogCalls;
3770
+ this.maxLogSize = maxLogSize;
3771
+
3772
+ this.attribute_map = {
3773
+ allowEmptySignatures: 'allow-empty-signatures',
3774
+ extraOpcodeBudget: 'extra-opcode-budget',
3775
+ maxLogCalls: 'max-log-calls',
3776
+ maxLogSize: 'max-log-size',
3777
+ };
3778
+ }
3779
+
3780
+ // eslint-disable-next-line camelcase
3781
+ static from_obj_for_encoding(
3782
+ data: Record<string, any>
3783
+ ): SimulationEvalOverrides {
3784
+ /* eslint-disable dot-notation */
3785
+ return new SimulationEvalOverrides({
3786
+ allowEmptySignatures: data['allow-empty-signatures'],
3787
+ extraOpcodeBudget: data['extra-opcode-budget'],
3788
+ maxLogCalls: data['max-log-calls'],
3789
+ maxLogSize: data['max-log-size'],
3304
3790
  });
3305
3791
  /* eslint-enable dot-notation */
3306
3792
  }
@@ -3648,6 +4134,44 @@ export class TealValue extends BaseModel {
3648
4134
  }
3649
4135
  }
3650
4136
 
4137
+ /**
4138
+ * Response containing all ledger state deltas for transaction groups, with their
4139
+ * associated Ids, in a single round.
4140
+ */
4141
+ export class TransactionGroupLedgerStateDeltasForRoundResponse extends BaseModel {
4142
+ public deltas: LedgerStateDeltaForTransactionGroup[];
4143
+
4144
+ /**
4145
+ * Creates a new `TransactionGroupLedgerStateDeltasForRoundResponse` object.
4146
+ * @param deltas -
4147
+ */
4148
+ constructor({ deltas }: { deltas: LedgerStateDeltaForTransactionGroup[] }) {
4149
+ super();
4150
+ this.deltas = deltas;
4151
+
4152
+ this.attribute_map = {
4153
+ deltas: 'deltas',
4154
+ };
4155
+ }
4156
+
4157
+ // eslint-disable-next-line camelcase
4158
+ static from_obj_for_encoding(
4159
+ data: Record<string, any>
4160
+ ): TransactionGroupLedgerStateDeltasForRoundResponse {
4161
+ /* eslint-disable dot-notation */
4162
+ if (!Array.isArray(data['Deltas']))
4163
+ throw new Error(
4164
+ `Response is missing required array field 'Deltas': ${data}`
4165
+ );
4166
+ return new TransactionGroupLedgerStateDeltasForRoundResponse({
4167
+ deltas: data['Deltas'].map(
4168
+ LedgerStateDeltaForTransactionGroup.from_obj_for_encoding
4169
+ ),
4170
+ });
4171
+ /* eslint-enable dot-notation */
4172
+ }
4173
+ }
4174
+
3651
4175
  /**
3652
4176
  * TransactionParams contains the parameters that help a client construct a new
3653
4177
  * transaction.