@snapshot-labs/snapshot.js 0.4.19 → 0.4.20-debug-1
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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/snapshot.cjs.js +14 -3
- package/dist/snapshot.esm.js +14 -3
- package/dist/snapshot.min.js +7 -7
- package/package.json +1 -1
- package/src/client.ts +0 -0
- package/src/utils/dist/provider.js +47 -0
- package/src/utils.ts +10 -2
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/dist/snapshot.cjs.js
CHANGED
|
@@ -3455,7 +3455,7 @@ function multicall(network, provider, abi$1, calls, options) {
|
|
|
3455
3455
|
function subgraphRequest(url, query, options) {
|
|
3456
3456
|
if (options === void 0) { options = {}; }
|
|
3457
3457
|
return __awaiter(this, void 0, void 0, function () {
|
|
3458
|
-
var res, responseData, data;
|
|
3458
|
+
var res, responseData, error_1, data;
|
|
3459
3459
|
return __generator(this, function (_a) {
|
|
3460
3460
|
switch (_a.label) {
|
|
3461
3461
|
case 0: return [4 /*yield*/, fetch__default['default'](url, {
|
|
@@ -3465,9 +3465,20 @@ function subgraphRequest(url, query, options) {
|
|
|
3465
3465
|
})];
|
|
3466
3466
|
case 1:
|
|
3467
3467
|
res = _a.sent();
|
|
3468
|
-
|
|
3468
|
+
responseData = {};
|
|
3469
|
+
_a.label = 2;
|
|
3469
3470
|
case 2:
|
|
3471
|
+
_a.trys.push([2, 4, , 5]);
|
|
3472
|
+
return [4 /*yield*/, res.json()];
|
|
3473
|
+
case 3:
|
|
3470
3474
|
responseData = _a.sent();
|
|
3475
|
+
return [3 /*break*/, 5];
|
|
3476
|
+
case 4:
|
|
3477
|
+
error_1 = _a.sent();
|
|
3478
|
+
console.log(error_1);
|
|
3479
|
+
console.log('[debug] Text Response:', res.text());
|
|
3480
|
+
throw error_1;
|
|
3481
|
+
case 5:
|
|
3471
3482
|
if (responseData.errors) {
|
|
3472
3483
|
throw new Error('Errors found in subgraphRequest: ' +
|
|
3473
3484
|
url +
|
|
@@ -3691,7 +3702,7 @@ function getDelegatesBySpace(network, space, snapshot) {
|
|
|
3691
3702
|
_a.label = 1;
|
|
3692
3703
|
case 1:
|
|
3693
3704
|
params.delegations.__args.skip = page * PAGE_SIZE;
|
|
3694
|
-
return [4 /*yield*/, subgraphRequest(delegationSubgraphs[network], params)];
|
|
3705
|
+
return [4 /*yield*/, subgraphRequest(delegationSubgraphs[network], params, { headers: { pragma: 'no-cache', 'cache-control': 'no-cache' } })];
|
|
3695
3706
|
case 2:
|
|
3696
3707
|
pageResult = _a.sent();
|
|
3697
3708
|
pageDelegations = pageResult.delegations || [];
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -3446,7 +3446,7 @@ function multicall(network, provider, abi, calls, options) {
|
|
|
3446
3446
|
function subgraphRequest(url, query, options) {
|
|
3447
3447
|
if (options === void 0) { options = {}; }
|
|
3448
3448
|
return __awaiter(this, void 0, void 0, function () {
|
|
3449
|
-
var res, responseData, data;
|
|
3449
|
+
var res, responseData, error_1, data;
|
|
3450
3450
|
return __generator(this, function (_a) {
|
|
3451
3451
|
switch (_a.label) {
|
|
3452
3452
|
case 0: return [4 /*yield*/, fetch(url, {
|
|
@@ -3456,9 +3456,20 @@ function subgraphRequest(url, query, options) {
|
|
|
3456
3456
|
})];
|
|
3457
3457
|
case 1:
|
|
3458
3458
|
res = _a.sent();
|
|
3459
|
-
|
|
3459
|
+
responseData = {};
|
|
3460
|
+
_a.label = 2;
|
|
3460
3461
|
case 2:
|
|
3462
|
+
_a.trys.push([2, 4, , 5]);
|
|
3463
|
+
return [4 /*yield*/, res.json()];
|
|
3464
|
+
case 3:
|
|
3461
3465
|
responseData = _a.sent();
|
|
3466
|
+
return [3 /*break*/, 5];
|
|
3467
|
+
case 4:
|
|
3468
|
+
error_1 = _a.sent();
|
|
3469
|
+
console.log(error_1);
|
|
3470
|
+
console.log('[debug] Text Response:', res.text());
|
|
3471
|
+
throw error_1;
|
|
3472
|
+
case 5:
|
|
3462
3473
|
if (responseData.errors) {
|
|
3463
3474
|
throw new Error('Errors found in subgraphRequest: ' +
|
|
3464
3475
|
url +
|
|
@@ -3682,7 +3693,7 @@ function getDelegatesBySpace(network, space, snapshot) {
|
|
|
3682
3693
|
_a.label = 1;
|
|
3683
3694
|
case 1:
|
|
3684
3695
|
params.delegations.__args.skip = page * PAGE_SIZE;
|
|
3685
|
-
return [4 /*yield*/, subgraphRequest(delegationSubgraphs[network], params)];
|
|
3696
|
+
return [4 /*yield*/, subgraphRequest(delegationSubgraphs[network], params, { headers: { pragma: 'no-cache', 'cache-control': 'no-cache' } })];
|
|
3686
3697
|
case 2:
|
|
3687
3698
|
pageResult = _a.sent();
|
|
3688
3699
|
pageDelegations = pageResult.delegations || [];
|