@snapshot-labs/snapshot.js 0.11.0 → 0.11.1
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 +8 -0
- package/dist/schemas/index.d.ts +8 -0
- package/dist/snapshot.cjs.js +13 -2
- package/dist/snapshot.esm.js +12 -2
- package/dist/snapshot.min.js +3 -3
- package/package.json +2 -1
- package/src/schemas/space.json +10 -2
- package/src/utils.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snapshot-labs/snapshot.js",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"repository": "snapshot-labs/snapshot.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/snapshot.cjs.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@ethersproject/units": "^5.7.0",
|
|
19
19
|
"@ethersproject/wallet": "^5.6.2",
|
|
20
20
|
"ajv": "^8.11.0",
|
|
21
|
+
"ajv-errors": "^3.0.0",
|
|
21
22
|
"ajv-formats": "^2.1.1",
|
|
22
23
|
"cross-fetch": "^3.1.6",
|
|
23
24
|
"json-to-graphql-query": "^2.2.4",
|
package/src/schemas/space.json
CHANGED
|
@@ -282,11 +282,19 @@
|
|
|
282
282
|
"properties": {
|
|
283
283
|
"delay": {
|
|
284
284
|
"type": "integer",
|
|
285
|
-
"minimum": 0
|
|
285
|
+
"minimum": 0,
|
|
286
|
+
"maximum": 2592000,
|
|
287
|
+
"errorMessage": {
|
|
288
|
+
"maximum": "Delay must be less than 30 days"
|
|
289
|
+
}
|
|
286
290
|
},
|
|
287
291
|
"period": {
|
|
288
292
|
"type": "integer",
|
|
289
|
-
"minimum": 0
|
|
293
|
+
"minimum": 0,
|
|
294
|
+
"maximum": 15552000,
|
|
295
|
+
"errorMessage": {
|
|
296
|
+
"maximum": "Delay must be less than 180 days"
|
|
297
|
+
}
|
|
290
298
|
},
|
|
291
299
|
"type": {
|
|
292
300
|
"type": "string",
|
package/src/utils.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { namehash, ensNormalize } from '@ethersproject/hash';
|
|
|
7
7
|
import { jsonToGraphQLQuery } from 'json-to-graphql-query';
|
|
8
8
|
import Ajv from 'ajv';
|
|
9
9
|
import addFormats from 'ajv-formats';
|
|
10
|
+
import addErrors from 'ajv-errors';
|
|
10
11
|
import Multicaller from './utils/multicaller';
|
|
11
12
|
import { getSnapshots } from './utils/blockfinder';
|
|
12
13
|
import getProvider from './utils/provider';
|
|
@@ -45,6 +46,7 @@ const ajv = new Ajv({
|
|
|
45
46
|
});
|
|
46
47
|
// @ts-ignore
|
|
47
48
|
addFormats(ajv);
|
|
49
|
+
addErrors(ajv);
|
|
48
50
|
|
|
49
51
|
ajv.addFormat('address', {
|
|
50
52
|
validate: (value: string) => {
|