@snapshot-labs/snapshot.js 0.5.2 → 0.5.4

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/index.d.ts CHANGED
@@ -491,6 +491,7 @@ declare const _default: {
491
491
  type: string;
492
492
  format: string;
493
493
  title: string;
494
+ maxLength: number;
494
495
  };
495
496
  };
496
497
  required: string[];
@@ -487,6 +487,7 @@ declare const _default: {
487
487
  type: string;
488
488
  format: string;
489
489
  title: string;
490
+ maxLength: number;
490
491
  };
491
492
  };
492
493
  required: string[];
@@ -1102,13 +1102,14 @@ var definitions$4 = {
1102
1102
  type: "string",
1103
1103
  format: "long",
1104
1104
  title: "About",
1105
- minLength: 1,
1105
+ minLength: 40,
1106
1106
  maxLength: 140
1107
1107
  },
1108
1108
  statement: {
1109
1109
  type: "string",
1110
1110
  format: "long",
1111
- title: "Statement"
1111
+ title: "Statement",
1112
+ maxLength: 10000
1112
1113
  }
1113
1114
  },
1114
1115
  required: [
@@ -4466,8 +4467,6 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
4466
4467
  return __generator(this, function (_a) {
4467
4468
  switch (_a.label) {
4468
4469
  case 0:
4469
- if (!options.returnValue)
4470
- options.returnValue = 'scores';
4471
4470
  url = new URL(scoreApiUrl);
4472
4471
  url.pathname = '/api/scores';
4473
4472
  scoreApiUrl = url.toString();
@@ -4491,7 +4490,9 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
4491
4490
  return [4 /*yield*/, res.json()];
4492
4491
  case 3:
4493
4492
  obj = _a.sent();
4494
- return [2 /*return*/, options.returnValue ? obj.result[options.returnValue] : obj.result];
4493
+ return [2 /*return*/, options.returnValue === 'all'
4494
+ ? obj.result
4495
+ : obj.result[options.returnValue || 'scores']];
4495
4496
  case 4:
4496
4497
  e_3 = _a.sent();
4497
4498
  return [2 /*return*/, Promise.reject(e_3)];
@@ -1093,13 +1093,14 @@ var definitions$4 = {
1093
1093
  type: "string",
1094
1094
  format: "long",
1095
1095
  title: "About",
1096
- minLength: 1,
1096
+ minLength: 40,
1097
1097
  maxLength: 140
1098
1098
  },
1099
1099
  statement: {
1100
1100
  type: "string",
1101
1101
  format: "long",
1102
- title: "Statement"
1102
+ title: "Statement",
1103
+ maxLength: 10000
1103
1104
  }
1104
1105
  },
1105
1106
  required: [
@@ -4457,8 +4458,6 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
4457
4458
  return __generator(this, function (_a) {
4458
4459
  switch (_a.label) {
4459
4460
  case 0:
4460
- if (!options.returnValue)
4461
- options.returnValue = 'scores';
4462
4461
  url = new URL(scoreApiUrl);
4463
4462
  url.pathname = '/api/scores';
4464
4463
  scoreApiUrl = url.toString();
@@ -4482,7 +4481,9 @@ function getScores(space, strategies, network, addresses, snapshot, scoreApiUrl,
4482
4481
  return [4 /*yield*/, res.json()];
4483
4482
  case 3:
4484
4483
  obj = _a.sent();
4485
- return [2 /*return*/, options.returnValue ? obj.result[options.returnValue] : obj.result];
4484
+ return [2 /*return*/, options.returnValue === 'all'
4485
+ ? obj.result
4486
+ : obj.result[options.returnValue || 'scores']];
4486
4487
  case 4:
4487
4488
  e_3 = _a.sent();
4488
4489
  return [2 /*return*/, Promise.reject(e_3)];