algosdk 2.5.0 → 2.6.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.
@@ -784,6 +784,183 @@ export class Application extends BaseModel {
784
784
  }
785
785
  }
786
786
 
787
+ /**
788
+ * An application's initial global/local/box states that were accessed during
789
+ * simulation.
790
+ */
791
+ export class ApplicationInitialStates extends BaseModel {
792
+ /**
793
+ * Application index.
794
+ */
795
+ public id: number | bigint;
796
+
797
+ /**
798
+ * An application's global/local/box state.
799
+ */
800
+ public appBoxes?: ApplicationKVStorage;
801
+
802
+ /**
803
+ * An application's global/local/box state.
804
+ */
805
+ public appGlobals?: ApplicationKVStorage;
806
+
807
+ /**
808
+ * An application's initial local states tied to different accounts.
809
+ */
810
+ public appLocals?: ApplicationKVStorage[];
811
+
812
+ /**
813
+ * Creates a new `ApplicationInitialStates` object.
814
+ * @param id - Application index.
815
+ * @param appBoxes - An application's global/local/box state.
816
+ * @param appGlobals - An application's global/local/box state.
817
+ * @param appLocals - An application's initial local states tied to different accounts.
818
+ */
819
+ constructor({
820
+ id,
821
+ appBoxes,
822
+ appGlobals,
823
+ appLocals,
824
+ }: {
825
+ id: number | bigint;
826
+ appBoxes?: ApplicationKVStorage;
827
+ appGlobals?: ApplicationKVStorage;
828
+ appLocals?: ApplicationKVStorage[];
829
+ }) {
830
+ super();
831
+ this.id = id;
832
+ this.appBoxes = appBoxes;
833
+ this.appGlobals = appGlobals;
834
+ this.appLocals = appLocals;
835
+
836
+ this.attribute_map = {
837
+ id: 'id',
838
+ appBoxes: 'app-boxes',
839
+ appGlobals: 'app-globals',
840
+ appLocals: 'app-locals',
841
+ };
842
+ }
843
+
844
+ // eslint-disable-next-line camelcase
845
+ static from_obj_for_encoding(
846
+ data: Record<string, any>
847
+ ): ApplicationInitialStates {
848
+ /* eslint-disable dot-notation */
849
+ if (typeof data['id'] === 'undefined')
850
+ throw new Error(`Response is missing required field 'id': ${data}`);
851
+ return new ApplicationInitialStates({
852
+ id: data['id'],
853
+ appBoxes:
854
+ typeof data['app-boxes'] !== 'undefined'
855
+ ? ApplicationKVStorage.from_obj_for_encoding(data['app-boxes'])
856
+ : undefined,
857
+ appGlobals:
858
+ typeof data['app-globals'] !== 'undefined'
859
+ ? ApplicationKVStorage.from_obj_for_encoding(data['app-globals'])
860
+ : undefined,
861
+ appLocals:
862
+ typeof data['app-locals'] !== 'undefined'
863
+ ? data['app-locals'].map(ApplicationKVStorage.from_obj_for_encoding)
864
+ : undefined,
865
+ });
866
+ /* eslint-enable dot-notation */
867
+ }
868
+ }
869
+
870
+ /**
871
+ * An application's global/local/box state.
872
+ */
873
+ export class ApplicationKVStorage extends BaseModel {
874
+ /**
875
+ * Key-Value pairs representing application states.
876
+ */
877
+ public kvs: AvmKeyValue[];
878
+
879
+ /**
880
+ * The address of the account associated with the local state.
881
+ */
882
+ public account?: string;
883
+
884
+ /**
885
+ * Creates a new `ApplicationKVStorage` object.
886
+ * @param kvs - Key-Value pairs representing application states.
887
+ * @param account - The address of the account associated with the local state.
888
+ */
889
+ constructor({ kvs, account }: { kvs: AvmKeyValue[]; account?: string }) {
890
+ super();
891
+ this.kvs = kvs;
892
+ this.account = account;
893
+
894
+ this.attribute_map = {
895
+ kvs: 'kvs',
896
+ account: 'account',
897
+ };
898
+ }
899
+
900
+ // eslint-disable-next-line camelcase
901
+ static from_obj_for_encoding(
902
+ data: Record<string, any>
903
+ ): ApplicationKVStorage {
904
+ /* eslint-disable dot-notation */
905
+ if (!Array.isArray(data['kvs']))
906
+ throw new Error(
907
+ `Response is missing required array field 'kvs': ${data}`
908
+ );
909
+ return new ApplicationKVStorage({
910
+ kvs: data['kvs'].map(AvmKeyValue.from_obj_for_encoding),
911
+ account: data['account'],
912
+ });
913
+ /* eslint-enable dot-notation */
914
+ }
915
+ }
916
+
917
+ /**
918
+ * References an account's local state for an application.
919
+ */
920
+ export class ApplicationLocalReference extends BaseModel {
921
+ /**
922
+ * Address of the account with the local state.
923
+ */
924
+ public account: string;
925
+
926
+ /**
927
+ * Application ID of the local state application.
928
+ */
929
+ public app: number | bigint;
930
+
931
+ /**
932
+ * Creates a new `ApplicationLocalReference` object.
933
+ * @param account - Address of the account with the local state.
934
+ * @param app - Application ID of the local state application.
935
+ */
936
+ constructor({ account, app }: { account: string; app: number | bigint }) {
937
+ super();
938
+ this.account = account;
939
+ this.app = app;
940
+
941
+ this.attribute_map = {
942
+ account: 'account',
943
+ app: 'app',
944
+ };
945
+ }
946
+
947
+ // eslint-disable-next-line camelcase
948
+ static from_obj_for_encoding(
949
+ data: Record<string, any>
950
+ ): ApplicationLocalReference {
951
+ /* eslint-disable dot-notation */
952
+ if (typeof data['account'] === 'undefined')
953
+ throw new Error(`Response is missing required field 'account': ${data}`);
954
+ if (typeof data['app'] === 'undefined')
955
+ throw new Error(`Response is missing required field 'app': ${data}`);
956
+ return new ApplicationLocalReference({
957
+ account: data['account'],
958
+ app: data['app'],
959
+ });
960
+ /* eslint-enable dot-notation */
961
+ }
962
+ }
963
+
787
964
  /**
788
965
  * Stores local state associated with an application.
789
966
  */
@@ -984,6 +1161,108 @@ export class ApplicationParams extends BaseModel {
984
1161
  }
985
1162
  }
986
1163
 
1164
+ /**
1165
+ * An operation against an application's global/local/box state.
1166
+ */
1167
+ export class ApplicationStateOperation extends BaseModel {
1168
+ /**
1169
+ * Type of application state. Value `g` is **global state**, `l` is **local
1170
+ * state**, `b` is **boxes**.
1171
+ */
1172
+ public appStateType: string;
1173
+
1174
+ /**
1175
+ * The key (name) of the global/local/box state.
1176
+ */
1177
+ public key: Uint8Array;
1178
+
1179
+ /**
1180
+ * Operation type. Value `w` is **write**, `d` is **delete**.
1181
+ */
1182
+ public operation: string;
1183
+
1184
+ /**
1185
+ * For local state changes, the address of the account associated with the local
1186
+ * state.
1187
+ */
1188
+ public account?: string;
1189
+
1190
+ /**
1191
+ * Represents an AVM value.
1192
+ */
1193
+ public newValue?: AvmValue;
1194
+
1195
+ /**
1196
+ * Creates a new `ApplicationStateOperation` object.
1197
+ * @param appStateType - Type of application state. Value `g` is **global state**, `l` is **local
1198
+ * state**, `b` is **boxes**.
1199
+ * @param key - The key (name) of the global/local/box state.
1200
+ * @param operation - Operation type. Value `w` is **write**, `d` is **delete**.
1201
+ * @param account - For local state changes, the address of the account associated with the local
1202
+ * state.
1203
+ * @param newValue - Represents an AVM value.
1204
+ */
1205
+ constructor({
1206
+ appStateType,
1207
+ key,
1208
+ operation,
1209
+ account,
1210
+ newValue,
1211
+ }: {
1212
+ appStateType: string;
1213
+ key: string | Uint8Array;
1214
+ operation: string;
1215
+ account?: string;
1216
+ newValue?: AvmValue;
1217
+ }) {
1218
+ super();
1219
+ this.appStateType = appStateType;
1220
+ this.key =
1221
+ typeof key === 'string'
1222
+ ? new Uint8Array(Buffer.from(key, 'base64'))
1223
+ : key;
1224
+ this.operation = operation;
1225
+ this.account = account;
1226
+ this.newValue = newValue;
1227
+
1228
+ this.attribute_map = {
1229
+ appStateType: 'app-state-type',
1230
+ key: 'key',
1231
+ operation: 'operation',
1232
+ account: 'account',
1233
+ newValue: 'new-value',
1234
+ };
1235
+ }
1236
+
1237
+ // eslint-disable-next-line camelcase
1238
+ static from_obj_for_encoding(
1239
+ data: Record<string, any>
1240
+ ): ApplicationStateOperation {
1241
+ /* eslint-disable dot-notation */
1242
+ if (typeof data['app-state-type'] === 'undefined')
1243
+ throw new Error(
1244
+ `Response is missing required field 'app-state-type': ${data}`
1245
+ );
1246
+ if (typeof data['key'] === 'undefined')
1247
+ throw new Error(`Response is missing required field 'key': ${data}`);
1248
+ if (typeof data['operation'] === 'undefined')
1249
+ throw new Error(
1250
+ `Response is missing required field 'operation': ${data}`
1251
+ );
1252
+ return new ApplicationStateOperation({
1253
+ appStateType: data['app-state-type'],
1254
+ key: data['key'],
1255
+ operation: data['operation'],
1256
+ account: data['account'],
1257
+ newValue:
1258
+ typeof data['new-value'] !== 'undefined'
1259
+ ? AvmValue.from_obj_for_encoding(data['new-value'])
1260
+ : undefined,
1261
+ });
1262
+ /* eslint-enable dot-notation */
1263
+ }
1264
+ }
1265
+
987
1266
  /**
988
1267
  * Specifies maximums on the number of each type that may be stored.
989
1268
  */
@@ -1164,6 +1443,53 @@ export class AssetHolding extends BaseModel {
1164
1443
  }
1165
1444
  }
1166
1445
 
1446
+ /**
1447
+ * References an asset held by an account.
1448
+ */
1449
+ export class AssetHoldingReference extends BaseModel {
1450
+ /**
1451
+ * Address of the account holding the asset.
1452
+ */
1453
+ public account: string;
1454
+
1455
+ /**
1456
+ * Asset ID of the holding.
1457
+ */
1458
+ public asset: number | bigint;
1459
+
1460
+ /**
1461
+ * Creates a new `AssetHoldingReference` object.
1462
+ * @param account - Address of the account holding the asset.
1463
+ * @param asset - Asset ID of the holding.
1464
+ */
1465
+ constructor({ account, asset }: { account: string; asset: number | bigint }) {
1466
+ super();
1467
+ this.account = account;
1468
+ this.asset = asset;
1469
+
1470
+ this.attribute_map = {
1471
+ account: 'account',
1472
+ asset: 'asset',
1473
+ };
1474
+ }
1475
+
1476
+ // eslint-disable-next-line camelcase
1477
+ static from_obj_for_encoding(
1478
+ data: Record<string, any>
1479
+ ): AssetHoldingReference {
1480
+ /* eslint-disable dot-notation */
1481
+ if (typeof data['account'] === 'undefined')
1482
+ throw new Error(`Response is missing required field 'account': ${data}`);
1483
+ if (typeof data['asset'] === 'undefined')
1484
+ throw new Error(`Response is missing required field 'asset': ${data}`);
1485
+ return new AssetHoldingReference({
1486
+ account: data['account'],
1487
+ asset: data['asset'],
1488
+ });
1489
+ /* eslint-enable dot-notation */
1490
+ }
1491
+ }
1492
+
1167
1493
  /**
1168
1494
  * AssetParams specifies the parameters for an asset.
1169
1495
  * (apar) when part of an AssetConfig transaction.
@@ -1397,6 +1723,51 @@ export class AssetParams extends BaseModel {
1397
1723
  }
1398
1724
  }
1399
1725
 
1726
+ /**
1727
+ * Represents an AVM key-value pair in an application store.
1728
+ */
1729
+ export class AvmKeyValue extends BaseModel {
1730
+ public key: Uint8Array;
1731
+
1732
+ /**
1733
+ * Represents an AVM value.
1734
+ */
1735
+ public value: AvmValue;
1736
+
1737
+ /**
1738
+ * Creates a new `AvmKeyValue` object.
1739
+ * @param key -
1740
+ * @param value - Represents an AVM value.
1741
+ */
1742
+ constructor({ key, value }: { key: string | Uint8Array; value: AvmValue }) {
1743
+ super();
1744
+ this.key =
1745
+ typeof key === 'string'
1746
+ ? new Uint8Array(Buffer.from(key, 'base64'))
1747
+ : key;
1748
+ this.value = value;
1749
+
1750
+ this.attribute_map = {
1751
+ key: 'key',
1752
+ value: 'value',
1753
+ };
1754
+ }
1755
+
1756
+ // eslint-disable-next-line camelcase
1757
+ static from_obj_for_encoding(data: Record<string, any>): AvmKeyValue {
1758
+ /* eslint-disable dot-notation */
1759
+ if (typeof data['key'] === 'undefined')
1760
+ throw new Error(`Response is missing required field 'key': ${data}`);
1761
+ if (typeof data['value'] === 'undefined')
1762
+ throw new Error(`Response is missing required field 'value': ${data}`);
1763
+ return new AvmKeyValue({
1764
+ key: data['key'],
1765
+ value: AvmValue.from_obj_for_encoding(data['value']),
1766
+ });
1767
+ /* eslint-enable dot-notation */
1768
+ }
1769
+ }
1770
+
1400
1771
  /**
1401
1772
  * Represents an AVM value.
1402
1773
  */
@@ -1547,6 +1918,42 @@ export class BlockResponse extends BaseModel {
1547
1918
  }
1548
1919
  }
1549
1920
 
1921
+ /**
1922
+ * Top level transaction IDs in a block.
1923
+ */
1924
+ export class BlockTxidsResponse extends BaseModel {
1925
+ /**
1926
+ * Block transaction IDs.
1927
+ */
1928
+ public blocktxids: string[];
1929
+
1930
+ /**
1931
+ * Creates a new `BlockTxidsResponse` object.
1932
+ * @param blocktxids - Block transaction IDs.
1933
+ */
1934
+ constructor({ blocktxids }: { blocktxids: string[] }) {
1935
+ super();
1936
+ this.blocktxids = blocktxids;
1937
+
1938
+ this.attribute_map = {
1939
+ blocktxids: 'blockTxids',
1940
+ };
1941
+ }
1942
+
1943
+ // eslint-disable-next-line camelcase
1944
+ static from_obj_for_encoding(data: Record<string, any>): BlockTxidsResponse {
1945
+ /* eslint-disable dot-notation */
1946
+ if (!Array.isArray(data['blockTxids']))
1947
+ throw new Error(
1948
+ `Response is missing required array field 'blockTxids': ${data}`
1949
+ );
1950
+ return new BlockTxidsResponse({
1951
+ blocktxids: data['blockTxids'],
1952
+ });
1953
+ /* eslint-enable dot-notation */
1954
+ }
1955
+ }
1956
+
1550
1957
  /**
1551
1958
  * Box name and its content.
1552
1959
  */
@@ -1654,6 +2061,60 @@ export class BoxDescriptor extends BaseModel {
1654
2061
  }
1655
2062
  }
1656
2063
 
2064
+ /**
2065
+ * References a box of an application.
2066
+ */
2067
+ export class BoxReference extends BaseModel {
2068
+ /**
2069
+ * Application ID which this box belongs to
2070
+ */
2071
+ public app: number | bigint;
2072
+
2073
+ /**
2074
+ * Base64 encoded box name
2075
+ */
2076
+ public name: Uint8Array;
2077
+
2078
+ /**
2079
+ * Creates a new `BoxReference` object.
2080
+ * @param app - Application ID which this box belongs to
2081
+ * @param name - Base64 encoded box name
2082
+ */
2083
+ constructor({
2084
+ app,
2085
+ name,
2086
+ }: {
2087
+ app: number | bigint;
2088
+ name: string | Uint8Array;
2089
+ }) {
2090
+ super();
2091
+ this.app = app;
2092
+ this.name =
2093
+ typeof name === 'string'
2094
+ ? new Uint8Array(Buffer.from(name, 'base64'))
2095
+ : name;
2096
+
2097
+ this.attribute_map = {
2098
+ app: 'app',
2099
+ name: 'name',
2100
+ };
2101
+ }
2102
+
2103
+ // eslint-disable-next-line camelcase
2104
+ static from_obj_for_encoding(data: Record<string, any>): BoxReference {
2105
+ /* eslint-disable dot-notation */
2106
+ if (typeof data['app'] === 'undefined')
2107
+ throw new Error(`Response is missing required field 'app': ${data}`);
2108
+ if (typeof data['name'] === 'undefined')
2109
+ throw new Error(`Response is missing required field 'name': ${data}`);
2110
+ return new BoxReference({
2111
+ app: data['app'],
2112
+ name: data['name'],
2113
+ });
2114
+ /* eslint-enable dot-notation */
2115
+ }
2116
+ }
2117
+
1657
2118
  /**
1658
2119
  * Box names of an application
1659
2120
  */
@@ -3473,6 +3934,51 @@ export class ScratchChange extends BaseModel {
3473
3934
  }
3474
3935
  }
3475
3936
 
3937
+ /**
3938
+ * Initial states of resources that were accessed during simulation.
3939
+ */
3940
+ export class SimulateInitialStates extends BaseModel {
3941
+ /**
3942
+ * The initial states of accessed application before simulation. The order of this
3943
+ * array is arbitrary.
3944
+ */
3945
+ public appInitialStates?: ApplicationInitialStates[];
3946
+
3947
+ /**
3948
+ * Creates a new `SimulateInitialStates` object.
3949
+ * @param appInitialStates - The initial states of accessed application before simulation. The order of this
3950
+ * array is arbitrary.
3951
+ */
3952
+ constructor({
3953
+ appInitialStates,
3954
+ }: {
3955
+ appInitialStates?: ApplicationInitialStates[];
3956
+ }) {
3957
+ super();
3958
+ this.appInitialStates = appInitialStates;
3959
+
3960
+ this.attribute_map = {
3961
+ appInitialStates: 'app-initial-states',
3962
+ };
3963
+ }
3964
+
3965
+ // eslint-disable-next-line camelcase
3966
+ static from_obj_for_encoding(
3967
+ data: Record<string, any>
3968
+ ): SimulateInitialStates {
3969
+ /* eslint-disable dot-notation */
3970
+ return new SimulateInitialStates({
3971
+ appInitialStates:
3972
+ typeof data['app-initial-states'] !== 'undefined'
3973
+ ? data['app-initial-states'].map(
3974
+ ApplicationInitialStates.from_obj_for_encoding
3975
+ )
3976
+ : undefined,
3977
+ });
3978
+ /* eslint-enable dot-notation */
3979
+ }
3980
+ }
3981
+
3476
3982
  /**
3477
3983
  * Request type for simulation endpoint.
3478
3984
  */
@@ -3483,7 +3989,7 @@ export class SimulateRequest extends BaseModel {
3483
3989
  public txnGroups: SimulateRequestTransactionGroup[];
3484
3990
 
3485
3991
  /**
3486
- * Allow transactions without signatures to be simulated as if they had correct
3992
+ * Allows transactions without signatures to be simulated as if they had correct
3487
3993
  * signatures.
3488
3994
  */
3489
3995
  public allowEmptySignatures?: boolean;
@@ -3493,6 +3999,11 @@ export class SimulateRequest extends BaseModel {
3493
3999
  */
3494
4000
  public allowMoreLogging?: boolean;
3495
4001
 
4002
+ /**
4003
+ * Allows access to unnamed resources during simulation.
4004
+ */
4005
+ public allowUnnamedResources?: boolean;
4006
+
3496
4007
  /**
3497
4008
  * An object that configures simulation execution trace.
3498
4009
  */
@@ -3503,41 +4014,62 @@ export class SimulateRequest extends BaseModel {
3503
4014
  */
3504
4015
  public extraOpcodeBudget?: number | bigint;
3505
4016
 
4017
+ /**
4018
+ * If provided, specifies the round preceding the simulation. State changes through
4019
+ * this round will be used to run this simulation. Usually only the 4 most recent
4020
+ * rounds will be available (controlled by the node config value MaxAcctLookback).
4021
+ * If not specified, defaults to the latest available round.
4022
+ */
4023
+ public round?: number | bigint;
4024
+
3506
4025
  /**
3507
4026
  * Creates a new `SimulateRequest` object.
3508
4027
  * @param txnGroups - The transaction groups to simulate.
3509
- * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
4028
+ * @param allowEmptySignatures - Allows transactions without signatures to be simulated as if they had correct
3510
4029
  * signatures.
3511
4030
  * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
4031
+ * @param allowUnnamedResources - Allows access to unnamed resources during simulation.
3512
4032
  * @param execTraceConfig - An object that configures simulation execution trace.
3513
4033
  * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
4034
+ * @param round - If provided, specifies the round preceding the simulation. State changes through
4035
+ * this round will be used to run this simulation. Usually only the 4 most recent
4036
+ * rounds will be available (controlled by the node config value MaxAcctLookback).
4037
+ * If not specified, defaults to the latest available round.
3514
4038
  */
3515
4039
  constructor({
3516
4040
  txnGroups,
3517
4041
  allowEmptySignatures,
3518
4042
  allowMoreLogging,
4043
+ allowUnnamedResources,
3519
4044
  execTraceConfig,
3520
4045
  extraOpcodeBudget,
4046
+ round,
3521
4047
  }: {
3522
4048
  txnGroups: SimulateRequestTransactionGroup[];
3523
4049
  allowEmptySignatures?: boolean;
3524
4050
  allowMoreLogging?: boolean;
4051
+ allowUnnamedResources?: boolean;
3525
4052
  execTraceConfig?: SimulateTraceConfig;
3526
4053
  extraOpcodeBudget?: number | bigint;
4054
+ round?: number | bigint;
3527
4055
  }) {
3528
4056
  super();
3529
4057
  this.txnGroups = txnGroups;
3530
4058
  this.allowEmptySignatures = allowEmptySignatures;
3531
4059
  this.allowMoreLogging = allowMoreLogging;
4060
+ this.allowUnnamedResources = allowUnnamedResources;
3532
4061
  this.execTraceConfig = execTraceConfig;
3533
4062
  this.extraOpcodeBudget = extraOpcodeBudget;
4063
+ this.round = round;
3534
4064
 
3535
4065
  this.attribute_map = {
3536
4066
  txnGroups: 'txn-groups',
3537
4067
  allowEmptySignatures: 'allow-empty-signatures',
3538
4068
  allowMoreLogging: 'allow-more-logging',
4069
+ allowUnnamedResources: 'allow-unnamed-resources',
3539
4070
  execTraceConfig: 'exec-trace-config',
3540
4071
  extraOpcodeBudget: 'extra-opcode-budget',
4072
+ round: 'round',
3541
4073
  };
3542
4074
  }
3543
4075
 
@@ -3554,11 +4086,13 @@ export class SimulateRequest extends BaseModel {
3554
4086
  ),
3555
4087
  allowEmptySignatures: data['allow-empty-signatures'],
3556
4088
  allowMoreLogging: data['allow-more-logging'],
4089
+ allowUnnamedResources: data['allow-unnamed-resources'],
3557
4090
  execTraceConfig:
3558
4091
  typeof data['exec-trace-config'] !== 'undefined'
3559
4092
  ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
3560
4093
  : undefined,
3561
4094
  extraOpcodeBudget: data['extra-opcode-budget'],
4095
+ round: data['round'],
3562
4096
  });
3563
4097
  /* eslint-enable dot-notation */
3564
4098
  }
@@ -3634,6 +4168,11 @@ export class SimulateResponse extends BaseModel {
3634
4168
  */
3635
4169
  public execTraceConfig?: SimulateTraceConfig;
3636
4170
 
4171
+ /**
4172
+ * Initial states of resources that were accessed during simulation.
4173
+ */
4174
+ public initialStates?: SimulateInitialStates;
4175
+
3637
4176
  /**
3638
4177
  * Creates a new `SimulateResponse` object.
3639
4178
  * @param lastRound - The round immediately preceding this simulation. State changes through this
@@ -3644,6 +4183,7 @@ export class SimulateResponse extends BaseModel {
3644
4183
  * parameters is present, then evaluation parameters may differ from standard
3645
4184
  * evaluation in certain ways.
3646
4185
  * @param execTraceConfig - An object that configures simulation execution trace.
4186
+ * @param initialStates - Initial states of resources that were accessed during simulation.
3647
4187
  */
3648
4188
  constructor({
3649
4189
  lastRound,
@@ -3651,12 +4191,14 @@ export class SimulateResponse extends BaseModel {
3651
4191
  version,
3652
4192
  evalOverrides,
3653
4193
  execTraceConfig,
4194
+ initialStates,
3654
4195
  }: {
3655
4196
  lastRound: number | bigint;
3656
4197
  txnGroups: SimulateTransactionGroupResult[];
3657
4198
  version: number | bigint;
3658
4199
  evalOverrides?: SimulationEvalOverrides;
3659
4200
  execTraceConfig?: SimulateTraceConfig;
4201
+ initialStates?: SimulateInitialStates;
3660
4202
  }) {
3661
4203
  super();
3662
4204
  this.lastRound = lastRound;
@@ -3664,6 +4206,7 @@ export class SimulateResponse extends BaseModel {
3664
4206
  this.version = version;
3665
4207
  this.evalOverrides = evalOverrides;
3666
4208
  this.execTraceConfig = execTraceConfig;
4209
+ this.initialStates = initialStates;
3667
4210
 
3668
4211
  this.attribute_map = {
3669
4212
  lastRound: 'last-round',
@@ -3671,6 +4214,7 @@ export class SimulateResponse extends BaseModel {
3671
4214
  version: 'version',
3672
4215
  evalOverrides: 'eval-overrides',
3673
4216
  execTraceConfig: 'exec-trace-config',
4217
+ initialStates: 'initial-states',
3674
4218
  };
3675
4219
  }
3676
4220
 
@@ -3703,6 +4247,10 @@ export class SimulateResponse extends BaseModel {
3703
4247
  typeof data['exec-trace-config'] !== 'undefined'
3704
4248
  ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
3705
4249
  : undefined,
4250
+ initialStates:
4251
+ typeof data['initial-states'] !== 'undefined'
4252
+ ? SimulateInitialStates.from_obj_for_encoding(data['initial-states'])
4253
+ : undefined,
3706
4254
  });
3707
4255
  /* eslint-enable dot-notation */
3708
4256
  }
@@ -3729,6 +4277,12 @@ export class SimulateTraceConfig extends BaseModel {
3729
4277
  */
3730
4278
  public stackChange?: boolean;
3731
4279
 
4280
+ /**
4281
+ * A boolean option enabling returning application state changes (global, local,
4282
+ * and box changes) with the execution trace during simulation.
4283
+ */
4284
+ public stateChange?: boolean;
4285
+
3732
4286
  /**
3733
4287
  * Creates a new `SimulateTraceConfig` object.
3734
4288
  * @param enable - A boolean option for opting in execution trace features simulation endpoint.
@@ -3736,25 +4290,31 @@ export class SimulateTraceConfig extends BaseModel {
3736
4290
  * trace during simulation.
3737
4291
  * @param stackChange - A boolean option enabling returning stack changes together with execution trace
3738
4292
  * during simulation.
4293
+ * @param stateChange - A boolean option enabling returning application state changes (global, local,
4294
+ * and box changes) with the execution trace during simulation.
3739
4295
  */
3740
4296
  constructor({
3741
4297
  enable,
3742
4298
  scratchChange,
3743
4299
  stackChange,
4300
+ stateChange,
3744
4301
  }: {
3745
4302
  enable?: boolean;
3746
4303
  scratchChange?: boolean;
3747
4304
  stackChange?: boolean;
4305
+ stateChange?: boolean;
3748
4306
  }) {
3749
4307
  super();
3750
4308
  this.enable = enable;
3751
4309
  this.scratchChange = scratchChange;
3752
4310
  this.stackChange = stackChange;
4311
+ this.stateChange = stateChange;
3753
4312
 
3754
4313
  this.attribute_map = {
3755
4314
  enable: 'enable',
3756
4315
  scratchChange: 'scratch-change',
3757
4316
  stackChange: 'stack-change',
4317
+ stateChange: 'state-change',
3758
4318
  };
3759
4319
  }
3760
4320
 
@@ -3765,6 +4325,7 @@ export class SimulateTraceConfig extends BaseModel {
3765
4325
  enable: data['enable'],
3766
4326
  scratchChange: data['scratch-change'],
3767
4327
  stackChange: data['stack-change'],
4328
+ stateChange: data['state-change'],
3768
4329
  });
3769
4330
  /* eslint-enable dot-notation */
3770
4331
  }
@@ -3803,6 +4364,19 @@ export class SimulateTransactionGroupResult extends BaseModel {
3803
4364
  */
3804
4365
  public failureMessage?: string;
3805
4366
 
4367
+ /**
4368
+ * These are resources that were accessed by this group that would normally have
4369
+ * caused failure, but were allowed in simulation. Depending on where this object
4370
+ * is in the response, the unnamed resources it contains may or may not qualify for
4371
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
4372
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
4373
+ * they do not qualify. In order to make this group valid for actual submission,
4374
+ * resources that qualify for group sharing can be made available by any
4375
+ * transaction of the group; otherwise, resources must be placed in the same
4376
+ * transaction which accessed them.
4377
+ */
4378
+ public unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
4379
+
3806
4380
  /**
3807
4381
  * Creates a new `SimulateTransactionGroupResult` object.
3808
4382
  * @param txnResults - Simulation result for individual transactions
@@ -3814,6 +4388,15 @@ export class SimulateTransactionGroupResult extends BaseModel {
3814
4388
  * indicate deeper inner transactions.
3815
4389
  * @param failureMessage - If present, indicates that the transaction group failed and specifies why that
3816
4390
  * happened
4391
+ * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
4392
+ * caused failure, but were allowed in simulation. Depending on where this object
4393
+ * is in the response, the unnamed resources it contains may or may not qualify for
4394
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
4395
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
4396
+ * they do not qualify. In order to make this group valid for actual submission,
4397
+ * resources that qualify for group sharing can be made available by any
4398
+ * transaction of the group; otherwise, resources must be placed in the same
4399
+ * transaction which accessed them.
3817
4400
  */
3818
4401
  constructor({
3819
4402
  txnResults,
@@ -3821,12 +4404,14 @@ export class SimulateTransactionGroupResult extends BaseModel {
3821
4404
  appBudgetConsumed,
3822
4405
  failedAt,
3823
4406
  failureMessage,
4407
+ unnamedResourcesAccessed,
3824
4408
  }: {
3825
4409
  txnResults: SimulateTransactionResult[];
3826
4410
  appBudgetAdded?: number | bigint;
3827
4411
  appBudgetConsumed?: number | bigint;
3828
4412
  failedAt?: (number | bigint)[];
3829
4413
  failureMessage?: string;
4414
+ unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
3830
4415
  }) {
3831
4416
  super();
3832
4417
  this.txnResults = txnResults;
@@ -3834,6 +4419,7 @@ export class SimulateTransactionGroupResult extends BaseModel {
3834
4419
  this.appBudgetConsumed = appBudgetConsumed;
3835
4420
  this.failedAt = failedAt;
3836
4421
  this.failureMessage = failureMessage;
4422
+ this.unnamedResourcesAccessed = unnamedResourcesAccessed;
3837
4423
 
3838
4424
  this.attribute_map = {
3839
4425
  txnResults: 'txn-results',
@@ -3841,6 +4427,7 @@ export class SimulateTransactionGroupResult extends BaseModel {
3841
4427
  appBudgetConsumed: 'app-budget-consumed',
3842
4428
  failedAt: 'failed-at',
3843
4429
  failureMessage: 'failure-message',
4430
+ unnamedResourcesAccessed: 'unnamed-resources-accessed',
3844
4431
  };
3845
4432
  }
3846
4433
 
@@ -3861,6 +4448,12 @@ export class SimulateTransactionGroupResult extends BaseModel {
3861
4448
  appBudgetConsumed: data['app-budget-consumed'],
3862
4449
  failedAt: data['failed-at'],
3863
4450
  failureMessage: data['failure-message'],
4451
+ unnamedResourcesAccessed:
4452
+ typeof data['unnamed-resources-accessed'] !== 'undefined'
4453
+ ? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(
4454
+ data['unnamed-resources-accessed']
4455
+ )
4456
+ : undefined,
3864
4457
  });
3865
4458
  /* eslint-enable dot-notation */
3866
4459
  }
@@ -3893,6 +4486,19 @@ export class SimulateTransactionResult extends BaseModel {
3893
4486
  */
3894
4487
  public logicSigBudgetConsumed?: number | bigint;
3895
4488
 
4489
+ /**
4490
+ * These are resources that were accessed by this group that would normally have
4491
+ * caused failure, but were allowed in simulation. Depending on where this object
4492
+ * is in the response, the unnamed resources it contains may or may not qualify for
4493
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
4494
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
4495
+ * they do not qualify. In order to make this group valid for actual submission,
4496
+ * resources that qualify for group sharing can be made available by any
4497
+ * transaction of the group; otherwise, resources must be placed in the same
4498
+ * transaction which accessed them.
4499
+ */
4500
+ public unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
4501
+
3896
4502
  /**
3897
4503
  * Creates a new `SimulateTransactionResult` object.
3898
4504
  * @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
@@ -3902,29 +4508,42 @@ export class SimulateTransactionResult extends BaseModel {
3902
4508
  * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
3903
4509
  * call trace in a recursive way.
3904
4510
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
4511
+ * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
4512
+ * caused failure, but were allowed in simulation. Depending on where this object
4513
+ * is in the response, the unnamed resources it contains may or may not qualify for
4514
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
4515
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
4516
+ * they do not qualify. In order to make this group valid for actual submission,
4517
+ * resources that qualify for group sharing can be made available by any
4518
+ * transaction of the group; otherwise, resources must be placed in the same
4519
+ * transaction which accessed them.
3905
4520
  */
3906
4521
  constructor({
3907
4522
  txnResult,
3908
4523
  appBudgetConsumed,
3909
4524
  execTrace,
3910
4525
  logicSigBudgetConsumed,
4526
+ unnamedResourcesAccessed,
3911
4527
  }: {
3912
4528
  txnResult: PendingTransactionResponse;
3913
4529
  appBudgetConsumed?: number | bigint;
3914
4530
  execTrace?: SimulationTransactionExecTrace;
3915
4531
  logicSigBudgetConsumed?: number | bigint;
4532
+ unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
3916
4533
  }) {
3917
4534
  super();
3918
4535
  this.txnResult = txnResult;
3919
4536
  this.appBudgetConsumed = appBudgetConsumed;
3920
4537
  this.execTrace = execTrace;
3921
4538
  this.logicSigBudgetConsumed = logicSigBudgetConsumed;
4539
+ this.unnamedResourcesAccessed = unnamedResourcesAccessed;
3922
4540
 
3923
4541
  this.attribute_map = {
3924
4542
  txnResult: 'txn-result',
3925
4543
  appBudgetConsumed: 'app-budget-consumed',
3926
4544
  execTrace: 'exec-trace',
3927
4545
  logicSigBudgetConsumed: 'logic-sig-budget-consumed',
4546
+ unnamedResourcesAccessed: 'unnamed-resources-accessed',
3928
4547
  };
3929
4548
  }
3930
4549
 
@@ -3949,6 +4568,147 @@ export class SimulateTransactionResult extends BaseModel {
3949
4568
  )
3950
4569
  : undefined,
3951
4570
  logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
4571
+ unnamedResourcesAccessed:
4572
+ typeof data['unnamed-resources-accessed'] !== 'undefined'
4573
+ ? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(
4574
+ data['unnamed-resources-accessed']
4575
+ )
4576
+ : undefined,
4577
+ });
4578
+ /* eslint-enable dot-notation */
4579
+ }
4580
+ }
4581
+
4582
+ /**
4583
+ * These are resources that were accessed by this group that would normally have
4584
+ * caused failure, but were allowed in simulation. Depending on where this object
4585
+ * is in the response, the unnamed resources it contains may or may not qualify for
4586
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
4587
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
4588
+ * they do not qualify. In order to make this group valid for actual submission,
4589
+ * resources that qualify for group sharing can be made available by any
4590
+ * transaction of the group; otherwise, resources must be placed in the same
4591
+ * transaction which accessed them.
4592
+ */
4593
+ export class SimulateUnnamedResourcesAccessed extends BaseModel {
4594
+ /**
4595
+ * The unnamed accounts that were referenced. The order of this array is arbitrary.
4596
+ */
4597
+ public accounts?: string[];
4598
+
4599
+ /**
4600
+ * The unnamed application local states that were referenced. The order of this
4601
+ * array is arbitrary.
4602
+ */
4603
+ public appLocals?: ApplicationLocalReference[];
4604
+
4605
+ /**
4606
+ * The unnamed applications that were referenced. The order of this array is
4607
+ * arbitrary.
4608
+ */
4609
+ public apps?: (number | bigint)[];
4610
+
4611
+ /**
4612
+ * The unnamed asset holdings that were referenced. The order of this array is
4613
+ * arbitrary.
4614
+ */
4615
+ public assetHoldings?: AssetHoldingReference[];
4616
+
4617
+ /**
4618
+ * The unnamed assets that were referenced. The order of this array is arbitrary.
4619
+ */
4620
+ public assets?: (number | bigint)[];
4621
+
4622
+ /**
4623
+ * The unnamed boxes that were referenced. The order of this array is arbitrary.
4624
+ */
4625
+ public boxes?: BoxReference[];
4626
+
4627
+ /**
4628
+ * The number of extra box references used to increase the IO budget. This is in
4629
+ * addition to the references defined in the input transaction group and any
4630
+ * referenced to unnamed boxes.
4631
+ */
4632
+ public extraBoxRefs?: number | bigint;
4633
+
4634
+ /**
4635
+ * Creates a new `SimulateUnnamedResourcesAccessed` object.
4636
+ * @param accounts - The unnamed accounts that were referenced. The order of this array is arbitrary.
4637
+ * @param appLocals - The unnamed application local states that were referenced. The order of this
4638
+ * array is arbitrary.
4639
+ * @param apps - The unnamed applications that were referenced. The order of this array is
4640
+ * arbitrary.
4641
+ * @param assetHoldings - The unnamed asset holdings that were referenced. The order of this array is
4642
+ * arbitrary.
4643
+ * @param assets - The unnamed assets that were referenced. The order of this array is arbitrary.
4644
+ * @param boxes - The unnamed boxes that were referenced. The order of this array is arbitrary.
4645
+ * @param extraBoxRefs - The number of extra box references used to increase the IO budget. This is in
4646
+ * addition to the references defined in the input transaction group and any
4647
+ * referenced to unnamed boxes.
4648
+ */
4649
+ constructor({
4650
+ accounts,
4651
+ appLocals,
4652
+ apps,
4653
+ assetHoldings,
4654
+ assets,
4655
+ boxes,
4656
+ extraBoxRefs,
4657
+ }: {
4658
+ accounts?: string[];
4659
+ appLocals?: ApplicationLocalReference[];
4660
+ apps?: (number | bigint)[];
4661
+ assetHoldings?: AssetHoldingReference[];
4662
+ assets?: (number | bigint)[];
4663
+ boxes?: BoxReference[];
4664
+ extraBoxRefs?: number | bigint;
4665
+ }) {
4666
+ super();
4667
+ this.accounts = accounts;
4668
+ this.appLocals = appLocals;
4669
+ this.apps = apps;
4670
+ this.assetHoldings = assetHoldings;
4671
+ this.assets = assets;
4672
+ this.boxes = boxes;
4673
+ this.extraBoxRefs = extraBoxRefs;
4674
+
4675
+ this.attribute_map = {
4676
+ accounts: 'accounts',
4677
+ appLocals: 'app-locals',
4678
+ apps: 'apps',
4679
+ assetHoldings: 'asset-holdings',
4680
+ assets: 'assets',
4681
+ boxes: 'boxes',
4682
+ extraBoxRefs: 'extra-box-refs',
4683
+ };
4684
+ }
4685
+
4686
+ // eslint-disable-next-line camelcase
4687
+ static from_obj_for_encoding(
4688
+ data: Record<string, any>
4689
+ ): SimulateUnnamedResourcesAccessed {
4690
+ /* eslint-disable dot-notation */
4691
+ return new SimulateUnnamedResourcesAccessed({
4692
+ accounts: data['accounts'],
4693
+ appLocals:
4694
+ typeof data['app-locals'] !== 'undefined'
4695
+ ? data['app-locals'].map(
4696
+ ApplicationLocalReference.from_obj_for_encoding
4697
+ )
4698
+ : undefined,
4699
+ apps: data['apps'],
4700
+ assetHoldings:
4701
+ typeof data['asset-holdings'] !== 'undefined'
4702
+ ? data['asset-holdings'].map(
4703
+ AssetHoldingReference.from_obj_for_encoding
4704
+ )
4705
+ : undefined,
4706
+ assets: data['assets'],
4707
+ boxes:
4708
+ typeof data['boxes'] !== 'undefined'
4709
+ ? data['boxes'].map(BoxReference.from_obj_for_encoding)
4710
+ : undefined,
4711
+ extraBoxRefs: data['extra-box-refs'],
3952
4712
  });
3953
4713
  /* eslint-enable dot-notation */
3954
4714
  }
@@ -3966,6 +4726,11 @@ export class SimulationEvalOverrides extends BaseModel {
3966
4726
  */
3967
4727
  public allowEmptySignatures?: boolean;
3968
4728
 
4729
+ /**
4730
+ * If true, allows access to unnamed resources during simulation.
4731
+ */
4732
+ public allowUnnamedResources?: boolean;
4733
+
3969
4734
  /**
3970
4735
  * The extra opcode budget added to each transaction group during simulation
3971
4736
  */
@@ -3985,29 +4750,34 @@ export class SimulationEvalOverrides extends BaseModel {
3985
4750
  * Creates a new `SimulationEvalOverrides` object.
3986
4751
  * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
3987
4752
  * were properly signed.
4753
+ * @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
3988
4754
  * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
3989
4755
  * @param maxLogCalls - The maximum log calls one can make during simulation
3990
4756
  * @param maxLogSize - The maximum byte number to log during simulation
3991
4757
  */
3992
4758
  constructor({
3993
4759
  allowEmptySignatures,
4760
+ allowUnnamedResources,
3994
4761
  extraOpcodeBudget,
3995
4762
  maxLogCalls,
3996
4763
  maxLogSize,
3997
4764
  }: {
3998
4765
  allowEmptySignatures?: boolean;
4766
+ allowUnnamedResources?: boolean;
3999
4767
  extraOpcodeBudget?: number | bigint;
4000
4768
  maxLogCalls?: number | bigint;
4001
4769
  maxLogSize?: number | bigint;
4002
4770
  }) {
4003
4771
  super();
4004
4772
  this.allowEmptySignatures = allowEmptySignatures;
4773
+ this.allowUnnamedResources = allowUnnamedResources;
4005
4774
  this.extraOpcodeBudget = extraOpcodeBudget;
4006
4775
  this.maxLogCalls = maxLogCalls;
4007
4776
  this.maxLogSize = maxLogSize;
4008
4777
 
4009
4778
  this.attribute_map = {
4010
4779
  allowEmptySignatures: 'allow-empty-signatures',
4780
+ allowUnnamedResources: 'allow-unnamed-resources',
4011
4781
  extraOpcodeBudget: 'extra-opcode-budget',
4012
4782
  maxLogCalls: 'max-log-calls',
4013
4783
  maxLogSize: 'max-log-size',
@@ -4021,6 +4791,7 @@ export class SimulationEvalOverrides extends BaseModel {
4021
4791
  /* eslint-disable dot-notation */
4022
4792
  return new SimulationEvalOverrides({
4023
4793
  allowEmptySignatures: data['allow-empty-signatures'],
4794
+ allowUnnamedResources: data['allow-unnamed-resources'],
4024
4795
  extraOpcodeBudget: data['extra-opcode-budget'],
4025
4796
  maxLogCalls: data['max-log-calls'],
4026
4797
  maxLogSize: data['max-log-size'],
@@ -4058,6 +4829,11 @@ export class SimulationOpcodeTraceUnit extends BaseModel {
4058
4829
  */
4059
4830
  public stackPopCount?: number | bigint;
4060
4831
 
4832
+ /**
4833
+ * The operations against the current application's states.
4834
+ */
4835
+ public stateChanges?: ApplicationStateOperation[];
4836
+
4061
4837
  /**
4062
4838
  * Creates a new `SimulationOpcodeTraceUnit` object.
4063
4839
  * @param pc - The program counter of the current opcode being evaluated.
@@ -4065,6 +4841,7 @@ export class SimulationOpcodeTraceUnit extends BaseModel {
4065
4841
  * @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
4066
4842
  * @param stackAdditions - The values added by this opcode to the stack.
4067
4843
  * @param stackPopCount - The number of deleted stack values by this opcode.
4844
+ * @param stateChanges - The operations against the current application's states.
4068
4845
  */
4069
4846
  constructor({
4070
4847
  pc,
@@ -4072,12 +4849,14 @@ export class SimulationOpcodeTraceUnit extends BaseModel {
4072
4849
  spawnedInners,
4073
4850
  stackAdditions,
4074
4851
  stackPopCount,
4852
+ stateChanges,
4075
4853
  }: {
4076
4854
  pc: number | bigint;
4077
4855
  scratchChanges?: ScratchChange[];
4078
4856
  spawnedInners?: (number | bigint)[];
4079
4857
  stackAdditions?: AvmValue[];
4080
4858
  stackPopCount?: number | bigint;
4859
+ stateChanges?: ApplicationStateOperation[];
4081
4860
  }) {
4082
4861
  super();
4083
4862
  this.pc = pc;
@@ -4085,6 +4864,7 @@ export class SimulationOpcodeTraceUnit extends BaseModel {
4085
4864
  this.spawnedInners = spawnedInners;
4086
4865
  this.stackAdditions = stackAdditions;
4087
4866
  this.stackPopCount = stackPopCount;
4867
+ this.stateChanges = stateChanges;
4088
4868
 
4089
4869
  this.attribute_map = {
4090
4870
  pc: 'pc',
@@ -4092,6 +4872,7 @@ export class SimulationOpcodeTraceUnit extends BaseModel {
4092
4872
  spawnedInners: 'spawned-inners',
4093
4873
  stackAdditions: 'stack-additions',
4094
4874
  stackPopCount: 'stack-pop-count',
4875
+ stateChanges: 'state-changes',
4095
4876
  };
4096
4877
  }
4097
4878
 
@@ -4114,6 +4895,12 @@ export class SimulationOpcodeTraceUnit extends BaseModel {
4114
4895
  ? data['stack-additions'].map(AvmValue.from_obj_for_encoding)
4115
4896
  : undefined,
4116
4897
  stackPopCount: data['stack-pop-count'],
4898
+ stateChanges:
4899
+ typeof data['state-changes'] !== 'undefined'
4900
+ ? data['state-changes'].map(
4901
+ ApplicationStateOperation.from_obj_for_encoding
4902
+ )
4903
+ : undefined,
4117
4904
  });
4118
4905
  /* eslint-enable dot-notation */
4119
4906
  }
@@ -4124,11 +4911,21 @@ export class SimulationOpcodeTraceUnit extends BaseModel {
4124
4911
  * call trace in a recursive way.
4125
4912
  */
4126
4913
  export class SimulationTransactionExecTrace extends BaseModel {
4914
+ /**
4915
+ * SHA512_256 hash digest of the approval program executed in transaction.
4916
+ */
4917
+ public approvalProgramHash?: Uint8Array;
4918
+
4127
4919
  /**
4128
4920
  * Program trace that contains a trace of opcode effects in an approval program.
4129
4921
  */
4130
4922
  public approvalProgramTrace?: SimulationOpcodeTraceUnit[];
4131
4923
 
4924
+ /**
4925
+ * SHA512_256 hash digest of the clear state program executed in transaction.
4926
+ */
4927
+ public clearStateProgramHash?: Uint8Array;
4928
+
4132
4929
  /**
4133
4930
  * Program trace that contains a trace of opcode effects in a clear state program.
4134
4931
  */
@@ -4140,6 +4937,11 @@ export class SimulationTransactionExecTrace extends BaseModel {
4140
4937
  */
4141
4938
  public innerTrace?: SimulationTransactionExecTrace[];
4142
4939
 
4940
+ /**
4941
+ * SHA512_256 hash digest of the logic sig executed in transaction.
4942
+ */
4943
+ public logicSigHash?: Uint8Array;
4944
+
4143
4945
  /**
4144
4946
  * Program trace that contains a trace of opcode effects in a logic sig.
4145
4947
  */
@@ -4147,33 +4949,57 @@ export class SimulationTransactionExecTrace extends BaseModel {
4147
4949
 
4148
4950
  /**
4149
4951
  * Creates a new `SimulationTransactionExecTrace` object.
4952
+ * @param approvalProgramHash - SHA512_256 hash digest of the approval program executed in transaction.
4150
4953
  * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
4954
+ * @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction.
4151
4955
  * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
4152
4956
  * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
4153
4957
  * any inner transactions executed.
4958
+ * @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction.
4154
4959
  * @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
4155
4960
  */
4156
4961
  constructor({
4962
+ approvalProgramHash,
4157
4963
  approvalProgramTrace,
4964
+ clearStateProgramHash,
4158
4965
  clearStateProgramTrace,
4159
4966
  innerTrace,
4967
+ logicSigHash,
4160
4968
  logicSigTrace,
4161
4969
  }: {
4970
+ approvalProgramHash?: string | Uint8Array;
4162
4971
  approvalProgramTrace?: SimulationOpcodeTraceUnit[];
4972
+ clearStateProgramHash?: string | Uint8Array;
4163
4973
  clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
4164
4974
  innerTrace?: SimulationTransactionExecTrace[];
4975
+ logicSigHash?: string | Uint8Array;
4165
4976
  logicSigTrace?: SimulationOpcodeTraceUnit[];
4166
4977
  }) {
4167
4978
  super();
4979
+ this.approvalProgramHash =
4980
+ typeof approvalProgramHash === 'string'
4981
+ ? new Uint8Array(Buffer.from(approvalProgramHash, 'base64'))
4982
+ : approvalProgramHash;
4168
4983
  this.approvalProgramTrace = approvalProgramTrace;
4984
+ this.clearStateProgramHash =
4985
+ typeof clearStateProgramHash === 'string'
4986
+ ? new Uint8Array(Buffer.from(clearStateProgramHash, 'base64'))
4987
+ : clearStateProgramHash;
4169
4988
  this.clearStateProgramTrace = clearStateProgramTrace;
4170
4989
  this.innerTrace = innerTrace;
4990
+ this.logicSigHash =
4991
+ typeof logicSigHash === 'string'
4992
+ ? new Uint8Array(Buffer.from(logicSigHash, 'base64'))
4993
+ : logicSigHash;
4171
4994
  this.logicSigTrace = logicSigTrace;
4172
4995
 
4173
4996
  this.attribute_map = {
4997
+ approvalProgramHash: 'approval-program-hash',
4174
4998
  approvalProgramTrace: 'approval-program-trace',
4999
+ clearStateProgramHash: 'clear-state-program-hash',
4175
5000
  clearStateProgramTrace: 'clear-state-program-trace',
4176
5001
  innerTrace: 'inner-trace',
5002
+ logicSigHash: 'logic-sig-hash',
4177
5003
  logicSigTrace: 'logic-sig-trace',
4178
5004
  };
4179
5005
  }
@@ -4184,12 +5010,14 @@ export class SimulationTransactionExecTrace extends BaseModel {
4184
5010
  ): SimulationTransactionExecTrace {
4185
5011
  /* eslint-disable dot-notation */
4186
5012
  return new SimulationTransactionExecTrace({
5013
+ approvalProgramHash: data['approval-program-hash'],
4187
5014
  approvalProgramTrace:
4188
5015
  typeof data['approval-program-trace'] !== 'undefined'
4189
5016
  ? data['approval-program-trace'].map(
4190
5017
  SimulationOpcodeTraceUnit.from_obj_for_encoding
4191
5018
  )
4192
5019
  : undefined,
5020
+ clearStateProgramHash: data['clear-state-program-hash'],
4193
5021
  clearStateProgramTrace:
4194
5022
  typeof data['clear-state-program-trace'] !== 'undefined'
4195
5023
  ? data['clear-state-program-trace'].map(
@@ -4202,6 +5030,7 @@ export class SimulationTransactionExecTrace extends BaseModel {
4202
5030
  SimulationTransactionExecTrace.from_obj_for_encoding
4203
5031
  )
4204
5032
  : undefined,
5033
+ logicSigHash: data['logic-sig-hash'],
4205
5034
  logicSigTrace:
4206
5035
  typeof data['logic-sig-trace'] !== 'undefined'
4207
5036
  ? data['logic-sig-trace'].map(