algosdk 2.3.0 → 2.5.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 (88) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/client/urlTokenBaseHTTPClient.js +0 -3
  5. package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/algod.js +51 -0
  7. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  8. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +20 -0
  9. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -0
  10. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +20 -0
  11. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
  12. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +25 -0
  13. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
  14. package/dist/cjs/client/v2/algod/models/types.js +301 -6
  15. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  16. package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +2 -3
  17. package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
  18. package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +2 -1
  19. package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
  20. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +2 -4
  21. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  22. package/dist/cjs/client/v2/indexer/searchAccounts.js +2 -1
  23. package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
  24. package/dist/cjs/client/v2/indexer/searchForTransactions.js +61 -62
  25. package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
  26. package/dist/cjs/client/v2/serviceClient.js +3 -0
  27. package/dist/cjs/client/v2/serviceClient.js.map +1 -1
  28. package/dist/cjs/composer.js +1 -1
  29. package/dist/cjs/composer.js.map +1 -1
  30. package/dist/cjs/nacl/naclWrappers.js +4 -0
  31. package/dist/cjs/nacl/naclWrappers.js.map +1 -1
  32. package/dist/cjs/utils/utils.js +13 -1
  33. package/dist/cjs/utils/utils.js.map +1 -1
  34. package/dist/esm/client/urlTokenBaseHTTPClient.js +0 -3
  35. package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
  36. package/dist/esm/client/v2/algod/algod.js +51 -0
  37. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  38. package/dist/esm/client/v2/algod/getLedgerStateDelta.js +14 -0
  39. package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -0
  40. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +14 -0
  41. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
  42. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +19 -0
  43. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
  44. package/dist/esm/client/v2/algod/models/types.js +292 -5
  45. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  46. package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +2 -3
  47. package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
  48. package/dist/esm/client/v2/indexer/lookupAssetBalances.js +2 -1
  49. package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
  50. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +2 -4
  51. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  52. package/dist/esm/client/v2/indexer/searchAccounts.js +2 -1
  53. package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
  54. package/dist/esm/client/v2/indexer/searchForTransactions.js +61 -62
  55. package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
  56. package/dist/esm/client/v2/serviceClient.js +3 -0
  57. package/dist/esm/client/v2/serviceClient.js.map +1 -1
  58. package/dist/esm/composer.js +1 -1
  59. package/dist/esm/composer.js.map +1 -1
  60. package/dist/esm/nacl/naclWrappers.js +4 -0
  61. package/dist/esm/nacl/naclWrappers.js.map +1 -1
  62. package/dist/esm/utils/utils.js +11 -0
  63. package/dist/esm/utils/utils.js.map +1 -1
  64. package/dist/types/client/v2/algod/algod.d.ts +45 -0
  65. package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +8 -0
  66. package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +8 -0
  67. package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +10 -0
  68. package/dist/types/client/v2/algod/models/types.d.ts +242 -5
  69. package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +0 -2
  70. package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +0 -3
  71. package/dist/types/client/v2/indexer/searchForTransactions.d.ts +54 -56
  72. package/dist/types/utils/utils.d.ts +5 -0
  73. package/package.json +4 -6
  74. package/src/client/urlTokenBaseHTTPClient.ts +0 -3
  75. package/src/client/v2/algod/algod.ts +62 -0
  76. package/src/client/v2/algod/getLedgerStateDelta.ts +16 -0
  77. package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -0
  78. package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +29 -0
  79. package/src/client/v2/algod/models/types.ts +527 -0
  80. package/src/client/v2/indexer/lookupAccountTransactions.ts +2 -3
  81. package/src/client/v2/indexer/lookupAssetBalances.ts +2 -1
  82. package/src/client/v2/indexer/lookupAssetTransactions.ts +2 -4
  83. package/src/client/v2/indexer/searchAccounts.ts +2 -1
  84. package/src/client/v2/indexer/searchForTransactions.ts +63 -64
  85. package/src/client/v2/serviceClient.ts +3 -0
  86. package/src/composer.ts +1 -1
  87. package/src/nacl/naclWrappers.ts +6 -0
  88. package/src/utils/utils.ts +12 -0
@@ -6,7 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  return (mod && mod.__esModule) ? mod : { "default": mod };
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.SimulationEvalOverrides = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateResponse = exports.SimulateRequestTransactionGroup = exports.SimulateRequest = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.KvDelta = exports.GetSyncRoundResponse = exports.GetBlockTimeStampOffsetResponse = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.BuildVersion = exports.BoxesResponse = exports.BoxDescriptor = exports.Box = exports.BlockResponse = exports.BlockHashResponse = exports.AssetParams = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationParams = exports.ApplicationLocalState = exports.Application = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetResponse = exports.AccountApplicationResponse = exports.Account = void 0;
9
+ exports.StateProofMessage = exports.StateProof = exports.SimulationTransactionExecTrace = exports.SimulationOpcodeTraceUnit = exports.SimulationEvalOverrides = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateTraceConfig = exports.SimulateResponse = exports.SimulateRequestTransactionGroup = exports.SimulateRequest = exports.ScratchChange = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.LedgerStateDeltaForTransactionGroup = exports.KvDelta = exports.GetSyncRoundResponse = exports.GetBlockTimeStampOffsetResponse = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.BuildVersion = exports.BoxesResponse = exports.BoxDescriptor = exports.Box = exports.BlockResponse = exports.BlockHashResponse = exports.AvmValue = exports.AssetParams = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationParams = exports.ApplicationLocalState = exports.Application = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetResponse = exports.AccountApplicationResponse = exports.Account = void 0;
10
+ exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TransactionGroupLedgerStateDeltasForRoundResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = void 0;
10
11
  /* eslint-disable no-use-before-define */
11
12
  const buffer_1 = require("buffer");
12
13
  const basemodel_1 = __importDefault(require("../../basemodel"));
@@ -739,6 +740,44 @@ class AssetParams extends basemodel_1.default {
739
740
  }
740
741
  }
741
742
  exports.AssetParams = AssetParams;
743
+ /**
744
+ * Represents an AVM value.
745
+ */
746
+ class AvmValue extends basemodel_1.default {
747
+ /**
748
+ * Creates a new `AvmValue` object.
749
+ * @param type - value type. Value `1` refers to **bytes**, value `2` refers to **uint64**
750
+ * @param bytes - bytes value.
751
+ * @param uint - uint value.
752
+ */
753
+ constructor({ type, bytes, uint, }) {
754
+ super();
755
+ this.type = type;
756
+ this.bytes =
757
+ typeof bytes === 'string'
758
+ ? new Uint8Array(buffer_1.Buffer.from(bytes, 'base64'))
759
+ : bytes;
760
+ this.uint = uint;
761
+ this.attribute_map = {
762
+ type: 'type',
763
+ bytes: 'bytes',
764
+ uint: 'uint',
765
+ };
766
+ }
767
+ // eslint-disable-next-line camelcase
768
+ static from_obj_for_encoding(data) {
769
+ /* eslint-disable dot-notation */
770
+ if (typeof data['type'] === 'undefined')
771
+ throw new Error(`Response is missing required field 'type': ${data}`);
772
+ return new AvmValue({
773
+ type: data['type'],
774
+ bytes: data['bytes'],
775
+ uint: data['uint'],
776
+ });
777
+ /* eslint-enable dot-notation */
778
+ }
779
+ }
780
+ exports.AvmValue = AvmValue;
742
781
  /**
743
782
  * Hash of a block header.
744
783
  */
@@ -805,20 +844,23 @@ class Box extends basemodel_1.default {
805
844
  /**
806
845
  * Creates a new `Box` object.
807
846
  * @param name - (name) box name, base64 encoded
847
+ * @param round - The round for which this information is relevant
808
848
  * @param value - (value) box value, base64 encoded.
809
849
  */
810
- constructor({ name, value, }) {
850
+ constructor({ name, round, value, }) {
811
851
  super();
812
852
  this.name =
813
853
  typeof name === 'string'
814
854
  ? new Uint8Array(buffer_1.Buffer.from(name, 'base64'))
815
855
  : name;
856
+ this.round = round;
816
857
  this.value =
817
858
  typeof value === 'string'
818
859
  ? new Uint8Array(buffer_1.Buffer.from(value, 'base64'))
819
860
  : value;
820
861
  this.attribute_map = {
821
862
  name: 'name',
863
+ round: 'round',
822
864
  value: 'value',
823
865
  };
824
866
  }
@@ -827,10 +869,13 @@ class Box extends basemodel_1.default {
827
869
  /* eslint-disable dot-notation */
828
870
  if (typeof data['name'] === 'undefined')
829
871
  throw new Error(`Response is missing required field 'name': ${data}`);
872
+ if (typeof data['round'] === 'undefined')
873
+ throw new Error(`Response is missing required field 'round': ${data}`);
830
874
  if (typeof data['value'] === 'undefined')
831
875
  throw new Error(`Response is missing required field 'value': ${data}`);
832
876
  return new Box({
833
877
  name: data['name'],
878
+ round: data['round'],
834
879
  value: data['value'],
835
880
  });
836
881
  /* eslint-enable dot-notation */
@@ -1480,6 +1525,39 @@ class KvDelta extends basemodel_1.default {
1480
1525
  }
1481
1526
  }
1482
1527
  exports.KvDelta = KvDelta;
1528
+ /**
1529
+ * Contains a ledger delta for a single transaction group
1530
+ */
1531
+ class LedgerStateDeltaForTransactionGroup extends basemodel_1.default {
1532
+ /**
1533
+ * Creates a new `LedgerStateDeltaForTransactionGroup` object.
1534
+ * @param delta - Ledger StateDelta object
1535
+ * @param ids -
1536
+ */
1537
+ constructor({ delta, ids }) {
1538
+ super();
1539
+ this.delta = delta;
1540
+ this.ids = ids;
1541
+ this.attribute_map = {
1542
+ delta: 'Delta',
1543
+ ids: 'Ids',
1544
+ };
1545
+ }
1546
+ // eslint-disable-next-line camelcase
1547
+ static from_obj_for_encoding(data) {
1548
+ /* eslint-disable dot-notation */
1549
+ if (typeof data['Delta'] === 'undefined')
1550
+ throw new Error(`Response is missing required field 'Delta': ${data}`);
1551
+ if (!Array.isArray(data['Ids']))
1552
+ throw new Error(`Response is missing required array field 'Ids': ${data}`);
1553
+ return new LedgerStateDeltaForTransactionGroup({
1554
+ delta: data['Delta'],
1555
+ ids: data['Ids'],
1556
+ });
1557
+ /* eslint-enable dot-notation */
1558
+ }
1559
+ }
1560
+ exports.LedgerStateDeltaForTransactionGroup = LedgerStateDeltaForTransactionGroup;
1483
1561
  /**
1484
1562
  * Proof of membership and position of a light block header.
1485
1563
  */
@@ -1827,6 +1905,39 @@ class PostTransactionsResponse extends basemodel_1.default {
1827
1905
  }
1828
1906
  }
1829
1907
  exports.PostTransactionsResponse = PostTransactionsResponse;
1908
+ /**
1909
+ * A write operation into a scratch slot.
1910
+ */
1911
+ class ScratchChange extends basemodel_1.default {
1912
+ /**
1913
+ * Creates a new `ScratchChange` object.
1914
+ * @param newValue - Represents an AVM value.
1915
+ * @param slot - The scratch slot written.
1916
+ */
1917
+ constructor({ newValue, slot, }) {
1918
+ super();
1919
+ this.newValue = newValue;
1920
+ this.slot = slot;
1921
+ this.attribute_map = {
1922
+ newValue: 'new-value',
1923
+ slot: 'slot',
1924
+ };
1925
+ }
1926
+ // eslint-disable-next-line camelcase
1927
+ static from_obj_for_encoding(data) {
1928
+ /* eslint-disable dot-notation */
1929
+ if (typeof data['new-value'] === 'undefined')
1930
+ throw new Error(`Response is missing required field 'new-value': ${data}`);
1931
+ if (typeof data['slot'] === 'undefined')
1932
+ throw new Error(`Response is missing required field 'slot': ${data}`);
1933
+ return new ScratchChange({
1934
+ newValue: AvmValue.from_obj_for_encoding(data['new-value']),
1935
+ slot: data['slot'],
1936
+ });
1937
+ /* eslint-enable dot-notation */
1938
+ }
1939
+ }
1940
+ exports.ScratchChange = ScratchChange;
1830
1941
  /**
1831
1942
  * Request type for simulation endpoint.
1832
1943
  */
@@ -1837,16 +1948,22 @@ class SimulateRequest extends basemodel_1.default {
1837
1948
  * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
1838
1949
  * signatures.
1839
1950
  * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
1951
+ * @param execTraceConfig - An object that configures simulation execution trace.
1952
+ * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
1840
1953
  */
1841
- constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, }) {
1954
+ constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, execTraceConfig, extraOpcodeBudget, }) {
1842
1955
  super();
1843
1956
  this.txnGroups = txnGroups;
1844
1957
  this.allowEmptySignatures = allowEmptySignatures;
1845
1958
  this.allowMoreLogging = allowMoreLogging;
1959
+ this.execTraceConfig = execTraceConfig;
1960
+ this.extraOpcodeBudget = extraOpcodeBudget;
1846
1961
  this.attribute_map = {
1847
1962
  txnGroups: 'txn-groups',
1848
1963
  allowEmptySignatures: 'allow-empty-signatures',
1849
1964
  allowMoreLogging: 'allow-more-logging',
1965
+ execTraceConfig: 'exec-trace-config',
1966
+ extraOpcodeBudget: 'extra-opcode-budget',
1850
1967
  };
1851
1968
  }
1852
1969
  // eslint-disable-next-line camelcase
@@ -1858,6 +1975,10 @@ class SimulateRequest extends basemodel_1.default {
1858
1975
  txnGroups: data['txn-groups'].map(SimulateRequestTransactionGroup.from_obj_for_encoding),
1859
1976
  allowEmptySignatures: data['allow-empty-signatures'],
1860
1977
  allowMoreLogging: data['allow-more-logging'],
1978
+ execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
1979
+ ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
1980
+ : undefined,
1981
+ extraOpcodeBudget: data['extra-opcode-budget'],
1861
1982
  });
1862
1983
  /* eslint-enable dot-notation */
1863
1984
  }
@@ -1903,18 +2024,21 @@ class SimulateResponse extends basemodel_1.default {
1903
2024
  * @param evalOverrides - The set of parameters and limits override during simulation. If this set of
1904
2025
  * parameters is present, then evaluation parameters may differ from standard
1905
2026
  * evaluation in certain ways.
2027
+ * @param execTraceConfig - An object that configures simulation execution trace.
1906
2028
  */
1907
- constructor({ lastRound, txnGroups, version, evalOverrides, }) {
2029
+ constructor({ lastRound, txnGroups, version, evalOverrides, execTraceConfig, }) {
1908
2030
  super();
1909
2031
  this.lastRound = lastRound;
1910
2032
  this.txnGroups = txnGroups;
1911
2033
  this.version = version;
1912
2034
  this.evalOverrides = evalOverrides;
2035
+ this.execTraceConfig = execTraceConfig;
1913
2036
  this.attribute_map = {
1914
2037
  lastRound: 'last-round',
1915
2038
  txnGroups: 'txn-groups',
1916
2039
  version: 'version',
1917
2040
  evalOverrides: 'eval-overrides',
2041
+ execTraceConfig: 'exec-trace-config',
1918
2042
  };
1919
2043
  }
1920
2044
  // eslint-disable-next-line camelcase
@@ -1933,11 +2057,49 @@ class SimulateResponse extends basemodel_1.default {
1933
2057
  evalOverrides: typeof data['eval-overrides'] !== 'undefined'
1934
2058
  ? SimulationEvalOverrides.from_obj_for_encoding(data['eval-overrides'])
1935
2059
  : undefined,
2060
+ execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
2061
+ ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
2062
+ : undefined,
1936
2063
  });
1937
2064
  /* eslint-enable dot-notation */
1938
2065
  }
1939
2066
  }
1940
2067
  exports.SimulateResponse = SimulateResponse;
2068
+ /**
2069
+ * An object that configures simulation execution trace.
2070
+ */
2071
+ class SimulateTraceConfig extends basemodel_1.default {
2072
+ /**
2073
+ * Creates a new `SimulateTraceConfig` object.
2074
+ * @param enable - A boolean option for opting in execution trace features simulation endpoint.
2075
+ * @param scratchChange - A boolean option enabling returning scratch slot changes together with execution
2076
+ * trace during simulation.
2077
+ * @param stackChange - A boolean option enabling returning stack changes together with execution trace
2078
+ * during simulation.
2079
+ */
2080
+ constructor({ enable, scratchChange, stackChange, }) {
2081
+ super();
2082
+ this.enable = enable;
2083
+ this.scratchChange = scratchChange;
2084
+ this.stackChange = stackChange;
2085
+ this.attribute_map = {
2086
+ enable: 'enable',
2087
+ scratchChange: 'scratch-change',
2088
+ stackChange: 'stack-change',
2089
+ };
2090
+ }
2091
+ // eslint-disable-next-line camelcase
2092
+ static from_obj_for_encoding(data) {
2093
+ /* eslint-disable dot-notation */
2094
+ return new SimulateTraceConfig({
2095
+ enable: data['enable'],
2096
+ scratchChange: data['scratch-change'],
2097
+ stackChange: data['stack-change'],
2098
+ });
2099
+ /* eslint-enable dot-notation */
2100
+ }
2101
+ }
2102
+ exports.SimulateTraceConfig = SimulateTraceConfig;
1941
2103
  /**
1942
2104
  * Simulation result for an atomic transaction group
1943
2105
  */
@@ -1995,16 +2157,20 @@ class SimulateTransactionResult extends basemodel_1.default {
1995
2157
  * includes confirmation details like the round and reward details.
1996
2158
  * @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
1997
2159
  * budged used by inner app calls spawned by this transaction.
2160
+ * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
2161
+ * call trace in a recursive way.
1998
2162
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
1999
2163
  */
2000
- constructor({ txnResult, appBudgetConsumed, logicSigBudgetConsumed, }) {
2164
+ constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, }) {
2001
2165
  super();
2002
2166
  this.txnResult = txnResult;
2003
2167
  this.appBudgetConsumed = appBudgetConsumed;
2168
+ this.execTrace = execTrace;
2004
2169
  this.logicSigBudgetConsumed = logicSigBudgetConsumed;
2005
2170
  this.attribute_map = {
2006
2171
  txnResult: 'txn-result',
2007
2172
  appBudgetConsumed: 'app-budget-consumed',
2173
+ execTrace: 'exec-trace',
2008
2174
  logicSigBudgetConsumed: 'logic-sig-budget-consumed',
2009
2175
  };
2010
2176
  }
@@ -2016,6 +2182,9 @@ class SimulateTransactionResult extends basemodel_1.default {
2016
2182
  return new SimulateTransactionResult({
2017
2183
  txnResult: PendingTransactionResponse.from_obj_for_encoding(data['txn-result']),
2018
2184
  appBudgetConsumed: data['app-budget-consumed'],
2185
+ execTrace: typeof data['exec-trace'] !== 'undefined'
2186
+ ? SimulationTransactionExecTrace.from_obj_for_encoding(data['exec-trace'])
2187
+ : undefined,
2019
2188
  logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
2020
2189
  });
2021
2190
  /* eslint-enable dot-notation */
@@ -2032,16 +2201,19 @@ class SimulationEvalOverrides extends basemodel_1.default {
2032
2201
  * Creates a new `SimulationEvalOverrides` object.
2033
2202
  * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
2034
2203
  * were properly signed.
2204
+ * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
2035
2205
  * @param maxLogCalls - The maximum log calls one can make during simulation
2036
2206
  * @param maxLogSize - The maximum byte number to log during simulation
2037
2207
  */
2038
- constructor({ allowEmptySignatures, maxLogCalls, maxLogSize, }) {
2208
+ constructor({ allowEmptySignatures, extraOpcodeBudget, maxLogCalls, maxLogSize, }) {
2039
2209
  super();
2040
2210
  this.allowEmptySignatures = allowEmptySignatures;
2211
+ this.extraOpcodeBudget = extraOpcodeBudget;
2041
2212
  this.maxLogCalls = maxLogCalls;
2042
2213
  this.maxLogSize = maxLogSize;
2043
2214
  this.attribute_map = {
2044
2215
  allowEmptySignatures: 'allow-empty-signatures',
2216
+ extraOpcodeBudget: 'extra-opcode-budget',
2045
2217
  maxLogCalls: 'max-log-calls',
2046
2218
  maxLogSize: 'max-log-size',
2047
2219
  };
@@ -2051,6 +2223,7 @@ class SimulationEvalOverrides extends basemodel_1.default {
2051
2223
  /* eslint-disable dot-notation */
2052
2224
  return new SimulationEvalOverrides({
2053
2225
  allowEmptySignatures: data['allow-empty-signatures'],
2226
+ extraOpcodeBudget: data['extra-opcode-budget'],
2054
2227
  maxLogCalls: data['max-log-calls'],
2055
2228
  maxLogSize: data['max-log-size'],
2056
2229
  });
@@ -2058,6 +2231,100 @@ class SimulationEvalOverrides extends basemodel_1.default {
2058
2231
  }
2059
2232
  }
2060
2233
  exports.SimulationEvalOverrides = SimulationEvalOverrides;
2234
+ /**
2235
+ * The set of trace information and effect from evaluating a single opcode.
2236
+ */
2237
+ class SimulationOpcodeTraceUnit extends basemodel_1.default {
2238
+ /**
2239
+ * Creates a new `SimulationOpcodeTraceUnit` object.
2240
+ * @param pc - The program counter of the current opcode being evaluated.
2241
+ * @param scratchChanges - The writes into scratch slots.
2242
+ * @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
2243
+ * @param stackAdditions - The values added by this opcode to the stack.
2244
+ * @param stackPopCount - The number of deleted stack values by this opcode.
2245
+ */
2246
+ constructor({ pc, scratchChanges, spawnedInners, stackAdditions, stackPopCount, }) {
2247
+ super();
2248
+ this.pc = pc;
2249
+ this.scratchChanges = scratchChanges;
2250
+ this.spawnedInners = spawnedInners;
2251
+ this.stackAdditions = stackAdditions;
2252
+ this.stackPopCount = stackPopCount;
2253
+ this.attribute_map = {
2254
+ pc: 'pc',
2255
+ scratchChanges: 'scratch-changes',
2256
+ spawnedInners: 'spawned-inners',
2257
+ stackAdditions: 'stack-additions',
2258
+ stackPopCount: 'stack-pop-count',
2259
+ };
2260
+ }
2261
+ // eslint-disable-next-line camelcase
2262
+ static from_obj_for_encoding(data) {
2263
+ /* eslint-disable dot-notation */
2264
+ if (typeof data['pc'] === 'undefined')
2265
+ throw new Error(`Response is missing required field 'pc': ${data}`);
2266
+ return new SimulationOpcodeTraceUnit({
2267
+ pc: data['pc'],
2268
+ scratchChanges: typeof data['scratch-changes'] !== 'undefined'
2269
+ ? data['scratch-changes'].map(ScratchChange.from_obj_for_encoding)
2270
+ : undefined,
2271
+ spawnedInners: data['spawned-inners'],
2272
+ stackAdditions: typeof data['stack-additions'] !== 'undefined'
2273
+ ? data['stack-additions'].map(AvmValue.from_obj_for_encoding)
2274
+ : undefined,
2275
+ stackPopCount: data['stack-pop-count'],
2276
+ });
2277
+ /* eslint-enable dot-notation */
2278
+ }
2279
+ }
2280
+ exports.SimulationOpcodeTraceUnit = SimulationOpcodeTraceUnit;
2281
+ /**
2282
+ * The execution trace of calling an app or a logic sig, containing the inner app
2283
+ * call trace in a recursive way.
2284
+ */
2285
+ class SimulationTransactionExecTrace extends basemodel_1.default {
2286
+ /**
2287
+ * Creates a new `SimulationTransactionExecTrace` object.
2288
+ * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
2289
+ * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
2290
+ * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
2291
+ * any inner transactions executed.
2292
+ * @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
2293
+ */
2294
+ constructor({ approvalProgramTrace, clearStateProgramTrace, innerTrace, logicSigTrace, }) {
2295
+ super();
2296
+ this.approvalProgramTrace = approvalProgramTrace;
2297
+ this.clearStateProgramTrace = clearStateProgramTrace;
2298
+ this.innerTrace = innerTrace;
2299
+ this.logicSigTrace = logicSigTrace;
2300
+ this.attribute_map = {
2301
+ approvalProgramTrace: 'approval-program-trace',
2302
+ clearStateProgramTrace: 'clear-state-program-trace',
2303
+ innerTrace: 'inner-trace',
2304
+ logicSigTrace: 'logic-sig-trace',
2305
+ };
2306
+ }
2307
+ // eslint-disable-next-line camelcase
2308
+ static from_obj_for_encoding(data) {
2309
+ /* eslint-disable dot-notation */
2310
+ return new SimulationTransactionExecTrace({
2311
+ approvalProgramTrace: typeof data['approval-program-trace'] !== 'undefined'
2312
+ ? data['approval-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
2313
+ : undefined,
2314
+ clearStateProgramTrace: typeof data['clear-state-program-trace'] !== 'undefined'
2315
+ ? data['clear-state-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
2316
+ : undefined,
2317
+ innerTrace: typeof data['inner-trace'] !== 'undefined'
2318
+ ? data['inner-trace'].map(SimulationTransactionExecTrace.from_obj_for_encoding)
2319
+ : undefined,
2320
+ logicSigTrace: typeof data['logic-sig-trace'] !== 'undefined'
2321
+ ? data['logic-sig-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
2322
+ : undefined,
2323
+ });
2324
+ /* eslint-enable dot-notation */
2325
+ }
2326
+ }
2327
+ exports.SimulationTransactionExecTrace = SimulationTransactionExecTrace;
2061
2328
  /**
2062
2329
  * Represents a state proof and its corresponding message
2063
2330
  */
@@ -2264,6 +2531,34 @@ class TealValue extends basemodel_1.default {
2264
2531
  }
2265
2532
  }
2266
2533
  exports.TealValue = TealValue;
2534
+ /**
2535
+ * Response containing all ledger state deltas for transaction groups, with their
2536
+ * associated Ids, in a single round.
2537
+ */
2538
+ class TransactionGroupLedgerStateDeltasForRoundResponse extends basemodel_1.default {
2539
+ /**
2540
+ * Creates a new `TransactionGroupLedgerStateDeltasForRoundResponse` object.
2541
+ * @param deltas -
2542
+ */
2543
+ constructor({ deltas }) {
2544
+ super();
2545
+ this.deltas = deltas;
2546
+ this.attribute_map = {
2547
+ deltas: 'Deltas',
2548
+ };
2549
+ }
2550
+ // eslint-disable-next-line camelcase
2551
+ static from_obj_for_encoding(data) {
2552
+ /* eslint-disable dot-notation */
2553
+ if (!Array.isArray(data['Deltas']))
2554
+ throw new Error(`Response is missing required array field 'Deltas': ${data}`);
2555
+ return new TransactionGroupLedgerStateDeltasForRoundResponse({
2556
+ deltas: data['Deltas'].map(LedgerStateDeltaForTransactionGroup.from_obj_for_encoding),
2557
+ });
2558
+ /* eslint-enable dot-notation */
2559
+ }
2560
+ }
2561
+ exports.TransactionGroupLedgerStateDeltasForRoundResponse = TransactionGroupLedgerStateDeltasForRoundResponse;
2267
2562
  /**
2268
2563
  * TransactionParams contains the parameters that help a client construct a new
2269
2564
  * transaction.