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
|
@@ -426,15 +426,15 @@ export declare class ApplicationParams extends BaseModel {
|
|
|
426
426
|
*/
|
|
427
427
|
extraProgramPages?: number | bigint;
|
|
428
428
|
/**
|
|
429
|
-
*
|
|
429
|
+
* (gs) global state
|
|
430
430
|
*/
|
|
431
431
|
globalState?: TealKeyValue[];
|
|
432
432
|
/**
|
|
433
|
-
*
|
|
433
|
+
* (gsch) global schema
|
|
434
434
|
*/
|
|
435
435
|
globalStateSchema?: ApplicationStateSchema;
|
|
436
436
|
/**
|
|
437
|
-
*
|
|
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 -
|
|
448
|
-
* @param globalStateSchema -
|
|
449
|
-
* @param localStateSchema -
|
|
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,64 @@ 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
|
+
}
|
|
1102
1160
|
/**
|
|
1103
1161
|
* Proof of membership and position of a light block header.
|
|
1104
1162
|
*/
|
|
@@ -1214,6 +1272,38 @@ export declare class NodeStatusResponse extends BaseModel {
|
|
|
1214
1272
|
* The last catchpoint seen by the node
|
|
1215
1273
|
*/
|
|
1216
1274
|
lastCatchpoint?: string;
|
|
1275
|
+
/**
|
|
1276
|
+
* Upgrade delay
|
|
1277
|
+
*/
|
|
1278
|
+
upgradeDelay?: number | bigint;
|
|
1279
|
+
/**
|
|
1280
|
+
* Next protocol round
|
|
1281
|
+
*/
|
|
1282
|
+
upgradeNextProtocolVoteBefore?: number | bigint;
|
|
1283
|
+
/**
|
|
1284
|
+
* No votes cast for consensus upgrade
|
|
1285
|
+
*/
|
|
1286
|
+
upgradeNoVotes?: number | bigint;
|
|
1287
|
+
/**
|
|
1288
|
+
* This node's upgrade vote
|
|
1289
|
+
*/
|
|
1290
|
+
upgradeNodeVote?: boolean;
|
|
1291
|
+
/**
|
|
1292
|
+
* Total voting rounds for current upgrade
|
|
1293
|
+
*/
|
|
1294
|
+
upgradeVoteRounds?: number | bigint;
|
|
1295
|
+
/**
|
|
1296
|
+
* Total votes cast for consensus upgrade
|
|
1297
|
+
*/
|
|
1298
|
+
upgradeVotes?: number | bigint;
|
|
1299
|
+
/**
|
|
1300
|
+
* Yes votes required for consensus upgrade
|
|
1301
|
+
*/
|
|
1302
|
+
upgradeVotesRequired?: number | bigint;
|
|
1303
|
+
/**
|
|
1304
|
+
* Yes votes cast for consensus upgrade
|
|
1305
|
+
*/
|
|
1306
|
+
upgradeYesVotes?: number | bigint;
|
|
1217
1307
|
/**
|
|
1218
1308
|
* Creates a new `NodeStatusResponse` object.
|
|
1219
1309
|
* @param catchupTime - CatchupTime in nanoseconds
|
|
@@ -1242,8 +1332,16 @@ export declare class NodeStatusResponse extends BaseModel {
|
|
|
1242
1332
|
* @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been
|
|
1243
1333
|
* verified so far as part of the catchup
|
|
1244
1334
|
* @param lastCatchpoint - The last catchpoint seen by the node
|
|
1245
|
-
|
|
1246
|
-
|
|
1335
|
+
* @param upgradeDelay - Upgrade delay
|
|
1336
|
+
* @param upgradeNextProtocolVoteBefore - Next protocol round
|
|
1337
|
+
* @param upgradeNoVotes - No votes cast for consensus upgrade
|
|
1338
|
+
* @param upgradeNodeVote - This node's upgrade vote
|
|
1339
|
+
* @param upgradeVoteRounds - Total voting rounds for current upgrade
|
|
1340
|
+
* @param upgradeVotes - Total votes cast for consensus upgrade
|
|
1341
|
+
* @param upgradeVotesRequired - Yes votes required for consensus upgrade
|
|
1342
|
+
* @param upgradeYesVotes - Yes votes cast for consensus upgrade
|
|
1343
|
+
*/
|
|
1344
|
+
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
1345
|
catchupTime: number | bigint;
|
|
1248
1346
|
lastRound: number | bigint;
|
|
1249
1347
|
lastVersion: string;
|
|
@@ -1262,6 +1360,14 @@ export declare class NodeStatusResponse extends BaseModel {
|
|
|
1262
1360
|
catchpointVerifiedAccounts?: number | bigint;
|
|
1263
1361
|
catchpointVerifiedKvs?: number | bigint;
|
|
1264
1362
|
lastCatchpoint?: string;
|
|
1363
|
+
upgradeDelay?: number | bigint;
|
|
1364
|
+
upgradeNextProtocolVoteBefore?: number | bigint;
|
|
1365
|
+
upgradeNoVotes?: number | bigint;
|
|
1366
|
+
upgradeNodeVote?: boolean;
|
|
1367
|
+
upgradeVoteRounds?: number | bigint;
|
|
1368
|
+
upgradeVotes?: number | bigint;
|
|
1369
|
+
upgradeVotesRequired?: number | bigint;
|
|
1370
|
+
upgradeYesVotes?: number | bigint;
|
|
1265
1371
|
});
|
|
1266
1372
|
static from_obj_for_encoding(data: Record<string, any>): NodeStatusResponse;
|
|
1267
1373
|
}
|
|
@@ -1306,7 +1412,7 @@ export declare class PendingTransactionResponse extends BaseModel {
|
|
|
1306
1412
|
*/
|
|
1307
1413
|
confirmedRound?: number | bigint;
|
|
1308
1414
|
/**
|
|
1309
|
-
*
|
|
1415
|
+
* Global state key/value changes for the application being executed by this
|
|
1310
1416
|
* transaction.
|
|
1311
1417
|
*/
|
|
1312
1418
|
globalStateDelta?: EvalDeltaKeyValue[];
|
|
@@ -1315,12 +1421,12 @@ export declare class PendingTransactionResponse extends BaseModel {
|
|
|
1315
1421
|
*/
|
|
1316
1422
|
innerTxns?: PendingTransactionResponse[];
|
|
1317
1423
|
/**
|
|
1318
|
-
*
|
|
1424
|
+
* Local state key/value changes for the application being executed by this
|
|
1319
1425
|
* transaction.
|
|
1320
1426
|
*/
|
|
1321
1427
|
localStateDelta?: AccountStateDelta[];
|
|
1322
1428
|
/**
|
|
1323
|
-
*
|
|
1429
|
+
* Logs for the application being executed by this transaction.
|
|
1324
1430
|
*/
|
|
1325
1431
|
logs?: Uint8Array[];
|
|
1326
1432
|
/**
|
|
@@ -1344,12 +1450,12 @@ export declare class PendingTransactionResponse extends BaseModel {
|
|
|
1344
1450
|
* @param closeRewards - Rewards in microalgos applied to the close remainder to account.
|
|
1345
1451
|
* @param closingAmount - Closing amount for the transaction.
|
|
1346
1452
|
* @param confirmedRound - The round where this transaction was confirmed, if present.
|
|
1347
|
-
* @param globalStateDelta -
|
|
1453
|
+
* @param globalStateDelta - Global state key/value changes for the application being executed by this
|
|
1348
1454
|
* transaction.
|
|
1349
1455
|
* @param innerTxns - Inner transactions produced by application execution.
|
|
1350
|
-
* @param localStateDelta -
|
|
1456
|
+
* @param localStateDelta - Local state key/value changes for the application being executed by this
|
|
1351
1457
|
* transaction.
|
|
1352
|
-
* @param logs -
|
|
1458
|
+
* @param logs - Logs for the application being executed by this transaction.
|
|
1353
1459
|
* @param receiverRewards - Rewards in microalgos applied to the receiver account.
|
|
1354
1460
|
* @param senderRewards - Rewards in microalgos applied to the sender account.
|
|
1355
1461
|
*/
|
|
@@ -1413,6 +1519,54 @@ export declare class PostTransactionsResponse extends BaseModel {
|
|
|
1413
1519
|
});
|
|
1414
1520
|
static from_obj_for_encoding(data: Record<string, any>): PostTransactionsResponse;
|
|
1415
1521
|
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Request type for simulation endpoint.
|
|
1524
|
+
*/
|
|
1525
|
+
export declare class SimulateRequest extends BaseModel {
|
|
1526
|
+
/**
|
|
1527
|
+
* The transaction groups to simulate.
|
|
1528
|
+
*/
|
|
1529
|
+
txnGroups: SimulateRequestTransactionGroup[];
|
|
1530
|
+
/**
|
|
1531
|
+
* Allow transactions without signatures to be simulated as if they had correct
|
|
1532
|
+
* signatures.
|
|
1533
|
+
*/
|
|
1534
|
+
allowEmptySignatures?: boolean;
|
|
1535
|
+
/**
|
|
1536
|
+
* Lifts limits on log opcode usage during simulation.
|
|
1537
|
+
*/
|
|
1538
|
+
allowMoreLogging?: boolean;
|
|
1539
|
+
/**
|
|
1540
|
+
* Creates a new `SimulateRequest` object.
|
|
1541
|
+
* @param txnGroups - The transaction groups to simulate.
|
|
1542
|
+
* @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
|
|
1543
|
+
* signatures.
|
|
1544
|
+
* @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
|
|
1545
|
+
*/
|
|
1546
|
+
constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, }: {
|
|
1547
|
+
txnGroups: SimulateRequestTransactionGroup[];
|
|
1548
|
+
allowEmptySignatures?: boolean;
|
|
1549
|
+
allowMoreLogging?: boolean;
|
|
1550
|
+
});
|
|
1551
|
+
static from_obj_for_encoding(data: Record<string, any>): SimulateRequest;
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* A transaction group to simulate.
|
|
1555
|
+
*/
|
|
1556
|
+
export declare class SimulateRequestTransactionGroup extends BaseModel {
|
|
1557
|
+
/**
|
|
1558
|
+
* An atomic transaction group.
|
|
1559
|
+
*/
|
|
1560
|
+
txns: EncodedSignedTransaction[];
|
|
1561
|
+
/**
|
|
1562
|
+
* Creates a new `SimulateRequestTransactionGroup` object.
|
|
1563
|
+
* @param txns - An atomic transaction group.
|
|
1564
|
+
*/
|
|
1565
|
+
constructor({ txns }: {
|
|
1566
|
+
txns: EncodedSignedTransaction[];
|
|
1567
|
+
});
|
|
1568
|
+
static from_obj_for_encoding(data: Record<string, any>): SimulateRequestTransactionGroup;
|
|
1569
|
+
}
|
|
1416
1570
|
/**
|
|
1417
1571
|
* Result of a transaction group simulation.
|
|
1418
1572
|
*/
|
|
@@ -1431,26 +1585,26 @@ export declare class SimulateResponse extends BaseModel {
|
|
|
1431
1585
|
*/
|
|
1432
1586
|
version: number | bigint;
|
|
1433
1587
|
/**
|
|
1434
|
-
*
|
|
1435
|
-
*
|
|
1436
|
-
*
|
|
1588
|
+
* The set of parameters and limits override during simulation. If this set of
|
|
1589
|
+
* parameters is present, then evaluation parameters may differ from standard
|
|
1590
|
+
* evaluation in certain ways.
|
|
1437
1591
|
*/
|
|
1438
|
-
|
|
1592
|
+
evalOverrides?: SimulationEvalOverrides;
|
|
1439
1593
|
/**
|
|
1440
1594
|
* Creates a new `SimulateResponse` object.
|
|
1441
1595
|
* @param lastRound - The round immediately preceding this simulation. State changes through this
|
|
1442
1596
|
* round were used to run this simulation.
|
|
1443
1597
|
* @param txnGroups - A result object for each transaction group that was simulated.
|
|
1444
1598
|
* @param version - The version of this response object.
|
|
1445
|
-
* @param
|
|
1446
|
-
*
|
|
1447
|
-
*
|
|
1599
|
+
* @param evalOverrides - The set of parameters and limits override during simulation. If this set of
|
|
1600
|
+
* parameters is present, then evaluation parameters may differ from standard
|
|
1601
|
+
* evaluation in certain ways.
|
|
1448
1602
|
*/
|
|
1449
|
-
constructor({ lastRound, txnGroups, version,
|
|
1603
|
+
constructor({ lastRound, txnGroups, version, evalOverrides, }: {
|
|
1450
1604
|
lastRound: number | bigint;
|
|
1451
1605
|
txnGroups: SimulateTransactionGroupResult[];
|
|
1452
1606
|
version: number | bigint;
|
|
1453
|
-
|
|
1607
|
+
evalOverrides?: SimulationEvalOverrides;
|
|
1454
1608
|
});
|
|
1455
1609
|
static from_obj_for_encoding(data: Record<string, any>): SimulateResponse;
|
|
1456
1610
|
}
|
|
@@ -1462,6 +1616,14 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
|
|
|
1462
1616
|
* Simulation result for individual transactions
|
|
1463
1617
|
*/
|
|
1464
1618
|
txnResults: SimulateTransactionResult[];
|
|
1619
|
+
/**
|
|
1620
|
+
* Total budget added during execution of app calls in the transaction group.
|
|
1621
|
+
*/
|
|
1622
|
+
appBudgetAdded?: number | bigint;
|
|
1623
|
+
/**
|
|
1624
|
+
* Total budget consumed during execution of app calls in the transaction group.
|
|
1625
|
+
*/
|
|
1626
|
+
appBudgetConsumed?: number | bigint;
|
|
1465
1627
|
/**
|
|
1466
1628
|
* If present, indicates which transaction in this group caused the failure. This
|
|
1467
1629
|
* array represents the path to the failing transaction. Indexes are zero based,
|
|
@@ -1477,6 +1639,8 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
|
|
|
1477
1639
|
/**
|
|
1478
1640
|
* Creates a new `SimulateTransactionGroupResult` object.
|
|
1479
1641
|
* @param txnResults - Simulation result for individual transactions
|
|
1642
|
+
* @param appBudgetAdded - Total budget added during execution of app calls in the transaction group.
|
|
1643
|
+
* @param appBudgetConsumed - Total budget consumed during execution of app calls in the transaction group.
|
|
1480
1644
|
* @param failedAt - If present, indicates which transaction in this group caused the failure. This
|
|
1481
1645
|
* array represents the path to the failing transaction. Indexes are zero based,
|
|
1482
1646
|
* the first element indicates the top-level transaction, and successive elements
|
|
@@ -1484,8 +1648,10 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
|
|
|
1484
1648
|
* @param failureMessage - If present, indicates that the transaction group failed and specifies why that
|
|
1485
1649
|
* happened
|
|
1486
1650
|
*/
|
|
1487
|
-
constructor({ txnResults, failedAt, failureMessage, }: {
|
|
1651
|
+
constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, }: {
|
|
1488
1652
|
txnResults: SimulateTransactionResult[];
|
|
1653
|
+
appBudgetAdded?: number | bigint;
|
|
1654
|
+
appBudgetConsumed?: number | bigint;
|
|
1489
1655
|
failedAt?: (number | bigint)[];
|
|
1490
1656
|
failureMessage?: string;
|
|
1491
1657
|
});
|
|
@@ -1501,21 +1667,62 @@ export declare class SimulateTransactionResult extends BaseModel {
|
|
|
1501
1667
|
*/
|
|
1502
1668
|
txnResult: PendingTransactionResponse;
|
|
1503
1669
|
/**
|
|
1504
|
-
*
|
|
1670
|
+
* Budget used during execution of an app call transaction. This value includes
|
|
1671
|
+
* budged used by inner app calls spawned by this transaction.
|
|
1672
|
+
*/
|
|
1673
|
+
appBudgetConsumed?: number | bigint;
|
|
1674
|
+
/**
|
|
1675
|
+
* Budget used during execution of a logic sig transaction.
|
|
1505
1676
|
*/
|
|
1506
|
-
|
|
1677
|
+
logicSigBudgetConsumed?: number | bigint;
|
|
1507
1678
|
/**
|
|
1508
1679
|
* Creates a new `SimulateTransactionResult` object.
|
|
1509
1680
|
* @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
|
|
1510
1681
|
* includes confirmation details like the round and reward details.
|
|
1511
|
-
* @param
|
|
1682
|
+
* @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
|
|
1683
|
+
* budged used by inner app calls spawned by this transaction.
|
|
1684
|
+
* @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
|
|
1512
1685
|
*/
|
|
1513
|
-
constructor({ txnResult,
|
|
1686
|
+
constructor({ txnResult, appBudgetConsumed, logicSigBudgetConsumed, }: {
|
|
1514
1687
|
txnResult: PendingTransactionResponse;
|
|
1515
|
-
|
|
1688
|
+
appBudgetConsumed?: number | bigint;
|
|
1689
|
+
logicSigBudgetConsumed?: number | bigint;
|
|
1516
1690
|
});
|
|
1517
1691
|
static from_obj_for_encoding(data: Record<string, any>): SimulateTransactionResult;
|
|
1518
1692
|
}
|
|
1693
|
+
/**
|
|
1694
|
+
* The set of parameters and limits override during simulation. If this set of
|
|
1695
|
+
* parameters is present, then evaluation parameters may differ from standard
|
|
1696
|
+
* evaluation in certain ways.
|
|
1697
|
+
*/
|
|
1698
|
+
export declare class SimulationEvalOverrides extends BaseModel {
|
|
1699
|
+
/**
|
|
1700
|
+
* If true, transactions without signatures are allowed and simulated as if they
|
|
1701
|
+
* were properly signed.
|
|
1702
|
+
*/
|
|
1703
|
+
allowEmptySignatures?: boolean;
|
|
1704
|
+
/**
|
|
1705
|
+
* The maximum log calls one can make during simulation
|
|
1706
|
+
*/
|
|
1707
|
+
maxLogCalls?: number | bigint;
|
|
1708
|
+
/**
|
|
1709
|
+
* The maximum byte number to log during simulation
|
|
1710
|
+
*/
|
|
1711
|
+
maxLogSize?: number | bigint;
|
|
1712
|
+
/**
|
|
1713
|
+
* Creates a new `SimulationEvalOverrides` object.
|
|
1714
|
+
* @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
|
|
1715
|
+
* were properly signed.
|
|
1716
|
+
* @param maxLogCalls - The maximum log calls one can make during simulation
|
|
1717
|
+
* @param maxLogSize - The maximum byte number to log during simulation
|
|
1718
|
+
*/
|
|
1719
|
+
constructor({ allowEmptySignatures, maxLogCalls, maxLogSize, }: {
|
|
1720
|
+
allowEmptySignatures?: boolean;
|
|
1721
|
+
maxLogCalls?: number | bigint;
|
|
1722
|
+
maxLogSize?: number | bigint;
|
|
1723
|
+
});
|
|
1724
|
+
static from_obj_for_encoding(data: Record<string, any>): SimulationEvalOverrides;
|
|
1725
|
+
}
|
|
1519
1726
|
/**
|
|
1520
1727
|
* Represents a state proof and its corresponding message
|
|
1521
1728
|
*/
|
|
@@ -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
|
|
15
|
-
constructor(c: HTTPClient,
|
|
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 {
|
|
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<
|
|
6
|
+
export default class SuggestedParamsRequest extends JSONRequest<SuggestedParamsWithMinFee> {
|
|
7
7
|
path(): string;
|
|
8
|
-
prepare(body: Record<string, any>):
|
|
8
|
+
prepare(body: Record<string, any>): SuggestedParamsWithMinFee;
|
|
9
9
|
}
|
package/dist/types/composer.d.ts
CHANGED
|
@@ -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
|
}>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -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';
|
package/dist/types/makeTxn.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "The official JavaScript SDK for Algorand",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -82,6 +82,6 @@
|
|
|
82
82
|
"author": "Algorand, llc",
|
|
83
83
|
"license": "MIT",
|
|
84
84
|
"engines": {
|
|
85
|
-
"node": ">=
|
|
85
|
+
"node": ">=16.0.0"
|
|
86
86
|
}
|
|
87
87
|
}
|