algosdk 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -7
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +201 -25
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js +1 -1
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +19 -0
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
- package/dist/cjs/client/v2/algod/getSyncRound.js +19 -0
- package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -0
- package/dist/cjs/client/v2/algod/models/types.js +257 -23
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/algod/ready.js +14 -0
- package/dist/cjs/client/v2/algod/ready.js.map +1 -0
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +22 -0
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
- package/dist/cjs/client/v2/algod/setSyncRound.js +22 -0
- package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -0
- package/dist/cjs/client/v2/algod/simulateTransaction.js +4 -19
- package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/cjs/client/v2/algod/suggestedParams.js +1 -0
- package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/cjs/client/v2/algod/unsetSyncRound.js +18 -0
- package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -0
- package/dist/cjs/composer.js +39 -2
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/transaction.js +1 -2
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +178 -25
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxes.js +1 -1
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +13 -0
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
- package/dist/esm/client/v2/algod/getSyncRound.js +13 -0
- package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -0
- package/dist/esm/client/v2/algod/models/types.js +250 -22
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/algod/ready.js +8 -0
- package/dist/esm/client/v2/algod/ready.js.map +1 -0
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +16 -0
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
- package/dist/esm/client/v2/algod/setSyncRound.js +16 -0
- package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -0
- package/dist/esm/client/v2/algod/simulateTransaction.js +4 -19
- package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/esm/client/v2/algod/suggestedParams.js +1 -0
- package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/esm/client/v2/algod/unsetSyncRound.js +12 -0
- package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -0
- package/dist/esm/composer.js +16 -2
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/transaction.js +1 -2
- package/dist/esm/transaction.js.map +1 -1
- package/dist/types/client/v2/algod/algod.d.ts +145 -24
- package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +1 -1
- package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +1 -1
- package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +6 -0
- package/dist/types/client/v2/algod/getSyncRound.d.ts +6 -0
- package/dist/types/client/v2/algod/models/types.d.ts +236 -29
- package/dist/types/client/v2/algod/ready.d.ts +4 -0
- package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +9 -0
- package/dist/types/client/v2/algod/setSyncRound.d.ts +9 -0
- package/dist/types/client/v2/algod/simulateTransaction.d.ts +3 -3
- package/dist/types/client/v2/algod/suggestedParams.d.ts +3 -3
- package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -0
- package/dist/types/composer.d.ts +5 -2
- package/dist/types/main.d.ts +1 -0
- package/dist/types/makeTxn.d.ts +1 -3
- package/dist/types/types/transactions/base.d.ts +6 -0
- package/package.json +2 -2
- package/src/client/v2/algod/algod.ts +184 -25
- package/src/client/v2/algod/getApplicationBoxByName.ts +1 -1
- package/src/client/v2/algod/getApplicationBoxes.ts +1 -1
- package/src/client/v2/algod/getBlockOffsetTimestamp.ts +17 -0
- package/src/client/v2/algod/getSyncRound.ts +17 -0
- package/src/client/v2/algod/models/types.ts +454 -36
- package/src/client/v2/algod/ready.ts +8 -0
- package/src/client/v2/algod/setBlockOffsetTimestamp.ts +20 -0
- package/src/client/v2/algod/setSyncRound.ts +20 -0
- package/src/client/v2/algod/simulateTransaction.ts +6 -22
- package/src/client/v2/algod/suggestedParams.ts +4 -3
- package/src/client/v2/algod/unsetSyncRound.ts +13 -0
- package/src/composer.ts +27 -3
- package/src/main.ts +7 -0
- package/src/makeTxn.ts +2 -4
- package/src/transaction.ts +1 -2
- package/src/types/transactions/base.ts +7 -0
|
@@ -6,7 +6,7 @@ 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.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = 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.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
10
|
/* eslint-disable no-use-before-define */
|
|
11
11
|
const buffer_1 = require("buffer");
|
|
12
12
|
const basemodel_1 = __importDefault(require("../../basemodel"));
|
|
@@ -459,9 +459,9 @@ class ApplicationParams extends basemodel_1.default {
|
|
|
459
459
|
* @param creator - The address that created this application. This is the address where the
|
|
460
460
|
* parameters and global state for this application can be found.
|
|
461
461
|
* @param extraProgramPages - (epp) the amount of extra program pages available to this app.
|
|
462
|
-
* @param globalState -
|
|
463
|
-
* @param globalStateSchema -
|
|
464
|
-
* @param localStateSchema -
|
|
462
|
+
* @param globalState - (gs) global state
|
|
463
|
+
* @param globalStateSchema - (gsch) global schema
|
|
464
|
+
* @param localStateSchema - (lsch) local schema
|
|
465
465
|
*/
|
|
466
466
|
constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, }) {
|
|
467
467
|
super();
|
|
@@ -1390,6 +1390,96 @@ class EvalDeltaKeyValue extends basemodel_1.default {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
exports.EvalDeltaKeyValue = EvalDeltaKeyValue;
|
|
1393
|
+
/**
|
|
1394
|
+
* Response containing the timestamp offset in seconds
|
|
1395
|
+
*/
|
|
1396
|
+
class GetBlockTimeStampOffsetResponse extends basemodel_1.default {
|
|
1397
|
+
/**
|
|
1398
|
+
* Creates a new `GetBlockTimeStampOffsetResponse` object.
|
|
1399
|
+
* @param offset - Timestamp offset in seconds.
|
|
1400
|
+
*/
|
|
1401
|
+
constructor({ offset }) {
|
|
1402
|
+
super();
|
|
1403
|
+
this.offset = offset;
|
|
1404
|
+
this.attribute_map = {
|
|
1405
|
+
offset: 'offset',
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
// eslint-disable-next-line camelcase
|
|
1409
|
+
static from_obj_for_encoding(data) {
|
|
1410
|
+
/* eslint-disable dot-notation */
|
|
1411
|
+
if (typeof data['offset'] === 'undefined')
|
|
1412
|
+
throw new Error(`Response is missing required field 'offset': ${data}`);
|
|
1413
|
+
return new GetBlockTimeStampOffsetResponse({
|
|
1414
|
+
offset: data['offset'],
|
|
1415
|
+
});
|
|
1416
|
+
/* eslint-enable dot-notation */
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
exports.GetBlockTimeStampOffsetResponse = GetBlockTimeStampOffsetResponse;
|
|
1420
|
+
/**
|
|
1421
|
+
* Response containing the ledger's minimum sync round
|
|
1422
|
+
*/
|
|
1423
|
+
class GetSyncRoundResponse extends basemodel_1.default {
|
|
1424
|
+
/**
|
|
1425
|
+
* Creates a new `GetSyncRoundResponse` object.
|
|
1426
|
+
* @param round - The minimum sync round for the ledger.
|
|
1427
|
+
*/
|
|
1428
|
+
constructor({ round }) {
|
|
1429
|
+
super();
|
|
1430
|
+
this.round = round;
|
|
1431
|
+
this.attribute_map = {
|
|
1432
|
+
round: 'round',
|
|
1433
|
+
};
|
|
1434
|
+
}
|
|
1435
|
+
// eslint-disable-next-line camelcase
|
|
1436
|
+
static from_obj_for_encoding(data) {
|
|
1437
|
+
/* eslint-disable dot-notation */
|
|
1438
|
+
if (typeof data['round'] === 'undefined')
|
|
1439
|
+
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
1440
|
+
return new GetSyncRoundResponse({
|
|
1441
|
+
round: data['round'],
|
|
1442
|
+
});
|
|
1443
|
+
/* eslint-enable dot-notation */
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
exports.GetSyncRoundResponse = GetSyncRoundResponse;
|
|
1447
|
+
/**
|
|
1448
|
+
* A single Delta containing the key, the previous value and the current value for
|
|
1449
|
+
* a single round.
|
|
1450
|
+
*/
|
|
1451
|
+
class KvDelta extends basemodel_1.default {
|
|
1452
|
+
/**
|
|
1453
|
+
* Creates a new `KvDelta` object.
|
|
1454
|
+
* @param key - The key, base64 encoded.
|
|
1455
|
+
* @param value - The new value of the KV store entry, base64 encoded.
|
|
1456
|
+
*/
|
|
1457
|
+
constructor({ key, value, }) {
|
|
1458
|
+
super();
|
|
1459
|
+
this.key =
|
|
1460
|
+
typeof key === 'string'
|
|
1461
|
+
? new Uint8Array(buffer_1.Buffer.from(key, 'base64'))
|
|
1462
|
+
: key;
|
|
1463
|
+
this.value =
|
|
1464
|
+
typeof value === 'string'
|
|
1465
|
+
? new Uint8Array(buffer_1.Buffer.from(value, 'base64'))
|
|
1466
|
+
: value;
|
|
1467
|
+
this.attribute_map = {
|
|
1468
|
+
key: 'key',
|
|
1469
|
+
value: 'value',
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
// eslint-disable-next-line camelcase
|
|
1473
|
+
static from_obj_for_encoding(data) {
|
|
1474
|
+
/* eslint-disable dot-notation */
|
|
1475
|
+
return new KvDelta({
|
|
1476
|
+
key: data['key'],
|
|
1477
|
+
value: data['value'],
|
|
1478
|
+
});
|
|
1479
|
+
/* eslint-enable dot-notation */
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
exports.KvDelta = KvDelta;
|
|
1393
1483
|
/**
|
|
1394
1484
|
* Proof of membership and position of a light block header.
|
|
1395
1485
|
*/
|
|
@@ -1465,8 +1555,16 @@ class NodeStatusResponse extends basemodel_1.default {
|
|
|
1465
1555
|
* @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been
|
|
1466
1556
|
* verified so far as part of the catchup
|
|
1467
1557
|
* @param lastCatchpoint - The last catchpoint seen by the node
|
|
1558
|
+
* @param upgradeDelay - Upgrade delay
|
|
1559
|
+
* @param upgradeNextProtocolVoteBefore - Next protocol round
|
|
1560
|
+
* @param upgradeNoVotes - No votes cast for consensus upgrade
|
|
1561
|
+
* @param upgradeNodeVote - This node's upgrade vote
|
|
1562
|
+
* @param upgradeVoteRounds - Total voting rounds for current upgrade
|
|
1563
|
+
* @param upgradeVotes - Total votes cast for consensus upgrade
|
|
1564
|
+
* @param upgradeVotesRequired - Yes votes required for consensus upgrade
|
|
1565
|
+
* @param upgradeYesVotes - Yes votes cast for consensus upgrade
|
|
1468
1566
|
*/
|
|
1469
|
-
constructor({ catchupTime, lastRound, lastVersion, nextVersion, nextVersionRound, nextVersionSupported, stoppedAtUnsupportedRound, timeSinceLastRound, catchpoint, catchpointAcquiredBlocks, catchpointProcessedAccounts, catchpointProcessedKvs, catchpointTotalAccounts, catchpointTotalBlocks, catchpointTotalKvs, catchpointVerifiedAccounts, catchpointVerifiedKvs, lastCatchpoint, }) {
|
|
1567
|
+
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
1568
|
super();
|
|
1471
1569
|
this.catchupTime = catchupTime;
|
|
1472
1570
|
this.lastRound = lastRound;
|
|
@@ -1486,6 +1584,14 @@ class NodeStatusResponse extends basemodel_1.default {
|
|
|
1486
1584
|
this.catchpointVerifiedAccounts = catchpointVerifiedAccounts;
|
|
1487
1585
|
this.catchpointVerifiedKvs = catchpointVerifiedKvs;
|
|
1488
1586
|
this.lastCatchpoint = lastCatchpoint;
|
|
1587
|
+
this.upgradeDelay = upgradeDelay;
|
|
1588
|
+
this.upgradeNextProtocolVoteBefore = upgradeNextProtocolVoteBefore;
|
|
1589
|
+
this.upgradeNoVotes = upgradeNoVotes;
|
|
1590
|
+
this.upgradeNodeVote = upgradeNodeVote;
|
|
1591
|
+
this.upgradeVoteRounds = upgradeVoteRounds;
|
|
1592
|
+
this.upgradeVotes = upgradeVotes;
|
|
1593
|
+
this.upgradeVotesRequired = upgradeVotesRequired;
|
|
1594
|
+
this.upgradeYesVotes = upgradeYesVotes;
|
|
1489
1595
|
this.attribute_map = {
|
|
1490
1596
|
catchupTime: 'catchup-time',
|
|
1491
1597
|
lastRound: 'last-round',
|
|
@@ -1505,6 +1611,14 @@ class NodeStatusResponse extends basemodel_1.default {
|
|
|
1505
1611
|
catchpointVerifiedAccounts: 'catchpoint-verified-accounts',
|
|
1506
1612
|
catchpointVerifiedKvs: 'catchpoint-verified-kvs',
|
|
1507
1613
|
lastCatchpoint: 'last-catchpoint',
|
|
1614
|
+
upgradeDelay: 'upgrade-delay',
|
|
1615
|
+
upgradeNextProtocolVoteBefore: 'upgrade-next-protocol-vote-before',
|
|
1616
|
+
upgradeNoVotes: 'upgrade-no-votes',
|
|
1617
|
+
upgradeNodeVote: 'upgrade-node-vote',
|
|
1618
|
+
upgradeVoteRounds: 'upgrade-vote-rounds',
|
|
1619
|
+
upgradeVotes: 'upgrade-votes',
|
|
1620
|
+
upgradeVotesRequired: 'upgrade-votes-required',
|
|
1621
|
+
upgradeYesVotes: 'upgrade-yes-votes',
|
|
1508
1622
|
};
|
|
1509
1623
|
}
|
|
1510
1624
|
// eslint-disable-next-line camelcase
|
|
@@ -1545,6 +1659,14 @@ class NodeStatusResponse extends basemodel_1.default {
|
|
|
1545
1659
|
catchpointVerifiedAccounts: data['catchpoint-verified-accounts'],
|
|
1546
1660
|
catchpointVerifiedKvs: data['catchpoint-verified-kvs'],
|
|
1547
1661
|
lastCatchpoint: data['last-catchpoint'],
|
|
1662
|
+
upgradeDelay: data['upgrade-delay'],
|
|
1663
|
+
upgradeNextProtocolVoteBefore: data['upgrade-next-protocol-vote-before'],
|
|
1664
|
+
upgradeNoVotes: data['upgrade-no-votes'],
|
|
1665
|
+
upgradeNodeVote: data['upgrade-node-vote'],
|
|
1666
|
+
upgradeVoteRounds: data['upgrade-vote-rounds'],
|
|
1667
|
+
upgradeVotes: data['upgrade-votes'],
|
|
1668
|
+
upgradeVotesRequired: data['upgrade-votes-required'],
|
|
1669
|
+
upgradeYesVotes: data['upgrade-yes-votes'],
|
|
1548
1670
|
});
|
|
1549
1671
|
/* eslint-enable dot-notation */
|
|
1550
1672
|
}
|
|
@@ -1568,12 +1690,12 @@ class PendingTransactionResponse extends basemodel_1.default {
|
|
|
1568
1690
|
* @param closeRewards - Rewards in microalgos applied to the close remainder to account.
|
|
1569
1691
|
* @param closingAmount - Closing amount for the transaction.
|
|
1570
1692
|
* @param confirmedRound - The round where this transaction was confirmed, if present.
|
|
1571
|
-
* @param globalStateDelta -
|
|
1693
|
+
* @param globalStateDelta - Global state key/value changes for the application being executed by this
|
|
1572
1694
|
* transaction.
|
|
1573
1695
|
* @param innerTxns - Inner transactions produced by application execution.
|
|
1574
|
-
* @param localStateDelta -
|
|
1696
|
+
* @param localStateDelta - Local state key/value changes for the application being executed by this
|
|
1575
1697
|
* transaction.
|
|
1576
|
-
* @param logs -
|
|
1698
|
+
* @param logs - Logs for the application being executed by this transaction.
|
|
1577
1699
|
* @param receiverRewards - Rewards in microalgos applied to the receiver account.
|
|
1578
1700
|
* @param senderRewards - Rewards in microalgos applied to the sender account.
|
|
1579
1701
|
*/
|
|
@@ -1705,6 +1827,69 @@ class PostTransactionsResponse extends basemodel_1.default {
|
|
|
1705
1827
|
}
|
|
1706
1828
|
}
|
|
1707
1829
|
exports.PostTransactionsResponse = PostTransactionsResponse;
|
|
1830
|
+
/**
|
|
1831
|
+
* Request type for simulation endpoint.
|
|
1832
|
+
*/
|
|
1833
|
+
class SimulateRequest extends basemodel_1.default {
|
|
1834
|
+
/**
|
|
1835
|
+
* Creates a new `SimulateRequest` object.
|
|
1836
|
+
* @param txnGroups - The transaction groups to simulate.
|
|
1837
|
+
* @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
|
|
1838
|
+
* signatures.
|
|
1839
|
+
* @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
|
|
1840
|
+
*/
|
|
1841
|
+
constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, }) {
|
|
1842
|
+
super();
|
|
1843
|
+
this.txnGroups = txnGroups;
|
|
1844
|
+
this.allowEmptySignatures = allowEmptySignatures;
|
|
1845
|
+
this.allowMoreLogging = allowMoreLogging;
|
|
1846
|
+
this.attribute_map = {
|
|
1847
|
+
txnGroups: 'txn-groups',
|
|
1848
|
+
allowEmptySignatures: 'allow-empty-signatures',
|
|
1849
|
+
allowMoreLogging: 'allow-more-logging',
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
// eslint-disable-next-line camelcase
|
|
1853
|
+
static from_obj_for_encoding(data) {
|
|
1854
|
+
/* eslint-disable dot-notation */
|
|
1855
|
+
if (!Array.isArray(data['txn-groups']))
|
|
1856
|
+
throw new Error(`Response is missing required array field 'txn-groups': ${data}`);
|
|
1857
|
+
return new SimulateRequest({
|
|
1858
|
+
txnGroups: data['txn-groups'].map(SimulateRequestTransactionGroup.from_obj_for_encoding),
|
|
1859
|
+
allowEmptySignatures: data['allow-empty-signatures'],
|
|
1860
|
+
allowMoreLogging: data['allow-more-logging'],
|
|
1861
|
+
});
|
|
1862
|
+
/* eslint-enable dot-notation */
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
exports.SimulateRequest = SimulateRequest;
|
|
1866
|
+
/**
|
|
1867
|
+
* A transaction group to simulate.
|
|
1868
|
+
*/
|
|
1869
|
+
class SimulateRequestTransactionGroup extends basemodel_1.default {
|
|
1870
|
+
/**
|
|
1871
|
+
* Creates a new `SimulateRequestTransactionGroup` object.
|
|
1872
|
+
* @param txns - An atomic transaction group.
|
|
1873
|
+
*/
|
|
1874
|
+
constructor({ txns }) {
|
|
1875
|
+
super();
|
|
1876
|
+
this.txns = txns;
|
|
1877
|
+
this.attribute_map = {
|
|
1878
|
+
txns: 'txns',
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
// eslint-disable-next-line camelcase
|
|
1882
|
+
static from_obj_for_encoding(data) {
|
|
1883
|
+
/* eslint-disable dot-notation */
|
|
1884
|
+
if (!Array.isArray(data['txns']))
|
|
1885
|
+
throw new Error(`Response is missing required array field 'txns': ${data}`);
|
|
1886
|
+
return new SimulateRequestTransactionGroup({
|
|
1887
|
+
txns: data['txns'],
|
|
1888
|
+
});
|
|
1889
|
+
/* eslint-enable dot-notation */
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
exports.SimulateRequestTransactionGroup = SimulateRequestTransactionGroup;
|
|
1708
1893
|
/**
|
|
1709
1894
|
* Result of a transaction group simulation.
|
|
1710
1895
|
*/
|
|
@@ -1715,21 +1900,21 @@ class SimulateResponse extends basemodel_1.default {
|
|
|
1715
1900
|
* round were used to run this simulation.
|
|
1716
1901
|
* @param txnGroups - A result object for each transaction group that was simulated.
|
|
1717
1902
|
* @param version - The version of this response object.
|
|
1718
|
-
* @param
|
|
1719
|
-
*
|
|
1720
|
-
*
|
|
1903
|
+
* @param evalOverrides - The set of parameters and limits override during simulation. If this set of
|
|
1904
|
+
* parameters is present, then evaluation parameters may differ from standard
|
|
1905
|
+
* evaluation in certain ways.
|
|
1721
1906
|
*/
|
|
1722
|
-
constructor({ lastRound, txnGroups, version,
|
|
1907
|
+
constructor({ lastRound, txnGroups, version, evalOverrides, }) {
|
|
1723
1908
|
super();
|
|
1724
1909
|
this.lastRound = lastRound;
|
|
1725
1910
|
this.txnGroups = txnGroups;
|
|
1726
1911
|
this.version = version;
|
|
1727
|
-
this.
|
|
1912
|
+
this.evalOverrides = evalOverrides;
|
|
1728
1913
|
this.attribute_map = {
|
|
1729
1914
|
lastRound: 'last-round',
|
|
1730
1915
|
txnGroups: 'txn-groups',
|
|
1731
1916
|
version: 'version',
|
|
1732
|
-
|
|
1917
|
+
evalOverrides: 'eval-overrides',
|
|
1733
1918
|
};
|
|
1734
1919
|
}
|
|
1735
1920
|
// eslint-disable-next-line camelcase
|
|
@@ -1741,13 +1926,13 @@ class SimulateResponse extends basemodel_1.default {
|
|
|
1741
1926
|
throw new Error(`Response is missing required array field 'txn-groups': ${data}`);
|
|
1742
1927
|
if (typeof data['version'] === 'undefined')
|
|
1743
1928
|
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
1929
|
return new SimulateResponse({
|
|
1747
1930
|
lastRound: data['last-round'],
|
|
1748
1931
|
txnGroups: data['txn-groups'].map(SimulateTransactionGroupResult.from_obj_for_encoding),
|
|
1749
1932
|
version: data['version'],
|
|
1750
|
-
|
|
1933
|
+
evalOverrides: typeof data['eval-overrides'] !== 'undefined'
|
|
1934
|
+
? SimulationEvalOverrides.from_obj_for_encoding(data['eval-overrides'])
|
|
1935
|
+
: undefined,
|
|
1751
1936
|
});
|
|
1752
1937
|
/* eslint-enable dot-notation */
|
|
1753
1938
|
}
|
|
@@ -1760,6 +1945,8 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
|
|
|
1760
1945
|
/**
|
|
1761
1946
|
* Creates a new `SimulateTransactionGroupResult` object.
|
|
1762
1947
|
* @param txnResults - Simulation result for individual transactions
|
|
1948
|
+
* @param appBudgetAdded - Total budget added during execution of app calls in the transaction group.
|
|
1949
|
+
* @param appBudgetConsumed - Total budget consumed during execution of app calls in the transaction group.
|
|
1763
1950
|
* @param failedAt - If present, indicates which transaction in this group caused the failure. This
|
|
1764
1951
|
* array represents the path to the failing transaction. Indexes are zero based,
|
|
1765
1952
|
* the first element indicates the top-level transaction, and successive elements
|
|
@@ -1767,13 +1954,17 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
|
|
|
1767
1954
|
* @param failureMessage - If present, indicates that the transaction group failed and specifies why that
|
|
1768
1955
|
* happened
|
|
1769
1956
|
*/
|
|
1770
|
-
constructor({ txnResults, failedAt, failureMessage, }) {
|
|
1957
|
+
constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, }) {
|
|
1771
1958
|
super();
|
|
1772
1959
|
this.txnResults = txnResults;
|
|
1960
|
+
this.appBudgetAdded = appBudgetAdded;
|
|
1961
|
+
this.appBudgetConsumed = appBudgetConsumed;
|
|
1773
1962
|
this.failedAt = failedAt;
|
|
1774
1963
|
this.failureMessage = failureMessage;
|
|
1775
1964
|
this.attribute_map = {
|
|
1776
1965
|
txnResults: 'txn-results',
|
|
1966
|
+
appBudgetAdded: 'app-budget-added',
|
|
1967
|
+
appBudgetConsumed: 'app-budget-consumed',
|
|
1777
1968
|
failedAt: 'failed-at',
|
|
1778
1969
|
failureMessage: 'failure-message',
|
|
1779
1970
|
};
|
|
@@ -1785,6 +1976,8 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
|
|
|
1785
1976
|
throw new Error(`Response is missing required array field 'txn-results': ${data}`);
|
|
1786
1977
|
return new SimulateTransactionGroupResult({
|
|
1787
1978
|
txnResults: data['txn-results'].map(SimulateTransactionResult.from_obj_for_encoding),
|
|
1979
|
+
appBudgetAdded: data['app-budget-added'],
|
|
1980
|
+
appBudgetConsumed: data['app-budget-consumed'],
|
|
1788
1981
|
failedAt: data['failed-at'],
|
|
1789
1982
|
failureMessage: data['failure-message'],
|
|
1790
1983
|
});
|
|
@@ -1800,15 +1993,19 @@ class SimulateTransactionResult extends basemodel_1.default {
|
|
|
1800
1993
|
* Creates a new `SimulateTransactionResult` object.
|
|
1801
1994
|
* @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
|
|
1802
1995
|
* includes confirmation details like the round and reward details.
|
|
1803
|
-
* @param
|
|
1996
|
+
* @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
|
|
1997
|
+
* budged used by inner app calls spawned by this transaction.
|
|
1998
|
+
* @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
|
|
1804
1999
|
*/
|
|
1805
|
-
constructor({ txnResult,
|
|
2000
|
+
constructor({ txnResult, appBudgetConsumed, logicSigBudgetConsumed, }) {
|
|
1806
2001
|
super();
|
|
1807
2002
|
this.txnResult = txnResult;
|
|
1808
|
-
this.
|
|
2003
|
+
this.appBudgetConsumed = appBudgetConsumed;
|
|
2004
|
+
this.logicSigBudgetConsumed = logicSigBudgetConsumed;
|
|
1809
2005
|
this.attribute_map = {
|
|
1810
2006
|
txnResult: 'txn-result',
|
|
1811
|
-
|
|
2007
|
+
appBudgetConsumed: 'app-budget-consumed',
|
|
2008
|
+
logicSigBudgetConsumed: 'logic-sig-budget-consumed',
|
|
1812
2009
|
};
|
|
1813
2010
|
}
|
|
1814
2011
|
// eslint-disable-next-line camelcase
|
|
@@ -1818,12 +2015,49 @@ class SimulateTransactionResult extends basemodel_1.default {
|
|
|
1818
2015
|
throw new Error(`Response is missing required field 'txn-result': ${data}`);
|
|
1819
2016
|
return new SimulateTransactionResult({
|
|
1820
2017
|
txnResult: PendingTransactionResponse.from_obj_for_encoding(data['txn-result']),
|
|
1821
|
-
|
|
2018
|
+
appBudgetConsumed: data['app-budget-consumed'],
|
|
2019
|
+
logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
|
|
1822
2020
|
});
|
|
1823
2021
|
/* eslint-enable dot-notation */
|
|
1824
2022
|
}
|
|
1825
2023
|
}
|
|
1826
2024
|
exports.SimulateTransactionResult = SimulateTransactionResult;
|
|
2025
|
+
/**
|
|
2026
|
+
* The set of parameters and limits override during simulation. If this set of
|
|
2027
|
+
* parameters is present, then evaluation parameters may differ from standard
|
|
2028
|
+
* evaluation in certain ways.
|
|
2029
|
+
*/
|
|
2030
|
+
class SimulationEvalOverrides extends basemodel_1.default {
|
|
2031
|
+
/**
|
|
2032
|
+
* Creates a new `SimulationEvalOverrides` object.
|
|
2033
|
+
* @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
|
|
2034
|
+
* were properly signed.
|
|
2035
|
+
* @param maxLogCalls - The maximum log calls one can make during simulation
|
|
2036
|
+
* @param maxLogSize - The maximum byte number to log during simulation
|
|
2037
|
+
*/
|
|
2038
|
+
constructor({ allowEmptySignatures, maxLogCalls, maxLogSize, }) {
|
|
2039
|
+
super();
|
|
2040
|
+
this.allowEmptySignatures = allowEmptySignatures;
|
|
2041
|
+
this.maxLogCalls = maxLogCalls;
|
|
2042
|
+
this.maxLogSize = maxLogSize;
|
|
2043
|
+
this.attribute_map = {
|
|
2044
|
+
allowEmptySignatures: 'allow-empty-signatures',
|
|
2045
|
+
maxLogCalls: 'max-log-calls',
|
|
2046
|
+
maxLogSize: 'max-log-size',
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
// eslint-disable-next-line camelcase
|
|
2050
|
+
static from_obj_for_encoding(data) {
|
|
2051
|
+
/* eslint-disable dot-notation */
|
|
2052
|
+
return new SimulationEvalOverrides({
|
|
2053
|
+
allowEmptySignatures: data['allow-empty-signatures'],
|
|
2054
|
+
maxLogCalls: data['max-log-calls'],
|
|
2055
|
+
maxLogSize: data['max-log-size'],
|
|
2056
|
+
});
|
|
2057
|
+
/* eslint-enable dot-notation */
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
exports.SimulationEvalOverrides = SimulationEvalOverrides;
|
|
1827
2061
|
/**
|
|
1828
2062
|
* Represents a state proof and its corresponding message
|
|
1829
2063
|
*/
|