algosdk 2.2.0 → 2.4.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 (116) hide show
  1. package/README.md +5 -7
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/client/v2/algod/algod.js +252 -25
  5. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +1 -1
  7. package/dist/cjs/client/v2/algod/getApplicationBoxes.js +1 -1
  8. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +19 -0
  9. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
  10. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +20 -0
  11. package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -0
  12. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +20 -0
  13. package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
  14. package/dist/cjs/client/v2/algod/getSyncRound.js +19 -0
  15. package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -0
  16. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +25 -0
  17. package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
  18. package/dist/cjs/client/v2/algod/models/types.js +327 -23
  19. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  20. package/dist/cjs/client/v2/algod/ready.js +14 -0
  21. package/dist/cjs/client/v2/algod/ready.js.map +1 -0
  22. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +22 -0
  23. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  24. package/dist/cjs/client/v2/algod/setSyncRound.js +22 -0
  25. package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -0
  26. package/dist/cjs/client/v2/algod/simulateTransaction.js +4 -19
  27. package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
  28. package/dist/cjs/client/v2/algod/suggestedParams.js +1 -0
  29. package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
  30. package/dist/cjs/client/v2/algod/unsetSyncRound.js +18 -0
  31. package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -0
  32. package/dist/cjs/client/v2/serviceClient.js +3 -0
  33. package/dist/cjs/client/v2/serviceClient.js.map +1 -1
  34. package/dist/cjs/composer.js +40 -3
  35. package/dist/cjs/composer.js.map +1 -1
  36. package/dist/cjs/main.js.map +1 -1
  37. package/dist/cjs/makeTxn.js.map +1 -1
  38. package/dist/cjs/transaction.js +1 -2
  39. package/dist/cjs/transaction.js.map +1 -1
  40. package/dist/esm/client/v2/algod/algod.js +229 -25
  41. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  42. package/dist/esm/client/v2/algod/getApplicationBoxByName.js +1 -1
  43. package/dist/esm/client/v2/algod/getApplicationBoxes.js +1 -1
  44. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +13 -0
  45. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
  46. package/dist/esm/client/v2/algod/getLedgerStateDelta.js +14 -0
  47. package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -0
  48. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +14 -0
  49. package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -0
  50. package/dist/esm/client/v2/algod/getSyncRound.js +13 -0
  51. package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -0
  52. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +19 -0
  53. package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
  54. package/dist/esm/client/v2/algod/models/types.js +317 -22
  55. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  56. package/dist/esm/client/v2/algod/ready.js +8 -0
  57. package/dist/esm/client/v2/algod/ready.js.map +1 -0
  58. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +16 -0
  59. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  60. package/dist/esm/client/v2/algod/setSyncRound.js +16 -0
  61. package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -0
  62. package/dist/esm/client/v2/algod/simulateTransaction.js +4 -19
  63. package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
  64. package/dist/esm/client/v2/algod/suggestedParams.js +1 -0
  65. package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
  66. package/dist/esm/client/v2/algod/unsetSyncRound.js +12 -0
  67. package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -0
  68. package/dist/esm/client/v2/serviceClient.js +3 -0
  69. package/dist/esm/client/v2/serviceClient.js.map +1 -1
  70. package/dist/esm/composer.js +17 -3
  71. package/dist/esm/composer.js.map +1 -1
  72. package/dist/esm/main.js.map +1 -1
  73. package/dist/esm/makeTxn.js.map +1 -1
  74. package/dist/esm/transaction.js +1 -2
  75. package/dist/esm/transaction.js.map +1 -1
  76. package/dist/types/client/v2/algod/algod.d.ts +190 -24
  77. package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +1 -1
  78. package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +1 -1
  79. package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +6 -0
  80. package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +8 -0
  81. package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +8 -0
  82. package/dist/types/client/v2/algod/getSyncRound.d.ts +6 -0
  83. package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +10 -0
  84. package/dist/types/client/v2/algod/models/types.d.ts +283 -29
  85. package/dist/types/client/v2/algod/ready.d.ts +4 -0
  86. package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +9 -0
  87. package/dist/types/client/v2/algod/setSyncRound.d.ts +9 -0
  88. package/dist/types/client/v2/algod/simulateTransaction.d.ts +3 -3
  89. package/dist/types/client/v2/algod/suggestedParams.d.ts +3 -3
  90. package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -0
  91. package/dist/types/composer.d.ts +5 -2
  92. package/dist/types/main.d.ts +1 -0
  93. package/dist/types/makeTxn.d.ts +1 -3
  94. package/dist/types/types/transactions/base.d.ts +6 -0
  95. package/package.json +2 -4
  96. package/src/client/v2/algod/algod.ts +246 -25
  97. package/src/client/v2/algod/getApplicationBoxByName.ts +1 -1
  98. package/src/client/v2/algod/getApplicationBoxes.ts +1 -1
  99. package/src/client/v2/algod/getBlockOffsetTimestamp.ts +17 -0
  100. package/src/client/v2/algod/getLedgerStateDelta.ts +16 -0
  101. package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -0
  102. package/src/client/v2/algod/getSyncRound.ts +17 -0
  103. package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +29 -0
  104. package/src/client/v2/algod/models/types.ts +560 -36
  105. package/src/client/v2/algod/ready.ts +8 -0
  106. package/src/client/v2/algod/setBlockOffsetTimestamp.ts +20 -0
  107. package/src/client/v2/algod/setSyncRound.ts +20 -0
  108. package/src/client/v2/algod/simulateTransaction.ts +6 -22
  109. package/src/client/v2/algod/suggestedParams.ts +4 -3
  110. package/src/client/v2/algod/unsetSyncRound.ts +13 -0
  111. package/src/client/v2/serviceClient.ts +3 -0
  112. package/src/composer.ts +28 -4
  113. package/src/main.ts +7 -0
  114. package/src/makeTxn.ts +2 -4
  115. package/src/transaction.ts +1 -2
  116. package/src/types/transactions/base.ts +7 -0
@@ -6,7 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  return (mod && mod.__esModule) ? mod : { "default": mod };
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateResponse = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.BuildVersion = exports.BoxesResponse = exports.BoxDescriptor = exports.Box = exports.BlockResponse = exports.BlockHashResponse = exports.AssetParams = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationParams = exports.ApplicationLocalState = exports.Application = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetResponse = exports.AccountApplicationResponse = exports.Account = void 0;
9
+ exports.TransactionParametersResponse = exports.TransactionGroupLedgerStateDeltasForRoundResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.SimulationEvalOverrides = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateResponse = exports.SimulateRequestTransactionGroup = exports.SimulateRequest = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.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.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 = void 0;
10
11
  /* eslint-disable no-use-before-define */
11
12
  const buffer_1 = require("buffer");
12
13
  const basemodel_1 = __importDefault(require("../../basemodel"));
@@ -459,9 +460,9 @@ class ApplicationParams extends basemodel_1.default {
459
460
  * @param creator - The address that created this application. This is the address where the
460
461
  * parameters and global state for this application can be found.
461
462
  * @param extraProgramPages - (epp) the amount of extra program pages available to this app.
462
- * @param globalState - [\gs) global schema
463
- * @param globalStateSchema - [\gsch) global schema
464
- * @param localStateSchema - [\lsch) local schema
463
+ * @param globalState - (gs) global state
464
+ * @param globalStateSchema - (gsch) global schema
465
+ * @param localStateSchema - (lsch) local schema
465
466
  */
466
467
  constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, }) {
467
468
  super();
@@ -1390,6 +1391,129 @@ class EvalDeltaKeyValue extends basemodel_1.default {
1390
1391
  }
1391
1392
  }
1392
1393
  exports.EvalDeltaKeyValue = EvalDeltaKeyValue;
1394
+ /**
1395
+ * Response containing the timestamp offset in seconds
1396
+ */
1397
+ class GetBlockTimeStampOffsetResponse extends basemodel_1.default {
1398
+ /**
1399
+ * Creates a new `GetBlockTimeStampOffsetResponse` object.
1400
+ * @param offset - Timestamp offset in seconds.
1401
+ */
1402
+ constructor({ offset }) {
1403
+ super();
1404
+ this.offset = offset;
1405
+ this.attribute_map = {
1406
+ offset: 'offset',
1407
+ };
1408
+ }
1409
+ // eslint-disable-next-line camelcase
1410
+ static from_obj_for_encoding(data) {
1411
+ /* eslint-disable dot-notation */
1412
+ if (typeof data['offset'] === 'undefined')
1413
+ throw new Error(`Response is missing required field 'offset': ${data}`);
1414
+ return new GetBlockTimeStampOffsetResponse({
1415
+ offset: data['offset'],
1416
+ });
1417
+ /* eslint-enable dot-notation */
1418
+ }
1419
+ }
1420
+ exports.GetBlockTimeStampOffsetResponse = GetBlockTimeStampOffsetResponse;
1421
+ /**
1422
+ * Response containing the ledger's minimum sync round
1423
+ */
1424
+ class GetSyncRoundResponse extends basemodel_1.default {
1425
+ /**
1426
+ * Creates a new `GetSyncRoundResponse` object.
1427
+ * @param round - The minimum sync round for the ledger.
1428
+ */
1429
+ constructor({ round }) {
1430
+ super();
1431
+ this.round = round;
1432
+ this.attribute_map = {
1433
+ round: 'round',
1434
+ };
1435
+ }
1436
+ // eslint-disable-next-line camelcase
1437
+ static from_obj_for_encoding(data) {
1438
+ /* eslint-disable dot-notation */
1439
+ if (typeof data['round'] === 'undefined')
1440
+ throw new Error(`Response is missing required field 'round': ${data}`);
1441
+ return new GetSyncRoundResponse({
1442
+ round: data['round'],
1443
+ });
1444
+ /* eslint-enable dot-notation */
1445
+ }
1446
+ }
1447
+ exports.GetSyncRoundResponse = GetSyncRoundResponse;
1448
+ /**
1449
+ * A single Delta containing the key, the previous value and the current value for
1450
+ * a single round.
1451
+ */
1452
+ class KvDelta extends basemodel_1.default {
1453
+ /**
1454
+ * Creates a new `KvDelta` object.
1455
+ * @param key - The key, base64 encoded.
1456
+ * @param value - The new value of the KV store entry, base64 encoded.
1457
+ */
1458
+ constructor({ key, value, }) {
1459
+ super();
1460
+ this.key =
1461
+ typeof key === 'string'
1462
+ ? new Uint8Array(buffer_1.Buffer.from(key, 'base64'))
1463
+ : key;
1464
+ this.value =
1465
+ typeof value === 'string'
1466
+ ? new Uint8Array(buffer_1.Buffer.from(value, 'base64'))
1467
+ : value;
1468
+ this.attribute_map = {
1469
+ key: 'key',
1470
+ value: 'value',
1471
+ };
1472
+ }
1473
+ // eslint-disable-next-line camelcase
1474
+ static from_obj_for_encoding(data) {
1475
+ /* eslint-disable dot-notation */
1476
+ return new KvDelta({
1477
+ key: data['key'],
1478
+ value: data['value'],
1479
+ });
1480
+ /* eslint-enable dot-notation */
1481
+ }
1482
+ }
1483
+ exports.KvDelta = KvDelta;
1484
+ /**
1485
+ * Contains a ledger delta for a single transaction group
1486
+ */
1487
+ class LedgerStateDeltaForTransactionGroup extends basemodel_1.default {
1488
+ /**
1489
+ * Creates a new `LedgerStateDeltaForTransactionGroup` object.
1490
+ * @param delta - Ledger StateDelta object
1491
+ * @param ids -
1492
+ */
1493
+ constructor({ delta, ids }) {
1494
+ super();
1495
+ this.delta = delta;
1496
+ this.ids = ids;
1497
+ this.attribute_map = {
1498
+ delta: 'delta',
1499
+ ids: 'ids',
1500
+ };
1501
+ }
1502
+ // eslint-disable-next-line camelcase
1503
+ static from_obj_for_encoding(data) {
1504
+ /* eslint-disable dot-notation */
1505
+ if (typeof data['delta'] === 'undefined')
1506
+ throw new Error(`Response is missing required field 'delta': ${data}`);
1507
+ if (!Array.isArray(data['ids']))
1508
+ throw new Error(`Response is missing required array field 'ids': ${data}`);
1509
+ return new LedgerStateDeltaForTransactionGroup({
1510
+ delta: data['delta'],
1511
+ ids: data['ids'],
1512
+ });
1513
+ /* eslint-enable dot-notation */
1514
+ }
1515
+ }
1516
+ exports.LedgerStateDeltaForTransactionGroup = LedgerStateDeltaForTransactionGroup;
1393
1517
  /**
1394
1518
  * Proof of membership and position of a light block header.
1395
1519
  */
@@ -1465,8 +1589,16 @@ class NodeStatusResponse extends basemodel_1.default {
1465
1589
  * @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been
1466
1590
  * verified so far as part of the catchup
1467
1591
  * @param lastCatchpoint - The last catchpoint seen by the node
1592
+ * @param upgradeDelay - Upgrade delay
1593
+ * @param upgradeNextProtocolVoteBefore - Next protocol round
1594
+ * @param upgradeNoVotes - No votes cast for consensus upgrade
1595
+ * @param upgradeNodeVote - This node's upgrade vote
1596
+ * @param upgradeVoteRounds - Total voting rounds for current upgrade
1597
+ * @param upgradeVotes - Total votes cast for consensus upgrade
1598
+ * @param upgradeVotesRequired - Yes votes required for consensus upgrade
1599
+ * @param upgradeYesVotes - Yes votes cast for consensus upgrade
1468
1600
  */
1469
- constructor({ catchupTime, lastRound, lastVersion, nextVersion, nextVersionRound, nextVersionSupported, stoppedAtUnsupportedRound, timeSinceLastRound, catchpoint, catchpointAcquiredBlocks, catchpointProcessedAccounts, catchpointProcessedKvs, catchpointTotalAccounts, catchpointTotalBlocks, catchpointTotalKvs, catchpointVerifiedAccounts, catchpointVerifiedKvs, lastCatchpoint, }) {
1601
+ constructor({ catchupTime, lastRound, lastVersion, nextVersion, nextVersionRound, nextVersionSupported, stoppedAtUnsupportedRound, timeSinceLastRound, catchpoint, catchpointAcquiredBlocks, catchpointProcessedAccounts, catchpointProcessedKvs, catchpointTotalAccounts, catchpointTotalBlocks, catchpointTotalKvs, catchpointVerifiedAccounts, catchpointVerifiedKvs, lastCatchpoint, upgradeDelay, upgradeNextProtocolVoteBefore, upgradeNoVotes, upgradeNodeVote, upgradeVoteRounds, upgradeVotes, upgradeVotesRequired, upgradeYesVotes, }) {
1470
1602
  super();
1471
1603
  this.catchupTime = catchupTime;
1472
1604
  this.lastRound = lastRound;
@@ -1486,6 +1618,14 @@ class NodeStatusResponse extends basemodel_1.default {
1486
1618
  this.catchpointVerifiedAccounts = catchpointVerifiedAccounts;
1487
1619
  this.catchpointVerifiedKvs = catchpointVerifiedKvs;
1488
1620
  this.lastCatchpoint = lastCatchpoint;
1621
+ this.upgradeDelay = upgradeDelay;
1622
+ this.upgradeNextProtocolVoteBefore = upgradeNextProtocolVoteBefore;
1623
+ this.upgradeNoVotes = upgradeNoVotes;
1624
+ this.upgradeNodeVote = upgradeNodeVote;
1625
+ this.upgradeVoteRounds = upgradeVoteRounds;
1626
+ this.upgradeVotes = upgradeVotes;
1627
+ this.upgradeVotesRequired = upgradeVotesRequired;
1628
+ this.upgradeYesVotes = upgradeYesVotes;
1489
1629
  this.attribute_map = {
1490
1630
  catchupTime: 'catchup-time',
1491
1631
  lastRound: 'last-round',
@@ -1505,6 +1645,14 @@ class NodeStatusResponse extends basemodel_1.default {
1505
1645
  catchpointVerifiedAccounts: 'catchpoint-verified-accounts',
1506
1646
  catchpointVerifiedKvs: 'catchpoint-verified-kvs',
1507
1647
  lastCatchpoint: 'last-catchpoint',
1648
+ upgradeDelay: 'upgrade-delay',
1649
+ upgradeNextProtocolVoteBefore: 'upgrade-next-protocol-vote-before',
1650
+ upgradeNoVotes: 'upgrade-no-votes',
1651
+ upgradeNodeVote: 'upgrade-node-vote',
1652
+ upgradeVoteRounds: 'upgrade-vote-rounds',
1653
+ upgradeVotes: 'upgrade-votes',
1654
+ upgradeVotesRequired: 'upgrade-votes-required',
1655
+ upgradeYesVotes: 'upgrade-yes-votes',
1508
1656
  };
1509
1657
  }
1510
1658
  // eslint-disable-next-line camelcase
@@ -1545,6 +1693,14 @@ class NodeStatusResponse extends basemodel_1.default {
1545
1693
  catchpointVerifiedAccounts: data['catchpoint-verified-accounts'],
1546
1694
  catchpointVerifiedKvs: data['catchpoint-verified-kvs'],
1547
1695
  lastCatchpoint: data['last-catchpoint'],
1696
+ upgradeDelay: data['upgrade-delay'],
1697
+ upgradeNextProtocolVoteBefore: data['upgrade-next-protocol-vote-before'],
1698
+ upgradeNoVotes: data['upgrade-no-votes'],
1699
+ upgradeNodeVote: data['upgrade-node-vote'],
1700
+ upgradeVoteRounds: data['upgrade-vote-rounds'],
1701
+ upgradeVotes: data['upgrade-votes'],
1702
+ upgradeVotesRequired: data['upgrade-votes-required'],
1703
+ upgradeYesVotes: data['upgrade-yes-votes'],
1548
1704
  });
1549
1705
  /* eslint-enable dot-notation */
1550
1706
  }
@@ -1568,12 +1724,12 @@ class PendingTransactionResponse extends basemodel_1.default {
1568
1724
  * @param closeRewards - Rewards in microalgos applied to the close remainder to account.
1569
1725
  * @param closingAmount - Closing amount for the transaction.
1570
1726
  * @param confirmedRound - The round where this transaction was confirmed, if present.
1571
- * @param globalStateDelta - (gd) Global state key/value changes for the application being executed by this
1727
+ * @param globalStateDelta - Global state key/value changes for the application being executed by this
1572
1728
  * transaction.
1573
1729
  * @param innerTxns - Inner transactions produced by application execution.
1574
- * @param localStateDelta - (ld) Local state key/value changes for the application being executed by this
1730
+ * @param localStateDelta - Local state key/value changes for the application being executed by this
1575
1731
  * transaction.
1576
- * @param logs - (lg) Logs for the application being executed by this transaction.
1732
+ * @param logs - Logs for the application being executed by this transaction.
1577
1733
  * @param receiverRewards - Rewards in microalgos applied to the receiver account.
1578
1734
  * @param senderRewards - Rewards in microalgos applied to the sender account.
1579
1735
  */
@@ -1705,6 +1861,73 @@ class PostTransactionsResponse extends basemodel_1.default {
1705
1861
  }
1706
1862
  }
1707
1863
  exports.PostTransactionsResponse = PostTransactionsResponse;
1864
+ /**
1865
+ * Request type for simulation endpoint.
1866
+ */
1867
+ class SimulateRequest extends basemodel_1.default {
1868
+ /**
1869
+ * Creates a new `SimulateRequest` object.
1870
+ * @param txnGroups - The transaction groups to simulate.
1871
+ * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
1872
+ * signatures.
1873
+ * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
1874
+ * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
1875
+ */
1876
+ constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, extraOpcodeBudget, }) {
1877
+ super();
1878
+ this.txnGroups = txnGroups;
1879
+ this.allowEmptySignatures = allowEmptySignatures;
1880
+ this.allowMoreLogging = allowMoreLogging;
1881
+ this.extraOpcodeBudget = extraOpcodeBudget;
1882
+ this.attribute_map = {
1883
+ txnGroups: 'txn-groups',
1884
+ allowEmptySignatures: 'allow-empty-signatures',
1885
+ allowMoreLogging: 'allow-more-logging',
1886
+ extraOpcodeBudget: 'extra-opcode-budget',
1887
+ };
1888
+ }
1889
+ // eslint-disable-next-line camelcase
1890
+ static from_obj_for_encoding(data) {
1891
+ /* eslint-disable dot-notation */
1892
+ if (!Array.isArray(data['txn-groups']))
1893
+ throw new Error(`Response is missing required array field 'txn-groups': ${data}`);
1894
+ return new SimulateRequest({
1895
+ txnGroups: data['txn-groups'].map(SimulateRequestTransactionGroup.from_obj_for_encoding),
1896
+ allowEmptySignatures: data['allow-empty-signatures'],
1897
+ allowMoreLogging: data['allow-more-logging'],
1898
+ extraOpcodeBudget: data['extra-opcode-budget'],
1899
+ });
1900
+ /* eslint-enable dot-notation */
1901
+ }
1902
+ }
1903
+ exports.SimulateRequest = SimulateRequest;
1904
+ /**
1905
+ * A transaction group to simulate.
1906
+ */
1907
+ class SimulateRequestTransactionGroup extends basemodel_1.default {
1908
+ /**
1909
+ * Creates a new `SimulateRequestTransactionGroup` object.
1910
+ * @param txns - An atomic transaction group.
1911
+ */
1912
+ constructor({ txns }) {
1913
+ super();
1914
+ this.txns = txns;
1915
+ this.attribute_map = {
1916
+ txns: 'txns',
1917
+ };
1918
+ }
1919
+ // eslint-disable-next-line camelcase
1920
+ static from_obj_for_encoding(data) {
1921
+ /* eslint-disable dot-notation */
1922
+ if (!Array.isArray(data['txns']))
1923
+ throw new Error(`Response is missing required array field 'txns': ${data}`);
1924
+ return new SimulateRequestTransactionGroup({
1925
+ txns: data['txns'],
1926
+ });
1927
+ /* eslint-enable dot-notation */
1928
+ }
1929
+ }
1930
+ exports.SimulateRequestTransactionGroup = SimulateRequestTransactionGroup;
1708
1931
  /**
1709
1932
  * Result of a transaction group simulation.
1710
1933
  */
@@ -1715,21 +1938,21 @@ class SimulateResponse extends basemodel_1.default {
1715
1938
  * round were used to run this simulation.
1716
1939
  * @param txnGroups - A result object for each transaction group that was simulated.
1717
1940
  * @param version - The version of this response object.
1718
- * @param wouldSucceed - Indicates whether the simulated transactions would have succeeded during an
1719
- * actual submission. If any transaction fails or is missing a signature, this will
1720
- * be false.
1941
+ * @param evalOverrides - The set of parameters and limits override during simulation. If this set of
1942
+ * parameters is present, then evaluation parameters may differ from standard
1943
+ * evaluation in certain ways.
1721
1944
  */
1722
- constructor({ lastRound, txnGroups, version, wouldSucceed, }) {
1945
+ constructor({ lastRound, txnGroups, version, evalOverrides, }) {
1723
1946
  super();
1724
1947
  this.lastRound = lastRound;
1725
1948
  this.txnGroups = txnGroups;
1726
1949
  this.version = version;
1727
- this.wouldSucceed = wouldSucceed;
1950
+ this.evalOverrides = evalOverrides;
1728
1951
  this.attribute_map = {
1729
1952
  lastRound: 'last-round',
1730
1953
  txnGroups: 'txn-groups',
1731
1954
  version: 'version',
1732
- wouldSucceed: 'would-succeed',
1955
+ evalOverrides: 'eval-overrides',
1733
1956
  };
1734
1957
  }
1735
1958
  // eslint-disable-next-line camelcase
@@ -1741,13 +1964,13 @@ class SimulateResponse extends basemodel_1.default {
1741
1964
  throw new Error(`Response is missing required array field 'txn-groups': ${data}`);
1742
1965
  if (typeof data['version'] === 'undefined')
1743
1966
  throw new Error(`Response is missing required field 'version': ${data}`);
1744
- if (typeof data['would-succeed'] === 'undefined')
1745
- throw new Error(`Response is missing required field 'would-succeed': ${data}`);
1746
1967
  return new SimulateResponse({
1747
1968
  lastRound: data['last-round'],
1748
1969
  txnGroups: data['txn-groups'].map(SimulateTransactionGroupResult.from_obj_for_encoding),
1749
1970
  version: data['version'],
1750
- wouldSucceed: data['would-succeed'],
1971
+ evalOverrides: typeof data['eval-overrides'] !== 'undefined'
1972
+ ? SimulationEvalOverrides.from_obj_for_encoding(data['eval-overrides'])
1973
+ : undefined,
1751
1974
  });
1752
1975
  /* eslint-enable dot-notation */
1753
1976
  }
@@ -1760,6 +1983,8 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
1760
1983
  /**
1761
1984
  * Creates a new `SimulateTransactionGroupResult` object.
1762
1985
  * @param txnResults - Simulation result for individual transactions
1986
+ * @param appBudgetAdded - Total budget added during execution of app calls in the transaction group.
1987
+ * @param appBudgetConsumed - Total budget consumed during execution of app calls in the transaction group.
1763
1988
  * @param failedAt - If present, indicates which transaction in this group caused the failure. This
1764
1989
  * array represents the path to the failing transaction. Indexes are zero based,
1765
1990
  * the first element indicates the top-level transaction, and successive elements
@@ -1767,13 +1992,17 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
1767
1992
  * @param failureMessage - If present, indicates that the transaction group failed and specifies why that
1768
1993
  * happened
1769
1994
  */
1770
- constructor({ txnResults, failedAt, failureMessage, }) {
1995
+ constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, }) {
1771
1996
  super();
1772
1997
  this.txnResults = txnResults;
1998
+ this.appBudgetAdded = appBudgetAdded;
1999
+ this.appBudgetConsumed = appBudgetConsumed;
1773
2000
  this.failedAt = failedAt;
1774
2001
  this.failureMessage = failureMessage;
1775
2002
  this.attribute_map = {
1776
2003
  txnResults: 'txn-results',
2004
+ appBudgetAdded: 'app-budget-added',
2005
+ appBudgetConsumed: 'app-budget-consumed',
1777
2006
  failedAt: 'failed-at',
1778
2007
  failureMessage: 'failure-message',
1779
2008
  };
@@ -1785,6 +2014,8 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
1785
2014
  throw new Error(`Response is missing required array field 'txn-results': ${data}`);
1786
2015
  return new SimulateTransactionGroupResult({
1787
2016
  txnResults: data['txn-results'].map(SimulateTransactionResult.from_obj_for_encoding),
2017
+ appBudgetAdded: data['app-budget-added'],
2018
+ appBudgetConsumed: data['app-budget-consumed'],
1788
2019
  failedAt: data['failed-at'],
1789
2020
  failureMessage: data['failure-message'],
1790
2021
  });
@@ -1800,15 +2031,19 @@ class SimulateTransactionResult extends basemodel_1.default {
1800
2031
  * Creates a new `SimulateTransactionResult` object.
1801
2032
  * @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
1802
2033
  * includes confirmation details like the round and reward details.
1803
- * @param missingSignature - A boolean indicating whether this transaction is missing signatures
2034
+ * @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
2035
+ * budged used by inner app calls spawned by this transaction.
2036
+ * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
1804
2037
  */
1805
- constructor({ txnResult, missingSignature, }) {
2038
+ constructor({ txnResult, appBudgetConsumed, logicSigBudgetConsumed, }) {
1806
2039
  super();
1807
2040
  this.txnResult = txnResult;
1808
- this.missingSignature = missingSignature;
2041
+ this.appBudgetConsumed = appBudgetConsumed;
2042
+ this.logicSigBudgetConsumed = logicSigBudgetConsumed;
1809
2043
  this.attribute_map = {
1810
2044
  txnResult: 'txn-result',
1811
- missingSignature: 'missing-signature',
2045
+ appBudgetConsumed: 'app-budget-consumed',
2046
+ logicSigBudgetConsumed: 'logic-sig-budget-consumed',
1812
2047
  };
1813
2048
  }
1814
2049
  // eslint-disable-next-line camelcase
@@ -1818,12 +2053,53 @@ class SimulateTransactionResult extends basemodel_1.default {
1818
2053
  throw new Error(`Response is missing required field 'txn-result': ${data}`);
1819
2054
  return new SimulateTransactionResult({
1820
2055
  txnResult: PendingTransactionResponse.from_obj_for_encoding(data['txn-result']),
1821
- missingSignature: data['missing-signature'],
2056
+ appBudgetConsumed: data['app-budget-consumed'],
2057
+ logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
1822
2058
  });
1823
2059
  /* eslint-enable dot-notation */
1824
2060
  }
1825
2061
  }
1826
2062
  exports.SimulateTransactionResult = SimulateTransactionResult;
2063
+ /**
2064
+ * The set of parameters and limits override during simulation. If this set of
2065
+ * parameters is present, then evaluation parameters may differ from standard
2066
+ * evaluation in certain ways.
2067
+ */
2068
+ class SimulationEvalOverrides extends basemodel_1.default {
2069
+ /**
2070
+ * Creates a new `SimulationEvalOverrides` object.
2071
+ * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
2072
+ * were properly signed.
2073
+ * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
2074
+ * @param maxLogCalls - The maximum log calls one can make during simulation
2075
+ * @param maxLogSize - The maximum byte number to log during simulation
2076
+ */
2077
+ constructor({ allowEmptySignatures, extraOpcodeBudget, maxLogCalls, maxLogSize, }) {
2078
+ super();
2079
+ this.allowEmptySignatures = allowEmptySignatures;
2080
+ this.extraOpcodeBudget = extraOpcodeBudget;
2081
+ this.maxLogCalls = maxLogCalls;
2082
+ this.maxLogSize = maxLogSize;
2083
+ this.attribute_map = {
2084
+ allowEmptySignatures: 'allow-empty-signatures',
2085
+ extraOpcodeBudget: 'extra-opcode-budget',
2086
+ maxLogCalls: 'max-log-calls',
2087
+ maxLogSize: 'max-log-size',
2088
+ };
2089
+ }
2090
+ // eslint-disable-next-line camelcase
2091
+ static from_obj_for_encoding(data) {
2092
+ /* eslint-disable dot-notation */
2093
+ return new SimulationEvalOverrides({
2094
+ allowEmptySignatures: data['allow-empty-signatures'],
2095
+ extraOpcodeBudget: data['extra-opcode-budget'],
2096
+ maxLogCalls: data['max-log-calls'],
2097
+ maxLogSize: data['max-log-size'],
2098
+ });
2099
+ /* eslint-enable dot-notation */
2100
+ }
2101
+ }
2102
+ exports.SimulationEvalOverrides = SimulationEvalOverrides;
1827
2103
  /**
1828
2104
  * Represents a state proof and its corresponding message
1829
2105
  */
@@ -2030,6 +2306,34 @@ class TealValue extends basemodel_1.default {
2030
2306
  }
2031
2307
  }
2032
2308
  exports.TealValue = TealValue;
2309
+ /**
2310
+ * Response containing all ledger state deltas for transaction groups, with their
2311
+ * associated Ids, in a single round.
2312
+ */
2313
+ class TransactionGroupLedgerStateDeltasForRoundResponse extends basemodel_1.default {
2314
+ /**
2315
+ * Creates a new `TransactionGroupLedgerStateDeltasForRoundResponse` object.
2316
+ * @param deltas -
2317
+ */
2318
+ constructor({ deltas }) {
2319
+ super();
2320
+ this.deltas = deltas;
2321
+ this.attribute_map = {
2322
+ deltas: 'deltas',
2323
+ };
2324
+ }
2325
+ // eslint-disable-next-line camelcase
2326
+ static from_obj_for_encoding(data) {
2327
+ /* eslint-disable dot-notation */
2328
+ if (!Array.isArray(data['Deltas']))
2329
+ throw new Error(`Response is missing required array field 'Deltas': ${data}`);
2330
+ return new TransactionGroupLedgerStateDeltasForRoundResponse({
2331
+ deltas: data['Deltas'].map(LedgerStateDeltaForTransactionGroup.from_obj_for_encoding),
2332
+ });
2333
+ /* eslint-enable dot-notation */
2334
+ }
2335
+ }
2336
+ exports.TransactionGroupLedgerStateDeltasForRoundResponse = TransactionGroupLedgerStateDeltasForRoundResponse;
2033
2337
  /**
2034
2338
  * TransactionParams contains the parameters that help a client construct a new
2035
2339
  * transaction.