@snapshot-labs/snapshot.js 0.3.81 → 0.3.82
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/snapshot.cjs.js +2 -19
- package/dist/snapshot.esm.js +2 -19
- package/dist/snapshot.min.js +5 -5
- package/package.json +1 -1
- package/src/utils.ts +0 -17
package/dist/snapshot.cjs.js
CHANGED
|
@@ -3136,7 +3136,7 @@ function getSpaceUri(id, network) {
|
|
|
3136
3136
|
function getDelegatesBySpace(network, space, snapshot) {
|
|
3137
3137
|
if (snapshot === void 0) { snapshot = 'latest'; }
|
|
3138
3138
|
return __awaiter(this, void 0, void 0, function () {
|
|
3139
|
-
var spaceIn, PAGE_SIZE, result, page, params, pageResult, pageDelegations
|
|
3139
|
+
var spaceIn, PAGE_SIZE, result, page, params, pageResult, pageDelegations;
|
|
3140
3140
|
return __generator(this, function (_a) {
|
|
3141
3141
|
switch (_a.label) {
|
|
3142
3142
|
case 0:
|
|
@@ -3175,24 +3175,7 @@ function getDelegatesBySpace(network, space, snapshot) {
|
|
|
3175
3175
|
if (pageDelegations.length < PAGE_SIZE)
|
|
3176
3176
|
return [3 /*break*/, 3];
|
|
3177
3177
|
return [3 /*break*/, 1];
|
|
3178
|
-
case 3:
|
|
3179
|
-
// Global delegations are null in decentralized subgraph
|
|
3180
|
-
page = 0;
|
|
3181
|
-
delete params.delegations.__args.where.space_in;
|
|
3182
|
-
_a.label = 4;
|
|
3183
|
-
case 4:
|
|
3184
|
-
params.delegations.__args.skip = page * PAGE_SIZE;
|
|
3185
|
-
params.delegations.__args.where.space = null;
|
|
3186
|
-
return [4 /*yield*/, subgraphRequest(SNAPSHOT_SUBGRAPH_URL[network], params)];
|
|
3187
|
-
case 5:
|
|
3188
|
-
pageResult = _a.sent();
|
|
3189
|
-
pageDelegations = pageResult.delegations || [];
|
|
3190
|
-
result = result.concat(pageDelegations);
|
|
3191
|
-
page++;
|
|
3192
|
-
if (pageDelegations.length < PAGE_SIZE)
|
|
3193
|
-
return [3 /*break*/, 6];
|
|
3194
|
-
return [3 /*break*/, 4];
|
|
3195
|
-
case 6: return [2 /*return*/, result];
|
|
3178
|
+
case 3: return [2 /*return*/, result];
|
|
3196
3179
|
}
|
|
3197
3180
|
});
|
|
3198
3181
|
});
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -3127,7 +3127,7 @@ function getSpaceUri(id, network) {
|
|
|
3127
3127
|
function getDelegatesBySpace(network, space, snapshot) {
|
|
3128
3128
|
if (snapshot === void 0) { snapshot = 'latest'; }
|
|
3129
3129
|
return __awaiter(this, void 0, void 0, function () {
|
|
3130
|
-
var spaceIn, PAGE_SIZE, result, page, params, pageResult, pageDelegations
|
|
3130
|
+
var spaceIn, PAGE_SIZE, result, page, params, pageResult, pageDelegations;
|
|
3131
3131
|
return __generator(this, function (_a) {
|
|
3132
3132
|
switch (_a.label) {
|
|
3133
3133
|
case 0:
|
|
@@ -3166,24 +3166,7 @@ function getDelegatesBySpace(network, space, snapshot) {
|
|
|
3166
3166
|
if (pageDelegations.length < PAGE_SIZE)
|
|
3167
3167
|
return [3 /*break*/, 3];
|
|
3168
3168
|
return [3 /*break*/, 1];
|
|
3169
|
-
case 3:
|
|
3170
|
-
// Global delegations are null in decentralized subgraph
|
|
3171
|
-
page = 0;
|
|
3172
|
-
delete params.delegations.__args.where.space_in;
|
|
3173
|
-
_a.label = 4;
|
|
3174
|
-
case 4:
|
|
3175
|
-
params.delegations.__args.skip = page * PAGE_SIZE;
|
|
3176
|
-
params.delegations.__args.where.space = null;
|
|
3177
|
-
return [4 /*yield*/, subgraphRequest(SNAPSHOT_SUBGRAPH_URL[network], params)];
|
|
3178
|
-
case 5:
|
|
3179
|
-
pageResult = _a.sent();
|
|
3180
|
-
pageDelegations = pageResult.delegations || [];
|
|
3181
|
-
result = result.concat(pageDelegations);
|
|
3182
|
-
page++;
|
|
3183
|
-
if (pageDelegations.length < PAGE_SIZE)
|
|
3184
|
-
return [3 /*break*/, 6];
|
|
3185
|
-
return [3 /*break*/, 4];
|
|
3186
|
-
case 6: return [2 /*return*/, result];
|
|
3169
|
+
case 3: return [2 /*return*/, result];
|
|
3187
3170
|
}
|
|
3188
3171
|
});
|
|
3189
3172
|
});
|