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.
- 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 +252 -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/getLedgerStateDelta.js +20 -0
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -0
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +20 -0
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.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/getTransactionGroupLedgerStateDeltasForRound.js +25 -0
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
- package/dist/cjs/client/v2/algod/models/types.js +327 -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/client/v2/serviceClient.js +3 -0
- package/dist/cjs/client/v2/serviceClient.js.map +1 -1
- package/dist/cjs/composer.js +40 -3
- 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 +229 -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/getLedgerStateDelta.js +14 -0
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -0
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +14 -0
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.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/getTransactionGroupLedgerStateDeltasForRound.js +19 -0
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -0
- package/dist/esm/client/v2/algod/models/types.js +317 -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/client/v2/serviceClient.js +3 -0
- package/dist/esm/client/v2/serviceClient.js.map +1 -1
- package/dist/esm/composer.js +17 -3
- 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 +190 -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/getLedgerStateDelta.d.ts +8 -0
- package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +8 -0
- package/dist/types/client/v2/algod/getSyncRound.d.ts +6 -0
- package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +10 -0
- package/dist/types/client/v2/algod/models/types.d.ts +283 -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 -4
- package/src/client/v2/algod/algod.ts +246 -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/getLedgerStateDelta.ts +16 -0
- package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -0
- package/src/client/v2/algod/getSyncRound.ts +17 -0
- package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +29 -0
- package/src/client/v2/algod/models/types.ts +560 -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/client/v2/serviceClient.ts +3 -0
- package/src/composer.ts +28 -4
- 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
|
@@ -27,8 +27,17 @@ import { BaseHTTPClient } from '../../baseHTTPClient';
|
|
|
27
27
|
import { AlgodTokenHeader, CustomTokenHeader } from '../../urlTokenBaseHTTPClient';
|
|
28
28
|
import LightBlockHeaderProof from './lightBlockHeaderProof';
|
|
29
29
|
import StateProof from './stateproof';
|
|
30
|
+
import SetSyncRound from './setSyncRound';
|
|
31
|
+
import GetSyncRound from './getSyncRound';
|
|
32
|
+
import SetBlockOffsetTimestamp from './setBlockOffsetTimestamp';
|
|
33
|
+
import GetBlockOffsetTimestamp from './getBlockOffsetTimestamp';
|
|
30
34
|
import Disassemble from './disassemble';
|
|
31
35
|
import SimulateRawTransactions from './simulateTransaction';
|
|
36
|
+
import Ready from './ready';
|
|
37
|
+
import UnsetSyncRound from './unsetSyncRound';
|
|
38
|
+
import GetLedgerStateDeltaForTransactionGroup from './getLedgerStateDeltaForTransactionGroup';
|
|
39
|
+
import GetLedgerStateDelta from './getLedgerStateDelta';
|
|
40
|
+
import GetTransactionGroupLedgerStateDeltasForRound from './getTransactionGroupLedgerStateDeltasForRound';
|
|
32
41
|
/**
|
|
33
42
|
* Algod client connects an application to the Algorand blockchain. The algod client requires a valid algod REST endpoint IP address and algod token from an Algorand node that is connected to the network you plan to interact with.
|
|
34
43
|
*
|
|
@@ -70,7 +79,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
70
79
|
* const health = await algodClient.healthCheck().do();
|
|
71
80
|
* ```
|
|
72
81
|
*
|
|
73
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
82
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-health)
|
|
74
83
|
* @category GET
|
|
75
84
|
*/
|
|
76
85
|
healthCheck(): HealthCheck;
|
|
@@ -82,7 +91,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
82
91
|
* const versionsDetails = await algodClient.versionsCheck().do();
|
|
83
92
|
* ```
|
|
84
93
|
*
|
|
85
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
94
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-versions)
|
|
86
95
|
* @category GET
|
|
87
96
|
*/
|
|
88
97
|
versionsCheck(): Versions;
|
|
@@ -95,7 +104,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
95
104
|
* const result = await waitForConfirmation(algodClient, txid, 3);
|
|
96
105
|
* ```
|
|
97
106
|
*
|
|
98
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
107
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2transactions)
|
|
99
108
|
*
|
|
100
109
|
* @remarks
|
|
101
110
|
* Often used with {@linkcode waitForConfirmation}
|
|
@@ -112,7 +121,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
112
121
|
* const accountInfo = await algodClient.accountInformation(address).do();
|
|
113
122
|
* ```
|
|
114
123
|
*
|
|
115
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
124
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
|
|
116
125
|
* @param account - The address of the account to look up.
|
|
117
126
|
* @category GET
|
|
118
127
|
*/
|
|
@@ -127,7 +136,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
127
136
|
* const accountAssetInfo = await algodClient.accountAssetInformation(address, index).do();
|
|
128
137
|
* ```
|
|
129
138
|
*
|
|
130
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
139
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
|
|
131
140
|
* @param account - The address of the account to look up.
|
|
132
141
|
* @param index - The asset ID to look up.
|
|
133
142
|
* @category GET
|
|
@@ -143,7 +152,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
143
152
|
* const accountInfo = await algodClient.accountApplicationInformation(address, index).do();
|
|
144
153
|
* ```
|
|
145
154
|
*
|
|
146
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
155
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
|
|
147
156
|
* @param account - The address of the account to look up.
|
|
148
157
|
* @param index - The application ID to look up.
|
|
149
158
|
* @category GET
|
|
@@ -158,7 +167,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
158
167
|
* const block = await algodClient.block(roundNumber).do();
|
|
159
168
|
* ```
|
|
160
169
|
*
|
|
161
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
170
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2blocksround)
|
|
162
171
|
* @param roundNumber - The round number of the block to get.
|
|
163
172
|
* @category GET
|
|
164
173
|
*/
|
|
@@ -172,7 +181,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
172
181
|
* const block = await algodClient.getBlockHash(roundNumber).do();
|
|
173
182
|
* ```
|
|
174
183
|
*
|
|
175
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
184
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2blocksroundhash)
|
|
176
185
|
* @param roundNumber - The round number of the block to get.
|
|
177
186
|
* @category GET
|
|
178
187
|
*/
|
|
@@ -186,7 +195,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
186
195
|
* const pending = await algodClient.pendingTransactionInformation(txId).do();
|
|
187
196
|
* ```
|
|
188
197
|
*
|
|
189
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
198
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2transactionspendingtxid)
|
|
190
199
|
*
|
|
191
200
|
* @remarks
|
|
192
201
|
* <br><br>
|
|
@@ -219,7 +228,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
219
228
|
* .do();
|
|
220
229
|
* ```
|
|
221
230
|
*
|
|
222
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
231
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2transactionspending)
|
|
223
232
|
* @category GET
|
|
224
233
|
*/
|
|
225
234
|
pendingTransactionsInformation(): PendingTransactions;
|
|
@@ -243,7 +252,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
243
252
|
* .do();
|
|
244
253
|
* ```
|
|
245
254
|
*
|
|
246
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
255
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddresstransactionspending)
|
|
247
256
|
* @param address - The address of the sender.
|
|
248
257
|
* @category GET
|
|
249
258
|
*/
|
|
@@ -256,7 +265,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
256
265
|
* const status = await algodClient.status().do();
|
|
257
266
|
* ```
|
|
258
267
|
*
|
|
259
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
268
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2status)
|
|
260
269
|
* @category GET
|
|
261
270
|
*/
|
|
262
271
|
status(): Status;
|
|
@@ -269,7 +278,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
269
278
|
* const statusAfterBlock = await algodClient.statusAfterBlock(round).do();
|
|
270
279
|
* ```
|
|
271
280
|
*
|
|
272
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
281
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2statuswait-for-block-afterround)
|
|
273
282
|
* @param round - The number of the round to wait for.
|
|
274
283
|
* @category GET
|
|
275
284
|
*/
|
|
@@ -289,7 +298,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
289
298
|
* });
|
|
290
299
|
* ```
|
|
291
300
|
*
|
|
292
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
301
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2transactionsparams)
|
|
293
302
|
*
|
|
294
303
|
* @remarks
|
|
295
304
|
* Often used with
|
|
@@ -305,7 +314,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
305
314
|
* const supplyDetails = await algodClient.supply().do();
|
|
306
315
|
* ```
|
|
307
316
|
*
|
|
308
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
317
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2ledgersupply)
|
|
309
318
|
* @category GET
|
|
310
319
|
*/
|
|
311
320
|
supply(): Supply;
|
|
@@ -318,7 +327,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
318
327
|
* const compiledSmartContract = await algodClient.compile(source).do();
|
|
319
328
|
* ```
|
|
320
329
|
*
|
|
321
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
330
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2tealcompile)
|
|
322
331
|
* @remarks
|
|
323
332
|
* This endpoint is only enabled when a node's configuration file sets `EnableDeveloperAPI` to true.
|
|
324
333
|
* @param source
|
|
@@ -348,7 +357,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
348
357
|
* const dryRunResult = await algodClient.dryrun(dr).do();
|
|
349
358
|
* ```
|
|
350
359
|
*
|
|
351
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
360
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2tealdryrun)
|
|
352
361
|
* @param dr
|
|
353
362
|
* @category POST
|
|
354
363
|
*/
|
|
@@ -363,7 +372,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
363
372
|
* const asset = await algodClient.getAssetByID(asset_id).do();
|
|
364
373
|
* ```
|
|
365
374
|
*
|
|
366
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
375
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2assetsasset-id)
|
|
367
376
|
* @param index - The asset ID to look up.
|
|
368
377
|
* @category GET
|
|
369
378
|
*/
|
|
@@ -378,7 +387,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
378
387
|
* const app = await algodClient.getApplicationByID(index).do();
|
|
379
388
|
* ```
|
|
380
389
|
*
|
|
381
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
390
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-id)
|
|
382
391
|
* @param index - The application ID to look up.
|
|
383
392
|
* @category GET
|
|
384
393
|
*/
|
|
@@ -394,7 +403,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
394
403
|
* const boxValue = boxResponse.value;
|
|
395
404
|
* ```
|
|
396
405
|
*
|
|
397
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
406
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idbox)
|
|
398
407
|
* @param index - The application ID to look up.
|
|
399
408
|
* @category GET
|
|
400
409
|
*/
|
|
@@ -409,7 +418,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
409
418
|
* const boxNames = boxesResponse.boxes.map(box => box.name);
|
|
410
419
|
* ```
|
|
411
420
|
*
|
|
412
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
421
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idboxes)
|
|
413
422
|
* @param index - The application ID to look up.
|
|
414
423
|
* @category GET
|
|
415
424
|
*/
|
|
@@ -422,7 +431,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
422
431
|
* const genesis = await algodClient.genesis().do();
|
|
423
432
|
* ```
|
|
424
433
|
*
|
|
425
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
434
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-genesis)
|
|
426
435
|
* @category GET
|
|
427
436
|
*/
|
|
428
437
|
genesis(): Genesis;
|
|
@@ -436,7 +445,7 @@ export default class AlgodClient extends ServiceClient {
|
|
|
436
445
|
* const proof = await algodClient.getTransactionProof(round, txId).do();
|
|
437
446
|
* ```
|
|
438
447
|
*
|
|
439
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
448
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2blocksroundtransactionstxidproof)
|
|
440
449
|
* @param round - The round in which the transaction appears.
|
|
441
450
|
* @param txID - The transaction ID for which to generate a proof.
|
|
442
451
|
* @category GET
|
|
@@ -473,12 +482,169 @@ export default class AlgodClient extends ServiceClient {
|
|
|
473
482
|
*
|
|
474
483
|
* #### Example
|
|
475
484
|
* ```typescript
|
|
485
|
+
* const txn1 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn1Params);
|
|
486
|
+
* const txn2 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn2Params);
|
|
487
|
+
* const txgroup = algosdk.assignGroupID([txn1, txn2]);
|
|
488
|
+
*
|
|
489
|
+
* // Actually sign the first transaction
|
|
490
|
+
* const signedTxn1 = txgroup[0].signTxn(senderSk).blob;
|
|
491
|
+
* // Simulate does not require signed transactions -- use this method to encode an unsigned transaction
|
|
492
|
+
* const signedTxn2 = algosdk.encodeUnsignedSimulateTransaction(txgroup[1]);
|
|
493
|
+
*
|
|
476
494
|
* const resp = await client.simulateRawTransactions([signedTxn1, signedTxn2]).do();
|
|
477
495
|
* ```
|
|
478
496
|
*
|
|
479
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
497
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2transactionssimulate)
|
|
480
498
|
* @param stxOrStxs
|
|
481
499
|
* @category POST
|
|
482
500
|
*/
|
|
483
501
|
simulateRawTransactions(stxOrStxs: Uint8Array | Uint8Array[]): SimulateRawTransactions;
|
|
502
|
+
/**
|
|
503
|
+
* Simulate transactions being sent to the network.
|
|
504
|
+
*
|
|
505
|
+
* #### Example
|
|
506
|
+
* ```typescript
|
|
507
|
+
* const txn1 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn1Params);
|
|
508
|
+
* const txn2 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn2Params);
|
|
509
|
+
* const txgroup = algosdk.assignGroupID([txn1, txn2]);
|
|
510
|
+
*
|
|
511
|
+
* // Actually sign the first transaction
|
|
512
|
+
* const signedTxn1 = txgroup[0].signTxn(senderSk).blob;
|
|
513
|
+
* // Simulate does not require signed transactions -- use this method to encode an unsigned transaction
|
|
514
|
+
* const signedTxn2 = algosdk.encodeUnsignedSimulateTransaction(txgroup[1]);
|
|
515
|
+
*
|
|
516
|
+
* const request = new modelsv2.SimulateRequest({
|
|
517
|
+
* txnGroups: [
|
|
518
|
+
* new modelsv2.SimulateRequestTransactionGroup({
|
|
519
|
+
* // Must decode the signed txn bytes into an object
|
|
520
|
+
* txns: [algosdk.decodeObj(signedTxn1), algosdk.decodeObj(signedTxn2)]
|
|
521
|
+
* }),
|
|
522
|
+
* ],
|
|
523
|
+
* });
|
|
524
|
+
* const resp = await client.simulateRawTransactions(request).do();
|
|
525
|
+
* ```
|
|
526
|
+
*
|
|
527
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2transactionssimulate)
|
|
528
|
+
* @param request
|
|
529
|
+
* @category POST
|
|
530
|
+
*/
|
|
531
|
+
simulateTransactions(request: modelsv2.SimulateRequest): SimulateRawTransactions;
|
|
532
|
+
/**
|
|
533
|
+
* Set the offset (in seconds) applied to the block timestamp when creating new blocks in devmode.
|
|
534
|
+
*
|
|
535
|
+
* #### Example
|
|
536
|
+
* ```typesecript
|
|
537
|
+
* const offset = 60
|
|
538
|
+
* await client.setBlockOffsetTimestamp(offset).do();
|
|
539
|
+
* ```
|
|
540
|
+
*
|
|
541
|
+
[Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2devmodeblocksoffsetoffset)
|
|
542
|
+
* @param offset
|
|
543
|
+
* @category POST
|
|
544
|
+
*/
|
|
545
|
+
setBlockOffsetTimestamp(offset: number): SetBlockOffsetTimestamp;
|
|
546
|
+
/**
|
|
547
|
+
* Get the offset (in seconds) applied to the block timestamp when creating new blocks in devmode.
|
|
548
|
+
*
|
|
549
|
+
* #### Example
|
|
550
|
+
* ```typesecript
|
|
551
|
+
* const currentOffset = await client.getBlockOffsetTimestamp().do();
|
|
552
|
+
* ```
|
|
553
|
+
*
|
|
554
|
+
[Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2devmodeblocksoffset)
|
|
555
|
+
* @category GET
|
|
556
|
+
*/
|
|
557
|
+
getBlockOffsetTimestamp(): GetBlockOffsetTimestamp;
|
|
558
|
+
/**
|
|
559
|
+
* Set the sync round on the ledger (algod must have EnableFollowMode: true), restricting catchup.
|
|
560
|
+
*
|
|
561
|
+
* #### Example
|
|
562
|
+
* ```typesecript
|
|
563
|
+
* const round = 10000
|
|
564
|
+
* await client.setSyncRound(round).do();
|
|
565
|
+
* ```
|
|
566
|
+
*
|
|
567
|
+
[Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2ledgersyncround)
|
|
568
|
+
* @param round
|
|
569
|
+
* @category POST
|
|
570
|
+
*/
|
|
571
|
+
setSyncRound(round: number): SetSyncRound;
|
|
572
|
+
/**
|
|
573
|
+
* Un-Set the sync round on the ledger (algod must have EnableFollowMode: true), removing the restriction on catchup.
|
|
574
|
+
*
|
|
575
|
+
* #### Example
|
|
576
|
+
* ```typesecript
|
|
577
|
+
* await client.unsetSyncRound().do();
|
|
578
|
+
* ```
|
|
579
|
+
*
|
|
580
|
+
[Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#delete-v2ledgersync)
|
|
581
|
+
* @category DELETE
|
|
582
|
+
*/
|
|
583
|
+
unsetSyncRound(): UnsetSyncRound;
|
|
584
|
+
/**
|
|
585
|
+
* Get the current sync round on the ledger (algod must have EnableFollowMode: true).
|
|
586
|
+
*
|
|
587
|
+
* #### Example
|
|
588
|
+
* ```typesecript
|
|
589
|
+
* const currentSyncRound = await client.getSyncRound().do();
|
|
590
|
+
* ```
|
|
591
|
+
*
|
|
592
|
+
[Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2ledgersync)
|
|
593
|
+
* @category GET
|
|
594
|
+
*/
|
|
595
|
+
getSyncRound(): GetSyncRound;
|
|
596
|
+
/**
|
|
597
|
+
* Ready check which returns 200 OK if algod is healthy and caught up
|
|
598
|
+
*
|
|
599
|
+
* #### Example
|
|
600
|
+
* ```typesecript
|
|
601
|
+
* await client.ready().do();
|
|
602
|
+
* ```
|
|
603
|
+
*
|
|
604
|
+
[Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-ready)
|
|
605
|
+
* @category GET
|
|
606
|
+
*/
|
|
607
|
+
ready(): Ready;
|
|
608
|
+
/**
|
|
609
|
+
* GetLedgerStateDeltaForTransactionGroup returns the ledger delta for the txn group identified by id
|
|
610
|
+
*
|
|
611
|
+
* #### Example
|
|
612
|
+
* ```typescript
|
|
613
|
+
* const id = "ABC123";
|
|
614
|
+
* await client.getLedgerStateDeltaForTransactionGroup(id).do();
|
|
615
|
+
* ```
|
|
616
|
+
*
|
|
617
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2deltastxngroupid)
|
|
618
|
+
* @param id txn ID or group ID to be searched for
|
|
619
|
+
* @category GET
|
|
620
|
+
*/
|
|
621
|
+
getLedgerStateDeltaForTransactionGroup(id: string): GetLedgerStateDeltaForTransactionGroup;
|
|
622
|
+
/**
|
|
623
|
+
* GetLedgerStateDelta returns the ledger delta for the entire round
|
|
624
|
+
*
|
|
625
|
+
* #### Example
|
|
626
|
+
* ```typescript
|
|
627
|
+
* const round = 12345;
|
|
628
|
+
* await client.getLedgerStateDelta(round).do();
|
|
629
|
+
* ```
|
|
630
|
+
*
|
|
631
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2deltasround)
|
|
632
|
+
* @param round the round number to be searched for
|
|
633
|
+
* @category GET
|
|
634
|
+
*/
|
|
635
|
+
getLedgerStateDelta(round: bigint): GetLedgerStateDelta;
|
|
636
|
+
/**
|
|
637
|
+
* GetTransactionGroupLedgerStateDeltasForRound returns all ledger deltas for txn groups in the provided round
|
|
638
|
+
*
|
|
639
|
+
* #### Example
|
|
640
|
+
* ```typescript
|
|
641
|
+
* const round = 12345;
|
|
642
|
+
* await client.getTransactionGroupLedgerStateDeltasForRound(round).do();
|
|
643
|
+
* ```
|
|
644
|
+
*
|
|
645
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2deltasroundtxngroup)
|
|
646
|
+
* @param round the round number to be searched for
|
|
647
|
+
* @category GET
|
|
648
|
+
*/
|
|
649
|
+
getTransactionGroupLedgerStateDeltasForRound(round: bigint): GetTransactionGroupLedgerStateDeltasForRound;
|
|
484
650
|
}
|
|
@@ -13,7 +13,7 @@ import { Box } from './models/types';
|
|
|
13
13
|
* const boxValue = boxResponse.value;
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
16
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idbox)
|
|
17
17
|
* @param index - The application ID to look up.
|
|
18
18
|
* @category GET
|
|
19
19
|
*/
|
|
@@ -12,7 +12,7 @@ import { BoxesResponse } from './models/types';
|
|
|
12
12
|
* const boxNames = boxesResponse.boxes.map(box => box.name);
|
|
13
13
|
* ```
|
|
14
14
|
*
|
|
15
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod
|
|
15
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idboxes)
|
|
16
16
|
* @param index - The application ID to look up.
|
|
17
17
|
* @category GET
|
|
18
18
|
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import JSONRequest from '../jsonrequest';
|
|
2
|
+
import { GetBlockTimeStampOffsetResponse } from './models/types';
|
|
3
|
+
export default class GetBlockOffsetTimestamp extends JSONRequest<GetBlockTimeStampOffsetResponse, Record<string, any>> {
|
|
4
|
+
path(): string;
|
|
5
|
+
prepare(body: Record<string, any>): GetBlockTimeStampOffsetResponse;
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import JSONRequest from '../jsonrequest';
|
|
2
|
+
import HTTPClient from '../../client';
|
|
3
|
+
import IntDecoding from '../../../types/intDecoding';
|
|
4
|
+
export default class GetLedgerStateDelta extends JSONRequest {
|
|
5
|
+
private round;
|
|
6
|
+
constructor(c: HTTPClient, intDecoding: IntDecoding, round: bigint);
|
|
7
|
+
path(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import JSONRequest from '../jsonrequest';
|
|
2
|
+
import HTTPClient from '../../client';
|
|
3
|
+
import IntDecoding from '../../../types/intDecoding';
|
|
4
|
+
export default class GetLedgerStateDeltaForTransactionGroup extends JSONRequest {
|
|
5
|
+
private id;
|
|
6
|
+
constructor(c: HTTPClient, intDecoding: IntDecoding, id: string);
|
|
7
|
+
path(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import JSONRequest from '../jsonrequest';
|
|
2
|
+
import { GetSyncRoundResponse } from './models/types';
|
|
3
|
+
export default class GetSyncRound extends JSONRequest<GetSyncRoundResponse, Record<string, any>> {
|
|
4
|
+
path(): string;
|
|
5
|
+
prepare(body: Record<string, any>): GetSyncRoundResponse;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import JSONRequest from '../jsonrequest';
|
|
2
|
+
import { TransactionGroupLedgerStateDeltasForRoundResponse } from './models/types';
|
|
3
|
+
import HTTPClient from '../../client';
|
|
4
|
+
import IntDecoding from '../../../types/intDecoding';
|
|
5
|
+
export default class GetTransactionGroupLedgerStateDeltasForRound extends JSONRequest<TransactionGroupLedgerStateDeltasForRoundResponse, Record<string, any>> {
|
|
6
|
+
private round;
|
|
7
|
+
constructor(c: HTTPClient, intDecoding: IntDecoding, round: bigint);
|
|
8
|
+
path(): string;
|
|
9
|
+
prepare(body: Record<string, any>): TransactionGroupLedgerStateDeltasForRoundResponse;
|
|
10
|
+
}
|