@snapshot-labs/snapshot.js 0.5.1 → 0.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapshot-labs/snapshot.js",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "repository": "snapshot-labs/snapshot.js",
5
5
  "license": "MIT",
6
6
  "main": "dist/snapshot.cjs.js",
package/src/utils.ts CHANGED
@@ -219,9 +219,14 @@ export async function getScores(
219
219
  network: string,
220
220
  addresses: string[],
221
221
  snapshot: number | string = 'latest',
222
- scoreApiUrl = 'https://score.snapshot.org/api/scores',
223
- options: any = { returnValue: 'scores' }
222
+ scoreApiUrl = 'https://score.snapshot.org',
223
+ options: any = {}
224
224
  ) {
225
+ if (!options.returnValue) options.returnValue = 'scores';
226
+ const url = new URL(scoreApiUrl);
227
+ url.pathname = '/api/scores';
228
+ scoreApiUrl = url.toString();
229
+
225
230
  try {
226
231
  const params = {
227
232
  space,