algosdk 2.5.0 → 2.7.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 (32) 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 +3 -4
  5. package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/algod.js +17 -0
  7. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  8. package/dist/cjs/client/v2/algod/getBlockTxids.js +19 -0
  9. package/dist/cjs/client/v2/algod/getBlockTxids.js.map +1 -0
  10. package/dist/cjs/client/v2/algod/models/types.js +484 -11
  11. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  12. package/dist/cjs/signer.js +6 -1
  13. package/dist/cjs/signer.js.map +1 -1
  14. package/dist/esm/client/urlTokenBaseHTTPClient.js +0 -1
  15. package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
  16. package/dist/esm/client/v2/algod/algod.js +17 -0
  17. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  18. package/dist/esm/client/v2/algod/getBlockTxids.js +13 -0
  19. package/dist/esm/client/v2/algod/getBlockTxids.js.map +1 -0
  20. package/dist/esm/client/v2/algod/models/types.js +472 -9
  21. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  22. package/dist/esm/signer.js +6 -1
  23. package/dist/esm/signer.js.map +1 -1
  24. package/dist/types/client/v2/algod/algod.d.ts +15 -0
  25. package/dist/types/client/v2/algod/getBlockTxids.d.ts +8 -0
  26. package/dist/types/client/v2/algod/models/types.d.ts +418 -12
  27. package/package.json +2 -3
  28. package/src/client/urlTokenBaseHTTPClient.ts +0 -1
  29. package/src/client/v2/algod/algod.ts +18 -0
  30. package/src/client/v2/algod/getBlockTxids.ts +18 -0
  31. package/src/client/v2/algod/models/types.ts +831 -2
  32. package/src/signer.ts +5 -1
@@ -6,8 +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.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;
9
+ exports.SimulateRequestTransactionGroup = exports.SimulateRequest = exports.SimulateInitialStates = 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.BoxReference = exports.BoxDescriptor = exports.Box = exports.BlockTxidsResponse = exports.BlockResponse = exports.BlockHashResponse = exports.AvmValue = exports.AvmKeyValue = exports.AssetParams = exports.AssetHoldingReference = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationStateOperation = exports.ApplicationParams = exports.ApplicationLocalState = exports.ApplicationLocalReference = exports.ApplicationKVStorage = exports.ApplicationInitialStates = 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 = exports.StateProofMessage = exports.StateProof = exports.SimulationTransactionExecTrace = exports.SimulationOpcodeTraceUnit = exports.SimulationEvalOverrides = exports.SimulateUnnamedResourcesAccessed = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateTraceConfig = exports.SimulateResponse = void 0;
11
11
  /* eslint-disable no-use-before-define */
12
12
  const buffer_1 = require("buffer");
13
13
  const basemodel_1 = __importDefault(require("../../basemodel"));
@@ -410,6 +410,116 @@ class Application extends basemodel_1.default {
410
410
  }
411
411
  }
412
412
  exports.Application = Application;
413
+ /**
414
+ * An application's initial global/local/box states that were accessed during
415
+ * simulation.
416
+ */
417
+ class ApplicationInitialStates extends basemodel_1.default {
418
+ /**
419
+ * Creates a new `ApplicationInitialStates` object.
420
+ * @param id - Application index.
421
+ * @param appBoxes - An application's global/local/box state.
422
+ * @param appGlobals - An application's global/local/box state.
423
+ * @param appLocals - An application's initial local states tied to different accounts.
424
+ */
425
+ constructor({ id, appBoxes, appGlobals, appLocals, }) {
426
+ super();
427
+ this.id = id;
428
+ this.appBoxes = appBoxes;
429
+ this.appGlobals = appGlobals;
430
+ this.appLocals = appLocals;
431
+ this.attribute_map = {
432
+ id: 'id',
433
+ appBoxes: 'app-boxes',
434
+ appGlobals: 'app-globals',
435
+ appLocals: 'app-locals',
436
+ };
437
+ }
438
+ // eslint-disable-next-line camelcase
439
+ static from_obj_for_encoding(data) {
440
+ /* eslint-disable dot-notation */
441
+ if (typeof data['id'] === 'undefined')
442
+ throw new Error(`Response is missing required field 'id': ${data}`);
443
+ return new ApplicationInitialStates({
444
+ id: data['id'],
445
+ appBoxes: typeof data['app-boxes'] !== 'undefined'
446
+ ? ApplicationKVStorage.from_obj_for_encoding(data['app-boxes'])
447
+ : undefined,
448
+ appGlobals: typeof data['app-globals'] !== 'undefined'
449
+ ? ApplicationKVStorage.from_obj_for_encoding(data['app-globals'])
450
+ : undefined,
451
+ appLocals: typeof data['app-locals'] !== 'undefined'
452
+ ? data['app-locals'].map(ApplicationKVStorage.from_obj_for_encoding)
453
+ : undefined,
454
+ });
455
+ /* eslint-enable dot-notation */
456
+ }
457
+ }
458
+ exports.ApplicationInitialStates = ApplicationInitialStates;
459
+ /**
460
+ * An application's global/local/box state.
461
+ */
462
+ class ApplicationKVStorage extends basemodel_1.default {
463
+ /**
464
+ * Creates a new `ApplicationKVStorage` object.
465
+ * @param kvs - Key-Value pairs representing application states.
466
+ * @param account - The address of the account associated with the local state.
467
+ */
468
+ constructor({ kvs, account }) {
469
+ super();
470
+ this.kvs = kvs;
471
+ this.account = account;
472
+ this.attribute_map = {
473
+ kvs: 'kvs',
474
+ account: 'account',
475
+ };
476
+ }
477
+ // eslint-disable-next-line camelcase
478
+ static from_obj_for_encoding(data) {
479
+ /* eslint-disable dot-notation */
480
+ if (!Array.isArray(data['kvs']))
481
+ throw new Error(`Response is missing required array field 'kvs': ${data}`);
482
+ return new ApplicationKVStorage({
483
+ kvs: data['kvs'].map(AvmKeyValue.from_obj_for_encoding),
484
+ account: data['account'],
485
+ });
486
+ /* eslint-enable dot-notation */
487
+ }
488
+ }
489
+ exports.ApplicationKVStorage = ApplicationKVStorage;
490
+ /**
491
+ * References an account's local state for an application.
492
+ */
493
+ class ApplicationLocalReference extends basemodel_1.default {
494
+ /**
495
+ * Creates a new `ApplicationLocalReference` object.
496
+ * @param account - Address of the account with the local state.
497
+ * @param app - Application ID of the local state application.
498
+ */
499
+ constructor({ account, app }) {
500
+ super();
501
+ this.account = account;
502
+ this.app = app;
503
+ this.attribute_map = {
504
+ account: 'account',
505
+ app: 'app',
506
+ };
507
+ }
508
+ // eslint-disable-next-line camelcase
509
+ static from_obj_for_encoding(data) {
510
+ /* eslint-disable dot-notation */
511
+ if (typeof data['account'] === 'undefined')
512
+ throw new Error(`Response is missing required field 'account': ${data}`);
513
+ if (typeof data['app'] === 'undefined')
514
+ throw new Error(`Response is missing required field 'app': ${data}`);
515
+ return new ApplicationLocalReference({
516
+ account: data['account'],
517
+ app: data['app'],
518
+ });
519
+ /* eslint-enable dot-notation */
520
+ }
521
+ }
522
+ exports.ApplicationLocalReference = ApplicationLocalReference;
413
523
  /**
414
524
  * Stores local state associated with an application.
415
525
  */
@@ -517,6 +627,60 @@ class ApplicationParams extends basemodel_1.default {
517
627
  }
518
628
  }
519
629
  exports.ApplicationParams = ApplicationParams;
630
+ /**
631
+ * An operation against an application's global/local/box state.
632
+ */
633
+ class ApplicationStateOperation extends basemodel_1.default {
634
+ /**
635
+ * Creates a new `ApplicationStateOperation` object.
636
+ * @param appStateType - Type of application state. Value `g` is **global state**, `l` is **local
637
+ * state**, `b` is **boxes**.
638
+ * @param key - The key (name) of the global/local/box state.
639
+ * @param operation - Operation type. Value `w` is **write**, `d` is **delete**.
640
+ * @param account - For local state changes, the address of the account associated with the local
641
+ * state.
642
+ * @param newValue - Represents an AVM value.
643
+ */
644
+ constructor({ appStateType, key, operation, account, newValue, }) {
645
+ super();
646
+ this.appStateType = appStateType;
647
+ this.key =
648
+ typeof key === 'string'
649
+ ? new Uint8Array(buffer_1.Buffer.from(key, 'base64'))
650
+ : key;
651
+ this.operation = operation;
652
+ this.account = account;
653
+ this.newValue = newValue;
654
+ this.attribute_map = {
655
+ appStateType: 'app-state-type',
656
+ key: 'key',
657
+ operation: 'operation',
658
+ account: 'account',
659
+ newValue: 'new-value',
660
+ };
661
+ }
662
+ // eslint-disable-next-line camelcase
663
+ static from_obj_for_encoding(data) {
664
+ /* eslint-disable dot-notation */
665
+ if (typeof data['app-state-type'] === 'undefined')
666
+ throw new Error(`Response is missing required field 'app-state-type': ${data}`);
667
+ if (typeof data['key'] === 'undefined')
668
+ throw new Error(`Response is missing required field 'key': ${data}`);
669
+ if (typeof data['operation'] === 'undefined')
670
+ throw new Error(`Response is missing required field 'operation': ${data}`);
671
+ return new ApplicationStateOperation({
672
+ appStateType: data['app-state-type'],
673
+ key: data['key'],
674
+ operation: data['operation'],
675
+ account: data['account'],
676
+ newValue: typeof data['new-value'] !== 'undefined'
677
+ ? AvmValue.from_obj_for_encoding(data['new-value'])
678
+ : undefined,
679
+ });
680
+ /* eslint-enable dot-notation */
681
+ }
682
+ }
683
+ exports.ApplicationStateOperation = ApplicationStateOperation;
520
684
  /**
521
685
  * Specifies maximums on the number of each type that may be stored.
522
686
  */
@@ -627,6 +791,39 @@ class AssetHolding extends basemodel_1.default {
627
791
  }
628
792
  }
629
793
  exports.AssetHolding = AssetHolding;
794
+ /**
795
+ * References an asset held by an account.
796
+ */
797
+ class AssetHoldingReference extends basemodel_1.default {
798
+ /**
799
+ * Creates a new `AssetHoldingReference` object.
800
+ * @param account - Address of the account holding the asset.
801
+ * @param asset - Asset ID of the holding.
802
+ */
803
+ constructor({ account, asset }) {
804
+ super();
805
+ this.account = account;
806
+ this.asset = asset;
807
+ this.attribute_map = {
808
+ account: 'account',
809
+ asset: 'asset',
810
+ };
811
+ }
812
+ // eslint-disable-next-line camelcase
813
+ static from_obj_for_encoding(data) {
814
+ /* eslint-disable dot-notation */
815
+ if (typeof data['account'] === 'undefined')
816
+ throw new Error(`Response is missing required field 'account': ${data}`);
817
+ if (typeof data['asset'] === 'undefined')
818
+ throw new Error(`Response is missing required field 'asset': ${data}`);
819
+ return new AssetHoldingReference({
820
+ account: data['account'],
821
+ asset: data['asset'],
822
+ });
823
+ /* eslint-enable dot-notation */
824
+ }
825
+ }
826
+ exports.AssetHoldingReference = AssetHoldingReference;
630
827
  /**
631
828
  * AssetParams specifies the parameters for an asset.
632
829
  * (apar) when part of an AssetConfig transaction.
@@ -740,6 +937,42 @@ class AssetParams extends basemodel_1.default {
740
937
  }
741
938
  }
742
939
  exports.AssetParams = AssetParams;
940
+ /**
941
+ * Represents an AVM key-value pair in an application store.
942
+ */
943
+ class AvmKeyValue extends basemodel_1.default {
944
+ /**
945
+ * Creates a new `AvmKeyValue` object.
946
+ * @param key -
947
+ * @param value - Represents an AVM value.
948
+ */
949
+ constructor({ key, value }) {
950
+ super();
951
+ this.key =
952
+ typeof key === 'string'
953
+ ? new Uint8Array(buffer_1.Buffer.from(key, 'base64'))
954
+ : key;
955
+ this.value = value;
956
+ this.attribute_map = {
957
+ key: 'key',
958
+ value: 'value',
959
+ };
960
+ }
961
+ // eslint-disable-next-line camelcase
962
+ static from_obj_for_encoding(data) {
963
+ /* eslint-disable dot-notation */
964
+ if (typeof data['key'] === 'undefined')
965
+ throw new Error(`Response is missing required field 'key': ${data}`);
966
+ if (typeof data['value'] === 'undefined')
967
+ throw new Error(`Response is missing required field 'value': ${data}`);
968
+ return new AvmKeyValue({
969
+ key: data['key'],
970
+ value: AvmValue.from_obj_for_encoding(data['value']),
971
+ });
972
+ /* eslint-enable dot-notation */
973
+ }
974
+ }
975
+ exports.AvmKeyValue = AvmKeyValue;
743
976
  /**
744
977
  * Represents an AVM value.
745
978
  */
@@ -837,6 +1070,33 @@ class BlockResponse extends basemodel_1.default {
837
1070
  }
838
1071
  }
839
1072
  exports.BlockResponse = BlockResponse;
1073
+ /**
1074
+ * Top level transaction IDs in a block.
1075
+ */
1076
+ class BlockTxidsResponse extends basemodel_1.default {
1077
+ /**
1078
+ * Creates a new `BlockTxidsResponse` object.
1079
+ * @param blocktxids - Block transaction IDs.
1080
+ */
1081
+ constructor({ blocktxids }) {
1082
+ super();
1083
+ this.blocktxids = blocktxids;
1084
+ this.attribute_map = {
1085
+ blocktxids: 'blockTxids',
1086
+ };
1087
+ }
1088
+ // eslint-disable-next-line camelcase
1089
+ static from_obj_for_encoding(data) {
1090
+ /* eslint-disable dot-notation */
1091
+ if (!Array.isArray(data['blockTxids']))
1092
+ throw new Error(`Response is missing required array field 'blockTxids': ${data}`);
1093
+ return new BlockTxidsResponse({
1094
+ blocktxids: data['blockTxids'],
1095
+ });
1096
+ /* eslint-enable dot-notation */
1097
+ }
1098
+ }
1099
+ exports.BlockTxidsResponse = BlockTxidsResponse;
840
1100
  /**
841
1101
  * Box name and its content.
842
1102
  */
@@ -912,6 +1172,42 @@ class BoxDescriptor extends basemodel_1.default {
912
1172
  }
913
1173
  }
914
1174
  exports.BoxDescriptor = BoxDescriptor;
1175
+ /**
1176
+ * References a box of an application.
1177
+ */
1178
+ class BoxReference extends basemodel_1.default {
1179
+ /**
1180
+ * Creates a new `BoxReference` object.
1181
+ * @param app - Application ID which this box belongs to
1182
+ * @param name - Base64 encoded box name
1183
+ */
1184
+ constructor({ app, name, }) {
1185
+ super();
1186
+ this.app = app;
1187
+ this.name =
1188
+ typeof name === 'string'
1189
+ ? new Uint8Array(buffer_1.Buffer.from(name, 'base64'))
1190
+ : name;
1191
+ this.attribute_map = {
1192
+ app: 'app',
1193
+ name: 'name',
1194
+ };
1195
+ }
1196
+ // eslint-disable-next-line camelcase
1197
+ static from_obj_for_encoding(data) {
1198
+ /* eslint-disable dot-notation */
1199
+ if (typeof data['app'] === 'undefined')
1200
+ throw new Error(`Response is missing required field 'app': ${data}`);
1201
+ if (typeof data['name'] === 'undefined')
1202
+ throw new Error(`Response is missing required field 'name': ${data}`);
1203
+ return new BoxReference({
1204
+ app: data['app'],
1205
+ name: data['name'],
1206
+ });
1207
+ /* eslint-enable dot-notation */
1208
+ }
1209
+ }
1210
+ exports.BoxReference = BoxReference;
915
1211
  /**
916
1212
  * Box names of an application
917
1213
  */
@@ -1938,6 +2234,34 @@ class ScratchChange extends basemodel_1.default {
1938
2234
  }
1939
2235
  }
1940
2236
  exports.ScratchChange = ScratchChange;
2237
+ /**
2238
+ * Initial states of resources that were accessed during simulation.
2239
+ */
2240
+ class SimulateInitialStates extends basemodel_1.default {
2241
+ /**
2242
+ * Creates a new `SimulateInitialStates` object.
2243
+ * @param appInitialStates - The initial states of accessed application before simulation. The order of this
2244
+ * array is arbitrary.
2245
+ */
2246
+ constructor({ appInitialStates, }) {
2247
+ super();
2248
+ this.appInitialStates = appInitialStates;
2249
+ this.attribute_map = {
2250
+ appInitialStates: 'app-initial-states',
2251
+ };
2252
+ }
2253
+ // eslint-disable-next-line camelcase
2254
+ static from_obj_for_encoding(data) {
2255
+ /* eslint-disable dot-notation */
2256
+ return new SimulateInitialStates({
2257
+ appInitialStates: typeof data['app-initial-states'] !== 'undefined'
2258
+ ? data['app-initial-states'].map(ApplicationInitialStates.from_obj_for_encoding)
2259
+ : undefined,
2260
+ });
2261
+ /* eslint-enable dot-notation */
2262
+ }
2263
+ }
2264
+ exports.SimulateInitialStates = SimulateInitialStates;
1941
2265
  /**
1942
2266
  * Request type for simulation endpoint.
1943
2267
  */
@@ -1945,25 +2269,34 @@ class SimulateRequest extends basemodel_1.default {
1945
2269
  /**
1946
2270
  * Creates a new `SimulateRequest` object.
1947
2271
  * @param txnGroups - The transaction groups to simulate.
1948
- * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
2272
+ * @param allowEmptySignatures - Allows transactions without signatures to be simulated as if they had correct
1949
2273
  * signatures.
1950
2274
  * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
2275
+ * @param allowUnnamedResources - Allows access to unnamed resources during simulation.
1951
2276
  * @param execTraceConfig - An object that configures simulation execution trace.
1952
2277
  * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
2278
+ * @param round - If provided, specifies the round preceding the simulation. State changes through
2279
+ * this round will be used to run this simulation. Usually only the 4 most recent
2280
+ * rounds will be available (controlled by the node config value MaxAcctLookback).
2281
+ * If not specified, defaults to the latest available round.
1953
2282
  */
1954
- constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, execTraceConfig, extraOpcodeBudget, }) {
2283
+ constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, allowUnnamedResources, execTraceConfig, extraOpcodeBudget, round, }) {
1955
2284
  super();
1956
2285
  this.txnGroups = txnGroups;
1957
2286
  this.allowEmptySignatures = allowEmptySignatures;
1958
2287
  this.allowMoreLogging = allowMoreLogging;
2288
+ this.allowUnnamedResources = allowUnnamedResources;
1959
2289
  this.execTraceConfig = execTraceConfig;
1960
2290
  this.extraOpcodeBudget = extraOpcodeBudget;
2291
+ this.round = round;
1961
2292
  this.attribute_map = {
1962
2293
  txnGroups: 'txn-groups',
1963
2294
  allowEmptySignatures: 'allow-empty-signatures',
1964
2295
  allowMoreLogging: 'allow-more-logging',
2296
+ allowUnnamedResources: 'allow-unnamed-resources',
1965
2297
  execTraceConfig: 'exec-trace-config',
1966
2298
  extraOpcodeBudget: 'extra-opcode-budget',
2299
+ round: 'round',
1967
2300
  };
1968
2301
  }
1969
2302
  // eslint-disable-next-line camelcase
@@ -1975,10 +2308,12 @@ class SimulateRequest extends basemodel_1.default {
1975
2308
  txnGroups: data['txn-groups'].map(SimulateRequestTransactionGroup.from_obj_for_encoding),
1976
2309
  allowEmptySignatures: data['allow-empty-signatures'],
1977
2310
  allowMoreLogging: data['allow-more-logging'],
2311
+ allowUnnamedResources: data['allow-unnamed-resources'],
1978
2312
  execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
1979
2313
  ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
1980
2314
  : undefined,
1981
2315
  extraOpcodeBudget: data['extra-opcode-budget'],
2316
+ round: data['round'],
1982
2317
  });
1983
2318
  /* eslint-enable dot-notation */
1984
2319
  }
@@ -2025,20 +2360,23 @@ class SimulateResponse extends basemodel_1.default {
2025
2360
  * parameters is present, then evaluation parameters may differ from standard
2026
2361
  * evaluation in certain ways.
2027
2362
  * @param execTraceConfig - An object that configures simulation execution trace.
2363
+ * @param initialStates - Initial states of resources that were accessed during simulation.
2028
2364
  */
2029
- constructor({ lastRound, txnGroups, version, evalOverrides, execTraceConfig, }) {
2365
+ constructor({ lastRound, txnGroups, version, evalOverrides, execTraceConfig, initialStates, }) {
2030
2366
  super();
2031
2367
  this.lastRound = lastRound;
2032
2368
  this.txnGroups = txnGroups;
2033
2369
  this.version = version;
2034
2370
  this.evalOverrides = evalOverrides;
2035
2371
  this.execTraceConfig = execTraceConfig;
2372
+ this.initialStates = initialStates;
2036
2373
  this.attribute_map = {
2037
2374
  lastRound: 'last-round',
2038
2375
  txnGroups: 'txn-groups',
2039
2376
  version: 'version',
2040
2377
  evalOverrides: 'eval-overrides',
2041
2378
  execTraceConfig: 'exec-trace-config',
2379
+ initialStates: 'initial-states',
2042
2380
  };
2043
2381
  }
2044
2382
  // eslint-disable-next-line camelcase
@@ -2060,6 +2398,9 @@ class SimulateResponse extends basemodel_1.default {
2060
2398
  execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
2061
2399
  ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
2062
2400
  : undefined,
2401
+ initialStates: typeof data['initial-states'] !== 'undefined'
2402
+ ? SimulateInitialStates.from_obj_for_encoding(data['initial-states'])
2403
+ : undefined,
2063
2404
  });
2064
2405
  /* eslint-enable dot-notation */
2065
2406
  }
@@ -2076,16 +2417,20 @@ class SimulateTraceConfig extends basemodel_1.default {
2076
2417
  * trace during simulation.
2077
2418
  * @param stackChange - A boolean option enabling returning stack changes together with execution trace
2078
2419
  * during simulation.
2420
+ * @param stateChange - A boolean option enabling returning application state changes (global, local,
2421
+ * and box changes) with the execution trace during simulation.
2079
2422
  */
2080
- constructor({ enable, scratchChange, stackChange, }) {
2423
+ constructor({ enable, scratchChange, stackChange, stateChange, }) {
2081
2424
  super();
2082
2425
  this.enable = enable;
2083
2426
  this.scratchChange = scratchChange;
2084
2427
  this.stackChange = stackChange;
2428
+ this.stateChange = stateChange;
2085
2429
  this.attribute_map = {
2086
2430
  enable: 'enable',
2087
2431
  scratchChange: 'scratch-change',
2088
2432
  stackChange: 'stack-change',
2433
+ stateChange: 'state-change',
2089
2434
  };
2090
2435
  }
2091
2436
  // eslint-disable-next-line camelcase
@@ -2095,6 +2440,7 @@ class SimulateTraceConfig extends basemodel_1.default {
2095
2440
  enable: data['enable'],
2096
2441
  scratchChange: data['scratch-change'],
2097
2442
  stackChange: data['stack-change'],
2443
+ stateChange: data['state-change'],
2098
2444
  });
2099
2445
  /* eslint-enable dot-notation */
2100
2446
  }
@@ -2115,20 +2461,31 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
2115
2461
  * indicate deeper inner transactions.
2116
2462
  * @param failureMessage - If present, indicates that the transaction group failed and specifies why that
2117
2463
  * happened
2464
+ * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
2465
+ * caused failure, but were allowed in simulation. Depending on where this object
2466
+ * is in the response, the unnamed resources it contains may or may not qualify for
2467
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2468
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2469
+ * they do not qualify. In order to make this group valid for actual submission,
2470
+ * resources that qualify for group sharing can be made available by any
2471
+ * transaction of the group; otherwise, resources must be placed in the same
2472
+ * transaction which accessed them.
2118
2473
  */
2119
- constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, }) {
2474
+ constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, unnamedResourcesAccessed, }) {
2120
2475
  super();
2121
2476
  this.txnResults = txnResults;
2122
2477
  this.appBudgetAdded = appBudgetAdded;
2123
2478
  this.appBudgetConsumed = appBudgetConsumed;
2124
2479
  this.failedAt = failedAt;
2125
2480
  this.failureMessage = failureMessage;
2481
+ this.unnamedResourcesAccessed = unnamedResourcesAccessed;
2126
2482
  this.attribute_map = {
2127
2483
  txnResults: 'txn-results',
2128
2484
  appBudgetAdded: 'app-budget-added',
2129
2485
  appBudgetConsumed: 'app-budget-consumed',
2130
2486
  failedAt: 'failed-at',
2131
2487
  failureMessage: 'failure-message',
2488
+ unnamedResourcesAccessed: 'unnamed-resources-accessed',
2132
2489
  };
2133
2490
  }
2134
2491
  // eslint-disable-next-line camelcase
@@ -2142,6 +2499,9 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
2142
2499
  appBudgetConsumed: data['app-budget-consumed'],
2143
2500
  failedAt: data['failed-at'],
2144
2501
  failureMessage: data['failure-message'],
2502
+ unnamedResourcesAccessed: typeof data['unnamed-resources-accessed'] !== 'undefined'
2503
+ ? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(data['unnamed-resources-accessed'])
2504
+ : undefined,
2145
2505
  });
2146
2506
  /* eslint-enable dot-notation */
2147
2507
  }
@@ -2160,18 +2520,29 @@ class SimulateTransactionResult extends basemodel_1.default {
2160
2520
  * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
2161
2521
  * call trace in a recursive way.
2162
2522
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
2523
+ * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
2524
+ * caused failure, but were allowed in simulation. Depending on where this object
2525
+ * is in the response, the unnamed resources it contains may or may not qualify for
2526
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2527
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2528
+ * they do not qualify. In order to make this group valid for actual submission,
2529
+ * resources that qualify for group sharing can be made available by any
2530
+ * transaction of the group; otherwise, resources must be placed in the same
2531
+ * transaction which accessed them.
2163
2532
  */
2164
- constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, }) {
2533
+ constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, unnamedResourcesAccessed, }) {
2165
2534
  super();
2166
2535
  this.txnResult = txnResult;
2167
2536
  this.appBudgetConsumed = appBudgetConsumed;
2168
2537
  this.execTrace = execTrace;
2169
2538
  this.logicSigBudgetConsumed = logicSigBudgetConsumed;
2539
+ this.unnamedResourcesAccessed = unnamedResourcesAccessed;
2170
2540
  this.attribute_map = {
2171
2541
  txnResult: 'txn-result',
2172
2542
  appBudgetConsumed: 'app-budget-consumed',
2173
2543
  execTrace: 'exec-trace',
2174
2544
  logicSigBudgetConsumed: 'logic-sig-budget-consumed',
2545
+ unnamedResourcesAccessed: 'unnamed-resources-accessed',
2175
2546
  };
2176
2547
  }
2177
2548
  // eslint-disable-next-line camelcase
@@ -2186,11 +2557,82 @@ class SimulateTransactionResult extends basemodel_1.default {
2186
2557
  ? SimulationTransactionExecTrace.from_obj_for_encoding(data['exec-trace'])
2187
2558
  : undefined,
2188
2559
  logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
2560
+ unnamedResourcesAccessed: typeof data['unnamed-resources-accessed'] !== 'undefined'
2561
+ ? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(data['unnamed-resources-accessed'])
2562
+ : undefined,
2189
2563
  });
2190
2564
  /* eslint-enable dot-notation */
2191
2565
  }
2192
2566
  }
2193
2567
  exports.SimulateTransactionResult = SimulateTransactionResult;
2568
+ /**
2569
+ * These are resources that were accessed by this group that would normally have
2570
+ * caused failure, but were allowed in simulation. Depending on where this object
2571
+ * is in the response, the unnamed resources it contains may or may not qualify for
2572
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2573
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2574
+ * they do not qualify. In order to make this group valid for actual submission,
2575
+ * resources that qualify for group sharing can be made available by any
2576
+ * transaction of the group; otherwise, resources must be placed in the same
2577
+ * transaction which accessed them.
2578
+ */
2579
+ class SimulateUnnamedResourcesAccessed extends basemodel_1.default {
2580
+ /**
2581
+ * Creates a new `SimulateUnnamedResourcesAccessed` object.
2582
+ * @param accounts - The unnamed accounts that were referenced. The order of this array is arbitrary.
2583
+ * @param appLocals - The unnamed application local states that were referenced. The order of this
2584
+ * array is arbitrary.
2585
+ * @param apps - The unnamed applications that were referenced. The order of this array is
2586
+ * arbitrary.
2587
+ * @param assetHoldings - The unnamed asset holdings that were referenced. The order of this array is
2588
+ * arbitrary.
2589
+ * @param assets - The unnamed assets that were referenced. The order of this array is arbitrary.
2590
+ * @param boxes - The unnamed boxes that were referenced. The order of this array is arbitrary.
2591
+ * @param extraBoxRefs - The number of extra box references used to increase the IO budget. This is in
2592
+ * addition to the references defined in the input transaction group and any
2593
+ * referenced to unnamed boxes.
2594
+ */
2595
+ constructor({ accounts, appLocals, apps, assetHoldings, assets, boxes, extraBoxRefs, }) {
2596
+ super();
2597
+ this.accounts = accounts;
2598
+ this.appLocals = appLocals;
2599
+ this.apps = apps;
2600
+ this.assetHoldings = assetHoldings;
2601
+ this.assets = assets;
2602
+ this.boxes = boxes;
2603
+ this.extraBoxRefs = extraBoxRefs;
2604
+ this.attribute_map = {
2605
+ accounts: 'accounts',
2606
+ appLocals: 'app-locals',
2607
+ apps: 'apps',
2608
+ assetHoldings: 'asset-holdings',
2609
+ assets: 'assets',
2610
+ boxes: 'boxes',
2611
+ extraBoxRefs: 'extra-box-refs',
2612
+ };
2613
+ }
2614
+ // eslint-disable-next-line camelcase
2615
+ static from_obj_for_encoding(data) {
2616
+ /* eslint-disable dot-notation */
2617
+ return new SimulateUnnamedResourcesAccessed({
2618
+ accounts: data['accounts'],
2619
+ appLocals: typeof data['app-locals'] !== 'undefined'
2620
+ ? data['app-locals'].map(ApplicationLocalReference.from_obj_for_encoding)
2621
+ : undefined,
2622
+ apps: data['apps'],
2623
+ assetHoldings: typeof data['asset-holdings'] !== 'undefined'
2624
+ ? data['asset-holdings'].map(AssetHoldingReference.from_obj_for_encoding)
2625
+ : undefined,
2626
+ assets: data['assets'],
2627
+ boxes: typeof data['boxes'] !== 'undefined'
2628
+ ? data['boxes'].map(BoxReference.from_obj_for_encoding)
2629
+ : undefined,
2630
+ extraBoxRefs: data['extra-box-refs'],
2631
+ });
2632
+ /* eslint-enable dot-notation */
2633
+ }
2634
+ }
2635
+ exports.SimulateUnnamedResourcesAccessed = SimulateUnnamedResourcesAccessed;
2194
2636
  /**
2195
2637
  * The set of parameters and limits override during simulation. If this set of
2196
2638
  * parameters is present, then evaluation parameters may differ from standard
@@ -2201,18 +2643,21 @@ class SimulationEvalOverrides extends basemodel_1.default {
2201
2643
  * Creates a new `SimulationEvalOverrides` object.
2202
2644
  * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
2203
2645
  * were properly signed.
2646
+ * @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
2204
2647
  * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
2205
2648
  * @param maxLogCalls - The maximum log calls one can make during simulation
2206
2649
  * @param maxLogSize - The maximum byte number to log during simulation
2207
2650
  */
2208
- constructor({ allowEmptySignatures, extraOpcodeBudget, maxLogCalls, maxLogSize, }) {
2651
+ constructor({ allowEmptySignatures, allowUnnamedResources, extraOpcodeBudget, maxLogCalls, maxLogSize, }) {
2209
2652
  super();
2210
2653
  this.allowEmptySignatures = allowEmptySignatures;
2654
+ this.allowUnnamedResources = allowUnnamedResources;
2211
2655
  this.extraOpcodeBudget = extraOpcodeBudget;
2212
2656
  this.maxLogCalls = maxLogCalls;
2213
2657
  this.maxLogSize = maxLogSize;
2214
2658
  this.attribute_map = {
2215
2659
  allowEmptySignatures: 'allow-empty-signatures',
2660
+ allowUnnamedResources: 'allow-unnamed-resources',
2216
2661
  extraOpcodeBudget: 'extra-opcode-budget',
2217
2662
  maxLogCalls: 'max-log-calls',
2218
2663
  maxLogSize: 'max-log-size',
@@ -2223,6 +2668,7 @@ class SimulationEvalOverrides extends basemodel_1.default {
2223
2668
  /* eslint-disable dot-notation */
2224
2669
  return new SimulationEvalOverrides({
2225
2670
  allowEmptySignatures: data['allow-empty-signatures'],
2671
+ allowUnnamedResources: data['allow-unnamed-resources'],
2226
2672
  extraOpcodeBudget: data['extra-opcode-budget'],
2227
2673
  maxLogCalls: data['max-log-calls'],
2228
2674
  maxLogSize: data['max-log-size'],
@@ -2242,20 +2688,23 @@ class SimulationOpcodeTraceUnit extends basemodel_1.default {
2242
2688
  * @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
2243
2689
  * @param stackAdditions - The values added by this opcode to the stack.
2244
2690
  * @param stackPopCount - The number of deleted stack values by this opcode.
2691
+ * @param stateChanges - The operations against the current application's states.
2245
2692
  */
2246
- constructor({ pc, scratchChanges, spawnedInners, stackAdditions, stackPopCount, }) {
2693
+ constructor({ pc, scratchChanges, spawnedInners, stackAdditions, stackPopCount, stateChanges, }) {
2247
2694
  super();
2248
2695
  this.pc = pc;
2249
2696
  this.scratchChanges = scratchChanges;
2250
2697
  this.spawnedInners = spawnedInners;
2251
2698
  this.stackAdditions = stackAdditions;
2252
2699
  this.stackPopCount = stackPopCount;
2700
+ this.stateChanges = stateChanges;
2253
2701
  this.attribute_map = {
2254
2702
  pc: 'pc',
2255
2703
  scratchChanges: 'scratch-changes',
2256
2704
  spawnedInners: 'spawned-inners',
2257
2705
  stackAdditions: 'stack-additions',
2258
2706
  stackPopCount: 'stack-pop-count',
2707
+ stateChanges: 'state-changes',
2259
2708
  };
2260
2709
  }
2261
2710
  // eslint-disable-next-line camelcase
@@ -2273,6 +2722,9 @@ class SimulationOpcodeTraceUnit extends basemodel_1.default {
2273
2722
  ? data['stack-additions'].map(AvmValue.from_obj_for_encoding)
2274
2723
  : undefined,
2275
2724
  stackPopCount: data['stack-pop-count'],
2725
+ stateChanges: typeof data['state-changes'] !== 'undefined'
2726
+ ? data['state-changes'].map(ApplicationStateOperation.from_obj_for_encoding)
2727
+ : undefined,
2276
2728
  });
2277
2729
  /* eslint-enable dot-notation */
2278
2730
  }
@@ -2285,22 +2737,40 @@ exports.SimulationOpcodeTraceUnit = SimulationOpcodeTraceUnit;
2285
2737
  class SimulationTransactionExecTrace extends basemodel_1.default {
2286
2738
  /**
2287
2739
  * Creates a new `SimulationTransactionExecTrace` object.
2740
+ * @param approvalProgramHash - SHA512_256 hash digest of the approval program executed in transaction.
2288
2741
  * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
2742
+ * @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction.
2289
2743
  * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
2290
2744
  * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
2291
2745
  * any inner transactions executed.
2746
+ * @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction.
2292
2747
  * @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
2293
2748
  */
2294
- constructor({ approvalProgramTrace, clearStateProgramTrace, innerTrace, logicSigTrace, }) {
2749
+ constructor({ approvalProgramHash, approvalProgramTrace, clearStateProgramHash, clearStateProgramTrace, innerTrace, logicSigHash, logicSigTrace, }) {
2295
2750
  super();
2751
+ this.approvalProgramHash =
2752
+ typeof approvalProgramHash === 'string'
2753
+ ? new Uint8Array(buffer_1.Buffer.from(approvalProgramHash, 'base64'))
2754
+ : approvalProgramHash;
2296
2755
  this.approvalProgramTrace = approvalProgramTrace;
2756
+ this.clearStateProgramHash =
2757
+ typeof clearStateProgramHash === 'string'
2758
+ ? new Uint8Array(buffer_1.Buffer.from(clearStateProgramHash, 'base64'))
2759
+ : clearStateProgramHash;
2297
2760
  this.clearStateProgramTrace = clearStateProgramTrace;
2298
2761
  this.innerTrace = innerTrace;
2762
+ this.logicSigHash =
2763
+ typeof logicSigHash === 'string'
2764
+ ? new Uint8Array(buffer_1.Buffer.from(logicSigHash, 'base64'))
2765
+ : logicSigHash;
2299
2766
  this.logicSigTrace = logicSigTrace;
2300
2767
  this.attribute_map = {
2768
+ approvalProgramHash: 'approval-program-hash',
2301
2769
  approvalProgramTrace: 'approval-program-trace',
2770
+ clearStateProgramHash: 'clear-state-program-hash',
2302
2771
  clearStateProgramTrace: 'clear-state-program-trace',
2303
2772
  innerTrace: 'inner-trace',
2773
+ logicSigHash: 'logic-sig-hash',
2304
2774
  logicSigTrace: 'logic-sig-trace',
2305
2775
  };
2306
2776
  }
@@ -2308,15 +2778,18 @@ class SimulationTransactionExecTrace extends basemodel_1.default {
2308
2778
  static from_obj_for_encoding(data) {
2309
2779
  /* eslint-disable dot-notation */
2310
2780
  return new SimulationTransactionExecTrace({
2781
+ approvalProgramHash: data['approval-program-hash'],
2311
2782
  approvalProgramTrace: typeof data['approval-program-trace'] !== 'undefined'
2312
2783
  ? data['approval-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
2313
2784
  : undefined,
2785
+ clearStateProgramHash: data['clear-state-program-hash'],
2314
2786
  clearStateProgramTrace: typeof data['clear-state-program-trace'] !== 'undefined'
2315
2787
  ? data['clear-state-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
2316
2788
  : undefined,
2317
2789
  innerTrace: typeof data['inner-trace'] !== 'undefined'
2318
2790
  ? data['inner-trace'].map(SimulationTransactionExecTrace.from_obj_for_encoding)
2319
2791
  : undefined,
2792
+ logicSigHash: data['logic-sig-hash'],
2320
2793
  logicSigTrace: typeof data['logic-sig-trace'] !== 'undefined'
2321
2794
  ? data['logic-sig-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
2322
2795
  : undefined,