@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/dist/snapshot.cjs.js +15 -8
- package/dist/snapshot.esm.js +15 -8
- package/dist/snapshot.min.js +1 -1
- package/package.json +1 -1
- package/src/utils.ts +7 -2
package/package.json
CHANGED
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
|
|
223
|
-
options: any = {
|
|
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,
|