@snapshot-labs/snapshot.js 0.5.2 → 0.5.3
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 +3 -3
- package/dist/snapshot.esm.js +3 -3
- package/dist/snapshot.min.js +1 -1
- package/package.json +1 -1
- package/src/utils.ts +3 -2
package/dist/snapshot.cjs.js
CHANGED
|
@@ -4466,8 +4466,6 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
|
|
|
4466
4466
|
return __generator(this, function (_a) {
|
|
4467
4467
|
switch (_a.label) {
|
|
4468
4468
|
case 0:
|
|
4469
|
-
if (!options.returnValue)
|
|
4470
|
-
options.returnValue = 'scores';
|
|
4471
4469
|
url = new URL(scoreApiUrl);
|
|
4472
4470
|
url.pathname = '/api/scores';
|
|
4473
4471
|
scoreApiUrl = url.toString();
|
|
@@ -4491,7 +4489,9 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
|
|
|
4491
4489
|
return [4 /*yield*/, res.json()];
|
|
4492
4490
|
case 3:
|
|
4493
4491
|
obj = _a.sent();
|
|
4494
|
-
return [2 /*return*/, options.returnValue
|
|
4492
|
+
return [2 /*return*/, options.returnValue === 'all'
|
|
4493
|
+
? obj.result
|
|
4494
|
+
: obj.result[options.returnValue || 'scores']];
|
|
4495
4495
|
case 4:
|
|
4496
4496
|
e_3 = _a.sent();
|
|
4497
4497
|
return [2 /*return*/, Promise.reject(e_3)];
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -4457,8 +4457,6 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
|
|
|
4457
4457
|
return __generator(this, function (_a) {
|
|
4458
4458
|
switch (_a.label) {
|
|
4459
4459
|
case 0:
|
|
4460
|
-
if (!options.returnValue)
|
|
4461
|
-
options.returnValue = 'scores';
|
|
4462
4460
|
url = new URL(scoreApiUrl);
|
|
4463
4461
|
url.pathname = '/api/scores';
|
|
4464
4462
|
scoreApiUrl = url.toString();
|
|
@@ -4482,7 +4480,9 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
|
|
|
4482
4480
|
return [4 /*yield*/, res.json()];
|
|
4483
4481
|
case 3:
|
|
4484
4482
|
obj = _a.sent();
|
|
4485
|
-
return [2 /*return*/, options.returnValue
|
|
4483
|
+
return [2 /*return*/, options.returnValue === 'all'
|
|
4484
|
+
? obj.result
|
|
4485
|
+
: obj.result[options.returnValue || 'scores']];
|
|
4486
4486
|
case 4:
|
|
4487
4487
|
e_3 = _a.sent();
|
|
4488
4488
|
return [2 /*return*/, Promise.reject(e_3)];
|