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