@snapshot-labs/snapshot.js 0.12.3 → 0.12.5

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.
@@ -423,7 +423,10 @@ declare const _default: {
423
423
  type: string;
424
424
  title: string;
425
425
  minItems: number;
426
- maxItems: number;
426
+ maxLengthWithSpaceType: {
427
+ default: number;
428
+ turbo: number;
429
+ };
427
430
  };
428
431
  type: {
429
432
  type: string;
@@ -491,7 +494,10 @@ declare const _default: {
491
494
  type: string;
492
495
  title: string;
493
496
  minItems: number;
494
- maxItems: number;
497
+ maxLengthWithSpaceType: {
498
+ default: number;
499
+ turbo: number;
500
+ };
495
501
  };
496
502
  type: {
497
503
  enum: string[];
@@ -717,6 +723,7 @@ declare const _default: {
717
723
  "100": string;
718
724
  "137": string;
719
725
  "250": string;
726
+ "8453": string;
720
727
  "42161": string;
721
728
  "11155111": string;
722
729
  };
@@ -419,7 +419,10 @@ declare const _default: {
419
419
  type: string;
420
420
  title: string;
421
421
  minItems: number;
422
- maxItems: number;
422
+ maxLengthWithSpaceType: {
423
+ default: number;
424
+ turbo: number;
425
+ };
423
426
  };
424
427
  type: {
425
428
  type: string;
@@ -487,7 +490,10 @@ declare const _default: {
487
490
  type: string;
488
491
  title: string;
489
492
  minItems: number;
490
- maxItems: number;
493
+ maxLengthWithSpaceType: {
494
+ default: number;
495
+ turbo: number;
496
+ };
491
497
  };
492
498
  type: {
493
499
  enum: string[];
@@ -5,6 +5,7 @@ export declare const SNAPSHOT_SUBGRAPH_URL: {
5
5
  "100": string;
6
6
  "137": string;
7
7
  "250": string;
8
+ "8453": string;
8
9
  "42161": string;
9
10
  "11155111": string;
10
11
  };
@@ -84,6 +84,7 @@ declare const _default: {
84
84
  "100": string;
85
85
  "137": string;
86
86
  "250": string;
87
+ "8453": string;
87
88
  "42161": string;
88
89
  "11155111": string;
89
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapshot-labs/snapshot.js",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "repository": "snapshot-labs/snapshot.js",
5
5
  "license": "MIT",
6
6
  "main": "dist/snapshot.cjs.js",
@@ -5,6 +5,7 @@
5
5
  "100": "https://subgrapher.snapshot.org/delegation/100",
6
6
  "137": "https://subgrapher.snapshot.org/delegation/137",
7
7
  "250": "https://subgrapher.snapshot.org/delegation/250",
8
+ "8453": "https://subgrapher.snapshot.org/delegation/8453",
8
9
  "42161": "https://subgrapher.snapshot.org/delegation/42161",
9
10
  "11155111": "https://subgrapher.snapshot.org/delegation/11155111"
10
11
  }
@@ -31,7 +31,10 @@
31
31
  "type": "array",
32
32
  "title": "choices",
33
33
  "minItems": 1,
34
- "maxItems": 500
34
+ "maxLengthWithSpaceType": {
35
+ "default": 500,
36
+ "turbo": 1000
37
+ }
35
38
  },
36
39
  "type": {
37
40
  "type": "string",
@@ -35,7 +35,10 @@
35
35
  "type": "array",
36
36
  "title": "choices",
37
37
  "minItems": 1,
38
- "maxItems": 500
38
+ "maxLengthWithSpaceType": {
39
+ "default": 500,
40
+ "turbo": 1000
41
+ }
39
42
  },
40
43
  "type": {
41
44
  "enum": [
package/src/utils.ts CHANGED
@@ -155,7 +155,7 @@ ajv.addKeyword({
155
155
  validate.errors = [
156
156
  {
157
157
  keyword: 'maxLengthWithSpaceType',
158
- message: `must NOT have more than ${schema[spaceType]} characters`,
158
+ message: `must not have more than ${schema[spaceType]}`,
159
159
  params: { limit: schema[spaceType] }
160
160
  }
161
161
  ];
@@ -254,6 +254,8 @@ export async function multicall(
254
254
  }
255
255
 
256
256
  export async function subgraphRequest(url: string, query, options: any = {}) {
257
+ const body: Record<string, any> = { query: jsonToGraphQLQuery({ query }) };
258
+ if (options.variables) body.variables = options.variables;
257
259
  const res = await fetch(url, {
258
260
  method: 'POST',
259
261
  headers: {
@@ -261,7 +263,7 @@ export async function subgraphRequest(url: string, query, options: any = {}) {
261
263
  'Content-Type': 'application/json',
262
264
  ...options?.headers
263
265
  },
264
- body: JSON.stringify({ query: jsonToGraphQLQuery({ query }) })
266
+ body: JSON.stringify(body)
265
267
  });
266
268
  let responseData: any = await res.text();
267
269
  try {