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
@@ -426,15 +426,15 @@ export declare class ApplicationParams extends BaseModel {
426
426
  */
427
427
  extraProgramPages?: number | bigint;
428
428
  /**
429
- * [\gs) global schema
429
+ * (gs) global state
430
430
  */
431
431
  globalState?: TealKeyValue[];
432
432
  /**
433
- * [\gsch) global schema
433
+ * (gsch) global schema
434
434
  */
435
435
  globalStateSchema?: ApplicationStateSchema;
436
436
  /**
437
- * [\lsch) local schema
437
+ * (lsch) local schema
438
438
  */
439
439
  localStateSchema?: ApplicationStateSchema;
440
440
  /**
@@ -444,9 +444,9 @@ export declare class ApplicationParams extends BaseModel {
444
444
  * @param creator - The address that created this application. This is the address where the
445
445
  * parameters and global state for this application can be found.
446
446
  * @param extraProgramPages - (epp) the amount of extra program pages available to this app.
447
- * @param globalState - [\gs) global schema
448
- * @param globalStateSchema - [\gsch) global schema
449
- * @param localStateSchema - [\lsch) local schema
447
+ * @param globalState - (gs) global state
448
+ * @param globalStateSchema - (gsch) global schema
449
+ * @param localStateSchema - (lsch) local schema
450
450
  */
451
451
  constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, }: {
452
452
  approvalProgram: string | Uint8Array;
@@ -1099,6 +1099,84 @@ export declare class EvalDeltaKeyValue extends BaseModel {
1099
1099
  });
1100
1100
  static from_obj_for_encoding(data: Record<string, any>): EvalDeltaKeyValue;
1101
1101
  }
1102
+ /**
1103
+ * Response containing the timestamp offset in seconds
1104
+ */
1105
+ export declare class GetBlockTimeStampOffsetResponse extends BaseModel {
1106
+ /**
1107
+ * Timestamp offset in seconds.
1108
+ */
1109
+ offset: number | bigint;
1110
+ /**
1111
+ * Creates a new `GetBlockTimeStampOffsetResponse` object.
1112
+ * @param offset - Timestamp offset in seconds.
1113
+ */
1114
+ constructor({ offset }: {
1115
+ offset: number | bigint;
1116
+ });
1117
+ static from_obj_for_encoding(data: Record<string, any>): GetBlockTimeStampOffsetResponse;
1118
+ }
1119
+ /**
1120
+ * Response containing the ledger's minimum sync round
1121
+ */
1122
+ export declare class GetSyncRoundResponse extends BaseModel {
1123
+ /**
1124
+ * The minimum sync round for the ledger.
1125
+ */
1126
+ round: number | bigint;
1127
+ /**
1128
+ * Creates a new `GetSyncRoundResponse` object.
1129
+ * @param round - The minimum sync round for the ledger.
1130
+ */
1131
+ constructor({ round }: {
1132
+ round: number | bigint;
1133
+ });
1134
+ static from_obj_for_encoding(data: Record<string, any>): GetSyncRoundResponse;
1135
+ }
1136
+ /**
1137
+ * A single Delta containing the key, the previous value and the current value for
1138
+ * a single round.
1139
+ */
1140
+ export declare class KvDelta extends BaseModel {
1141
+ /**
1142
+ * The key, base64 encoded.
1143
+ */
1144
+ key?: Uint8Array;
1145
+ /**
1146
+ * The new value of the KV store entry, base64 encoded.
1147
+ */
1148
+ value?: Uint8Array;
1149
+ /**
1150
+ * Creates a new `KvDelta` object.
1151
+ * @param key - The key, base64 encoded.
1152
+ * @param value - The new value of the KV store entry, base64 encoded.
1153
+ */
1154
+ constructor({ key, value, }: {
1155
+ key?: string | Uint8Array;
1156
+ value?: string | Uint8Array;
1157
+ });
1158
+ static from_obj_for_encoding(data: Record<string, any>): KvDelta;
1159
+ }
1160
+ /**
1161
+ * Contains a ledger delta for a single transaction group
1162
+ */
1163
+ export declare class LedgerStateDeltaForTransactionGroup extends BaseModel {
1164
+ /**
1165
+ * Ledger StateDelta object
1166
+ */
1167
+ delta: Record<string, any>;
1168
+ ids: string[];
1169
+ /**
1170
+ * Creates a new `LedgerStateDeltaForTransactionGroup` object.
1171
+ * @param delta - Ledger StateDelta object
1172
+ * @param ids -
1173
+ */
1174
+ constructor({ delta, ids }: {
1175
+ delta: Record<string, any>;
1176
+ ids: string[];
1177
+ });
1178
+ static from_obj_for_encoding(data: Record<string, any>): LedgerStateDeltaForTransactionGroup;
1179
+ }
1102
1180
  /**
1103
1181
  * Proof of membership and position of a light block header.
1104
1182
  */
@@ -1214,6 +1292,38 @@ export declare class NodeStatusResponse extends BaseModel {
1214
1292
  * The last catchpoint seen by the node
1215
1293
  */
1216
1294
  lastCatchpoint?: string;
1295
+ /**
1296
+ * Upgrade delay
1297
+ */
1298
+ upgradeDelay?: number | bigint;
1299
+ /**
1300
+ * Next protocol round
1301
+ */
1302
+ upgradeNextProtocolVoteBefore?: number | bigint;
1303
+ /**
1304
+ * No votes cast for consensus upgrade
1305
+ */
1306
+ upgradeNoVotes?: number | bigint;
1307
+ /**
1308
+ * This node's upgrade vote
1309
+ */
1310
+ upgradeNodeVote?: boolean;
1311
+ /**
1312
+ * Total voting rounds for current upgrade
1313
+ */
1314
+ upgradeVoteRounds?: number | bigint;
1315
+ /**
1316
+ * Total votes cast for consensus upgrade
1317
+ */
1318
+ upgradeVotes?: number | bigint;
1319
+ /**
1320
+ * Yes votes required for consensus upgrade
1321
+ */
1322
+ upgradeVotesRequired?: number | bigint;
1323
+ /**
1324
+ * Yes votes cast for consensus upgrade
1325
+ */
1326
+ upgradeYesVotes?: number | bigint;
1217
1327
  /**
1218
1328
  * Creates a new `NodeStatusResponse` object.
1219
1329
  * @param catchupTime - CatchupTime in nanoseconds
@@ -1242,8 +1352,16 @@ export declare class NodeStatusResponse extends BaseModel {
1242
1352
  * @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been
1243
1353
  * verified so far as part of the catchup
1244
1354
  * @param lastCatchpoint - The last catchpoint seen by the node
1245
- */
1246
- constructor({ catchupTime, lastRound, lastVersion, nextVersion, nextVersionRound, nextVersionSupported, stoppedAtUnsupportedRound, timeSinceLastRound, catchpoint, catchpointAcquiredBlocks, catchpointProcessedAccounts, catchpointProcessedKvs, catchpointTotalAccounts, catchpointTotalBlocks, catchpointTotalKvs, catchpointVerifiedAccounts, catchpointVerifiedKvs, lastCatchpoint, }: {
1355
+ * @param upgradeDelay - Upgrade delay
1356
+ * @param upgradeNextProtocolVoteBefore - Next protocol round
1357
+ * @param upgradeNoVotes - No votes cast for consensus upgrade
1358
+ * @param upgradeNodeVote - This node's upgrade vote
1359
+ * @param upgradeVoteRounds - Total voting rounds for current upgrade
1360
+ * @param upgradeVotes - Total votes cast for consensus upgrade
1361
+ * @param upgradeVotesRequired - Yes votes required for consensus upgrade
1362
+ * @param upgradeYesVotes - Yes votes cast for consensus upgrade
1363
+ */
1364
+ 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, }: {
1247
1365
  catchupTime: number | bigint;
1248
1366
  lastRound: number | bigint;
1249
1367
  lastVersion: string;
@@ -1262,6 +1380,14 @@ export declare class NodeStatusResponse extends BaseModel {
1262
1380
  catchpointVerifiedAccounts?: number | bigint;
1263
1381
  catchpointVerifiedKvs?: number | bigint;
1264
1382
  lastCatchpoint?: string;
1383
+ upgradeDelay?: number | bigint;
1384
+ upgradeNextProtocolVoteBefore?: number | bigint;
1385
+ upgradeNoVotes?: number | bigint;
1386
+ upgradeNodeVote?: boolean;
1387
+ upgradeVoteRounds?: number | bigint;
1388
+ upgradeVotes?: number | bigint;
1389
+ upgradeVotesRequired?: number | bigint;
1390
+ upgradeYesVotes?: number | bigint;
1265
1391
  });
1266
1392
  static from_obj_for_encoding(data: Record<string, any>): NodeStatusResponse;
1267
1393
  }
@@ -1306,7 +1432,7 @@ export declare class PendingTransactionResponse extends BaseModel {
1306
1432
  */
1307
1433
  confirmedRound?: number | bigint;
1308
1434
  /**
1309
- * (gd) Global state key/value changes for the application being executed by this
1435
+ * Global state key/value changes for the application being executed by this
1310
1436
  * transaction.
1311
1437
  */
1312
1438
  globalStateDelta?: EvalDeltaKeyValue[];
@@ -1315,12 +1441,12 @@ export declare class PendingTransactionResponse extends BaseModel {
1315
1441
  */
1316
1442
  innerTxns?: PendingTransactionResponse[];
1317
1443
  /**
1318
- * (ld) Local state key/value changes for the application being executed by this
1444
+ * Local state key/value changes for the application being executed by this
1319
1445
  * transaction.
1320
1446
  */
1321
1447
  localStateDelta?: AccountStateDelta[];
1322
1448
  /**
1323
- * (lg) Logs for the application being executed by this transaction.
1449
+ * Logs for the application being executed by this transaction.
1324
1450
  */
1325
1451
  logs?: Uint8Array[];
1326
1452
  /**
@@ -1344,12 +1470,12 @@ export declare class PendingTransactionResponse extends BaseModel {
1344
1470
  * @param closeRewards - Rewards in microalgos applied to the close remainder to account.
1345
1471
  * @param closingAmount - Closing amount for the transaction.
1346
1472
  * @param confirmedRound - The round where this transaction was confirmed, if present.
1347
- * @param globalStateDelta - (gd) Global state key/value changes for the application being executed by this
1473
+ * @param globalStateDelta - Global state key/value changes for the application being executed by this
1348
1474
  * transaction.
1349
1475
  * @param innerTxns - Inner transactions produced by application execution.
1350
- * @param localStateDelta - (ld) Local state key/value changes for the application being executed by this
1476
+ * @param localStateDelta - Local state key/value changes for the application being executed by this
1351
1477
  * transaction.
1352
- * @param logs - (lg) Logs for the application being executed by this transaction.
1478
+ * @param logs - Logs for the application being executed by this transaction.
1353
1479
  * @param receiverRewards - Rewards in microalgos applied to the receiver account.
1354
1480
  * @param senderRewards - Rewards in microalgos applied to the sender account.
1355
1481
  */
@@ -1413,6 +1539,60 @@ export declare class PostTransactionsResponse extends BaseModel {
1413
1539
  });
1414
1540
  static from_obj_for_encoding(data: Record<string, any>): PostTransactionsResponse;
1415
1541
  }
1542
+ /**
1543
+ * Request type for simulation endpoint.
1544
+ */
1545
+ export declare class SimulateRequest extends BaseModel {
1546
+ /**
1547
+ * The transaction groups to simulate.
1548
+ */
1549
+ txnGroups: SimulateRequestTransactionGroup[];
1550
+ /**
1551
+ * Allow transactions without signatures to be simulated as if they had correct
1552
+ * signatures.
1553
+ */
1554
+ allowEmptySignatures?: boolean;
1555
+ /**
1556
+ * Lifts limits on log opcode usage during simulation.
1557
+ */
1558
+ allowMoreLogging?: boolean;
1559
+ /**
1560
+ * Applies extra opcode budget during simulation for each transaction group.
1561
+ */
1562
+ extraOpcodeBudget?: number | bigint;
1563
+ /**
1564
+ * Creates a new `SimulateRequest` object.
1565
+ * @param txnGroups - The transaction groups to simulate.
1566
+ * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
1567
+ * signatures.
1568
+ * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
1569
+ * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
1570
+ */
1571
+ constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, extraOpcodeBudget, }: {
1572
+ txnGroups: SimulateRequestTransactionGroup[];
1573
+ allowEmptySignatures?: boolean;
1574
+ allowMoreLogging?: boolean;
1575
+ extraOpcodeBudget?: number | bigint;
1576
+ });
1577
+ static from_obj_for_encoding(data: Record<string, any>): SimulateRequest;
1578
+ }
1579
+ /**
1580
+ * A transaction group to simulate.
1581
+ */
1582
+ export declare class SimulateRequestTransactionGroup extends BaseModel {
1583
+ /**
1584
+ * An atomic transaction group.
1585
+ */
1586
+ txns: EncodedSignedTransaction[];
1587
+ /**
1588
+ * Creates a new `SimulateRequestTransactionGroup` object.
1589
+ * @param txns - An atomic transaction group.
1590
+ */
1591
+ constructor({ txns }: {
1592
+ txns: EncodedSignedTransaction[];
1593
+ });
1594
+ static from_obj_for_encoding(data: Record<string, any>): SimulateRequestTransactionGroup;
1595
+ }
1416
1596
  /**
1417
1597
  * Result of a transaction group simulation.
1418
1598
  */
@@ -1431,26 +1611,26 @@ export declare class SimulateResponse extends BaseModel {
1431
1611
  */
1432
1612
  version: number | bigint;
1433
1613
  /**
1434
- * Indicates whether the simulated transactions would have succeeded during an
1435
- * actual submission. If any transaction fails or is missing a signature, this will
1436
- * be false.
1614
+ * The set of parameters and limits override during simulation. If this set of
1615
+ * parameters is present, then evaluation parameters may differ from standard
1616
+ * evaluation in certain ways.
1437
1617
  */
1438
- wouldSucceed: boolean;
1618
+ evalOverrides?: SimulationEvalOverrides;
1439
1619
  /**
1440
1620
  * Creates a new `SimulateResponse` object.
1441
1621
  * @param lastRound - The round immediately preceding this simulation. State changes through this
1442
1622
  * round were used to run this simulation.
1443
1623
  * @param txnGroups - A result object for each transaction group that was simulated.
1444
1624
  * @param version - The version of this response object.
1445
- * @param wouldSucceed - Indicates whether the simulated transactions would have succeeded during an
1446
- * actual submission. If any transaction fails or is missing a signature, this will
1447
- * be false.
1625
+ * @param evalOverrides - The set of parameters and limits override during simulation. If this set of
1626
+ * parameters is present, then evaluation parameters may differ from standard
1627
+ * evaluation in certain ways.
1448
1628
  */
1449
- constructor({ lastRound, txnGroups, version, wouldSucceed, }: {
1629
+ constructor({ lastRound, txnGroups, version, evalOverrides, }: {
1450
1630
  lastRound: number | bigint;
1451
1631
  txnGroups: SimulateTransactionGroupResult[];
1452
1632
  version: number | bigint;
1453
- wouldSucceed: boolean;
1633
+ evalOverrides?: SimulationEvalOverrides;
1454
1634
  });
1455
1635
  static from_obj_for_encoding(data: Record<string, any>): SimulateResponse;
1456
1636
  }
@@ -1462,6 +1642,14 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
1462
1642
  * Simulation result for individual transactions
1463
1643
  */
1464
1644
  txnResults: SimulateTransactionResult[];
1645
+ /**
1646
+ * Total budget added during execution of app calls in the transaction group.
1647
+ */
1648
+ appBudgetAdded?: number | bigint;
1649
+ /**
1650
+ * Total budget consumed during execution of app calls in the transaction group.
1651
+ */
1652
+ appBudgetConsumed?: number | bigint;
1465
1653
  /**
1466
1654
  * If present, indicates which transaction in this group caused the failure. This
1467
1655
  * array represents the path to the failing transaction. Indexes are zero based,
@@ -1477,6 +1665,8 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
1477
1665
  /**
1478
1666
  * Creates a new `SimulateTransactionGroupResult` object.
1479
1667
  * @param txnResults - Simulation result for individual transactions
1668
+ * @param appBudgetAdded - Total budget added during execution of app calls in the transaction group.
1669
+ * @param appBudgetConsumed - Total budget consumed during execution of app calls in the transaction group.
1480
1670
  * @param failedAt - If present, indicates which transaction in this group caused the failure. This
1481
1671
  * array represents the path to the failing transaction. Indexes are zero based,
1482
1672
  * the first element indicates the top-level transaction, and successive elements
@@ -1484,8 +1674,10 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
1484
1674
  * @param failureMessage - If present, indicates that the transaction group failed and specifies why that
1485
1675
  * happened
1486
1676
  */
1487
- constructor({ txnResults, failedAt, failureMessage, }: {
1677
+ constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, }: {
1488
1678
  txnResults: SimulateTransactionResult[];
1679
+ appBudgetAdded?: number | bigint;
1680
+ appBudgetConsumed?: number | bigint;
1489
1681
  failedAt?: (number | bigint)[];
1490
1682
  failureMessage?: string;
1491
1683
  });
@@ -1501,21 +1693,68 @@ export declare class SimulateTransactionResult extends BaseModel {
1501
1693
  */
1502
1694
  txnResult: PendingTransactionResponse;
1503
1695
  /**
1504
- * A boolean indicating whether this transaction is missing signatures
1696
+ * Budget used during execution of an app call transaction. This value includes
1697
+ * budged used by inner app calls spawned by this transaction.
1505
1698
  */
1506
- missingSignature?: boolean;
1699
+ appBudgetConsumed?: number | bigint;
1700
+ /**
1701
+ * Budget used during execution of a logic sig transaction.
1702
+ */
1703
+ logicSigBudgetConsumed?: number | bigint;
1507
1704
  /**
1508
1705
  * Creates a new `SimulateTransactionResult` object.
1509
1706
  * @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
1510
1707
  * includes confirmation details like the round and reward details.
1511
- * @param missingSignature - A boolean indicating whether this transaction is missing signatures
1708
+ * @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
1709
+ * budged used by inner app calls spawned by this transaction.
1710
+ * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
1512
1711
  */
1513
- constructor({ txnResult, missingSignature, }: {
1712
+ constructor({ txnResult, appBudgetConsumed, logicSigBudgetConsumed, }: {
1514
1713
  txnResult: PendingTransactionResponse;
1515
- missingSignature?: boolean;
1714
+ appBudgetConsumed?: number | bigint;
1715
+ logicSigBudgetConsumed?: number | bigint;
1516
1716
  });
1517
1717
  static from_obj_for_encoding(data: Record<string, any>): SimulateTransactionResult;
1518
1718
  }
1719
+ /**
1720
+ * The set of parameters and limits override during simulation. If this set of
1721
+ * parameters is present, then evaluation parameters may differ from standard
1722
+ * evaluation in certain ways.
1723
+ */
1724
+ export declare class SimulationEvalOverrides extends BaseModel {
1725
+ /**
1726
+ * If true, transactions without signatures are allowed and simulated as if they
1727
+ * were properly signed.
1728
+ */
1729
+ allowEmptySignatures?: boolean;
1730
+ /**
1731
+ * The extra opcode budget added to each transaction group during simulation
1732
+ */
1733
+ extraOpcodeBudget?: number | bigint;
1734
+ /**
1735
+ * The maximum log calls one can make during simulation
1736
+ */
1737
+ maxLogCalls?: number | bigint;
1738
+ /**
1739
+ * The maximum byte number to log during simulation
1740
+ */
1741
+ maxLogSize?: number | bigint;
1742
+ /**
1743
+ * Creates a new `SimulationEvalOverrides` object.
1744
+ * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
1745
+ * were properly signed.
1746
+ * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
1747
+ * @param maxLogCalls - The maximum log calls one can make during simulation
1748
+ * @param maxLogSize - The maximum byte number to log during simulation
1749
+ */
1750
+ constructor({ allowEmptySignatures, extraOpcodeBudget, maxLogCalls, maxLogSize, }: {
1751
+ allowEmptySignatures?: boolean;
1752
+ extraOpcodeBudget?: number | bigint;
1753
+ maxLogCalls?: number | bigint;
1754
+ maxLogSize?: number | bigint;
1755
+ });
1756
+ static from_obj_for_encoding(data: Record<string, any>): SimulationEvalOverrides;
1757
+ }
1519
1758
  /**
1520
1759
  * Represents a state proof and its corresponding message
1521
1760
  */
@@ -1662,6 +1901,21 @@ export declare class TealValue extends BaseModel {
1662
1901
  });
1663
1902
  static from_obj_for_encoding(data: Record<string, any>): TealValue;
1664
1903
  }
1904
+ /**
1905
+ * Response containing all ledger state deltas for transaction groups, with their
1906
+ * associated Ids, in a single round.
1907
+ */
1908
+ export declare class TransactionGroupLedgerStateDeltasForRoundResponse extends BaseModel {
1909
+ deltas: LedgerStateDeltaForTransactionGroup[];
1910
+ /**
1911
+ * Creates a new `TransactionGroupLedgerStateDeltasForRoundResponse` object.
1912
+ * @param deltas -
1913
+ */
1914
+ constructor({ deltas }: {
1915
+ deltas: LedgerStateDeltaForTransactionGroup[];
1916
+ });
1917
+ static from_obj_for_encoding(data: Record<string, any>): TransactionGroupLedgerStateDeltasForRoundResponse;
1918
+ }
1665
1919
  /**
1666
1920
  * TransactionParams contains the parameters that help a client construct a new
1667
1921
  * transaction.
@@ -0,0 +1,4 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ export default class Ready extends JSONRequest {
3
+ path(): string;
4
+ }
@@ -0,0 +1,9 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ import HTTPClient from '../../client';
3
+ import IntDecoding from '../../../types/intDecoding';
4
+ export default class SetBlockOffsetTimestamp extends JSONRequest {
5
+ private offset;
6
+ constructor(c: HTTPClient, intDecoding: IntDecoding, offset: number);
7
+ path(): string;
8
+ do(headers?: {}): Promise<any>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ import HTTPClient from '../../client';
3
+ import IntDecoding from '../../../types/intDecoding';
4
+ export default class SetSyncRound extends JSONRequest {
5
+ private round;
6
+ constructor(c: HTTPClient, intDecoding: IntDecoding, round: number);
7
+ path(): string;
8
+ do(headers?: {}): Promise<any>;
9
+ }
@@ -1,6 +1,6 @@
1
1
  import HTTPClient from '../../client';
2
2
  import JSONRequest from '../jsonrequest';
3
- import { SimulateResponse } from './models/types';
3
+ import { SimulateRequest, SimulateResponse } from './models/types';
4
4
  /**
5
5
  * Sets the default header (if not previously set) for simulating a raw
6
6
  * transaction.
@@ -11,8 +11,8 @@ export declare function setSimulateTransactionsHeaders(headers?: {}): {};
11
11
  * Simulates signed txns.
12
12
  */
13
13
  export default class SimulateRawTransactions extends JSONRequest<SimulateResponse, Uint8Array> {
14
- private txnBytesToPost;
15
- constructor(c: HTTPClient, stxOrStxs: Uint8Array | Uint8Array[]);
14
+ private requestBytes;
15
+ constructor(c: HTTPClient, request: SimulateRequest);
16
16
  path(): string;
17
17
  do(headers?: {}): Promise<SimulateResponse>;
18
18
  prepare(body: Uint8Array): SimulateResponse;
@@ -1,9 +1,9 @@
1
1
  import JSONRequest from '../jsonrequest';
2
- import { SuggestedParams } from '../../../types/transactions/base';
2
+ import { SuggestedParamsWithMinFee } from '../../../types/transactions/base';
3
3
  /**
4
4
  * Returns the common needed parameters for a new transaction, in a format the transaction builder expects
5
5
  */
6
- export default class SuggestedParamsRequest extends JSONRequest<SuggestedParams> {
6
+ export default class SuggestedParamsRequest extends JSONRequest<SuggestedParamsWithMinFee> {
7
7
  path(): string;
8
- prepare(body: Record<string, any>): SuggestedParams;
8
+ prepare(body: Record<string, any>): SuggestedParamsWithMinFee;
9
9
  }
@@ -0,0 +1,5 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ export default class UnsetSyncRound extends JSONRequest {
3
+ path(): string;
4
+ do(headers?: {}): Promise<any>;
5
+ }
@@ -1,6 +1,6 @@
1
1
  import { ABIMethod, ABIValue } from './abi';
2
2
  import Algodv2 from './client/v2/algod/algod';
3
- import { SimulateResponse } from './client/v2/algod/models/types';
3
+ import { SimulateResponse, SimulateRequest } from './client/v2/algod/models/types';
4
4
  import { TransactionSigner, TransactionWithSigner } from './signer';
5
5
  import { BoxReference, OnApplicationComplete, SuggestedParams } from './types/transactions/base';
6
6
  export declare type ABIArgument = ABIValue | TransactionWithSigner;
@@ -158,12 +158,15 @@ export declare class AtomicTransactionComposer {
158
158
  * Simulating the group will not change the composer's status.
159
159
  *
160
160
  * @param client - An Algodv2 client
161
+ * @param request - SimulateRequest with options in simulation.
162
+ * If provided, the request's transaction group will be overrwritten by the composer's group,
163
+ * only simulation related options will be used.
161
164
  *
162
165
  * @returns A promise that, upon success, resolves to an object containing an
163
166
  * array of results containing one element for each method call transaction
164
167
  * in this group (ABIResult[]) and the SimulateResponse object.
165
168
  */
166
- simulate(client: Algodv2): Promise<{
169
+ simulate(client: Algodv2, request?: SimulateRequest): Promise<{
167
170
  methodResults: ABIResult[];
168
171
  simulateResponse: SimulateResponse;
169
172
  }>;
@@ -66,6 +66,7 @@ export { default as IntDecoding } from './types/intDecoding';
66
66
  export { default as Account } from './types/account';
67
67
  export { default as Indexer } from './client/v2/indexer/indexer';
68
68
  export { BaseHTTPClient, BaseHTTPClientResponse, BaseHTTPClientError, } from './client/baseHTTPClient';
69
+ export { AlgodTokenHeader, IndexerTokenHeader, KMDTokenHeader, CustomTokenHeader, TokenHeader, } from './client/urlTokenBaseHTTPClient';
69
70
  export { waitForConfirmation } from './wait';
70
71
  export { isValidAddress, encodeAddress, decodeAddress, getApplicationAddress, } from './encoding/address';
71
72
  export { bytesToBigInt, bigIntToBytes } from './encoding/bigint';
@@ -49,9 +49,7 @@ export declare function makeKeyRegistrationTxnWithSuggestedParams(from: KeyRegis
49
49
  export declare function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperty<MustHaveSuggestedParams<KeyRegistrationTxn>, 'reKeyTo', 'rekeyTo'>, 'from' | 'note' | 'voteKey' | 'selectionKey' | 'stateProofKey' | 'voteFirst' | 'voteLast' | 'voteKeyDilution' | 'suggestedParams' | 'rekeyTo'> & {
50
50
  nonParticipation?: false;
51
51
  }>): txnBuilder.Transaction;
52
- export declare function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperty<MustHaveSuggestedParams<KeyRegistrationTxn>, 'reKeyTo', 'rekeyTo'>, 'from' | 'note' | 'suggestedParams' | 'rekeyTo'> & {
53
- nonParticipation: true;
54
- }>): txnBuilder.Transaction;
52
+ export declare function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperty<MustHaveSuggestedParams<KeyRegistrationTxn>, 'reKeyTo', 'rekeyTo'>, 'from' | 'note' | 'suggestedParams' | 'rekeyTo' | 'nonParticipation'>>): txnBuilder.Transaction;
55
53
  /** makeAssetCreateTxnWithSuggestedParams takes asset creation arguments and returns a Transaction object
56
54
  * for creating that asset
57
55
  *
@@ -101,6 +101,12 @@ export interface SuggestedParams {
101
101
  */
102
102
  genesisHash: string;
103
103
  }
104
+ export declare type SuggestedParamsWithMinFee = SuggestedParams & {
105
+ /**
106
+ * Minimum fee (not per byte) required for the transaction to be confirmed
107
+ */
108
+ minFee: number;
109
+ };
104
110
  /**
105
111
  * A grouping of the app ID and name of the box in an Uint8Array
106
112
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "algosdk",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "The official JavaScript SDK for Algorand",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -40,7 +40,6 @@
40
40
  "assert": "^2.0.0",
41
41
  "chromedriver": "^108.0.0",
42
42
  "concurrently": "^6.2.0",
43
- "coveralls": "^3.1.0",
44
43
  "cucumber": "^5.1.0",
45
44
  "es-abstract": "^1.18.3",
46
45
  "eslint": "^7.21.0",
@@ -53,7 +52,6 @@
53
52
  "husky": "^4.3.8",
54
53
  "lint-staged": "^10.5.4",
55
54
  "mocha": "^9.0.0",
56
- "mocha-lcov-reporter": "^1.3.0",
57
55
  "mock-http-server": "^1.4.3",
58
56
  "prettier": "2.2.1",
59
57
  "selenium-webdriver": "^4.2.0",
@@ -82,6 +80,6 @@
82
80
  "author": "Algorand, llc",
83
81
  "license": "MIT",
84
82
  "engines": {
85
- "node": ">=14.0.0"
83
+ "node": ">=16.0.0"
86
84
  }
87
85
  }