@snapshot-labs/snapshot.js 0.12.0-beta.0 → 0.12.0-beta.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.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +20 -2
  3. package/dist/schemas/index.d.ts +19 -1
  4. package/dist/sign/types.d.ts +2 -0
  5. package/dist/snapshot.cjs.js +1851 -1929
  6. package/dist/snapshot.esm.js +1852 -1930
  7. package/dist/snapshot.min.js +16 -5
  8. package/dist/src/index.d.ts +725 -0
  9. package/dist/src/schemas/index.d.ts +671 -0
  10. package/dist/src/sign/index.d.ts +29 -0
  11. package/dist/src/sign/types.d.ts +227 -0
  12. package/dist/src/utils/blockfinder.d.ts +1 -0
  13. package/dist/src/utils/delegation.d.ts +18 -0
  14. package/dist/src/utils/multicaller.d.ts +12 -0
  15. package/dist/src/utils/provider.d.ts +5 -0
  16. package/dist/src/utils/web3.d.ts +2 -0
  17. package/dist/src/utils.d.ts +91 -0
  18. package/dist/src/verify/evm.d.ts +4 -0
  19. package/dist/src/verify/evm.spec.d.ts +1 -0
  20. package/dist/src/verify/index.d.ts +11 -0
  21. package/dist/src/verify/index.spec.d.ts +1 -0
  22. package/dist/src/verify/starknet.d.ts +6 -0
  23. package/dist/src/verify/starknet.spec.d.ts +1 -0
  24. package/dist/src/voting/approval.d.ts +22 -0
  25. package/dist/src/voting/index.d.ts +14 -0
  26. package/dist/src/voting/quadratic.d.ts +20 -0
  27. package/dist/src/voting/rankedChoice.d.ts +18 -0
  28. package/dist/src/voting/singleChoice.d.ts +18 -0
  29. package/dist/src/voting/types.d.ts +35 -0
  30. package/dist/src/voting/weighted.d.ts +26 -0
  31. package/dist/utils/delegation.d.ts +1 -1
  32. package/dist/utils.d.ts +3 -2
  33. package/package.json +6 -3
  34. package/src/delegationSubgraphs.json +8 -8
  35. package/src/gateways.json +1 -2
  36. package/src/networks.json +222 -60
  37. package/src/schemas/profile.json +30 -0
  38. package/src/schemas/proposal.json +1 -1
  39. package/src/schemas/space.json +8 -7
  40. package/src/schemas/statement.json +17 -2
  41. package/src/schemas/vote.json +1 -1
  42. package/src/sign/hashedTypes.json +8 -1
  43. package/src/sign/index.ts +8 -6
  44. package/src/sign/types.ts +11 -1
  45. package/src/utils/provider.ts +8 -2
  46. package/src/utils/web3.ts +1 -1
  47. package/src/utils.spec.js +86 -31
  48. package/src/utils.ts +111 -38
  49. package/src/verify/evm.spec.ts +32 -0
  50. package/src/verify/evm.ts +82 -0
  51. package/src/verify/index.spec.ts +84 -0
  52. package/src/verify/index.ts +41 -0
  53. package/src/verify/starknet.spec.ts +55 -0
  54. package/src/verify/starknet.ts +82 -0
  55. package/src/sign/eip1271.ts +0 -55
  56. package/src/sign/utils.ts +0 -27
@@ -0,0 +1,725 @@
1
+ import Client712 from './sign';
2
+ declare const _default: {
3
+ Client: typeof Client712;
4
+ Client712: typeof Client712;
5
+ schemas: {
6
+ space: {
7
+ title: string;
8
+ type: string;
9
+ properties: {
10
+ name: {
11
+ type: string;
12
+ title: string;
13
+ minLength: number;
14
+ maxLength: number;
15
+ };
16
+ private: {
17
+ type: string;
18
+ };
19
+ about: {
20
+ type: string;
21
+ title: string;
22
+ maxLength: number;
23
+ };
24
+ guidelines: {
25
+ type: string;
26
+ format: string;
27
+ title: string;
28
+ maxLength: number;
29
+ };
30
+ template: {
31
+ type: string;
32
+ title: string;
33
+ maxLength: number;
34
+ };
35
+ terms: {
36
+ type: string;
37
+ title: string;
38
+ format: string;
39
+ maxLength: number;
40
+ };
41
+ avatar: {
42
+ type: string;
43
+ title: string;
44
+ format: string;
45
+ maxLength: number;
46
+ };
47
+ location: {
48
+ type: string;
49
+ title: string;
50
+ maxLength: number;
51
+ };
52
+ website: {
53
+ type: string;
54
+ title: string;
55
+ format: string;
56
+ maxLength: number;
57
+ };
58
+ twitter: {
59
+ type: string;
60
+ title: string;
61
+ pattern: string;
62
+ maxLength: number;
63
+ };
64
+ coingecko: {
65
+ type: string;
66
+ title: string;
67
+ pattern: string;
68
+ maxLength: number;
69
+ };
70
+ github: {
71
+ type: string;
72
+ title: string;
73
+ pattern: string;
74
+ maxLength: number;
75
+ };
76
+ email: {
77
+ type: string;
78
+ title: string;
79
+ maxLength: number;
80
+ };
81
+ network: {
82
+ type: string;
83
+ snapshotNetwork: boolean;
84
+ title: string;
85
+ minLength: number;
86
+ maxLength: number;
87
+ };
88
+ symbol: {
89
+ type: string;
90
+ title: string;
91
+ minLength: number;
92
+ maxLength: number;
93
+ };
94
+ skin: {
95
+ type: string;
96
+ title: string;
97
+ maxLength: number;
98
+ };
99
+ domain: {
100
+ type: string;
101
+ title: string;
102
+ maxLength: number;
103
+ };
104
+ strategies: {
105
+ type: string;
106
+ minItems: number;
107
+ maxItemsWithSpaceType: {
108
+ default: number;
109
+ turbo: number;
110
+ };
111
+ uniqueItems: boolean;
112
+ items: {
113
+ type: string;
114
+ properties: {
115
+ name: {
116
+ type: string;
117
+ maxLength: number;
118
+ title: string;
119
+ };
120
+ network: {
121
+ type: string;
122
+ maxLength: number;
123
+ title: string;
124
+ snapshotNetwork: boolean;
125
+ };
126
+ params: {
127
+ type: string;
128
+ title: string;
129
+ };
130
+ };
131
+ required: string[];
132
+ additionalProperties: boolean;
133
+ };
134
+ title: string;
135
+ };
136
+ members: {
137
+ type: string;
138
+ maxItems: number;
139
+ items: {
140
+ type: string;
141
+ pattern: string;
142
+ minLength: number;
143
+ maxLength: number;
144
+ };
145
+ title: string;
146
+ uniqueItems: boolean;
147
+ };
148
+ admins: {
149
+ type: string;
150
+ maxItems: number;
151
+ items: {
152
+ type: string;
153
+ pattern: string;
154
+ minLength: number;
155
+ maxLength: number;
156
+ };
157
+ title: string;
158
+ uniqueItems: boolean;
159
+ };
160
+ moderators: {
161
+ type: string;
162
+ maxItems: number;
163
+ items: {
164
+ type: string;
165
+ pattern: string;
166
+ minLength: number;
167
+ maxLength: number;
168
+ };
169
+ title: string;
170
+ uniqueItems: boolean;
171
+ };
172
+ filters: {
173
+ type: string;
174
+ properties: {
175
+ defaultTab: {
176
+ type: string;
177
+ };
178
+ minScore: {
179
+ type: string;
180
+ minimum: number;
181
+ };
182
+ onlyMembers: {
183
+ type: string;
184
+ };
185
+ invalids: {
186
+ type: string;
187
+ items: {
188
+ type: string;
189
+ maxLength: number;
190
+ };
191
+ title: string;
192
+ };
193
+ };
194
+ additionalProperties: boolean;
195
+ };
196
+ validation: {
197
+ type: string;
198
+ properties: {
199
+ name: {
200
+ type: string;
201
+ maxLength: number;
202
+ title: string;
203
+ };
204
+ params: {
205
+ type: string;
206
+ title: string;
207
+ };
208
+ };
209
+ required: string[];
210
+ additionalProperties: boolean;
211
+ };
212
+ voteValidation: {
213
+ type: string;
214
+ properties: {
215
+ name: {
216
+ type: string;
217
+ maxLength: number;
218
+ title: string;
219
+ };
220
+ params: {
221
+ type: string;
222
+ title: string;
223
+ };
224
+ };
225
+ required: string[];
226
+ additionalProperties: boolean;
227
+ };
228
+ followValidation: {
229
+ type: string;
230
+ properties: {
231
+ name: {
232
+ type: string;
233
+ maxLength: number;
234
+ title: string;
235
+ };
236
+ params: {
237
+ type: string;
238
+ title: string;
239
+ };
240
+ };
241
+ required: string[];
242
+ additionalProperties: boolean;
243
+ };
244
+ delegationPortal: {
245
+ type: string;
246
+ properties: {
247
+ delegationType: {
248
+ type: string;
249
+ title: string;
250
+ description: string;
251
+ anyOf: {
252
+ const: string;
253
+ title: string;
254
+ }[];
255
+ };
256
+ delegationContract: {
257
+ type: string;
258
+ format: string;
259
+ title: string;
260
+ description: string;
261
+ examples: string[];
262
+ };
263
+ delegationApi: {
264
+ type: string;
265
+ format: string;
266
+ title: string;
267
+ description: string;
268
+ examples: string[];
269
+ };
270
+ };
271
+ required: string[];
272
+ additionalProperties: boolean;
273
+ };
274
+ allowAlias: {
275
+ type: string;
276
+ };
277
+ plugins: {
278
+ type: string;
279
+ };
280
+ voting: {
281
+ type: string;
282
+ properties: {
283
+ delay: {
284
+ type: string;
285
+ minimum: number;
286
+ maximum: number;
287
+ errorMessage: {
288
+ maximum: string;
289
+ };
290
+ };
291
+ period: {
292
+ type: string;
293
+ minimum: number;
294
+ maximum: number;
295
+ errorMessage: {
296
+ maximum: string;
297
+ };
298
+ };
299
+ type: {
300
+ type: string;
301
+ title: string;
302
+ };
303
+ quorum: {
304
+ type: string;
305
+ minimum: number;
306
+ };
307
+ quorumType: {
308
+ type: string;
309
+ enum: string[];
310
+ };
311
+ blind: {
312
+ type: string;
313
+ };
314
+ hideAbstain: {
315
+ type: string;
316
+ };
317
+ aliased: {
318
+ type: string;
319
+ };
320
+ privacy: {
321
+ type: string;
322
+ enum: string[];
323
+ };
324
+ };
325
+ additionalProperties: boolean;
326
+ };
327
+ categories: {
328
+ type: string;
329
+ maxItems: number;
330
+ items: {
331
+ type: string;
332
+ enum: string[];
333
+ };
334
+ };
335
+ treasuries: {
336
+ type: string;
337
+ maxItems: number;
338
+ items: {
339
+ type: string;
340
+ properties: {
341
+ name: {
342
+ type: string;
343
+ title: string;
344
+ examples: string[];
345
+ minLength: number;
346
+ maxLength: number;
347
+ };
348
+ address: {
349
+ type: string;
350
+ title: string;
351
+ examples: string[];
352
+ pattern: string;
353
+ minLength: number;
354
+ maxLength: number;
355
+ };
356
+ network: {
357
+ type: string;
358
+ snapshotNetwork: boolean;
359
+ title: string;
360
+ maxLength: number;
361
+ };
362
+ };
363
+ required: string[];
364
+ additionalProperties: boolean;
365
+ };
366
+ };
367
+ parent: {
368
+ type: string;
369
+ title: string;
370
+ };
371
+ children: {
372
+ type: string;
373
+ maxItems: number;
374
+ title: string;
375
+ items: {
376
+ type: string;
377
+ };
378
+ uniqueItems: boolean;
379
+ };
380
+ boost: {
381
+ type: string;
382
+ properties: {
383
+ enabled: {
384
+ type: string;
385
+ };
386
+ bribeEnabled: {
387
+ type: string;
388
+ };
389
+ };
390
+ required: string[];
391
+ additionalProperties: boolean;
392
+ };
393
+ };
394
+ required: string[];
395
+ additionalProperties: boolean;
396
+ };
397
+ proposal: {
398
+ title: string;
399
+ type: string;
400
+ properties: {
401
+ name: {
402
+ type: string;
403
+ title: string;
404
+ minLength: number;
405
+ maxLength: number;
406
+ };
407
+ body: {
408
+ type: string;
409
+ title: string;
410
+ minLength: number;
411
+ maxLengthWithSpaceType: {
412
+ default: number;
413
+ turbo: number;
414
+ };
415
+ };
416
+ discussion: {
417
+ type: string;
418
+ format: string;
419
+ title: string;
420
+ maxLength: number;
421
+ };
422
+ choices: {
423
+ type: string;
424
+ title: string;
425
+ minItems: number;
426
+ maxItems: number;
427
+ };
428
+ type: {
429
+ type: string;
430
+ enum: string[];
431
+ };
432
+ snapshot: {
433
+ type: string;
434
+ title: string;
435
+ };
436
+ start: {
437
+ type: string;
438
+ title: string;
439
+ minimum: number;
440
+ maximum: number;
441
+ };
442
+ end: {
443
+ type: string;
444
+ title: string;
445
+ minimum: number;
446
+ maximum: number;
447
+ };
448
+ metadata: {
449
+ type: string;
450
+ title: string;
451
+ };
452
+ app: {
453
+ type: string;
454
+ title: string;
455
+ maxLength: number;
456
+ };
457
+ };
458
+ required: string[];
459
+ additionalProperties: boolean;
460
+ };
461
+ updateProposal: {
462
+ title: string;
463
+ type: string;
464
+ properties: {
465
+ proposal: {
466
+ type: string;
467
+ title: string;
468
+ };
469
+ name: {
470
+ type: string;
471
+ title: string;
472
+ minLength: number;
473
+ maxLength: number;
474
+ };
475
+ body: {
476
+ type: string;
477
+ title: string;
478
+ minLength: number;
479
+ maxLengthWithSpaceType: {
480
+ default: number;
481
+ turbo: number;
482
+ };
483
+ };
484
+ discussion: {
485
+ type: string;
486
+ format: string;
487
+ title: string;
488
+ maxLength: number;
489
+ };
490
+ choices: {
491
+ type: string;
492
+ title: string;
493
+ minItems: number;
494
+ maxItems: number;
495
+ };
496
+ type: {
497
+ enum: string[];
498
+ };
499
+ metadata: {
500
+ type: string;
501
+ title: string;
502
+ };
503
+ };
504
+ required: string[];
505
+ additionalProperties: boolean;
506
+ };
507
+ vote: {
508
+ title: string;
509
+ type: string;
510
+ properties: {
511
+ proposal: {
512
+ type: string;
513
+ title: string;
514
+ };
515
+ choice: {
516
+ type: string[];
517
+ title: string;
518
+ };
519
+ metadata: {
520
+ type: string;
521
+ title: string;
522
+ };
523
+ reason: {
524
+ type: string;
525
+ title: string;
526
+ maxLength: number;
527
+ };
528
+ app: {
529
+ type: string;
530
+ title: string;
531
+ maxLength: number;
532
+ };
533
+ };
534
+ required: string[];
535
+ additionalProperties: boolean;
536
+ };
537
+ profile: {
538
+ title: string;
539
+ type: string;
540
+ properties: {
541
+ name: {
542
+ type: string;
543
+ title: string;
544
+ maxLength: number;
545
+ };
546
+ about: {
547
+ type: string;
548
+ title: string;
549
+ maxLength: number;
550
+ };
551
+ avatar: {
552
+ type: string;
553
+ title: string;
554
+ format: string;
555
+ maxLength: number;
556
+ };
557
+ cover: {
558
+ type: string;
559
+ title: string;
560
+ format: string;
561
+ maxLength: number;
562
+ };
563
+ twitter: {
564
+ type: string;
565
+ title: string;
566
+ pattern: string;
567
+ maxLength: number;
568
+ };
569
+ github: {
570
+ type: string;
571
+ title: string;
572
+ pattern: string;
573
+ maxLength: number;
574
+ };
575
+ lens: {
576
+ type: string;
577
+ title: string;
578
+ pattern: string;
579
+ maxLength: number;
580
+ };
581
+ farcaster: {
582
+ type: string;
583
+ title: string;
584
+ pattern: string;
585
+ maxLength: number;
586
+ };
587
+ };
588
+ required: never[];
589
+ additionalProperties: boolean;
590
+ };
591
+ statement: {
592
+ title: string;
593
+ type: string;
594
+ properties: {
595
+ about: {
596
+ type: string;
597
+ format: string;
598
+ title: string;
599
+ maxLength: number;
600
+ };
601
+ statement: {
602
+ type: string;
603
+ format: string;
604
+ title: string;
605
+ maxLength: number;
606
+ };
607
+ discourse: {
608
+ type: string;
609
+ title: string;
610
+ pattern: string;
611
+ maxLength: number;
612
+ };
613
+ network: {
614
+ type: string;
615
+ title: string;
616
+ pattern: string;
617
+ maxLength: number;
618
+ };
619
+ status: {
620
+ enum: string[];
621
+ title: string;
622
+ };
623
+ };
624
+ required: never[];
625
+ additionalProperties: boolean;
626
+ };
627
+ zodiac: {
628
+ title: string;
629
+ type: string;
630
+ properties: {
631
+ safes: {
632
+ title: string;
633
+ type: string;
634
+ maxItems: number;
635
+ items: {
636
+ type: string;
637
+ properties: {
638
+ network: {
639
+ title: string;
640
+ type: string;
641
+ snapshotNetwork: boolean;
642
+ };
643
+ multisend: {
644
+ title: string;
645
+ type: string;
646
+ };
647
+ realityAddress: {
648
+ title: string;
649
+ type: string;
650
+ };
651
+ umaAddress: {
652
+ title: string;
653
+ type: string;
654
+ };
655
+ };
656
+ additionalProperties: boolean;
657
+ };
658
+ };
659
+ additionalProperties: boolean;
660
+ };
661
+ };
662
+ alias: {
663
+ title: string;
664
+ type: string;
665
+ properties: {
666
+ alias: {
667
+ type: string;
668
+ format: string;
669
+ };
670
+ };
671
+ required: string[];
672
+ additionalProperties: boolean;
673
+ };
674
+ };
675
+ utils: {
676
+ call: typeof import("./utils").call;
677
+ multicall: typeof import("./utils").multicall;
678
+ subgraphRequest: typeof import("./utils").subgraphRequest;
679
+ ipfsGet: typeof import("./utils").ipfsGet;
680
+ getUrl: typeof import("./utils").getUrl;
681
+ getJSON: typeof import("./utils").getJSON;
682
+ sendTransaction: typeof import("./utils").sendTransaction;
683
+ getScores: typeof import("./utils").getScores;
684
+ getVp: typeof import("./utils").getVp;
685
+ validateSchema: typeof import("./utils").validateSchema;
686
+ getEnsTextRecord: typeof import("./utils").getEnsTextRecord;
687
+ getSpaceUri: typeof import("./utils").getSpaceUri;
688
+ getEnsOwner: typeof import("./utils").getEnsOwner;
689
+ getSpaceController: typeof import("./utils").getSpaceController;
690
+ getDelegatesBySpace: typeof import("./utils").getDelegatesBySpace;
691
+ clone: typeof import("./utils").clone;
692
+ sleep: typeof import("./utils").sleep;
693
+ getNumberWithOrdinal: typeof import("./utils").getNumberWithOrdinal;
694
+ voting: {
695
+ 'single-choice': typeof import("./voting/singleChoice").default;
696
+ approval: typeof import("./voting/approval").default;
697
+ quadratic: typeof import("./voting/quadratic").default;
698
+ 'ranked-choice': typeof import("./voting/rankedChoice").default;
699
+ weighted: typeof import("./voting/weighted").default;
700
+ basic: typeof import("./voting/singleChoice").default;
701
+ };
702
+ getProvider: typeof import("./utils/provider").default;
703
+ signMessage: typeof import("./utils/web3").signMessage;
704
+ getBlockNumber: typeof import("./utils/web3").getBlockNumber;
705
+ Multicaller: typeof import("./utils/multicaller").default;
706
+ getSnapshots: typeof import("./utils/blockfinder").getSnapshots;
707
+ getHash: typeof import("./verify").getHash;
708
+ verify: typeof import("./verify").verify;
709
+ validate: typeof import("./utils").validate;
710
+ isStarknetAddress: typeof import("./utils").isStarknetAddress;
711
+ isEvmAddress: typeof import("./utils").isEvmAddress;
712
+ getFormattedAddress: typeof import("./utils").getFormattedAddress;
713
+ SNAPSHOT_SUBGRAPH_URL: {
714
+ "1": string;
715
+ "10": string;
716
+ "56": string;
717
+ "100": string;
718
+ "137": string;
719
+ "250": string;
720
+ "42161": string;
721
+ "11155111": string;
722
+ };
723
+ };
724
+ };
725
+ export default _default;