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.
Files changed (93) hide show
  1. package/README.md +5 -7
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/client/v2/algod/algod.js +201 -25
  5. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +1 -1
  7. package/dist/cjs/client/v2/algod/getApplicationBoxes.js +1 -1
  8. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +19 -0
  9. package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
  10. package/dist/cjs/client/v2/algod/getSyncRound.js +19 -0
  11. package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -0
  12. package/dist/cjs/client/v2/algod/models/types.js +257 -23
  13. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  14. package/dist/cjs/client/v2/algod/ready.js +14 -0
  15. package/dist/cjs/client/v2/algod/ready.js.map +1 -0
  16. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +22 -0
  17. package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  18. package/dist/cjs/client/v2/algod/setSyncRound.js +22 -0
  19. package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -0
  20. package/dist/cjs/client/v2/algod/simulateTransaction.js +4 -19
  21. package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
  22. package/dist/cjs/client/v2/algod/suggestedParams.js +1 -0
  23. package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
  24. package/dist/cjs/client/v2/algod/unsetSyncRound.js +18 -0
  25. package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -0
  26. package/dist/cjs/composer.js +39 -2
  27. package/dist/cjs/composer.js.map +1 -1
  28. package/dist/cjs/main.js.map +1 -1
  29. package/dist/cjs/makeTxn.js.map +1 -1
  30. package/dist/cjs/transaction.js +1 -2
  31. package/dist/cjs/transaction.js.map +1 -1
  32. package/dist/esm/client/v2/algod/algod.js +178 -25
  33. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  34. package/dist/esm/client/v2/algod/getApplicationBoxByName.js +1 -1
  35. package/dist/esm/client/v2/algod/getApplicationBoxes.js +1 -1
  36. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +13 -0
  37. package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -0
  38. package/dist/esm/client/v2/algod/getSyncRound.js +13 -0
  39. package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -0
  40. package/dist/esm/client/v2/algod/models/types.js +250 -22
  41. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  42. package/dist/esm/client/v2/algod/ready.js +8 -0
  43. package/dist/esm/client/v2/algod/ready.js.map +1 -0
  44. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +16 -0
  45. package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -0
  46. package/dist/esm/client/v2/algod/setSyncRound.js +16 -0
  47. package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -0
  48. package/dist/esm/client/v2/algod/simulateTransaction.js +4 -19
  49. package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
  50. package/dist/esm/client/v2/algod/suggestedParams.js +1 -0
  51. package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
  52. package/dist/esm/client/v2/algod/unsetSyncRound.js +12 -0
  53. package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -0
  54. package/dist/esm/composer.js +16 -2
  55. package/dist/esm/composer.js.map +1 -1
  56. package/dist/esm/main.js.map +1 -1
  57. package/dist/esm/makeTxn.js.map +1 -1
  58. package/dist/esm/transaction.js +1 -2
  59. package/dist/esm/transaction.js.map +1 -1
  60. package/dist/types/client/v2/algod/algod.d.ts +145 -24
  61. package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +1 -1
  62. package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +1 -1
  63. package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +6 -0
  64. package/dist/types/client/v2/algod/getSyncRound.d.ts +6 -0
  65. package/dist/types/client/v2/algod/models/types.d.ts +236 -29
  66. package/dist/types/client/v2/algod/ready.d.ts +4 -0
  67. package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +9 -0
  68. package/dist/types/client/v2/algod/setSyncRound.d.ts +9 -0
  69. package/dist/types/client/v2/algod/simulateTransaction.d.ts +3 -3
  70. package/dist/types/client/v2/algod/suggestedParams.d.ts +3 -3
  71. package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -0
  72. package/dist/types/composer.d.ts +5 -2
  73. package/dist/types/main.d.ts +1 -0
  74. package/dist/types/makeTxn.d.ts +1 -3
  75. package/dist/types/types/transactions/base.d.ts +6 -0
  76. package/package.json +2 -2
  77. package/src/client/v2/algod/algod.ts +184 -25
  78. package/src/client/v2/algod/getApplicationBoxByName.ts +1 -1
  79. package/src/client/v2/algod/getApplicationBoxes.ts +1 -1
  80. package/src/client/v2/algod/getBlockOffsetTimestamp.ts +17 -0
  81. package/src/client/v2/algod/getSyncRound.ts +17 -0
  82. package/src/client/v2/algod/models/types.ts +454 -36
  83. package/src/client/v2/algod/ready.ts +8 -0
  84. package/src/client/v2/algod/setBlockOffsetTimestamp.ts +20 -0
  85. package/src/client/v2/algod/setSyncRound.ts +20 -0
  86. package/src/client/v2/algod/simulateTransaction.ts +6 -22
  87. package/src/client/v2/algod/suggestedParams.ts +4 -3
  88. package/src/client/v2/algod/unsetSyncRound.ts +13 -0
  89. package/src/composer.ts +27 -3
  90. package/src/main.ts +7 -0
  91. package/src/makeTxn.ts +2 -4
  92. package/src/transaction.ts +1 -2
  93. package/src/types/transactions/base.ts +7 -0
@@ -30,8 +30,16 @@ import {
30
30
  } from '../../urlTokenBaseHTTPClient';
31
31
  import LightBlockHeaderProof from './lightBlockHeaderProof';
32
32
  import StateProof from './stateproof';
33
+ import SetSyncRound from './setSyncRound';
34
+ import GetSyncRound from './getSyncRound';
35
+ import SetBlockOffsetTimestamp from './setBlockOffsetTimestamp';
36
+ import GetBlockOffsetTimestamp from './getBlockOffsetTimestamp';
33
37
  import Disassemble from './disassemble';
34
38
  import SimulateRawTransactions from './simulateTransaction';
39
+ import { EncodedSignedTransaction } from '../../../types';
40
+ import * as encoding from '../../../encoding/encoding';
41
+ import Ready from './ready';
42
+ import UnsetSyncRound from './unsetSyncRound';
35
43
 
36
44
  /**
37
45
  * 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.
@@ -86,7 +94,7 @@ export default class AlgodClient extends ServiceClient {
86
94
  * const health = await algodClient.healthCheck().do();
87
95
  * ```
88
96
  *
89
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-health)
97
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-health)
90
98
  * @category GET
91
99
  */
92
100
  healthCheck() {
@@ -101,7 +109,7 @@ export default class AlgodClient extends ServiceClient {
101
109
  * const versionsDetails = await algodClient.versionsCheck().do();
102
110
  * ```
103
111
  *
104
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-versions)
112
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-versions)
105
113
  * @category GET
106
114
  */
107
115
  versionsCheck() {
@@ -117,7 +125,7 @@ export default class AlgodClient extends ServiceClient {
117
125
  * const result = await waitForConfirmation(algodClient, txid, 3);
118
126
  * ```
119
127
  *
120
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#post-v2transactions)
128
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2transactions)
121
129
  *
122
130
  * @remarks
123
131
  * Often used with {@linkcode waitForConfirmation}
@@ -137,7 +145,7 @@ export default class AlgodClient extends ServiceClient {
137
145
  * const accountInfo = await algodClient.accountInformation(address).do();
138
146
  * ```
139
147
  *
140
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2accountsaddress)
148
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
141
149
  * @param account - The address of the account to look up.
142
150
  * @category GET
143
151
  */
@@ -155,7 +163,7 @@ export default class AlgodClient extends ServiceClient {
155
163
  * const accountAssetInfo = await algodClient.accountAssetInformation(address, index).do();
156
164
  * ```
157
165
  *
158
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2accountsaddress)
166
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
159
167
  * @param account - The address of the account to look up.
160
168
  * @param index - The asset ID to look up.
161
169
  * @category GET
@@ -179,7 +187,7 @@ export default class AlgodClient extends ServiceClient {
179
187
  * const accountInfo = await algodClient.accountApplicationInformation(address, index).do();
180
188
  * ```
181
189
  *
182
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2accountsaddress)
190
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
183
191
  * @param account - The address of the account to look up.
184
192
  * @param index - The application ID to look up.
185
193
  * @category GET
@@ -202,7 +210,7 @@ export default class AlgodClient extends ServiceClient {
202
210
  * const block = await algodClient.block(roundNumber).do();
203
211
  * ```
204
212
  *
205
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2blocksround)
213
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2blocksround)
206
214
  * @param roundNumber - The round number of the block to get.
207
215
  * @category GET
208
216
  */
@@ -219,7 +227,7 @@ export default class AlgodClient extends ServiceClient {
219
227
  * const block = await algodClient.getBlockHash(roundNumber).do();
220
228
  * ```
221
229
  *
222
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2blocksroundhash)
230
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2blocksroundhash)
223
231
  * @param roundNumber - The round number of the block to get.
224
232
  * @category GET
225
233
  */
@@ -236,7 +244,7 @@ export default class AlgodClient extends ServiceClient {
236
244
  * const pending = await algodClient.pendingTransactionInformation(txId).do();
237
245
  * ```
238
246
  *
239
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2transactionspendingtxid)
247
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2transactionspendingtxid)
240
248
  *
241
249
  * @remarks
242
250
  * <br><br>
@@ -272,7 +280,7 @@ export default class AlgodClient extends ServiceClient {
272
280
  * .do();
273
281
  * ```
274
282
  *
275
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2transactionspending)
283
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2transactionspending)
276
284
  * @category GET
277
285
  */
278
286
  pendingTransactionsInformation() {
@@ -299,7 +307,7 @@ export default class AlgodClient extends ServiceClient {
299
307
  * .do();
300
308
  * ```
301
309
  *
302
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2accountsaddresstransactionspending)
310
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddresstransactionspending)
303
311
  * @param address - The address of the sender.
304
312
  * @category GET
305
313
  */
@@ -315,7 +323,7 @@ export default class AlgodClient extends ServiceClient {
315
323
  * const status = await algodClient.status().do();
316
324
  * ```
317
325
  *
318
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2status)
326
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2status)
319
327
  * @category GET
320
328
  */
321
329
  status() {
@@ -331,7 +339,7 @@ export default class AlgodClient extends ServiceClient {
331
339
  * const statusAfterBlock = await algodClient.statusAfterBlock(round).do();
332
340
  * ```
333
341
  *
334
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2statuswait-for-block-afterround)
342
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2statuswait-for-block-afterround)
335
343
  * @param round - The number of the round to wait for.
336
344
  * @category GET
337
345
  */
@@ -354,7 +362,7 @@ export default class AlgodClient extends ServiceClient {
354
362
  * });
355
363
  * ```
356
364
  *
357
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2transactionsparams)
365
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2transactionsparams)
358
366
  *
359
367
  * @remarks
360
368
  * Often used with
@@ -373,7 +381,7 @@ export default class AlgodClient extends ServiceClient {
373
381
  * const supplyDetails = await algodClient.supply().do();
374
382
  * ```
375
383
  *
376
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2ledgersupply)
384
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2ledgersupply)
377
385
  * @category GET
378
386
  */
379
387
  supply() {
@@ -389,7 +397,7 @@ export default class AlgodClient extends ServiceClient {
389
397
  * const compiledSmartContract = await algodClient.compile(source).do();
390
398
  * ```
391
399
  *
392
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#post-v2tealcompile)
400
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2tealcompile)
393
401
  * @remarks
394
402
  * This endpoint is only enabled when a node's configuration file sets `EnableDeveloperAPI` to true.
395
403
  * @param source
@@ -425,7 +433,7 @@ export default class AlgodClient extends ServiceClient {
425
433
  * const dryRunResult = await algodClient.dryrun(dr).do();
426
434
  * ```
427
435
  *
428
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#post-v2tealdryrun)
436
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2tealdryrun)
429
437
  * @param dr
430
438
  * @category POST
431
439
  */
@@ -443,7 +451,7 @@ export default class AlgodClient extends ServiceClient {
443
451
  * const asset = await algodClient.getAssetByID(asset_id).do();
444
452
  * ```
445
453
  *
446
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2assetsasset-id)
454
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2assetsasset-id)
447
455
  * @param index - The asset ID to look up.
448
456
  * @category GET
449
457
  */
@@ -461,7 +469,7 @@ export default class AlgodClient extends ServiceClient {
461
469
  * const app = await algodClient.getApplicationByID(index).do();
462
470
  * ```
463
471
  *
464
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-id)
472
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-id)
465
473
  * @param index - The application ID to look up.
466
474
  * @category GET
467
475
  */
@@ -480,7 +488,7 @@ export default class AlgodClient extends ServiceClient {
480
488
  * const boxValue = boxResponse.value;
481
489
  * ```
482
490
  *
483
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idbox)
491
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idbox)
484
492
  * @param index - The application ID to look up.
485
493
  * @category GET
486
494
  */
@@ -503,7 +511,7 @@ export default class AlgodClient extends ServiceClient {
503
511
  * const boxNames = boxesResponse.boxes.map(box => box.name);
504
512
  * ```
505
513
  *
506
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idboxes)
514
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idboxes)
507
515
  * @param index - The application ID to look up.
508
516
  * @category GET
509
517
  */
@@ -519,7 +527,7 @@ export default class AlgodClient extends ServiceClient {
519
527
  * const genesis = await algodClient.genesis().do();
520
528
  * ```
521
529
  *
522
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-genesis)
530
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-genesis)
523
531
  * @category GET
524
532
  */
525
533
  genesis() {
@@ -536,7 +544,7 @@ export default class AlgodClient extends ServiceClient {
536
544
  * const proof = await algodClient.getTransactionProof(round, txId).do();
537
545
  * ```
538
546
  *
539
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2blocksroundtransactionstxidproof)
547
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2blocksroundtransactionstxidproof)
540
548
  * @param round - The round in which the transaction appears.
541
549
  * @param txID - The transaction ID for which to generate a proof.
542
550
  * @category GET
@@ -582,14 +590,165 @@ export default class AlgodClient extends ServiceClient {
582
590
  *
583
591
  * #### Example
584
592
  * ```typescript
593
+ * const txn1 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn1Params);
594
+ * const txn2 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn2Params);
595
+ * const txgroup = algosdk.assignGroupID([txn1, txn2]);
596
+ *
597
+ * // Actually sign the first transaction
598
+ * const signedTxn1 = txgroup[0].signTxn(senderSk).blob;
599
+ * // Simulate does not require signed transactions -- use this method to encode an unsigned transaction
600
+ * const signedTxn2 = algosdk.encodeUnsignedSimulateTransaction(txgroup[1]);
601
+ *
585
602
  * const resp = await client.simulateRawTransactions([signedTxn1, signedTxn2]).do();
586
603
  * ```
587
604
  *
588
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#post-v2transactionssimulate)
605
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2transactionssimulate)
589
606
  * @param stxOrStxs
590
607
  * @category POST
591
608
  */
592
609
  simulateRawTransactions(stxOrStxs: Uint8Array | Uint8Array[]) {
593
- return new SimulateRawTransactions(this.c, stxOrStxs);
610
+ const txnObjects: EncodedSignedTransaction[] = [];
611
+ if (Array.isArray(stxOrStxs)) {
612
+ for (const stxn of stxOrStxs) {
613
+ txnObjects.push(encoding.decode(stxn) as EncodedSignedTransaction);
614
+ }
615
+ } else {
616
+ txnObjects.push(encoding.decode(stxOrStxs) as EncodedSignedTransaction);
617
+ }
618
+ const request = new modelsv2.SimulateRequest({
619
+ txnGroups: [
620
+ new modelsv2.SimulateRequestTransactionGroup({
621
+ txns: txnObjects,
622
+ }),
623
+ ],
624
+ });
625
+ return this.simulateTransactions(request);
626
+ }
627
+
628
+ /**
629
+ * Simulate transactions being sent to the network.
630
+ *
631
+ * #### Example
632
+ * ```typescript
633
+ * const txn1 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn1Params);
634
+ * const txn2 = algosdk.makePaymentTxnWithSuggestedParamsFromObject(txn2Params);
635
+ * const txgroup = algosdk.assignGroupID([txn1, txn2]);
636
+ *
637
+ * // Actually sign the first transaction
638
+ * const signedTxn1 = txgroup[0].signTxn(senderSk).blob;
639
+ * // Simulate does not require signed transactions -- use this method to encode an unsigned transaction
640
+ * const signedTxn2 = algosdk.encodeUnsignedSimulateTransaction(txgroup[1]);
641
+ *
642
+ * const request = new modelsv2.SimulateRequest({
643
+ * txnGroups: [
644
+ * new modelsv2.SimulateRequestTransactionGroup({
645
+ * // Must decode the signed txn bytes into an object
646
+ * txns: [algosdk.decodeObj(signedTxn1), algosdk.decodeObj(signedTxn2)]
647
+ * }),
648
+ * ],
649
+ * });
650
+ * const resp = await client.simulateRawTransactions(request).do();
651
+ * ```
652
+ *
653
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2transactionssimulate)
654
+ * @param request
655
+ * @category POST
656
+ */
657
+ simulateTransactions(request: modelsv2.SimulateRequest) {
658
+ return new SimulateRawTransactions(this.c, request);
659
+ }
660
+
661
+ /**
662
+ * Set the offset (in seconds) applied to the block timestamp when creating new blocks in devmode.
663
+ *
664
+ * #### Example
665
+ * ```typesecript
666
+ * const offset = 60
667
+ * await client.setBlockOffsetTimestamp(offset).do();
668
+ * ```
669
+ *
670
+ [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2devmodeblocksoffsetoffset)
671
+ * @param offset
672
+ * @category POST
673
+ */
674
+ setBlockOffsetTimestamp(offset: number) {
675
+ return new SetBlockOffsetTimestamp(this.c, this.intDecoding, offset);
676
+ }
677
+
678
+ /**
679
+ * Get the offset (in seconds) applied to the block timestamp when creating new blocks in devmode.
680
+ *
681
+ * #### Example
682
+ * ```typesecript
683
+ * const currentOffset = await client.getBlockOffsetTimestamp().do();
684
+ * ```
685
+ *
686
+ [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2devmodeblocksoffset)
687
+ * @category GET
688
+ */
689
+ getBlockOffsetTimestamp() {
690
+ return new GetBlockOffsetTimestamp(this.c, this.intDecoding);
691
+ }
692
+
693
+ /**
694
+ * Set the sync round on the ledger (algod must have EnableFollowMode: true), restricting catchup.
695
+ *
696
+ * #### Example
697
+ * ```typesecript
698
+ * const round = 10000
699
+ * await client.setSyncRound(round).do();
700
+ * ```
701
+ *
702
+ [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#post-v2ledgersyncround)
703
+ * @param round
704
+ * @category POST
705
+ */
706
+ setSyncRound(round: number) {
707
+ return new SetSyncRound(this.c, this.intDecoding, round);
708
+ }
709
+
710
+ /**
711
+ * Un-Set the sync round on the ledger (algod must have EnableFollowMode: true), removing the restriction on catchup.
712
+ *
713
+ * #### Example
714
+ * ```typesecript
715
+ * await client.unsetSyncRound().do();
716
+ * ```
717
+ *
718
+ [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#delete-v2ledgersync)
719
+ * @category DELETE
720
+ */
721
+ unsetSyncRound() {
722
+ return new UnsetSyncRound(this.c, this.intDecoding);
723
+ }
724
+
725
+ /**
726
+ * Get the current sync round on the ledger (algod must have EnableFollowMode: true).
727
+ *
728
+ * #### Example
729
+ * ```typesecript
730
+ * const currentSyncRound = await client.getSyncRound().do();
731
+ * ```
732
+ *
733
+ [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2ledgersync)
734
+ * @category GET
735
+ */
736
+ getSyncRound() {
737
+ return new GetSyncRound(this.c, this.intDecoding);
738
+ }
739
+
740
+ /**
741
+ * Ready check which returns 200 OK if algod is healthy and caught up
742
+ *
743
+ * #### Example
744
+ * ```typesecript
745
+ * await client.ready().do();
746
+ * ```
747
+ *
748
+ [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-ready)
749
+ * @category GET
750
+ */
751
+ ready() {
752
+ return new Ready(this.c, this.intDecoding);
594
753
  }
595
754
  }
@@ -15,7 +15,7 @@ import { Box } from './models/types';
15
15
  * const boxValue = boxResponse.value;
16
16
  * ```
17
17
  *
18
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idbox)
18
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idbox)
19
19
  * @param index - The application ID to look up.
20
20
  * @category GET
21
21
  */
@@ -13,7 +13,7 @@ import { BoxesResponse } from './models/types';
13
13
  * const boxNames = boxesResponse.boxes.map(box => box.name);
14
14
  * ```
15
15
  *
16
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idboxes)
16
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2applicationsapplication-idboxes)
17
17
  * @param index - The application ID to look up.
18
18
  * @category GET
19
19
  */
@@ -0,0 +1,17 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ import { GetBlockTimeStampOffsetResponse } from './models/types';
3
+
4
+ export default class GetBlockOffsetTimestamp extends JSONRequest<
5
+ GetBlockTimeStampOffsetResponse,
6
+ Record<string, any>
7
+ > {
8
+ // eslint-disable-next-line class-methods-use-this
9
+ path() {
10
+ return `/v2/devmode/blocks/offset`;
11
+ }
12
+
13
+ // eslint-disable-next-line class-methods-use-this
14
+ prepare(body: Record<string, any>): GetBlockTimeStampOffsetResponse {
15
+ return GetBlockTimeStampOffsetResponse.from_obj_for_encoding(body);
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ import { GetSyncRoundResponse } from './models/types';
3
+
4
+ export default class GetSyncRound extends JSONRequest<
5
+ GetSyncRoundResponse,
6
+ Record<string, any>
7
+ > {
8
+ // eslint-disable-next-line class-methods-use-this
9
+ path() {
10
+ return `/v2/ledger/sync`;
11
+ }
12
+
13
+ // eslint-disable-next-line class-methods-use-this
14
+ prepare(body: Record<string, any>): GetSyncRoundResponse {
15
+ return GetSyncRoundResponse.from_obj_for_encoding(body);
16
+ }
17
+ }