@taquito/rpc 10.2.0 → 11.0.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/dist/lib/opkind.js +1 -0
- package/dist/lib/opkind.js.map +1 -1
- package/dist/lib/rpc-client-interface.js.map +1 -1
- package/dist/lib/rpc-client-modules/rpc-cache.js +332 -313
- package/dist/lib/rpc-client-modules/rpc-cache.js.map +1 -1
- package/dist/lib/taquito-rpc.js +35 -3
- package/dist/lib/taquito-rpc.js.map +1 -1
- package/dist/lib/version.js +2 -2
- package/dist/taquito-rpc.es5.js +338 -318
- package/dist/taquito-rpc.es5.js.map +1 -1
- package/dist/taquito-rpc.umd.js +338 -318
- package/dist/taquito-rpc.umd.js.map +1 -1
- package/dist/types/opkind.d.ts +2 -1
- package/dist/types/rpc-client-interface.d.ts +2 -1
- package/dist/types/rpc-client-modules/rpc-cache.d.ts +20 -8
- package/dist/types/taquito-rpc.d.ts +19 -2
- package/dist/types/types.d.ts +68 -7
- package/package.json +7 -6
- package/signature.json +1 -1
package/dist/taquito-rpc.umd.js
CHANGED
|
@@ -152,11 +152,16 @@
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
RpcClientCache.prototype.formatCacheKey = function (rpcUrl, rpcMethodName, rpcMethodParams, rpcMethodData) {
|
|
155
|
-
var paramsToString =
|
|
155
|
+
var paramsToString = '';
|
|
156
156
|
rpcMethodParams.forEach(function (param) {
|
|
157
|
-
paramsToString =
|
|
157
|
+
paramsToString =
|
|
158
|
+
typeof param === 'object'
|
|
159
|
+
? paramsToString + JSON.stringify(param) + '/'
|
|
160
|
+
: paramsToString + param + '/';
|
|
158
161
|
});
|
|
159
|
-
return rpcMethodData
|
|
162
|
+
return rpcMethodData
|
|
163
|
+
? rpcUrl + "/" + rpcMethodName + "/" + paramsToString + "/" + JSON.stringify(rpcMethodData)
|
|
164
|
+
: rpcUrl + "/" + rpcMethodName + "/" + paramsToString;
|
|
160
165
|
};
|
|
161
166
|
RpcClientCache.prototype.has = function (key) {
|
|
162
167
|
return key in this._cache;
|
|
@@ -190,16 +195,14 @@
|
|
|
190
195
|
return __awaiter(this, void 0, void 0, function () {
|
|
191
196
|
var key, response;
|
|
192
197
|
return __generator(this, function (_c) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
this.put(key, response);
|
|
202
|
-
return [2 /*return*/, response];
|
|
198
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBlockHash', [block]);
|
|
199
|
+
if (this.has(key)) {
|
|
200
|
+
return [2 /*return*/, this.get(key)];
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
response = this.rpcClient.getBlockHash({ block: block });
|
|
204
|
+
this.put(key, response);
|
|
205
|
+
return [2 /*return*/, response];
|
|
203
206
|
}
|
|
204
207
|
});
|
|
205
208
|
});
|
|
@@ -217,16 +220,14 @@
|
|
|
217
220
|
return __awaiter(this, void 0, void 0, function () {
|
|
218
221
|
var key, response;
|
|
219
222
|
return __generator(this, function (_c) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
this.put(key, response);
|
|
229
|
-
return [2 /*return*/, response];
|
|
223
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getLiveBlocks', [block]);
|
|
224
|
+
if (this.has(key)) {
|
|
225
|
+
return [2 /*return*/, this.get(key)];
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
response = this.rpcClient.getLiveBlocks({ block: block });
|
|
229
|
+
this.put(key, response);
|
|
230
|
+
return [2 /*return*/, response];
|
|
230
231
|
}
|
|
231
232
|
});
|
|
232
233
|
});
|
|
@@ -245,16 +246,14 @@
|
|
|
245
246
|
return __awaiter(this, void 0, void 0, function () {
|
|
246
247
|
var key, response;
|
|
247
248
|
return __generator(this, function (_c) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
this.put(key, response);
|
|
257
|
-
return [2 /*return*/, response];
|
|
249
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBalance', [block, address]);
|
|
250
|
+
if (this.has(key)) {
|
|
251
|
+
return [2 /*return*/, this.get(key)];
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
response = this.rpcClient.getBalance(address, { block: block });
|
|
255
|
+
this.put(key, response);
|
|
256
|
+
return [2 /*return*/, response];
|
|
258
257
|
}
|
|
259
258
|
});
|
|
260
259
|
});
|
|
@@ -273,16 +272,14 @@
|
|
|
273
272
|
return __awaiter(this, void 0, void 0, function () {
|
|
274
273
|
var key, response;
|
|
275
274
|
return __generator(this, function (_c) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this.put(key, response);
|
|
285
|
-
return [2 /*return*/, response];
|
|
275
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getStorage', [block, address]);
|
|
276
|
+
if (this.has(key)) {
|
|
277
|
+
return [2 /*return*/, this.get(key)];
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
response = this.rpcClient.getStorage(address, { block: block });
|
|
281
|
+
this.put(key, response);
|
|
282
|
+
return [2 /*return*/, response];
|
|
286
283
|
}
|
|
287
284
|
});
|
|
288
285
|
});
|
|
@@ -301,16 +298,45 @@
|
|
|
301
298
|
return __awaiter(this, void 0, void 0, function () {
|
|
302
299
|
var key, response;
|
|
303
300
|
return __generator(this, function (_c) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
301
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getScript', [block, address]);
|
|
302
|
+
if (this.has(key)) {
|
|
303
|
+
return [2 /*return*/, this.get(key)];
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
response = this.rpcClient.getScript(address, { block: block });
|
|
307
|
+
this.put(key, response);
|
|
308
|
+
return [2 /*return*/, response];
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
*
|
|
315
|
+
* @param address contract address from which we want to retrieve the script
|
|
316
|
+
* @param unparsingMode default is { unparsing_mode: "Readable" }
|
|
317
|
+
* @param options contains generic configuration for rpc calls
|
|
318
|
+
*
|
|
319
|
+
* @description Access the script of the contract and normalize it using the requested unparsing mode.
|
|
320
|
+
*
|
|
321
|
+
*/
|
|
322
|
+
RpcClientCache.prototype.getNormalizedScript = function (address, unparsingMode, _a) {
|
|
323
|
+
if (unparsingMode === void 0) { unparsingMode = { unparsing_mode: 'Readable' }; }
|
|
324
|
+
var _b = _a === void 0 ? defaultRPCOptions : _a, block = _b.block;
|
|
325
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
326
|
+
var key, response;
|
|
327
|
+
return __generator(this, function (_c) {
|
|
328
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getNormalizedScript', [
|
|
329
|
+
block,
|
|
330
|
+
address,
|
|
331
|
+
unparsingMode,
|
|
332
|
+
]);
|
|
333
|
+
if (this.has(key)) {
|
|
334
|
+
return [2 /*return*/, this.get(key)];
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
response = this.rpcClient.getNormalizedScript(address, unparsingMode, { block: block });
|
|
338
|
+
this.put(key, response);
|
|
339
|
+
return [2 /*return*/, response];
|
|
314
340
|
}
|
|
315
341
|
});
|
|
316
342
|
});
|
|
@@ -329,16 +355,14 @@
|
|
|
329
355
|
return __awaiter(this, void 0, void 0, function () {
|
|
330
356
|
var key, response;
|
|
331
357
|
return __generator(this, function (_c) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
this.put(key, response);
|
|
341
|
-
return [2 /*return*/, response];
|
|
358
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getContract', [block, address]);
|
|
359
|
+
if (this.has(key)) {
|
|
360
|
+
return [2 /*return*/, this.get(key)];
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
response = this.rpcClient.getContract(address, { block: block });
|
|
364
|
+
this.put(key, response);
|
|
365
|
+
return [2 /*return*/, response];
|
|
342
366
|
}
|
|
343
367
|
});
|
|
344
368
|
});
|
|
@@ -357,16 +381,14 @@
|
|
|
357
381
|
return __awaiter(this, void 0, void 0, function () {
|
|
358
382
|
var key, response;
|
|
359
383
|
return __generator(this, function (_c) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
this.put(key, response);
|
|
369
|
-
return [2 /*return*/, response];
|
|
384
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getManagerKey', [block, address]);
|
|
385
|
+
if (this.has(key)) {
|
|
386
|
+
return [2 /*return*/, this.get(key)];
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
response = this.rpcClient.getManagerKey(address, { block: block });
|
|
390
|
+
this.put(key, response);
|
|
391
|
+
return [2 /*return*/, response];
|
|
370
392
|
}
|
|
371
393
|
});
|
|
372
394
|
});
|
|
@@ -385,16 +407,14 @@
|
|
|
385
407
|
return __awaiter(this, void 0, void 0, function () {
|
|
386
408
|
var key, response;
|
|
387
409
|
return __generator(this, function (_c) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
this.put(key, response);
|
|
397
|
-
return [2 /*return*/, response];
|
|
410
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getDelegate', [block, address]);
|
|
411
|
+
if (this.has(key)) {
|
|
412
|
+
return [2 /*return*/, this.get(key)];
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
response = this.rpcClient.getDelegate(address, { block: block });
|
|
416
|
+
this.put(key, response);
|
|
417
|
+
return [2 /*return*/, response];
|
|
398
418
|
}
|
|
399
419
|
});
|
|
400
420
|
});
|
|
@@ -415,16 +435,18 @@
|
|
|
415
435
|
return __awaiter(this, void 0, void 0, function () {
|
|
416
436
|
var keyUrl, response;
|
|
417
437
|
return __generator(this, function (_c) {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
438
|
+
keyUrl = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBigMapKey', [
|
|
439
|
+
block,
|
|
440
|
+
address,
|
|
441
|
+
key,
|
|
442
|
+
]);
|
|
443
|
+
if (this.has(keyUrl)) {
|
|
444
|
+
return [2 /*return*/, this.get(keyUrl)];
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
response = this.rpcClient.getBigMapKey(address, key, { block: block });
|
|
448
|
+
this.put(keyUrl, response);
|
|
449
|
+
return [2 /*return*/, response];
|
|
428
450
|
}
|
|
429
451
|
});
|
|
430
452
|
});
|
|
@@ -444,16 +466,14 @@
|
|
|
444
466
|
return __awaiter(this, void 0, void 0, function () {
|
|
445
467
|
var key, response;
|
|
446
468
|
return __generator(this, function (_c) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
this.put(key, response);
|
|
456
|
-
return [2 /*return*/, response];
|
|
469
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBigMapExpr', [block, id, expr]);
|
|
470
|
+
if (this.has(key)) {
|
|
471
|
+
return [2 /*return*/, this.get(key)];
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
response = this.rpcClient.getBigMapExpr(id, expr, { block: block });
|
|
475
|
+
this.put(key, response);
|
|
476
|
+
return [2 /*return*/, response];
|
|
457
477
|
}
|
|
458
478
|
});
|
|
459
479
|
});
|
|
@@ -472,16 +492,14 @@
|
|
|
472
492
|
return __awaiter(this, void 0, void 0, function () {
|
|
473
493
|
var key, response;
|
|
474
494
|
return __generator(this, function (_c) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
this.put(key, response);
|
|
484
|
-
return [2 /*return*/, response];
|
|
495
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getDelegates', [block, address]);
|
|
496
|
+
if (this.has(key)) {
|
|
497
|
+
return [2 /*return*/, this.get(key)];
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
response = this.rpcClient.getDelegates(address, { block: block });
|
|
501
|
+
this.put(key, response);
|
|
502
|
+
return [2 /*return*/, response];
|
|
485
503
|
}
|
|
486
504
|
});
|
|
487
505
|
});
|
|
@@ -499,16 +517,14 @@
|
|
|
499
517
|
return __awaiter(this, void 0, void 0, function () {
|
|
500
518
|
var key, response;
|
|
501
519
|
return __generator(this, function (_c) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
this.put(key, response);
|
|
511
|
-
return [2 /*return*/, response];
|
|
520
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getConstants', [block]);
|
|
521
|
+
if (this.has(key)) {
|
|
522
|
+
return [2 /*return*/, this.get(key)];
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
response = this.rpcClient.getConstants({ block: block });
|
|
526
|
+
this.put(key, response);
|
|
527
|
+
return [2 /*return*/, response];
|
|
512
528
|
}
|
|
513
529
|
});
|
|
514
530
|
});
|
|
@@ -529,16 +545,14 @@
|
|
|
529
545
|
return __awaiter(this, void 0, void 0, function () {
|
|
530
546
|
var key, response;
|
|
531
547
|
return __generator(this, function (_c) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
this.put(key, response);
|
|
541
|
-
return [2 /*return*/, response];
|
|
548
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBlock', [block]);
|
|
549
|
+
if (this.has(key)) {
|
|
550
|
+
return [2 /*return*/, this.get(key)];
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
response = this.rpcClient.getBlock({ block: block });
|
|
554
|
+
this.put(key, response);
|
|
555
|
+
return [2 /*return*/, response];
|
|
542
556
|
}
|
|
543
557
|
});
|
|
544
558
|
});
|
|
@@ -556,16 +570,14 @@
|
|
|
556
570
|
return __awaiter(this, void 0, void 0, function () {
|
|
557
571
|
var key, response;
|
|
558
572
|
return __generator(this, function (_c) {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
this.put(key, response);
|
|
568
|
-
return [2 /*return*/, response];
|
|
573
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBlockHeader', [block]);
|
|
574
|
+
if (this.has(key)) {
|
|
575
|
+
return [2 /*return*/, this.get(key)];
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
response = this.rpcClient.getBlockHeader({ block: block });
|
|
579
|
+
this.put(key, response);
|
|
580
|
+
return [2 /*return*/, response];
|
|
569
581
|
}
|
|
570
582
|
});
|
|
571
583
|
});
|
|
@@ -583,16 +595,14 @@
|
|
|
583
595
|
return __awaiter(this, void 0, void 0, function () {
|
|
584
596
|
var key, response;
|
|
585
597
|
return __generator(this, function (_c) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
this.put(key, response);
|
|
595
|
-
return [2 /*return*/, response];
|
|
598
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBlockMetadata', [block]);
|
|
599
|
+
if (this.has(key)) {
|
|
600
|
+
return [2 /*return*/, this.get(key)];
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
response = this.rpcClient.getBlockMetadata({ block: block });
|
|
604
|
+
this.put(key, response);
|
|
605
|
+
return [2 /*return*/, response];
|
|
596
606
|
}
|
|
597
607
|
});
|
|
598
608
|
});
|
|
@@ -612,16 +622,14 @@
|
|
|
612
622
|
return __awaiter(this, void 0, void 0, function () {
|
|
613
623
|
var key, response;
|
|
614
624
|
return __generator(this, function (_c) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
this.put(key, response);
|
|
624
|
-
return [2 /*return*/, response];
|
|
625
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBakingRights', [block, args]);
|
|
626
|
+
if (this.has(key)) {
|
|
627
|
+
return [2 /*return*/, this.get(key)];
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
response = this.rpcClient.getBakingRights(args, { block: block });
|
|
631
|
+
this.put(key, response);
|
|
632
|
+
return [2 /*return*/, response];
|
|
625
633
|
}
|
|
626
634
|
});
|
|
627
635
|
});
|
|
@@ -641,16 +649,17 @@
|
|
|
641
649
|
return __awaiter(this, void 0, void 0, function () {
|
|
642
650
|
var key, response;
|
|
643
651
|
return __generator(this, function (_c) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
652
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getEndorsingRights', [
|
|
653
|
+
block,
|
|
654
|
+
args,
|
|
655
|
+
]);
|
|
656
|
+
if (this.has(key)) {
|
|
657
|
+
return [2 /*return*/, this.get(key)];
|
|
658
|
+
}
|
|
659
|
+
else {
|
|
660
|
+
response = this.rpcClient.getEndorsingRights(args, { block: block });
|
|
661
|
+
this.put(key, response);
|
|
662
|
+
return [2 /*return*/, response];
|
|
654
663
|
}
|
|
655
664
|
});
|
|
656
665
|
});
|
|
@@ -667,16 +676,14 @@
|
|
|
667
676
|
return __awaiter(this, void 0, void 0, function () {
|
|
668
677
|
var key, response;
|
|
669
678
|
return __generator(this, function (_c) {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
this.put(key, response);
|
|
679
|
-
return [2 /*return*/, response];
|
|
679
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBallotList', [block]);
|
|
680
|
+
if (this.has(key)) {
|
|
681
|
+
return [2 /*return*/, this.get(key)];
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
response = this.rpcClient.getBallotList({ block: block });
|
|
685
|
+
this.put(key, response);
|
|
686
|
+
return [2 /*return*/, response];
|
|
680
687
|
}
|
|
681
688
|
});
|
|
682
689
|
});
|
|
@@ -694,16 +701,14 @@
|
|
|
694
701
|
return __awaiter(this, void 0, void 0, function () {
|
|
695
702
|
var key, response;
|
|
696
703
|
return __generator(this, function (_c) {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
this.put(key, response);
|
|
706
|
-
return [2 /*return*/, response];
|
|
704
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getBallots', [block]);
|
|
705
|
+
if (this.has(key)) {
|
|
706
|
+
return [2 /*return*/, this.get(key)];
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
response = this.rpcClient.getBallots({ block: block });
|
|
710
|
+
this.put(key, response);
|
|
711
|
+
return [2 /*return*/, response];
|
|
707
712
|
}
|
|
708
713
|
});
|
|
709
714
|
});
|
|
@@ -723,16 +728,14 @@
|
|
|
723
728
|
return __awaiter(this, void 0, void 0, function () {
|
|
724
729
|
var key, response;
|
|
725
730
|
return __generator(this, function (_c) {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
this.put(key, response);
|
|
735
|
-
return [2 /*return*/, response];
|
|
731
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getCurrentPeriodKind', [block]);
|
|
732
|
+
if (this.has(key)) {
|
|
733
|
+
return [2 /*return*/, this.get(key)];
|
|
734
|
+
}
|
|
735
|
+
else {
|
|
736
|
+
response = this.rpcClient.getCurrentPeriodKind({ block: block });
|
|
737
|
+
this.put(key, response);
|
|
738
|
+
return [2 /*return*/, response];
|
|
736
739
|
}
|
|
737
740
|
});
|
|
738
741
|
});
|
|
@@ -750,16 +753,14 @@
|
|
|
750
753
|
return __awaiter(this, void 0, void 0, function () {
|
|
751
754
|
var key, response;
|
|
752
755
|
return __generator(this, function (_c) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
this.put(key, response);
|
|
762
|
-
return [2 /*return*/, response];
|
|
756
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getCurrentProposal', [block]);
|
|
757
|
+
if (this.has(key)) {
|
|
758
|
+
return [2 /*return*/, this.get(key)];
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
response = this.rpcClient.getCurrentProposal({ block: block });
|
|
762
|
+
this.put(key, response);
|
|
763
|
+
return [2 /*return*/, response];
|
|
763
764
|
}
|
|
764
765
|
});
|
|
765
766
|
});
|
|
@@ -777,16 +778,14 @@
|
|
|
777
778
|
return __awaiter(this, void 0, void 0, function () {
|
|
778
779
|
var key, response;
|
|
779
780
|
return __generator(this, function (_c) {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
this.put(key, response);
|
|
789
|
-
return [2 /*return*/, response];
|
|
781
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getCurrentQuorum', [block]);
|
|
782
|
+
if (this.has(key)) {
|
|
783
|
+
return [2 /*return*/, this.get(key)];
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
response = this.rpcClient.getCurrentQuorum({ block: block });
|
|
787
|
+
this.put(key, response);
|
|
788
|
+
return [2 /*return*/, response];
|
|
790
789
|
}
|
|
791
790
|
});
|
|
792
791
|
});
|
|
@@ -804,16 +803,14 @@
|
|
|
804
803
|
return __awaiter(this, void 0, void 0, function () {
|
|
805
804
|
var key, response;
|
|
806
805
|
return __generator(this, function (_c) {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
this.put(key, response);
|
|
816
|
-
return [2 /*return*/, response];
|
|
806
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getVotesListings', [block]);
|
|
807
|
+
if (this.has(key)) {
|
|
808
|
+
return [2 /*return*/, this.get(key)];
|
|
809
|
+
}
|
|
810
|
+
else {
|
|
811
|
+
response = this.rpcClient.getVotesListings({ block: block });
|
|
812
|
+
this.put(key, response);
|
|
813
|
+
return [2 /*return*/, response];
|
|
817
814
|
}
|
|
818
815
|
});
|
|
819
816
|
});
|
|
@@ -831,16 +828,14 @@
|
|
|
831
828
|
return __awaiter(this, void 0, void 0, function () {
|
|
832
829
|
var key, response;
|
|
833
830
|
return __generator(this, function (_c) {
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
this.put(key, response);
|
|
843
|
-
return [2 /*return*/, response];
|
|
831
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getProposals', [block]);
|
|
832
|
+
if (this.has(key)) {
|
|
833
|
+
return [2 /*return*/, this.get(key)];
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
response = this.rpcClient.getProposals({ block: block });
|
|
837
|
+
this.put(key, response);
|
|
838
|
+
return [2 /*return*/, response];
|
|
844
839
|
}
|
|
845
840
|
});
|
|
846
841
|
});
|
|
@@ -909,16 +904,17 @@
|
|
|
909
904
|
return __awaiter(this, void 0, void 0, function () {
|
|
910
905
|
var key, response;
|
|
911
906
|
return __generator(this, function (_c) {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
907
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getEntrypoints', [
|
|
908
|
+
block,
|
|
909
|
+
contract,
|
|
910
|
+
]);
|
|
911
|
+
if (this.has(key)) {
|
|
912
|
+
return [2 /*return*/, this.get(key)];
|
|
913
|
+
}
|
|
914
|
+
else {
|
|
915
|
+
response = this.rpcClient.getEntrypoints(contract, { block: block });
|
|
916
|
+
this.put(key, response);
|
|
917
|
+
return [2 /*return*/, response];
|
|
922
918
|
}
|
|
923
919
|
});
|
|
924
920
|
});
|
|
@@ -959,16 +955,14 @@
|
|
|
959
955
|
return __awaiter(this, void 0, void 0, function () {
|
|
960
956
|
var key, response;
|
|
961
957
|
return __generator(this, function (_a) {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
this.put(key, response);
|
|
971
|
-
return [2 /*return*/, response];
|
|
958
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getChainId', []);
|
|
959
|
+
if (this.has(key)) {
|
|
960
|
+
return [2 /*return*/, this.get(key)];
|
|
961
|
+
}
|
|
962
|
+
else {
|
|
963
|
+
response = this.rpcClient.getChainId();
|
|
964
|
+
this.put(key, response);
|
|
965
|
+
return [2 /*return*/, response];
|
|
972
966
|
}
|
|
973
967
|
});
|
|
974
968
|
});
|
|
@@ -989,16 +983,14 @@
|
|
|
989
983
|
return __awaiter(this, void 0, void 0, function () {
|
|
990
984
|
var key, response;
|
|
991
985
|
return __generator(this, function (_c) {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
this.put(key, response);
|
|
1001
|
-
return [2 /*return*/, response];
|
|
986
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'packData', [block, data]);
|
|
987
|
+
if (this.has(key)) {
|
|
988
|
+
return [2 /*return*/, this.get(key)];
|
|
989
|
+
}
|
|
990
|
+
else {
|
|
991
|
+
response = this.rpcClient.packData(data, { block: block });
|
|
992
|
+
this.put(key, response);
|
|
993
|
+
return [2 /*return*/, response];
|
|
1002
994
|
}
|
|
1003
995
|
});
|
|
1004
996
|
});
|
|
@@ -1025,16 +1017,14 @@
|
|
|
1025
1017
|
return __awaiter(this, void 0, void 0, function () {
|
|
1026
1018
|
var key, response;
|
|
1027
1019
|
return __generator(this, function (_c) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
this.put(key, response);
|
|
1037
|
-
return [2 /*return*/, response];
|
|
1020
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getCurrentPeriod', [block]);
|
|
1021
|
+
if (this.has(key)) {
|
|
1022
|
+
return [2 /*return*/, this.get(key)];
|
|
1023
|
+
}
|
|
1024
|
+
else {
|
|
1025
|
+
response = this.rpcClient.getCurrentPeriod({ block: block });
|
|
1026
|
+
this.put(key, response);
|
|
1027
|
+
return [2 /*return*/, response];
|
|
1038
1028
|
}
|
|
1039
1029
|
});
|
|
1040
1030
|
});
|
|
@@ -1054,16 +1044,14 @@
|
|
|
1054
1044
|
return __awaiter(this, void 0, void 0, function () {
|
|
1055
1045
|
var key, response;
|
|
1056
1046
|
return __generator(this, function (_c) {
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
this.put(key, response);
|
|
1066
|
-
return [2 /*return*/, response];
|
|
1047
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getSuccessorPeriod', [block]);
|
|
1048
|
+
if (this.has(key)) {
|
|
1049
|
+
return [2 /*return*/, this.get(key)];
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
response = this.rpcClient.getSuccessorPeriod({ block: block });
|
|
1053
|
+
this.put(key, response);
|
|
1054
|
+
return [2 /*return*/, response];
|
|
1067
1055
|
}
|
|
1068
1056
|
});
|
|
1069
1057
|
});
|
|
@@ -1082,16 +1070,14 @@
|
|
|
1082
1070
|
return __awaiter(this, void 0, void 0, function () {
|
|
1083
1071
|
var key, response;
|
|
1084
1072
|
return __generator(this, function (_c) {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
this.put(key, response);
|
|
1094
|
-
return [2 /*return*/, response];
|
|
1073
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getSaplingDiffById', [block, id]);
|
|
1074
|
+
if (this.has(key)) {
|
|
1075
|
+
return [2 /*return*/, this.get(key)];
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
response = this.rpcClient.getSaplingDiffById(id, { block: block });
|
|
1079
|
+
this.put(key, response);
|
|
1080
|
+
return [2 /*return*/, response];
|
|
1095
1081
|
}
|
|
1096
1082
|
});
|
|
1097
1083
|
});
|
|
@@ -1110,16 +1096,17 @@
|
|
|
1110
1096
|
return __awaiter(this, void 0, void 0, function () {
|
|
1111
1097
|
var key, response;
|
|
1112
1098
|
return __generator(this, function (_c) {
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1099
|
+
key = this.formatCacheKey(this.rpcClient.getRpcUrl(), 'getSaplingDiffByContract', [
|
|
1100
|
+
block,
|
|
1101
|
+
contract,
|
|
1102
|
+
]);
|
|
1103
|
+
if (this.has(key)) {
|
|
1104
|
+
return [2 /*return*/, this.get(key)];
|
|
1105
|
+
}
|
|
1106
|
+
else {
|
|
1107
|
+
response = this.rpcClient.getSaplingDiffByContract(contract, { block: block });
|
|
1108
|
+
this.put(key, response);
|
|
1109
|
+
return [2 /*return*/, response];
|
|
1123
1110
|
}
|
|
1124
1111
|
});
|
|
1125
1112
|
});
|
|
@@ -1142,13 +1129,14 @@
|
|
|
1142
1129
|
OpKind["PROPOSALS"] = "proposals";
|
|
1143
1130
|
OpKind["BALLOT"] = "ballot";
|
|
1144
1131
|
OpKind["FAILING_NOOP"] = "failing_noop";
|
|
1132
|
+
OpKind["REGISTER_GLOBAL_CONSTANT"] = "register_global_constant";
|
|
1145
1133
|
})(exports.OpKind || (exports.OpKind = {}));
|
|
1146
1134
|
|
|
1147
1135
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
1148
1136
|
/* tslint:disable */
|
|
1149
1137
|
var VERSION = {
|
|
1150
|
-
"commitHash": "
|
|
1151
|
-
"version": "
|
|
1138
|
+
"commitHash": "f7dbf5647ce1a35266ad921e6dd2aeef0b4aff93",
|
|
1139
|
+
"version": "11.0.0"
|
|
1152
1140
|
};
|
|
1153
1141
|
/* tslint:enable */
|
|
1154
1142
|
|
|
@@ -1292,6 +1280,27 @@
|
|
|
1292
1280
|
});
|
|
1293
1281
|
});
|
|
1294
1282
|
};
|
|
1283
|
+
/**
|
|
1284
|
+
*
|
|
1285
|
+
* @param address contract address from which we want to retrieve the script
|
|
1286
|
+
* @param unparsingMode default is { unparsing_mode: "Readable" }
|
|
1287
|
+
* @param options contains generic configuration for rpc calls
|
|
1288
|
+
*
|
|
1289
|
+
* @description Access the script of the contract and normalize it using the requested unparsing mode.
|
|
1290
|
+
*
|
|
1291
|
+
*/
|
|
1292
|
+
RpcClient.prototype.getNormalizedScript = function (address, unparsingMode, _a) {
|
|
1293
|
+
if (unparsingMode === void 0) { unparsingMode = { unparsing_mode: 'Readable' }; }
|
|
1294
|
+
var _b = _a === void 0 ? defaultRPCOptions : _a, block = _b.block;
|
|
1295
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1296
|
+
return __generator(this, function (_c) {
|
|
1297
|
+
return [2 /*return*/, this.httpBackend.createRequest({
|
|
1298
|
+
url: this.createURL("/chains/" + this.chain + "/blocks/" + block + "/context/contracts/" + address + "/script/normalized"),
|
|
1299
|
+
method: 'POST',
|
|
1300
|
+
}, unparsingMode)];
|
|
1301
|
+
});
|
|
1302
|
+
});
|
|
1303
|
+
};
|
|
1295
1304
|
/**
|
|
1296
1305
|
*
|
|
1297
1306
|
* @param address contract address from which we want to retrieve
|
|
@@ -1450,7 +1459,7 @@
|
|
|
1450
1459
|
'deposit',
|
|
1451
1460
|
'deposits',
|
|
1452
1461
|
'fees',
|
|
1453
|
-
'rewards'
|
|
1462
|
+
'rewards',
|
|
1454
1463
|
]);
|
|
1455
1464
|
return __assign(__assign({}, rest), { deposit: castedToBigNumber.deposit, deposits: castedToBigNumber.deposits, fees: castedToBigNumber.fees, rewards: castedToBigNumber.rewards });
|
|
1456
1465
|
}),
|
|
@@ -1458,7 +1467,7 @@
|
|
|
1458
1467
|
delegated_contracts: response.delegated_contracts,
|
|
1459
1468
|
delegated_balance: new BigNumber__default['default'](response.delegated_balance),
|
|
1460
1469
|
grace_period: response.grace_period,
|
|
1461
|
-
voting_power: response.voting_power
|
|
1470
|
+
voting_power: response.voting_power,
|
|
1462
1471
|
}];
|
|
1463
1472
|
}
|
|
1464
1473
|
});
|
|
@@ -1501,7 +1510,13 @@
|
|
|
1501
1510
|
'baking_reward_per_endorsement',
|
|
1502
1511
|
'delay_per_missing_endorsement',
|
|
1503
1512
|
'minimal_block_delay',
|
|
1504
|
-
'liquidity_baking_subsidy'
|
|
1513
|
+
'liquidity_baking_subsidy',
|
|
1514
|
+
'cache_layout',
|
|
1515
|
+
'baking_reward_fixed_portion',
|
|
1516
|
+
'baking_reward_bonus_per_slot',
|
|
1517
|
+
'endorsing_reward_per_slot',
|
|
1518
|
+
'round_durations',
|
|
1519
|
+
'double_baking_punishment'
|
|
1505
1520
|
]);
|
|
1506
1521
|
return [2 /*return*/, __assign(__assign({}, response), castedResponse)];
|
|
1507
1522
|
}
|
|
@@ -1975,9 +1990,14 @@
|
|
|
1975
1990
|
* @param options contains generic configuration for rpc calls
|
|
1976
1991
|
*
|
|
1977
1992
|
* @description Computes the serialized version of a data expression using the same algorithm as script instruction PACK
|
|
1993
|
+
* Note: You should always verify the packed bytes before signing or requesting that they be signed when using the the RPC to pack.
|
|
1994
|
+
* This precaution helps protect you and your applications users from RPC nodes that have been compromised.
|
|
1995
|
+
* A node that is operated by a bad actor, or compromised by a bad actor could return a fully formed operation that does not correspond to the input provided to the RPC endpoint.
|
|
1996
|
+
* A safer solution to pack and sign data would be to use the `packDataBytes` function available in the `@taquito/michel-codec` package.
|
|
1978
1997
|
*
|
|
1979
1998
|
* @example packData({ data: { string: "test" }, type: { prim: "string" } })
|
|
1980
1999
|
*
|
|
2000
|
+
*
|
|
1981
2001
|
* @see https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-scripts-pack-data
|
|
1982
2002
|
*/
|
|
1983
2003
|
RpcClient.prototype.packData = function (data, _a) {
|