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.
- package/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/client/urlTokenBaseHTTPClient.js +0 -3
- package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +51 -0
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +20 -0
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -0
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +20 -0
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +25 -0
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
- package/dist/cjs/client/v2/algod/models/types.js +301 -6
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +2 -3
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +2 -1
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +2 -4
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchAccounts.js +2 -1
- package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForTransactions.js +61 -62
- package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/cjs/client/v2/serviceClient.js +3 -0
- package/dist/cjs/client/v2/serviceClient.js.map +1 -1
- package/dist/cjs/composer.js +1 -1
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/nacl/naclWrappers.js +4 -0
- package/dist/cjs/nacl/naclWrappers.js.map +1 -1
- package/dist/cjs/utils/utils.js +13 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/client/urlTokenBaseHTTPClient.js +0 -3
- package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +51 -0
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js +14 -0
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -0
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +14 -0
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +19 -0
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
- package/dist/esm/client/v2/algod/models/types.js +292 -5
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +2 -3
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js +2 -1
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +2 -4
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchAccounts.js +2 -1
- package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForTransactions.js +61 -62
- package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/esm/client/v2/serviceClient.js +3 -0
- package/dist/esm/client/v2/serviceClient.js.map +1 -1
- package/dist/esm/composer.js +1 -1
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/nacl/naclWrappers.js +4 -0
- package/dist/esm/nacl/naclWrappers.js.map +1 -1
- package/dist/esm/utils/utils.js +11 -0
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/types/client/v2/algod/algod.d.ts +45 -0
- package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +8 -0
- package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +8 -0
- package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +10 -0
- package/dist/types/client/v2/algod/models/types.d.ts +242 -5
- package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +0 -2
- package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +0 -3
- package/dist/types/client/v2/indexer/searchForTransactions.d.ts +54 -56
- package/dist/types/utils/utils.d.ts +5 -0
- package/package.json +4 -6
- package/src/client/urlTokenBaseHTTPClient.ts +0 -3
- package/src/client/v2/algod/algod.ts +62 -0
- package/src/client/v2/algod/getLedgerStateDelta.ts +16 -0
- package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -0
- package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +29 -0
- package/src/client/v2/algod/models/types.ts +527 -0
- package/src/client/v2/indexer/lookupAccountTransactions.ts +2 -3
- package/src/client/v2/indexer/lookupAssetBalances.ts +2 -1
- package/src/client/v2/indexer/lookupAssetTransactions.ts +2 -4
- package/src/client/v2/indexer/searchAccounts.ts +2 -1
- package/src/client/v2/indexer/searchForTransactions.ts +63 -64
- package/src/client/v2/serviceClient.ts +3 -0
- package/src/composer.ts +1 -1
- package/src/nacl/naclWrappers.ts +6 -0
- package/src/utils/utils.ts +12 -0
|
@@ -721,6 +721,43 @@ export class AssetParams extends BaseModel {
|
|
|
721
721
|
/* eslint-enable dot-notation */
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
+
/**
|
|
725
|
+
* Represents an AVM value.
|
|
726
|
+
*/
|
|
727
|
+
export class AvmValue extends BaseModel {
|
|
728
|
+
/**
|
|
729
|
+
* Creates a new `AvmValue` object.
|
|
730
|
+
* @param type - value type. Value `1` refers to **bytes**, value `2` refers to **uint64**
|
|
731
|
+
* @param bytes - bytes value.
|
|
732
|
+
* @param uint - uint value.
|
|
733
|
+
*/
|
|
734
|
+
constructor({ type, bytes, uint, }) {
|
|
735
|
+
super();
|
|
736
|
+
this.type = type;
|
|
737
|
+
this.bytes =
|
|
738
|
+
typeof bytes === 'string'
|
|
739
|
+
? new Uint8Array(Buffer.from(bytes, 'base64'))
|
|
740
|
+
: bytes;
|
|
741
|
+
this.uint = uint;
|
|
742
|
+
this.attribute_map = {
|
|
743
|
+
type: 'type',
|
|
744
|
+
bytes: 'bytes',
|
|
745
|
+
uint: 'uint',
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
// eslint-disable-next-line camelcase
|
|
749
|
+
static from_obj_for_encoding(data) {
|
|
750
|
+
/* eslint-disable dot-notation */
|
|
751
|
+
if (typeof data['type'] === 'undefined')
|
|
752
|
+
throw new Error(`Response is missing required field 'type': ${data}`);
|
|
753
|
+
return new AvmValue({
|
|
754
|
+
type: data['type'],
|
|
755
|
+
bytes: data['bytes'],
|
|
756
|
+
uint: data['uint'],
|
|
757
|
+
});
|
|
758
|
+
/* eslint-enable dot-notation */
|
|
759
|
+
}
|
|
760
|
+
}
|
|
724
761
|
/**
|
|
725
762
|
* Hash of a block header.
|
|
726
763
|
*/
|
|
@@ -785,20 +822,23 @@ export class Box extends BaseModel {
|
|
|
785
822
|
/**
|
|
786
823
|
* Creates a new `Box` object.
|
|
787
824
|
* @param name - (name) box name, base64 encoded
|
|
825
|
+
* @param round - The round for which this information is relevant
|
|
788
826
|
* @param value - (value) box value, base64 encoded.
|
|
789
827
|
*/
|
|
790
|
-
constructor({ name, value, }) {
|
|
828
|
+
constructor({ name, round, value, }) {
|
|
791
829
|
super();
|
|
792
830
|
this.name =
|
|
793
831
|
typeof name === 'string'
|
|
794
832
|
? new Uint8Array(Buffer.from(name, 'base64'))
|
|
795
833
|
: name;
|
|
834
|
+
this.round = round;
|
|
796
835
|
this.value =
|
|
797
836
|
typeof value === 'string'
|
|
798
837
|
? new Uint8Array(Buffer.from(value, 'base64'))
|
|
799
838
|
: value;
|
|
800
839
|
this.attribute_map = {
|
|
801
840
|
name: 'name',
|
|
841
|
+
round: 'round',
|
|
802
842
|
value: 'value',
|
|
803
843
|
};
|
|
804
844
|
}
|
|
@@ -807,10 +847,13 @@ export class Box extends BaseModel {
|
|
|
807
847
|
/* eslint-disable dot-notation */
|
|
808
848
|
if (typeof data['name'] === 'undefined')
|
|
809
849
|
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
850
|
+
if (typeof data['round'] === 'undefined')
|
|
851
|
+
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
810
852
|
if (typeof data['value'] === 'undefined')
|
|
811
853
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
812
854
|
return new Box({
|
|
813
855
|
name: data['name'],
|
|
856
|
+
round: data['round'],
|
|
814
857
|
value: data['value'],
|
|
815
858
|
});
|
|
816
859
|
/* eslint-enable dot-notation */
|
|
@@ -1443,6 +1486,38 @@ export class KvDelta extends BaseModel {
|
|
|
1443
1486
|
/* eslint-enable dot-notation */
|
|
1444
1487
|
}
|
|
1445
1488
|
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Contains a ledger delta for a single transaction group
|
|
1491
|
+
*/
|
|
1492
|
+
export class LedgerStateDeltaForTransactionGroup extends BaseModel {
|
|
1493
|
+
/**
|
|
1494
|
+
* Creates a new `LedgerStateDeltaForTransactionGroup` object.
|
|
1495
|
+
* @param delta - Ledger StateDelta object
|
|
1496
|
+
* @param ids -
|
|
1497
|
+
*/
|
|
1498
|
+
constructor({ delta, ids }) {
|
|
1499
|
+
super();
|
|
1500
|
+
this.delta = delta;
|
|
1501
|
+
this.ids = ids;
|
|
1502
|
+
this.attribute_map = {
|
|
1503
|
+
delta: 'Delta',
|
|
1504
|
+
ids: 'Ids',
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
// eslint-disable-next-line camelcase
|
|
1508
|
+
static from_obj_for_encoding(data) {
|
|
1509
|
+
/* eslint-disable dot-notation */
|
|
1510
|
+
if (typeof data['Delta'] === 'undefined')
|
|
1511
|
+
throw new Error(`Response is missing required field 'Delta': ${data}`);
|
|
1512
|
+
if (!Array.isArray(data['Ids']))
|
|
1513
|
+
throw new Error(`Response is missing required array field 'Ids': ${data}`);
|
|
1514
|
+
return new LedgerStateDeltaForTransactionGroup({
|
|
1515
|
+
delta: data['Delta'],
|
|
1516
|
+
ids: data['Ids'],
|
|
1517
|
+
});
|
|
1518
|
+
/* eslint-enable dot-notation */
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1446
1521
|
/**
|
|
1447
1522
|
* Proof of membership and position of a light block header.
|
|
1448
1523
|
*/
|
|
@@ -1785,6 +1860,38 @@ export class PostTransactionsResponse extends BaseModel {
|
|
|
1785
1860
|
/* eslint-enable dot-notation */
|
|
1786
1861
|
}
|
|
1787
1862
|
}
|
|
1863
|
+
/**
|
|
1864
|
+
* A write operation into a scratch slot.
|
|
1865
|
+
*/
|
|
1866
|
+
export class ScratchChange extends BaseModel {
|
|
1867
|
+
/**
|
|
1868
|
+
* Creates a new `ScratchChange` object.
|
|
1869
|
+
* @param newValue - Represents an AVM value.
|
|
1870
|
+
* @param slot - The scratch slot written.
|
|
1871
|
+
*/
|
|
1872
|
+
constructor({ newValue, slot, }) {
|
|
1873
|
+
super();
|
|
1874
|
+
this.newValue = newValue;
|
|
1875
|
+
this.slot = slot;
|
|
1876
|
+
this.attribute_map = {
|
|
1877
|
+
newValue: 'new-value',
|
|
1878
|
+
slot: 'slot',
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
// eslint-disable-next-line camelcase
|
|
1882
|
+
static from_obj_for_encoding(data) {
|
|
1883
|
+
/* eslint-disable dot-notation */
|
|
1884
|
+
if (typeof data['new-value'] === 'undefined')
|
|
1885
|
+
throw new Error(`Response is missing required field 'new-value': ${data}`);
|
|
1886
|
+
if (typeof data['slot'] === 'undefined')
|
|
1887
|
+
throw new Error(`Response is missing required field 'slot': ${data}`);
|
|
1888
|
+
return new ScratchChange({
|
|
1889
|
+
newValue: AvmValue.from_obj_for_encoding(data['new-value']),
|
|
1890
|
+
slot: data['slot'],
|
|
1891
|
+
});
|
|
1892
|
+
/* eslint-enable dot-notation */
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1788
1895
|
/**
|
|
1789
1896
|
* Request type for simulation endpoint.
|
|
1790
1897
|
*/
|
|
@@ -1795,16 +1902,22 @@ export class SimulateRequest extends BaseModel {
|
|
|
1795
1902
|
* @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
|
|
1796
1903
|
* signatures.
|
|
1797
1904
|
* @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
|
|
1905
|
+
* @param execTraceConfig - An object that configures simulation execution trace.
|
|
1906
|
+
* @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
|
|
1798
1907
|
*/
|
|
1799
|
-
constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, }) {
|
|
1908
|
+
constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, execTraceConfig, extraOpcodeBudget, }) {
|
|
1800
1909
|
super();
|
|
1801
1910
|
this.txnGroups = txnGroups;
|
|
1802
1911
|
this.allowEmptySignatures = allowEmptySignatures;
|
|
1803
1912
|
this.allowMoreLogging = allowMoreLogging;
|
|
1913
|
+
this.execTraceConfig = execTraceConfig;
|
|
1914
|
+
this.extraOpcodeBudget = extraOpcodeBudget;
|
|
1804
1915
|
this.attribute_map = {
|
|
1805
1916
|
txnGroups: 'txn-groups',
|
|
1806
1917
|
allowEmptySignatures: 'allow-empty-signatures',
|
|
1807
1918
|
allowMoreLogging: 'allow-more-logging',
|
|
1919
|
+
execTraceConfig: 'exec-trace-config',
|
|
1920
|
+
extraOpcodeBudget: 'extra-opcode-budget',
|
|
1808
1921
|
};
|
|
1809
1922
|
}
|
|
1810
1923
|
// eslint-disable-next-line camelcase
|
|
@@ -1816,6 +1929,10 @@ export class SimulateRequest extends BaseModel {
|
|
|
1816
1929
|
txnGroups: data['txn-groups'].map(SimulateRequestTransactionGroup.from_obj_for_encoding),
|
|
1817
1930
|
allowEmptySignatures: data['allow-empty-signatures'],
|
|
1818
1931
|
allowMoreLogging: data['allow-more-logging'],
|
|
1932
|
+
execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
|
|
1933
|
+
? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
|
|
1934
|
+
: undefined,
|
|
1935
|
+
extraOpcodeBudget: data['extra-opcode-budget'],
|
|
1819
1936
|
});
|
|
1820
1937
|
/* eslint-enable dot-notation */
|
|
1821
1938
|
}
|
|
@@ -1859,18 +1976,21 @@ export class SimulateResponse extends BaseModel {
|
|
|
1859
1976
|
* @param evalOverrides - The set of parameters and limits override during simulation. If this set of
|
|
1860
1977
|
* parameters is present, then evaluation parameters may differ from standard
|
|
1861
1978
|
* evaluation in certain ways.
|
|
1979
|
+
* @param execTraceConfig - An object that configures simulation execution trace.
|
|
1862
1980
|
*/
|
|
1863
|
-
constructor({ lastRound, txnGroups, version, evalOverrides, }) {
|
|
1981
|
+
constructor({ lastRound, txnGroups, version, evalOverrides, execTraceConfig, }) {
|
|
1864
1982
|
super();
|
|
1865
1983
|
this.lastRound = lastRound;
|
|
1866
1984
|
this.txnGroups = txnGroups;
|
|
1867
1985
|
this.version = version;
|
|
1868
1986
|
this.evalOverrides = evalOverrides;
|
|
1987
|
+
this.execTraceConfig = execTraceConfig;
|
|
1869
1988
|
this.attribute_map = {
|
|
1870
1989
|
lastRound: 'last-round',
|
|
1871
1990
|
txnGroups: 'txn-groups',
|
|
1872
1991
|
version: 'version',
|
|
1873
1992
|
evalOverrides: 'eval-overrides',
|
|
1993
|
+
execTraceConfig: 'exec-trace-config',
|
|
1874
1994
|
};
|
|
1875
1995
|
}
|
|
1876
1996
|
// eslint-disable-next-line camelcase
|
|
@@ -1889,6 +2009,43 @@ export class SimulateResponse extends BaseModel {
|
|
|
1889
2009
|
evalOverrides: typeof data['eval-overrides'] !== 'undefined'
|
|
1890
2010
|
? SimulationEvalOverrides.from_obj_for_encoding(data['eval-overrides'])
|
|
1891
2011
|
: undefined,
|
|
2012
|
+
execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
|
|
2013
|
+
? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
|
|
2014
|
+
: undefined,
|
|
2015
|
+
});
|
|
2016
|
+
/* eslint-enable dot-notation */
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* An object that configures simulation execution trace.
|
|
2021
|
+
*/
|
|
2022
|
+
export class SimulateTraceConfig extends BaseModel {
|
|
2023
|
+
/**
|
|
2024
|
+
* Creates a new `SimulateTraceConfig` object.
|
|
2025
|
+
* @param enable - A boolean option for opting in execution trace features simulation endpoint.
|
|
2026
|
+
* @param scratchChange - A boolean option enabling returning scratch slot changes together with execution
|
|
2027
|
+
* trace during simulation.
|
|
2028
|
+
* @param stackChange - A boolean option enabling returning stack changes together with execution trace
|
|
2029
|
+
* during simulation.
|
|
2030
|
+
*/
|
|
2031
|
+
constructor({ enable, scratchChange, stackChange, }) {
|
|
2032
|
+
super();
|
|
2033
|
+
this.enable = enable;
|
|
2034
|
+
this.scratchChange = scratchChange;
|
|
2035
|
+
this.stackChange = stackChange;
|
|
2036
|
+
this.attribute_map = {
|
|
2037
|
+
enable: 'enable',
|
|
2038
|
+
scratchChange: 'scratch-change',
|
|
2039
|
+
stackChange: 'stack-change',
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
// eslint-disable-next-line camelcase
|
|
2043
|
+
static from_obj_for_encoding(data) {
|
|
2044
|
+
/* eslint-disable dot-notation */
|
|
2045
|
+
return new SimulateTraceConfig({
|
|
2046
|
+
enable: data['enable'],
|
|
2047
|
+
scratchChange: data['scratch-change'],
|
|
2048
|
+
stackChange: data['stack-change'],
|
|
1892
2049
|
});
|
|
1893
2050
|
/* eslint-enable dot-notation */
|
|
1894
2051
|
}
|
|
@@ -1949,16 +2106,20 @@ export class SimulateTransactionResult extends BaseModel {
|
|
|
1949
2106
|
* includes confirmation details like the round and reward details.
|
|
1950
2107
|
* @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
|
|
1951
2108
|
* budged used by inner app calls spawned by this transaction.
|
|
2109
|
+
* @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
|
|
2110
|
+
* call trace in a recursive way.
|
|
1952
2111
|
* @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
|
|
1953
2112
|
*/
|
|
1954
|
-
constructor({ txnResult, appBudgetConsumed, logicSigBudgetConsumed, }) {
|
|
2113
|
+
constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, }) {
|
|
1955
2114
|
super();
|
|
1956
2115
|
this.txnResult = txnResult;
|
|
1957
2116
|
this.appBudgetConsumed = appBudgetConsumed;
|
|
2117
|
+
this.execTrace = execTrace;
|
|
1958
2118
|
this.logicSigBudgetConsumed = logicSigBudgetConsumed;
|
|
1959
2119
|
this.attribute_map = {
|
|
1960
2120
|
txnResult: 'txn-result',
|
|
1961
2121
|
appBudgetConsumed: 'app-budget-consumed',
|
|
2122
|
+
execTrace: 'exec-trace',
|
|
1962
2123
|
logicSigBudgetConsumed: 'logic-sig-budget-consumed',
|
|
1963
2124
|
};
|
|
1964
2125
|
}
|
|
@@ -1970,6 +2131,9 @@ export class SimulateTransactionResult extends BaseModel {
|
|
|
1970
2131
|
return new SimulateTransactionResult({
|
|
1971
2132
|
txnResult: PendingTransactionResponse.from_obj_for_encoding(data['txn-result']),
|
|
1972
2133
|
appBudgetConsumed: data['app-budget-consumed'],
|
|
2134
|
+
execTrace: typeof data['exec-trace'] !== 'undefined'
|
|
2135
|
+
? SimulationTransactionExecTrace.from_obj_for_encoding(data['exec-trace'])
|
|
2136
|
+
: undefined,
|
|
1973
2137
|
logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
|
|
1974
2138
|
});
|
|
1975
2139
|
/* eslint-enable dot-notation */
|
|
@@ -1985,16 +2149,19 @@ export class SimulationEvalOverrides extends BaseModel {
|
|
|
1985
2149
|
* Creates a new `SimulationEvalOverrides` object.
|
|
1986
2150
|
* @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
|
|
1987
2151
|
* were properly signed.
|
|
2152
|
+
* @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
|
|
1988
2153
|
* @param maxLogCalls - The maximum log calls one can make during simulation
|
|
1989
2154
|
* @param maxLogSize - The maximum byte number to log during simulation
|
|
1990
2155
|
*/
|
|
1991
|
-
constructor({ allowEmptySignatures, maxLogCalls, maxLogSize, }) {
|
|
2156
|
+
constructor({ allowEmptySignatures, extraOpcodeBudget, maxLogCalls, maxLogSize, }) {
|
|
1992
2157
|
super();
|
|
1993
2158
|
this.allowEmptySignatures = allowEmptySignatures;
|
|
2159
|
+
this.extraOpcodeBudget = extraOpcodeBudget;
|
|
1994
2160
|
this.maxLogCalls = maxLogCalls;
|
|
1995
2161
|
this.maxLogSize = maxLogSize;
|
|
1996
2162
|
this.attribute_map = {
|
|
1997
2163
|
allowEmptySignatures: 'allow-empty-signatures',
|
|
2164
|
+
extraOpcodeBudget: 'extra-opcode-budget',
|
|
1998
2165
|
maxLogCalls: 'max-log-calls',
|
|
1999
2166
|
maxLogSize: 'max-log-size',
|
|
2000
2167
|
};
|
|
@@ -2004,12 +2171,105 @@ export class SimulationEvalOverrides extends BaseModel {
|
|
|
2004
2171
|
/* eslint-disable dot-notation */
|
|
2005
2172
|
return new SimulationEvalOverrides({
|
|
2006
2173
|
allowEmptySignatures: data['allow-empty-signatures'],
|
|
2174
|
+
extraOpcodeBudget: data['extra-opcode-budget'],
|
|
2007
2175
|
maxLogCalls: data['max-log-calls'],
|
|
2008
2176
|
maxLogSize: data['max-log-size'],
|
|
2009
2177
|
});
|
|
2010
2178
|
/* eslint-enable dot-notation */
|
|
2011
2179
|
}
|
|
2012
2180
|
}
|
|
2181
|
+
/**
|
|
2182
|
+
* The set of trace information and effect from evaluating a single opcode.
|
|
2183
|
+
*/
|
|
2184
|
+
export class SimulationOpcodeTraceUnit extends BaseModel {
|
|
2185
|
+
/**
|
|
2186
|
+
* Creates a new `SimulationOpcodeTraceUnit` object.
|
|
2187
|
+
* @param pc - The program counter of the current opcode being evaluated.
|
|
2188
|
+
* @param scratchChanges - The writes into scratch slots.
|
|
2189
|
+
* @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
|
|
2190
|
+
* @param stackAdditions - The values added by this opcode to the stack.
|
|
2191
|
+
* @param stackPopCount - The number of deleted stack values by this opcode.
|
|
2192
|
+
*/
|
|
2193
|
+
constructor({ pc, scratchChanges, spawnedInners, stackAdditions, stackPopCount, }) {
|
|
2194
|
+
super();
|
|
2195
|
+
this.pc = pc;
|
|
2196
|
+
this.scratchChanges = scratchChanges;
|
|
2197
|
+
this.spawnedInners = spawnedInners;
|
|
2198
|
+
this.stackAdditions = stackAdditions;
|
|
2199
|
+
this.stackPopCount = stackPopCount;
|
|
2200
|
+
this.attribute_map = {
|
|
2201
|
+
pc: 'pc',
|
|
2202
|
+
scratchChanges: 'scratch-changes',
|
|
2203
|
+
spawnedInners: 'spawned-inners',
|
|
2204
|
+
stackAdditions: 'stack-additions',
|
|
2205
|
+
stackPopCount: 'stack-pop-count',
|
|
2206
|
+
};
|
|
2207
|
+
}
|
|
2208
|
+
// eslint-disable-next-line camelcase
|
|
2209
|
+
static from_obj_for_encoding(data) {
|
|
2210
|
+
/* eslint-disable dot-notation */
|
|
2211
|
+
if (typeof data['pc'] === 'undefined')
|
|
2212
|
+
throw new Error(`Response is missing required field 'pc': ${data}`);
|
|
2213
|
+
return new SimulationOpcodeTraceUnit({
|
|
2214
|
+
pc: data['pc'],
|
|
2215
|
+
scratchChanges: typeof data['scratch-changes'] !== 'undefined'
|
|
2216
|
+
? data['scratch-changes'].map(ScratchChange.from_obj_for_encoding)
|
|
2217
|
+
: undefined,
|
|
2218
|
+
spawnedInners: data['spawned-inners'],
|
|
2219
|
+
stackAdditions: typeof data['stack-additions'] !== 'undefined'
|
|
2220
|
+
? data['stack-additions'].map(AvmValue.from_obj_for_encoding)
|
|
2221
|
+
: undefined,
|
|
2222
|
+
stackPopCount: data['stack-pop-count'],
|
|
2223
|
+
});
|
|
2224
|
+
/* eslint-enable dot-notation */
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
/**
|
|
2228
|
+
* The execution trace of calling an app or a logic sig, containing the inner app
|
|
2229
|
+
* call trace in a recursive way.
|
|
2230
|
+
*/
|
|
2231
|
+
export class SimulationTransactionExecTrace extends BaseModel {
|
|
2232
|
+
/**
|
|
2233
|
+
* Creates a new `SimulationTransactionExecTrace` object.
|
|
2234
|
+
* @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
|
|
2235
|
+
* @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
|
|
2236
|
+
* @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
|
|
2237
|
+
* any inner transactions executed.
|
|
2238
|
+
* @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
|
|
2239
|
+
*/
|
|
2240
|
+
constructor({ approvalProgramTrace, clearStateProgramTrace, innerTrace, logicSigTrace, }) {
|
|
2241
|
+
super();
|
|
2242
|
+
this.approvalProgramTrace = approvalProgramTrace;
|
|
2243
|
+
this.clearStateProgramTrace = clearStateProgramTrace;
|
|
2244
|
+
this.innerTrace = innerTrace;
|
|
2245
|
+
this.logicSigTrace = logicSigTrace;
|
|
2246
|
+
this.attribute_map = {
|
|
2247
|
+
approvalProgramTrace: 'approval-program-trace',
|
|
2248
|
+
clearStateProgramTrace: 'clear-state-program-trace',
|
|
2249
|
+
innerTrace: 'inner-trace',
|
|
2250
|
+
logicSigTrace: 'logic-sig-trace',
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
// eslint-disable-next-line camelcase
|
|
2254
|
+
static from_obj_for_encoding(data) {
|
|
2255
|
+
/* eslint-disable dot-notation */
|
|
2256
|
+
return new SimulationTransactionExecTrace({
|
|
2257
|
+
approvalProgramTrace: typeof data['approval-program-trace'] !== 'undefined'
|
|
2258
|
+
? data['approval-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
|
|
2259
|
+
: undefined,
|
|
2260
|
+
clearStateProgramTrace: typeof data['clear-state-program-trace'] !== 'undefined'
|
|
2261
|
+
? data['clear-state-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
|
|
2262
|
+
: undefined,
|
|
2263
|
+
innerTrace: typeof data['inner-trace'] !== 'undefined'
|
|
2264
|
+
? data['inner-trace'].map(SimulationTransactionExecTrace.from_obj_for_encoding)
|
|
2265
|
+
: undefined,
|
|
2266
|
+
logicSigTrace: typeof data['logic-sig-trace'] !== 'undefined'
|
|
2267
|
+
? data['logic-sig-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
|
|
2268
|
+
: undefined,
|
|
2269
|
+
});
|
|
2270
|
+
/* eslint-enable dot-notation */
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2013
2273
|
/**
|
|
2014
2274
|
* Represents a state proof and its corresponding message
|
|
2015
2275
|
*/
|
|
@@ -2211,6 +2471,33 @@ export class TealValue extends BaseModel {
|
|
|
2211
2471
|
/* eslint-enable dot-notation */
|
|
2212
2472
|
}
|
|
2213
2473
|
}
|
|
2474
|
+
/**
|
|
2475
|
+
* Response containing all ledger state deltas for transaction groups, with their
|
|
2476
|
+
* associated Ids, in a single round.
|
|
2477
|
+
*/
|
|
2478
|
+
export class TransactionGroupLedgerStateDeltasForRoundResponse extends BaseModel {
|
|
2479
|
+
/**
|
|
2480
|
+
* Creates a new `TransactionGroupLedgerStateDeltasForRoundResponse` object.
|
|
2481
|
+
* @param deltas -
|
|
2482
|
+
*/
|
|
2483
|
+
constructor({ deltas }) {
|
|
2484
|
+
super();
|
|
2485
|
+
this.deltas = deltas;
|
|
2486
|
+
this.attribute_map = {
|
|
2487
|
+
deltas: 'Deltas',
|
|
2488
|
+
};
|
|
2489
|
+
}
|
|
2490
|
+
// eslint-disable-next-line camelcase
|
|
2491
|
+
static from_obj_for_encoding(data) {
|
|
2492
|
+
/* eslint-disable dot-notation */
|
|
2493
|
+
if (!Array.isArray(data['Deltas']))
|
|
2494
|
+
throw new Error(`Response is missing required array field 'Deltas': ${data}`);
|
|
2495
|
+
return new TransactionGroupLedgerStateDeltasForRoundResponse({
|
|
2496
|
+
deltas: data['Deltas'].map(LedgerStateDeltaForTransactionGroup.from_obj_for_encoding),
|
|
2497
|
+
});
|
|
2498
|
+
/* eslint-enable dot-notation */
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2214
2501
|
/**
|
|
2215
2502
|
* TransactionParams contains the parameters that help a client construct a new
|
|
2216
2503
|
* transaction.
|