algosdk 2.2.0 → 2.3.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 (93) 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 +201 -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/getSyncRound.js +19 -0
  11. package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -0
  12. package/dist/cjs/client/v2/algod/models/types.js +257 -23
  13. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  14. package/dist/cjs/client/v2/algod/ready.js +14 -0
  15. package/dist/cjs/client/v2/algod/ready.js.map +1 -0
  16. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +22 -0
  17. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  18. package/dist/cjs/client/v2/algod/setSyncRound.js +22 -0
  19. package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -0
  20. package/dist/cjs/client/v2/algod/simulateTransaction.js +4 -19
  21. package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
  22. package/dist/cjs/client/v2/algod/suggestedParams.js +1 -0
  23. package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
  24. package/dist/cjs/client/v2/algod/unsetSyncRound.js +18 -0
  25. package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -0
  26. package/dist/cjs/composer.js +39 -2
  27. package/dist/cjs/composer.js.map +1 -1
  28. package/dist/cjs/main.js.map +1 -1
  29. package/dist/cjs/makeTxn.js.map +1 -1
  30. package/dist/cjs/transaction.js +1 -2
  31. package/dist/cjs/transaction.js.map +1 -1
  32. package/dist/esm/client/v2/algod/algod.js +178 -25
  33. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  34. package/dist/esm/client/v2/algod/getApplicationBoxByName.js +1 -1
  35. package/dist/esm/client/v2/algod/getApplicationBoxes.js +1 -1
  36. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +13 -0
  37. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
  38. package/dist/esm/client/v2/algod/getSyncRound.js +13 -0
  39. package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -0
  40. package/dist/esm/client/v2/algod/models/types.js +250 -22
  41. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  42. package/dist/esm/client/v2/algod/ready.js +8 -0
  43. package/dist/esm/client/v2/algod/ready.js.map +1 -0
  44. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +16 -0
  45. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  46. package/dist/esm/client/v2/algod/setSyncRound.js +16 -0
  47. package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -0
  48. package/dist/esm/client/v2/algod/simulateTransaction.js +4 -19
  49. package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
  50. package/dist/esm/client/v2/algod/suggestedParams.js +1 -0
  51. package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
  52. package/dist/esm/client/v2/algod/unsetSyncRound.js +12 -0
  53. package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -0
  54. package/dist/esm/composer.js +16 -2
  55. package/dist/esm/composer.js.map +1 -1
  56. package/dist/esm/main.js.map +1 -1
  57. package/dist/esm/makeTxn.js.map +1 -1
  58. package/dist/esm/transaction.js +1 -2
  59. package/dist/esm/transaction.js.map +1 -1
  60. package/dist/types/client/v2/algod/algod.d.ts +145 -24
  61. package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +1 -1
  62. package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +1 -1
  63. package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +6 -0
  64. package/dist/types/client/v2/algod/getSyncRound.d.ts +6 -0
  65. package/dist/types/client/v2/algod/models/types.d.ts +236 -29
  66. package/dist/types/client/v2/algod/ready.d.ts +4 -0
  67. package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +9 -0
  68. package/dist/types/client/v2/algod/setSyncRound.d.ts +9 -0
  69. package/dist/types/client/v2/algod/simulateTransaction.d.ts +3 -3
  70. package/dist/types/client/v2/algod/suggestedParams.d.ts +3 -3
  71. package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -0
  72. package/dist/types/composer.d.ts +5 -2
  73. package/dist/types/main.d.ts +1 -0
  74. package/dist/types/makeTxn.d.ts +1 -3
  75. package/dist/types/types/transactions/base.d.ts +6 -0
  76. package/package.json +2 -2
  77. package/src/client/v2/algod/algod.ts +184 -25
  78. package/src/client/v2/algod/getApplicationBoxByName.ts +1 -1
  79. package/src/client/v2/algod/getApplicationBoxes.ts +1 -1
  80. package/src/client/v2/algod/getBlockOffsetTimestamp.ts +17 -0
  81. package/src/client/v2/algod/getSyncRound.ts +17 -0
  82. package/src/client/v2/algod/models/types.ts +454 -36
  83. package/src/client/v2/algod/ready.ts +8 -0
  84. package/src/client/v2/algod/setBlockOffsetTimestamp.ts +20 -0
  85. package/src/client/v2/algod/setSyncRound.ts +20 -0
  86. package/src/client/v2/algod/simulateTransaction.ts +6 -22
  87. package/src/client/v2/algod/suggestedParams.ts +4 -3
  88. package/src/client/v2/algod/unsetSyncRound.ts +13 -0
  89. package/src/composer.ts +27 -3
  90. package/src/main.ts +7 -0
  91. package/src/makeTxn.ts +2 -4
  92. package/src/transaction.ts +1 -2
  93. 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,132 @@ 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
+
2435
2561
  /**
2436
2562
  * Proof of membership and position of a light block header.
2437
2563
  */
@@ -2607,6 +2733,46 @@ export class NodeStatusResponse extends BaseModel {
2607
2733
  */
2608
2734
  public lastCatchpoint?: string;
2609
2735
 
2736
+ /**
2737
+ * Upgrade delay
2738
+ */
2739
+ public upgradeDelay?: number | bigint;
2740
+
2741
+ /**
2742
+ * Next protocol round
2743
+ */
2744
+ public upgradeNextProtocolVoteBefore?: number | bigint;
2745
+
2746
+ /**
2747
+ * No votes cast for consensus upgrade
2748
+ */
2749
+ public upgradeNoVotes?: number | bigint;
2750
+
2751
+ /**
2752
+ * This node's upgrade vote
2753
+ */
2754
+ public upgradeNodeVote?: boolean;
2755
+
2756
+ /**
2757
+ * Total voting rounds for current upgrade
2758
+ */
2759
+ public upgradeVoteRounds?: number | bigint;
2760
+
2761
+ /**
2762
+ * Total votes cast for consensus upgrade
2763
+ */
2764
+ public upgradeVotes?: number | bigint;
2765
+
2766
+ /**
2767
+ * Yes votes required for consensus upgrade
2768
+ */
2769
+ public upgradeVotesRequired?: number | bigint;
2770
+
2771
+ /**
2772
+ * Yes votes cast for consensus upgrade
2773
+ */
2774
+ public upgradeYesVotes?: number | bigint;
2775
+
2610
2776
  /**
2611
2777
  * Creates a new `NodeStatusResponse` object.
2612
2778
  * @param catchupTime - CatchupTime in nanoseconds
@@ -2635,6 +2801,14 @@ export class NodeStatusResponse extends BaseModel {
2635
2801
  * @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been
2636
2802
  * verified so far as part of the catchup
2637
2803
  * @param lastCatchpoint - The last catchpoint seen by the node
2804
+ * @param upgradeDelay - Upgrade delay
2805
+ * @param upgradeNextProtocolVoteBefore - Next protocol round
2806
+ * @param upgradeNoVotes - No votes cast for consensus upgrade
2807
+ * @param upgradeNodeVote - This node's upgrade vote
2808
+ * @param upgradeVoteRounds - Total voting rounds for current upgrade
2809
+ * @param upgradeVotes - Total votes cast for consensus upgrade
2810
+ * @param upgradeVotesRequired - Yes votes required for consensus upgrade
2811
+ * @param upgradeYesVotes - Yes votes cast for consensus upgrade
2638
2812
  */
2639
2813
  constructor({
2640
2814
  catchupTime,
@@ -2655,6 +2829,14 @@ export class NodeStatusResponse extends BaseModel {
2655
2829
  catchpointVerifiedAccounts,
2656
2830
  catchpointVerifiedKvs,
2657
2831
  lastCatchpoint,
2832
+ upgradeDelay,
2833
+ upgradeNextProtocolVoteBefore,
2834
+ upgradeNoVotes,
2835
+ upgradeNodeVote,
2836
+ upgradeVoteRounds,
2837
+ upgradeVotes,
2838
+ upgradeVotesRequired,
2839
+ upgradeYesVotes,
2658
2840
  }: {
2659
2841
  catchupTime: number | bigint;
2660
2842
  lastRound: number | bigint;
@@ -2674,6 +2856,14 @@ export class NodeStatusResponse extends BaseModel {
2674
2856
  catchpointVerifiedAccounts?: number | bigint;
2675
2857
  catchpointVerifiedKvs?: number | bigint;
2676
2858
  lastCatchpoint?: string;
2859
+ upgradeDelay?: number | bigint;
2860
+ upgradeNextProtocolVoteBefore?: number | bigint;
2861
+ upgradeNoVotes?: number | bigint;
2862
+ upgradeNodeVote?: boolean;
2863
+ upgradeVoteRounds?: number | bigint;
2864
+ upgradeVotes?: number | bigint;
2865
+ upgradeVotesRequired?: number | bigint;
2866
+ upgradeYesVotes?: number | bigint;
2677
2867
  }) {
2678
2868
  super();
2679
2869
  this.catchupTime = catchupTime;
@@ -2694,6 +2884,14 @@ export class NodeStatusResponse extends BaseModel {
2694
2884
  this.catchpointVerifiedAccounts = catchpointVerifiedAccounts;
2695
2885
  this.catchpointVerifiedKvs = catchpointVerifiedKvs;
2696
2886
  this.lastCatchpoint = lastCatchpoint;
2887
+ this.upgradeDelay = upgradeDelay;
2888
+ this.upgradeNextProtocolVoteBefore = upgradeNextProtocolVoteBefore;
2889
+ this.upgradeNoVotes = upgradeNoVotes;
2890
+ this.upgradeNodeVote = upgradeNodeVote;
2891
+ this.upgradeVoteRounds = upgradeVoteRounds;
2892
+ this.upgradeVotes = upgradeVotes;
2893
+ this.upgradeVotesRequired = upgradeVotesRequired;
2894
+ this.upgradeYesVotes = upgradeYesVotes;
2697
2895
 
2698
2896
  this.attribute_map = {
2699
2897
  catchupTime: 'catchup-time',
@@ -2714,6 +2912,14 @@ export class NodeStatusResponse extends BaseModel {
2714
2912
  catchpointVerifiedAccounts: 'catchpoint-verified-accounts',
2715
2913
  catchpointVerifiedKvs: 'catchpoint-verified-kvs',
2716
2914
  lastCatchpoint: 'last-catchpoint',
2915
+ upgradeDelay: 'upgrade-delay',
2916
+ upgradeNextProtocolVoteBefore: 'upgrade-next-protocol-vote-before',
2917
+ upgradeNoVotes: 'upgrade-no-votes',
2918
+ upgradeNodeVote: 'upgrade-node-vote',
2919
+ upgradeVoteRounds: 'upgrade-vote-rounds',
2920
+ upgradeVotes: 'upgrade-votes',
2921
+ upgradeVotesRequired: 'upgrade-votes-required',
2922
+ upgradeYesVotes: 'upgrade-yes-votes',
2717
2923
  };
2718
2924
  }
2719
2925
 
@@ -2771,6 +2977,14 @@ export class NodeStatusResponse extends BaseModel {
2771
2977
  catchpointVerifiedAccounts: data['catchpoint-verified-accounts'],
2772
2978
  catchpointVerifiedKvs: data['catchpoint-verified-kvs'],
2773
2979
  lastCatchpoint: data['last-catchpoint'],
2980
+ upgradeDelay: data['upgrade-delay'],
2981
+ upgradeNextProtocolVoteBefore: data['upgrade-next-protocol-vote-before'],
2982
+ upgradeNoVotes: data['upgrade-no-votes'],
2983
+ upgradeNodeVote: data['upgrade-node-vote'],
2984
+ upgradeVoteRounds: data['upgrade-vote-rounds'],
2985
+ upgradeVotes: data['upgrade-votes'],
2986
+ upgradeVotesRequired: data['upgrade-votes-required'],
2987
+ upgradeYesVotes: data['upgrade-yes-votes'],
2774
2988
  });
2775
2989
  /* eslint-enable dot-notation */
2776
2990
  }
@@ -2825,7 +3039,7 @@ export class PendingTransactionResponse extends BaseModel {
2825
3039
  public confirmedRound?: number | bigint;
2826
3040
 
2827
3041
  /**
2828
- * (gd) Global state key/value changes for the application being executed by this
3042
+ * Global state key/value changes for the application being executed by this
2829
3043
  * transaction.
2830
3044
  */
2831
3045
  public globalStateDelta?: EvalDeltaKeyValue[];
@@ -2836,13 +3050,13 @@ export class PendingTransactionResponse extends BaseModel {
2836
3050
  public innerTxns?: PendingTransactionResponse[];
2837
3051
 
2838
3052
  /**
2839
- * (ld) Local state key/value changes for the application being executed by this
3053
+ * Local state key/value changes for the application being executed by this
2840
3054
  * transaction.
2841
3055
  */
2842
3056
  public localStateDelta?: AccountStateDelta[];
2843
3057
 
2844
3058
  /**
2845
- * (lg) Logs for the application being executed by this transaction.
3059
+ * Logs for the application being executed by this transaction.
2846
3060
  */
2847
3061
  public logs?: Uint8Array[];
2848
3062
 
@@ -2869,12 +3083,12 @@ export class PendingTransactionResponse extends BaseModel {
2869
3083
  * @param closeRewards - Rewards in microalgos applied to the close remainder to account.
2870
3084
  * @param closingAmount - Closing amount for the transaction.
2871
3085
  * @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
3086
+ * @param globalStateDelta - Global state key/value changes for the application being executed by this
2873
3087
  * transaction.
2874
3088
  * @param innerTxns - Inner transactions produced by application execution.
2875
- * @param localStateDelta - (ld) Local state key/value changes for the application being executed by this
3089
+ * @param localStateDelta - Local state key/value changes for the application being executed by this
2876
3090
  * transaction.
2877
- * @param logs - (lg) Logs for the application being executed by this transaction.
3091
+ * @param logs - Logs for the application being executed by this transaction.
2878
3092
  * @param receiverRewards - Rewards in microalgos applied to the receiver account.
2879
3093
  * @param senderRewards - Rewards in microalgos applied to the sender account.
2880
3094
  */
@@ -3084,6 +3298,110 @@ export class PostTransactionsResponse extends BaseModel {
3084
3298
  }
3085
3299
  }
3086
3300
 
3301
+ /**
3302
+ * Request type for simulation endpoint.
3303
+ */
3304
+ export class SimulateRequest extends BaseModel {
3305
+ /**
3306
+ * The transaction groups to simulate.
3307
+ */
3308
+ public txnGroups: SimulateRequestTransactionGroup[];
3309
+
3310
+ /**
3311
+ * Allow transactions without signatures to be simulated as if they had correct
3312
+ * signatures.
3313
+ */
3314
+ public allowEmptySignatures?: boolean;
3315
+
3316
+ /**
3317
+ * Lifts limits on log opcode usage during simulation.
3318
+ */
3319
+ public allowMoreLogging?: boolean;
3320
+
3321
+ /**
3322
+ * Creates a new `SimulateRequest` object.
3323
+ * @param txnGroups - The transaction groups to simulate.
3324
+ * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
3325
+ * signatures.
3326
+ * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
3327
+ */
3328
+ constructor({
3329
+ txnGroups,
3330
+ allowEmptySignatures,
3331
+ allowMoreLogging,
3332
+ }: {
3333
+ txnGroups: SimulateRequestTransactionGroup[];
3334
+ allowEmptySignatures?: boolean;
3335
+ allowMoreLogging?: boolean;
3336
+ }) {
3337
+ super();
3338
+ this.txnGroups = txnGroups;
3339
+ this.allowEmptySignatures = allowEmptySignatures;
3340
+ this.allowMoreLogging = allowMoreLogging;
3341
+
3342
+ this.attribute_map = {
3343
+ txnGroups: 'txn-groups',
3344
+ allowEmptySignatures: 'allow-empty-signatures',
3345
+ allowMoreLogging: 'allow-more-logging',
3346
+ };
3347
+ }
3348
+
3349
+ // eslint-disable-next-line camelcase
3350
+ static from_obj_for_encoding(data: Record<string, any>): SimulateRequest {
3351
+ /* eslint-disable dot-notation */
3352
+ if (!Array.isArray(data['txn-groups']))
3353
+ throw new Error(
3354
+ `Response is missing required array field 'txn-groups': ${data}`
3355
+ );
3356
+ return new SimulateRequest({
3357
+ txnGroups: data['txn-groups'].map(
3358
+ SimulateRequestTransactionGroup.from_obj_for_encoding
3359
+ ),
3360
+ allowEmptySignatures: data['allow-empty-signatures'],
3361
+ allowMoreLogging: data['allow-more-logging'],
3362
+ });
3363
+ /* eslint-enable dot-notation */
3364
+ }
3365
+ }
3366
+
3367
+ /**
3368
+ * A transaction group to simulate.
3369
+ */
3370
+ export class SimulateRequestTransactionGroup extends BaseModel {
3371
+ /**
3372
+ * An atomic transaction group.
3373
+ */
3374
+ public txns: EncodedSignedTransaction[];
3375
+
3376
+ /**
3377
+ * Creates a new `SimulateRequestTransactionGroup` object.
3378
+ * @param txns - An atomic transaction group.
3379
+ */
3380
+ constructor({ txns }: { txns: EncodedSignedTransaction[] }) {
3381
+ super();
3382
+ this.txns = txns;
3383
+
3384
+ this.attribute_map = {
3385
+ txns: 'txns',
3386
+ };
3387
+ }
3388
+
3389
+ // eslint-disable-next-line camelcase
3390
+ static from_obj_for_encoding(
3391
+ data: Record<string, any>
3392
+ ): SimulateRequestTransactionGroup {
3393
+ /* eslint-disable dot-notation */
3394
+ if (!Array.isArray(data['txns']))
3395
+ throw new Error(
3396
+ `Response is missing required array field 'txns': ${data}`
3397
+ );
3398
+ return new SimulateRequestTransactionGroup({
3399
+ txns: data['txns'],
3400
+ });
3401
+ /* eslint-enable dot-notation */
3402
+ }
3403
+ }
3404
+
3087
3405
  /**
3088
3406
  * Result of a transaction group simulation.
3089
3407
  */
@@ -3105,11 +3423,11 @@ export class SimulateResponse extends BaseModel {
3105
3423
  public version: number | bigint;
3106
3424
 
3107
3425
  /**
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.
3426
+ * The set of parameters and limits override during simulation. If this set of
3427
+ * parameters is present, then evaluation parameters may differ from standard
3428
+ * evaluation in certain ways.
3111
3429
  */
3112
- public wouldSucceed: boolean;
3430
+ public evalOverrides?: SimulationEvalOverrides;
3113
3431
 
3114
3432
  /**
3115
3433
  * Creates a new `SimulateResponse` object.
@@ -3117,32 +3435,32 @@ export class SimulateResponse extends BaseModel {
3117
3435
  * round were used to run this simulation.
3118
3436
  * @param txnGroups - A result object for each transaction group that was simulated.
3119
3437
  * @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.
3438
+ * @param evalOverrides - The set of parameters and limits override during simulation. If this set of
3439
+ * parameters is present, then evaluation parameters may differ from standard
3440
+ * evaluation in certain ways.
3123
3441
  */
3124
3442
  constructor({
3125
3443
  lastRound,
3126
3444
  txnGroups,
3127
3445
  version,
3128
- wouldSucceed,
3446
+ evalOverrides,
3129
3447
  }: {
3130
3448
  lastRound: number | bigint;
3131
3449
  txnGroups: SimulateTransactionGroupResult[];
3132
3450
  version: number | bigint;
3133
- wouldSucceed: boolean;
3451
+ evalOverrides?: SimulationEvalOverrides;
3134
3452
  }) {
3135
3453
  super();
3136
3454
  this.lastRound = lastRound;
3137
3455
  this.txnGroups = txnGroups;
3138
3456
  this.version = version;
3139
- this.wouldSucceed = wouldSucceed;
3457
+ this.evalOverrides = evalOverrides;
3140
3458
 
3141
3459
  this.attribute_map = {
3142
3460
  lastRound: 'last-round',
3143
3461
  txnGroups: 'txn-groups',
3144
3462
  version: 'version',
3145
- wouldSucceed: 'would-succeed',
3463
+ evalOverrides: 'eval-overrides',
3146
3464
  };
3147
3465
  }
3148
3466
 
@@ -3159,17 +3477,18 @@ export class SimulateResponse extends BaseModel {
3159
3477
  );
3160
3478
  if (typeof data['version'] === 'undefined')
3161
3479
  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
3480
  return new SimulateResponse({
3167
3481
  lastRound: data['last-round'],
3168
3482
  txnGroups: data['txn-groups'].map(
3169
3483
  SimulateTransactionGroupResult.from_obj_for_encoding
3170
3484
  ),
3171
3485
  version: data['version'],
3172
- wouldSucceed: data['would-succeed'],
3486
+ evalOverrides:
3487
+ typeof data['eval-overrides'] !== 'undefined'
3488
+ ? SimulationEvalOverrides.from_obj_for_encoding(
3489
+ data['eval-overrides']
3490
+ )
3491
+ : undefined,
3173
3492
  });
3174
3493
  /* eslint-enable dot-notation */
3175
3494
  }
@@ -3184,6 +3503,16 @@ export class SimulateTransactionGroupResult extends BaseModel {
3184
3503
  */
3185
3504
  public txnResults: SimulateTransactionResult[];
3186
3505
 
3506
+ /**
3507
+ * Total budget added during execution of app calls in the transaction group.
3508
+ */
3509
+ public appBudgetAdded?: number | bigint;
3510
+
3511
+ /**
3512
+ * Total budget consumed during execution of app calls in the transaction group.
3513
+ */
3514
+ public appBudgetConsumed?: number | bigint;
3515
+
3187
3516
  /**
3188
3517
  * If present, indicates which transaction in this group caused the failure. This
3189
3518
  * array represents the path to the failing transaction. Indexes are zero based,
@@ -3201,6 +3530,8 @@ export class SimulateTransactionGroupResult extends BaseModel {
3201
3530
  /**
3202
3531
  * Creates a new `SimulateTransactionGroupResult` object.
3203
3532
  * @param txnResults - Simulation result for individual transactions
3533
+ * @param appBudgetAdded - Total budget added during execution of app calls in the transaction group.
3534
+ * @param appBudgetConsumed - Total budget consumed during execution of app calls in the transaction group.
3204
3535
  * @param failedAt - If present, indicates which transaction in this group caused the failure. This
3205
3536
  * array represents the path to the failing transaction. Indexes are zero based,
3206
3537
  * the first element indicates the top-level transaction, and successive elements
@@ -3210,20 +3541,28 @@ export class SimulateTransactionGroupResult extends BaseModel {
3210
3541
  */
3211
3542
  constructor({
3212
3543
  txnResults,
3544
+ appBudgetAdded,
3545
+ appBudgetConsumed,
3213
3546
  failedAt,
3214
3547
  failureMessage,
3215
3548
  }: {
3216
3549
  txnResults: SimulateTransactionResult[];
3550
+ appBudgetAdded?: number | bigint;
3551
+ appBudgetConsumed?: number | bigint;
3217
3552
  failedAt?: (number | bigint)[];
3218
3553
  failureMessage?: string;
3219
3554
  }) {
3220
3555
  super();
3221
3556
  this.txnResults = txnResults;
3557
+ this.appBudgetAdded = appBudgetAdded;
3558
+ this.appBudgetConsumed = appBudgetConsumed;
3222
3559
  this.failedAt = failedAt;
3223
3560
  this.failureMessage = failureMessage;
3224
3561
 
3225
3562
  this.attribute_map = {
3226
3563
  txnResults: 'txn-results',
3564
+ appBudgetAdded: 'app-budget-added',
3565
+ appBudgetConsumed: 'app-budget-consumed',
3227
3566
  failedAt: 'failed-at',
3228
3567
  failureMessage: 'failure-message',
3229
3568
  };
@@ -3242,6 +3581,8 @@ export class SimulateTransactionGroupResult extends BaseModel {
3242
3581
  txnResults: data['txn-results'].map(
3243
3582
  SimulateTransactionResult.from_obj_for_encoding
3244
3583
  ),
3584
+ appBudgetAdded: data['app-budget-added'],
3585
+ appBudgetConsumed: data['app-budget-consumed'],
3245
3586
  failedAt: data['failed-at'],
3246
3587
  failureMessage: data['failure-message'],
3247
3588
  });
@@ -3260,30 +3601,42 @@ export class SimulateTransactionResult extends BaseModel {
3260
3601
  public txnResult: PendingTransactionResponse;
3261
3602
 
3262
3603
  /**
3263
- * A boolean indicating whether this transaction is missing signatures
3604
+ * Budget used during execution of an app call transaction. This value includes
3605
+ * budged used by inner app calls spawned by this transaction.
3264
3606
  */
3265
- public missingSignature?: boolean;
3607
+ public appBudgetConsumed?: number | bigint;
3608
+
3609
+ /**
3610
+ * Budget used during execution of a logic sig transaction.
3611
+ */
3612
+ public logicSigBudgetConsumed?: number | bigint;
3266
3613
 
3267
3614
  /**
3268
3615
  * Creates a new `SimulateTransactionResult` object.
3269
3616
  * @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
3270
3617
  * includes confirmation details like the round and reward details.
3271
- * @param missingSignature - A boolean indicating whether this transaction is missing signatures
3618
+ * @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
3619
+ * budged used by inner app calls spawned by this transaction.
3620
+ * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
3272
3621
  */
3273
3622
  constructor({
3274
3623
  txnResult,
3275
- missingSignature,
3624
+ appBudgetConsumed,
3625
+ logicSigBudgetConsumed,
3276
3626
  }: {
3277
3627
  txnResult: PendingTransactionResponse;
3278
- missingSignature?: boolean;
3628
+ appBudgetConsumed?: number | bigint;
3629
+ logicSigBudgetConsumed?: number | bigint;
3279
3630
  }) {
3280
3631
  super();
3281
3632
  this.txnResult = txnResult;
3282
- this.missingSignature = missingSignature;
3633
+ this.appBudgetConsumed = appBudgetConsumed;
3634
+ this.logicSigBudgetConsumed = logicSigBudgetConsumed;
3283
3635
 
3284
3636
  this.attribute_map = {
3285
3637
  txnResult: 'txn-result',
3286
- missingSignature: 'missing-signature',
3638
+ appBudgetConsumed: 'app-budget-consumed',
3639
+ logicSigBudgetConsumed: 'logic-sig-budget-consumed',
3287
3640
  };
3288
3641
  }
3289
3642
 
@@ -3300,7 +3653,72 @@ export class SimulateTransactionResult extends BaseModel {
3300
3653
  txnResult: PendingTransactionResponse.from_obj_for_encoding(
3301
3654
  data['txn-result']
3302
3655
  ),
3303
- missingSignature: data['missing-signature'],
3656
+ appBudgetConsumed: data['app-budget-consumed'],
3657
+ logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
3658
+ });
3659
+ /* eslint-enable dot-notation */
3660
+ }
3661
+ }
3662
+
3663
+ /**
3664
+ * The set of parameters and limits override during simulation. If this set of
3665
+ * parameters is present, then evaluation parameters may differ from standard
3666
+ * evaluation in certain ways.
3667
+ */
3668
+ export class SimulationEvalOverrides extends BaseModel {
3669
+ /**
3670
+ * If true, transactions without signatures are allowed and simulated as if they
3671
+ * were properly signed.
3672
+ */
3673
+ public allowEmptySignatures?: boolean;
3674
+
3675
+ /**
3676
+ * The maximum log calls one can make during simulation
3677
+ */
3678
+ public maxLogCalls?: number | bigint;
3679
+
3680
+ /**
3681
+ * The maximum byte number to log during simulation
3682
+ */
3683
+ public maxLogSize?: number | bigint;
3684
+
3685
+ /**
3686
+ * Creates a new `SimulationEvalOverrides` object.
3687
+ * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
3688
+ * were properly signed.
3689
+ * @param maxLogCalls - The maximum log calls one can make during simulation
3690
+ * @param maxLogSize - The maximum byte number to log during simulation
3691
+ */
3692
+ constructor({
3693
+ allowEmptySignatures,
3694
+ maxLogCalls,
3695
+ maxLogSize,
3696
+ }: {
3697
+ allowEmptySignatures?: boolean;
3698
+ maxLogCalls?: number | bigint;
3699
+ maxLogSize?: number | bigint;
3700
+ }) {
3701
+ super();
3702
+ this.allowEmptySignatures = allowEmptySignatures;
3703
+ this.maxLogCalls = maxLogCalls;
3704
+ this.maxLogSize = maxLogSize;
3705
+
3706
+ this.attribute_map = {
3707
+ allowEmptySignatures: 'allow-empty-signatures',
3708
+ maxLogCalls: 'max-log-calls',
3709
+ maxLogSize: 'max-log-size',
3710
+ };
3711
+ }
3712
+
3713
+ // eslint-disable-next-line camelcase
3714
+ static from_obj_for_encoding(
3715
+ data: Record<string, any>
3716
+ ): SimulationEvalOverrides {
3717
+ /* eslint-disable dot-notation */
3718
+ return new SimulationEvalOverrides({
3719
+ allowEmptySignatures: data['allow-empty-signatures'],
3720
+ maxLogCalls: data['max-log-calls'],
3721
+ maxLogSize: data['max-log-size'],
3304
3722
  });
3305
3723
  /* eslint-enable dot-notation */
3306
3724
  }