@snapshot-labs/snapshot.js 0.12.64 → 0.13.0

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.
@@ -1,7 +1,7 @@
1
1
  import fetch from 'cross-fetch';
2
- import { getAddress, isAddress } from '@ethersproject/address';
3
2
  import { AbiCoder, Interface } from '@ethersproject/abi';
4
3
  import { Contract as Contract$1 } from '@ethersproject/contracts';
4
+ import { isAddress, getAddress } from '@ethersproject/address';
5
5
  import { parseUnits } from '@ethersproject/units';
6
6
  import { _TypedDataEncoder, namehash, ensNormalize } from '@ethersproject/hash';
7
7
  import { jsonToGraphQLQuery } from 'json-to-graphql-query';
@@ -62,7 +62,7 @@ const spaceTypes = {
62
62
  };
63
63
  const proposalTypes = {
64
64
  Proposal: [
65
- { name: 'from', type: 'address' },
65
+ { name: 'from', type: 'string' },
66
66
  { name: 'space', type: 'string' },
67
67
  { name: 'timestamp', type: 'uint64' },
68
68
  { name: 'type', type: 'string' },
@@ -82,7 +82,7 @@ const proposalTypes = {
82
82
  const updateProposalTypes = {
83
83
  UpdateProposal: [
84
84
  { name: 'proposal', type: 'string' },
85
- { name: 'from', type: 'address' },
85
+ { name: 'from', type: 'string' },
86
86
  { name: 'space', type: 'string' },
87
87
  { name: 'timestamp', type: 'uint64' },
88
88
  { name: 'type', type: 'string' },
@@ -105,7 +105,7 @@ const flagProposalTypes = {
105
105
  };
106
106
  const cancelProposalTypes = {
107
107
  CancelProposal: [
108
- { name: 'from', type: 'address' },
108
+ { name: 'from', type: 'string' },
109
109
  { name: 'space', type: 'string' },
110
110
  { name: 'timestamp', type: 'uint64' },
111
111
  { name: 'proposal', type: 'string' }
@@ -113,7 +113,7 @@ const cancelProposalTypes = {
113
113
  };
114
114
  const cancelProposal2Types = {
115
115
  CancelProposal: [
116
- { name: 'from', type: 'address' },
116
+ { name: 'from', type: 'string' },
117
117
  { name: 'space', type: 'string' },
118
118
  { name: 'timestamp', type: 'uint64' },
119
119
  { name: 'proposal', type: 'bytes32' }
@@ -121,7 +121,7 @@ const cancelProposal2Types = {
121
121
  };
122
122
  const voteTypes = {
123
123
  Vote: [
124
- { name: 'from', type: 'address' },
124
+ { name: 'from', type: 'string' },
125
125
  { name: 'space', type: 'string' },
126
126
  { name: 'timestamp', type: 'uint64' },
127
127
  { name: 'proposal', type: 'string' },
@@ -133,7 +133,7 @@ const voteTypes = {
133
133
  };
134
134
  const voteArrayTypes = {
135
135
  Vote: [
136
- { name: 'from', type: 'address' },
136
+ { name: 'from', type: 'string' },
137
137
  { name: 'space', type: 'string' },
138
138
  { name: 'timestamp', type: 'uint64' },
139
139
  { name: 'proposal', type: 'string' },
@@ -145,7 +145,7 @@ const voteArrayTypes = {
145
145
  };
146
146
  const voteStringTypes = {
147
147
  Vote: [
148
- { name: 'from', type: 'address' },
148
+ { name: 'from', type: 'string' },
149
149
  { name: 'space', type: 'string' },
150
150
  { name: 'timestamp', type: 'uint64' },
151
151
  { name: 'proposal', type: 'string' },
@@ -157,7 +157,7 @@ const voteStringTypes = {
157
157
  };
158
158
  const vote2Types = {
159
159
  Vote: [
160
- { name: 'from', type: 'address' },
160
+ { name: 'from', type: 'string' },
161
161
  { name: 'space', type: 'string' },
162
162
  { name: 'timestamp', type: 'uint64' },
163
163
  { name: 'proposal', type: 'bytes32' },
@@ -169,7 +169,7 @@ const vote2Types = {
169
169
  };
170
170
  const voteArray2Types = {
171
171
  Vote: [
172
- { name: 'from', type: 'address' },
172
+ { name: 'from', type: 'string' },
173
173
  { name: 'space', type: 'string' },
174
174
  { name: 'timestamp', type: 'uint64' },
175
175
  { name: 'proposal', type: 'bytes32' },
@@ -181,7 +181,7 @@ const voteArray2Types = {
181
181
  };
182
182
  const voteString2Types = {
183
183
  Vote: [
184
- { name: 'from', type: 'address' },
184
+ { name: 'from', type: 'string' },
185
185
  { name: 'space', type: 'string' },
186
186
  { name: 'timestamp', type: 'uint64' },
187
187
  { name: 'proposal', type: 'bytes32' },
@@ -273,1275 +273,78 @@ var constants = {
273
273
  local: local
274
274
  };
275
275
 
276
- const NAME = 'snapshot';
277
- const VERSION = '0.1.4';
278
- const domain = {
279
- name: NAME,
280
- version: VERSION
281
- // chainId: 1
282
- };
283
- class Client {
284
- constructor(address = constants.mainnet.sequencer, options = {}) {
285
- address = address.replace(constants.mainnet.hub, constants.mainnet.sequencer);
286
- address = address.replace(constants.testnet.hub, constants.testnet.sequencer);
287
- address = address.replace(constants.local.hub, constants.local.sequencer);
288
- this.address = address;
289
- this.options = options;
290
- }
291
- sign(web3, address, message, types) {
292
- return __awaiter(this, void 0, void 0, function* () {
293
- var _a;
294
- // @ts-ignore
295
- const signer = (web3 === null || web3 === void 0 ? void 0 : web3.getSigner) ? web3.getSigner() : web3;
296
- const checksumAddress = getAddress(address);
297
- message.from = message.from ? getAddress(message.from) : checksumAddress;
298
- if (!message.timestamp)
299
- message.timestamp = parseInt((Date.now() / 1e3).toFixed());
300
- const domainData = Object.assign({}, domain);
301
- // @ts-ignore
302
- if (typeof window !== 'undefined' && ((_a = window.ethereum) === null || _a === void 0 ? void 0 : _a.isTrust)) {
303
- domainData.chainId = (yield signer.provider.getNetwork()).chainId;
304
- }
305
- const data = { domain: domainData, types, message };
306
- const sig = yield signer._signTypedData(domainData, data.types, message);
307
- return yield this.send({ address: checksumAddress, sig, data });
308
- });
309
- }
310
- send(envelop) {
311
- return __awaiter(this, void 0, void 0, function* () {
312
- let address = this.address;
313
- if (envelop.sig === '0x' && this.options.relayerURL)
314
- address = this.options.relayerURL;
315
- const init = {
316
- method: 'POST',
317
- headers: {
318
- Accept: 'application/json',
319
- 'Content-Type': 'application/json'
320
- },
321
- body: JSON.stringify(envelop)
322
- };
323
- return new Promise((resolve, reject) => {
324
- fetch(address, init)
325
- .then((res) => {
326
- var _a;
327
- if (res.ok)
328
- return resolve(res.json());
329
- if ((_a = res.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.includes('application/json'))
330
- return res.json().then(reject).catch(reject);
331
- throw res;
332
- })
333
- .catch(reject);
334
- });
335
- });
336
- }
337
- space(web3, address, message) {
338
- return __awaiter(this, void 0, void 0, function* () {
339
- return yield this.sign(web3, address, message, spaceTypes);
340
- });
341
- }
342
- proposal(web3, address, message) {
343
- return __awaiter(this, void 0, void 0, function* () {
344
- if (!message.labels)
345
- message.labels = [];
346
- if (!message.discussion)
347
- message.discussion = '';
348
- if (!message.app)
349
- message.app = '';
350
- if (!message.privacy)
351
- message.privacy = '';
352
- return yield this.sign(web3, address, message, proposalTypes);
353
- });
354
- }
355
- updateProposal(web3, address, message) {
356
- return __awaiter(this, void 0, void 0, function* () {
357
- if (!message.privacy)
358
- message.privacy = '';
359
- return yield this.sign(web3, address, message, updateProposalTypes);
360
- });
276
+ class Multicaller {
277
+ constructor(network, provider, abi, options) {
278
+ this.options = {};
279
+ this.calls = [];
280
+ this.paths = [];
281
+ this.network = network;
282
+ this.provider = provider;
283
+ this.abi = abi;
284
+ this.options = options || {};
361
285
  }
362
- flagProposal(web3, address, message) {
363
- return __awaiter(this, void 0, void 0, function* () {
364
- return yield this.sign(web3, address, message, flagProposalTypes);
365
- });
286
+ call(path, address, fn, params) {
287
+ this.calls.push([address, fn, params]);
288
+ this.paths.push(path);
289
+ return this;
366
290
  }
367
- cancelProposal(web3, address, message) {
291
+ execute(from) {
368
292
  return __awaiter(this, void 0, void 0, function* () {
369
- const type2 = message.proposal.startsWith('0x');
370
- return yield this.sign(web3, address, message, type2 ? cancelProposal2Types : cancelProposalTypes);
293
+ const obj = from || {};
294
+ const result = yield multicall(this.network, this.provider, this.abi, this.calls, this.options);
295
+ result.forEach((r, i) => set(obj, this.paths[i], r.length > 1 ? r : r[0]));
296
+ this.calls = [];
297
+ this.paths = [];
298
+ return obj;
371
299
  });
372
300
  }
373
- vote(web3, address, message) {
374
- return __awaiter(this, void 0, void 0, function* () {
375
- const isShutter = (message === null || message === void 0 ? void 0 : message.privacy) === 'shutter';
376
- if (!message.reason)
377
- message.reason = '';
378
- if (!message.app)
379
- message.app = '';
380
- if (!message.metadata)
381
- message.metadata = '{}';
382
- const type2 = message.proposal.startsWith('0x');
383
- let type = type2 ? vote2Types : voteTypes;
384
- if (['approval', 'ranked-choice'].includes(message.type))
385
- type = type2 ? voteArray2Types : voteArrayTypes;
386
- if (!isShutter && ['quadratic', 'weighted'].includes(message.type)) {
387
- type = type2 ? voteString2Types : voteStringTypes;
388
- message.choice = JSON.stringify(message.choice);
301
+ }
302
+
303
+ let cache = {};
304
+ let expirationTime = 0;
305
+ function getSnapshots(network_1, snapshot_1, provider_1, networks_1) {
306
+ return __awaiter(this, arguments, void 0, function* (network, snapshot, provider, networks, options = {}) {
307
+ // If snapshot is latest, return all latest
308
+ const snapshots = {};
309
+ networks.forEach((n) => (snapshots[n] = 'latest'));
310
+ if (snapshot === 'latest')
311
+ return snapshots;
312
+ // Check if cache is valid
313
+ const cacheKey = `${network}-${snapshot}-${networks.join('-')}`;
314
+ const cachedEntry = cache[cacheKey];
315
+ const now = Date.now();
316
+ if (cachedEntry && expirationTime > now) {
317
+ return cachedEntry;
318
+ }
319
+ // Reset cache every hour
320
+ if (expirationTime < now) {
321
+ cache = {};
322
+ // Set expiration time to next hour
323
+ expirationTime = now + 60 * 60 * 1000 - (now % (60 * 60 * 1000));
324
+ }
325
+ snapshots[network] = snapshot;
326
+ const networkIn = Object.keys(snapshots).filter((s) => network !== s);
327
+ if (networkIn.length === 0)
328
+ return snapshots;
329
+ const block = yield provider.getBlock(snapshot);
330
+ const query = {
331
+ blocks: {
332
+ __args: {
333
+ where: {
334
+ ts: block.timestamp,
335
+ network_in: networkIn
336
+ }
337
+ },
338
+ network: true,
339
+ number: true
389
340
  }
390
- if (isShutter)
391
- type = type2 ? voteString2Types : voteStringTypes;
392
- delete message.privacy;
393
- // @ts-ignore
394
- delete message.type;
395
- return yield this.sign(web3, address, message, type);
396
- });
397
- }
398
- follow(web3, address, message) {
399
- return __awaiter(this, void 0, void 0, function* () {
400
- return yield this.sign(web3, address, message, followTypes);
401
- });
402
- }
403
- unfollow(web3, address, message) {
404
- return __awaiter(this, void 0, void 0, function* () {
405
- return yield this.sign(web3, address, message, unfollowTypes);
406
- });
407
- }
408
- subscribe(web3, address, message) {
409
- return __awaiter(this, void 0, void 0, function* () {
410
- return yield this.sign(web3, address, message, subscribeTypes);
411
- });
412
- }
413
- unsubscribe(web3, address, message) {
414
- return __awaiter(this, void 0, void 0, function* () {
415
- return yield this.sign(web3, address, message, unsubscribeTypes);
416
- });
417
- }
418
- profile(web3, address, message) {
419
- return __awaiter(this, void 0, void 0, function* () {
420
- return yield this.sign(web3, address, message, profileTypes);
421
- });
422
- }
423
- statement(web3, address, message) {
424
- return __awaiter(this, void 0, void 0, function* () {
425
- return yield this.sign(web3, address, message, statementTypes);
426
- });
427
- }
428
- alias(web3, address, message) {
429
- return __awaiter(this, void 0, void 0, function* () {
430
- return yield this.sign(web3, address, message, aliasTypes);
431
- });
432
- }
433
- deleteSpace(web3, address, message) {
434
- return __awaiter(this, void 0, void 0, function* () {
435
- return yield this.sign(web3, address, message, deleteSpaceType);
436
- });
437
- }
438
- }
439
-
440
- var $schema = "http://json-schema.org/draft-07/schema#";
441
- var $ref = "#/definitions/Space";
442
- var definitions = {
443
- Space: {
444
- title: "Space",
445
- type: "object",
446
- properties: {
447
- name: {
448
- type: "string",
449
- title: "name",
450
- minLength: 1,
451
- maxLength: 32
452
- },
453
- "private": {
454
- type: "boolean"
455
- },
456
- about: {
457
- type: "string",
458
- title: "about",
459
- maxLength: 160
460
- },
461
- guidelines: {
462
- type: "string",
463
- format: "customUrl",
464
- title: "guidelines",
465
- maxLength: 256
466
- },
467
- template: {
468
- type: "string",
469
- title: "template",
470
- maxLength: 1024
471
- },
472
- terms: {
473
- type: "string",
474
- title: "terms",
475
- format: "customUrl",
476
- maxLength: 256
477
- },
478
- avatar: {
479
- type: "string",
480
- title: "avatar",
481
- format: "customUrl",
482
- maxLength: 256
483
- },
484
- cover: {
485
- type: "string",
486
- title: "avatar",
487
- format: "customUrl",
488
- maxLength: 256
489
- },
490
- location: {
491
- type: "string",
492
- title: "location",
493
- maxLength: 24
494
- },
495
- website: {
496
- type: "string",
497
- title: "website",
498
- format: "customUrl",
499
- maxLength: 256
500
- },
501
- twitter: {
502
- type: "string",
503
- title: "twitter",
504
- pattern: "^[A-Za-z0-9_]*$",
505
- maxLength: 15
506
- },
507
- coingecko: {
508
- type: "string",
509
- title: "coingecko",
510
- pattern: "^[a-z0-9-]*$",
511
- maxLength: 32
512
- },
513
- github: {
514
- type: "string",
515
- title: "github",
516
- pattern: "^[A-Za-z0-9_-]*$",
517
- maxLength: 39
518
- },
519
- farcaster: {
520
- type: "string",
521
- title: "farcaster"
522
- },
523
- email: {
524
- type: "string",
525
- title: "email",
526
- maxLength: 32
527
- },
528
- network: {
529
- type: "string",
530
- snapshotNetwork: true,
531
- title: "network",
532
- minLength: 1,
533
- maxLength: 32
534
- },
535
- symbol: {
536
- type: "string",
537
- title: "symbol",
538
- maxLength: 16
539
- },
540
- skin: {
541
- type: "string",
542
- title: "skin",
543
- maxLength: 32
544
- },
545
- domain: {
546
- type: "string",
547
- title: "domain",
548
- maxLength: 64,
549
- format: "domain"
550
- },
551
- discussions: {
552
- type: "string",
553
- format: "uri",
554
- title: "Discussions link",
555
- maxLength: 256
556
- },
557
- discourseCategory: {
558
- type: "integer",
559
- minimum: 1,
560
- title: "Discourse category"
561
- },
562
- strategies: {
563
- type: "array",
564
- minItems: 1,
565
- uniqueItems: true,
566
- items: {
567
- type: "object",
568
- properties: {
569
- name: {
570
- type: "string",
571
- maxLength: 64,
572
- title: "name"
573
- },
574
- network: {
575
- type: "string",
576
- maxLength: 12,
577
- title: "network",
578
- snapshotNetwork: true
579
- },
580
- params: {
581
- type: "object",
582
- title: "params"
583
- }
584
- },
585
- required: [
586
- "name"
587
- ],
588
- additionalProperties: false
589
- },
590
- title: "strategies"
591
- },
592
- members: {
593
- type: "array",
594
- maxItems: 100,
595
- items: {
596
- type: "string",
597
- format: "evmAddress"
598
- },
599
- title: "members",
600
- uniqueItems: true
601
- },
602
- admins: {
603
- type: "array",
604
- maxItems: 100,
605
- items: {
606
- type: "string",
607
- format: "evmAddress"
608
- },
609
- title: "admins",
610
- uniqueItems: true
611
- },
612
- moderators: {
613
- type: "array",
614
- maxItems: 100,
615
- items: {
616
- type: "string",
617
- format: "evmAddress"
618
- },
619
- title: "moderators",
620
- uniqueItems: true
621
- },
622
- filters: {
623
- type: "object",
624
- properties: {
625
- defaultTab: {
626
- type: "string"
627
- },
628
- minScore: {
629
- type: "number",
630
- minimum: 0
631
- },
632
- onlyMembers: {
633
- type: "boolean"
634
- },
635
- invalids: {
636
- type: "array",
637
- items: {
638
- type: "string",
639
- maxLength: 64
640
- },
641
- title: "invalids"
642
- }
643
- },
644
- additionalProperties: false
645
- },
646
- validation: {
647
- type: "object",
648
- properties: {
649
- name: {
650
- type: "string",
651
- maxLength: 64,
652
- title: "name"
653
- },
654
- params: {
655
- type: "object",
656
- title: "params"
657
- }
658
- },
659
- required: [
660
- "name"
661
- ],
662
- additionalProperties: false
663
- },
664
- voteValidation: {
665
- type: "object",
666
- properties: {
667
- name: {
668
- type: "string",
669
- maxLength: 32,
670
- title: "name"
671
- },
672
- params: {
673
- type: "object",
674
- title: "params"
675
- }
676
- },
677
- required: [
678
- "name"
679
- ],
680
- additionalProperties: false
681
- },
682
- followValidation: {
683
- type: "object",
684
- properties: {
685
- name: {
686
- type: "string",
687
- maxLength: 32,
688
- title: "name"
689
- },
690
- params: {
691
- type: "object",
692
- title: "params"
693
- }
694
- },
695
- required: [
696
- "name"
697
- ],
698
- additionalProperties: false
699
- },
700
- delegationPortal: {
701
- type: "object",
702
- properties: {
703
- delegationType: {
704
- type: "string",
705
- title: "Delegation type",
706
- description: "Specify the type of delegation that you are using",
707
- anyOf: [
708
- {
709
- "const": "compound-governor",
710
- title: "Compound governor"
711
- },
712
- {
713
- "const": "split-delegation",
714
- title: "Split Delegation"
715
- }
716
- ]
717
- },
718
- delegationContract: {
719
- type: "string",
720
- title: "Contract address",
721
- description: "The address of your delegation contract",
722
- examples: [
723
- "0x3901D0fDe202aF1427216b79f5243f8A022d68cf"
724
- ],
725
- anyOf: [
726
- {
727
- format: "evmAddress"
728
- },
729
- {
730
- format: "starknetAddress"
731
- }
732
- ],
733
- errorMessage: "Must be a valid EVM of Starknet address"
734
- },
735
- delegationNetwork: {
736
- type: "string",
737
- title: "Delegation network",
738
- description: "The network of your delegation contract",
739
- anyOf: [
740
- {
741
- snapshotNetwork: true
742
- },
743
- {
744
- starknetNetwork: true
745
- }
746
- ],
747
- errorMessage: "Must be a valid network"
748
- },
749
- delegationApi: {
750
- type: "string",
751
- format: "uri",
752
- title: "Delegation API",
753
- description: "The URL of your delegation API (e.g a subgraph)",
754
- examples: [
755
- "https://subgrapher.snapshot.org/subgraph/arbitrum/FTzC6VrZd8JhJgWfTJnwWgH1Z1dS3GxaosKkRbCqkZAZ"
756
- ]
757
- }
758
- },
759
- required: [
760
- "delegationType",
761
- "delegationApi",
762
- "delegationContract"
763
- ],
764
- additionalProperties: false
765
- },
766
- allowAlias: {
767
- type: "boolean"
768
- },
769
- plugins: {
770
- type: "object"
771
- },
772
- voting: {
773
- type: "object",
774
- properties: {
775
- delay: {
776
- type: "integer",
777
- minimum: 0,
778
- maximum: 2592000,
779
- errorMessage: {
780
- maximum: "Delay must be less than 30 days"
781
- }
782
- },
783
- period: {
784
- type: "integer",
785
- minimum: 0,
786
- maximum: 31622400,
787
- errorMessage: {
788
- maximum: "Delay must be less than a year"
789
- }
790
- },
791
- type: {
792
- type: "string",
793
- title: "type"
794
- },
795
- quorum: {
796
- type: "number",
797
- minimum: 0
798
- },
799
- quorumType: {
800
- type: "string",
801
- "enum": [
802
- "rejection"
803
- ]
804
- },
805
- blind: {
806
- type: "boolean"
807
- },
808
- hideAbstain: {
809
- type: "boolean"
810
- },
811
- aliased: {
812
- type: "boolean"
813
- },
814
- privacy: {
815
- type: "string",
816
- "enum": [
817
- "",
818
- "shutter",
819
- "any"
820
- ]
821
- }
822
- },
823
- additionalProperties: false
824
- },
825
- categories: {
826
- type: "array",
827
- maxItems: 2,
828
- items: {
829
- type: "string",
830
- "enum": [
831
- "protocol",
832
- "social",
833
- "investment",
834
- "grant",
835
- "service",
836
- "media",
837
- "creator",
838
- "collector",
839
- "ai-agent",
840
- "gaming",
841
- "wallet",
842
- "music",
843
- "layer-2",
844
- "defai",
845
- "defi",
846
- "rwa",
847
- "depin",
848
- "meme"
849
- ]
850
- }
851
- },
852
- treasuries: {
853
- type: "array",
854
- maxItems: 10,
855
- uniqueItems: true,
856
- items: {
857
- type: "object",
858
- properties: {
859
- name: {
860
- type: "string",
861
- title: "Name",
862
- examples: [
863
- "e.g. Balancer DAO 1"
864
- ],
865
- minLength: 1,
866
- maxLength: 64
867
- },
868
- address: {
869
- type: "string",
870
- title: "Contract address",
871
- examples: [
872
- "e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
873
- ],
874
- anyOf: [
875
- {
876
- format: "evmAddress"
877
- },
878
- {
879
- format: "starknetAddress"
880
- }
881
- ],
882
- errorMessage: "Must be a valid EVM of Starknet address"
883
- },
884
- network: {
885
- type: "string",
886
- title: "Network",
887
- anyOf: [
888
- {
889
- snapshotNetwork: true
890
- },
891
- {
892
- starknetNetwork: true
893
- }
894
- ],
895
- errorMessage: "Must be a valid network"
896
- }
897
- },
898
- required: [
899
- "name",
900
- "address",
901
- "network"
902
- ],
903
- additionalProperties: false
904
- }
905
- },
906
- labels: {
907
- type: "array",
908
- maxItems: 10,
909
- uniqueItems: true,
910
- items: {
911
- type: "object",
912
- properties: {
913
- id: {
914
- type: "string",
915
- title: "Id",
916
- minLength: 1,
917
- maxLength: 8
918
- },
919
- name: {
920
- type: "string",
921
- title: "Name",
922
- minLength: 1,
923
- maxLength: 32
924
- },
925
- description: {
926
- type: "string",
927
- title: "Description",
928
- maxLength: 100
929
- },
930
- color: {
931
- type: "string",
932
- title: "Color",
933
- format: "color"
934
- }
935
- },
936
- required: [
937
- "id",
938
- "name",
939
- "color"
940
- ],
941
- additionalProperties: false
942
- }
943
- },
944
- parent: {
945
- type: "string",
946
- title: "parent"
947
- },
948
- children: {
949
- type: "array",
950
- maxItems: 16,
951
- title: "children",
952
- items: {
953
- type: "string"
954
- },
955
- uniqueItems: true
956
- },
957
- boost: {
958
- type: "object",
959
- properties: {
960
- enabled: {
961
- type: "boolean"
962
- },
963
- bribeEnabled: {
964
- type: "boolean"
965
- }
966
- },
967
- required: [
968
- "enabled",
969
- "bribeEnabled"
970
- ],
971
- additionalProperties: false
972
- },
973
- skinSettings: {
974
- type: "object",
975
- properties: {
976
- bg_color: {
977
- type: "string",
978
- format: "color"
979
- },
980
- link_color: {
981
- type: "string",
982
- format: "color"
983
- },
984
- text_color: {
985
- type: "string",
986
- format: "color"
987
- },
988
- content_color: {
989
- type: "string",
990
- format: "color"
991
- },
992
- border_color: {
993
- type: "string",
994
- format: "color"
995
- },
996
- heading_color: {
997
- type: "string",
998
- format: "color"
999
- },
1000
- primary_color: {
1001
- type: "string",
1002
- format: "color"
1003
- },
1004
- header_color: {
1005
- type: "string",
1006
- format: "color"
1007
- },
1008
- theme: {
1009
- type: "string",
1010
- "enum": [
1011
- "light",
1012
- "dark"
1013
- ]
1014
- },
1015
- logo: {
1016
- type: "string",
1017
- title: "logo",
1018
- format: "customUrl",
1019
- maxLength: 256
1020
- }
1021
- },
1022
- additionalProperties: false
1023
- }
1024
- },
1025
- required: [
1026
- "name",
1027
- "network",
1028
- "strategies"
1029
- ],
1030
- additionalProperties: false
1031
- }
1032
- };
1033
- var space = {
1034
- $schema: $schema,
1035
- $ref: $ref,
1036
- definitions: definitions
1037
- };
1038
-
1039
- var $schema$1 = "http://json-schema.org/draft-07/schema#";
1040
- var $ref$1 = "#/definitions/Proposal";
1041
- var definitions$1 = {
1042
- Proposal: {
1043
- title: "Proposal",
1044
- type: "object",
1045
- properties: {
1046
- name: {
1047
- type: "string",
1048
- title: "name",
1049
- minLength: 1,
1050
- maxLength: 256
1051
- },
1052
- body: {
1053
- type: "string",
1054
- title: "body",
1055
- minLength: 0
1056
- },
1057
- discussion: {
1058
- type: "string",
1059
- format: "customUrl",
1060
- title: "discussion",
1061
- maxLength: 256
1062
- },
1063
- choices: {
1064
- type: "array",
1065
- title: "choices",
1066
- minItems: 1
1067
- },
1068
- labels: {
1069
- type: "array",
1070
- title: "labels",
1071
- maxItems: 10,
1072
- uniqueItems: true,
1073
- items: {
1074
- type: "string",
1075
- minLength: 1,
1076
- maxLength: 8,
1077
- pattern: "^[a-zA-Z0-9]+$"
1078
- }
1079
- },
1080
- type: {
1081
- type: "string",
1082
- "enum": [
1083
- "single-choice",
1084
- "approval",
1085
- "ranked-choice",
1086
- "quadratic",
1087
- "copeland",
1088
- "weighted",
1089
- "custom",
1090
- "basic"
1091
- ]
1092
- },
1093
- snapshot: {
1094
- type: "number",
1095
- title: "snapshot"
1096
- },
1097
- start: {
1098
- type: "number",
1099
- title: "start",
1100
- minimum: 1000000000,
1101
- maximum: 2000000000
1102
- },
1103
- end: {
1104
- type: "number",
1105
- title: "end",
1106
- minimum: 1000000000,
1107
- maximum: 2000000000
1108
- },
1109
- metadata: {
1110
- type: "object",
1111
- title: "metadata"
1112
- },
1113
- app: {
1114
- type: "string",
1115
- title: "app",
1116
- maxLength: 24
1117
- },
1118
- privacy: {
1119
- type: "string",
1120
- "enum": [
1121
- "",
1122
- "shutter"
1123
- ]
1124
- }
1125
- },
1126
- required: [
1127
- "name",
1128
- "body",
1129
- "choices",
1130
- "snapshot",
1131
- "start",
1132
- "end"
1133
- ],
1134
- additionalProperties: false
1135
- }
1136
- };
1137
- var proposal = {
1138
- $schema: $schema$1,
1139
- $ref: $ref$1,
1140
- definitions: definitions$1
1141
- };
1142
-
1143
- var $schema$2 = "http://json-schema.org/draft-07/schema#";
1144
- var $ref$2 = "#/definitions/UpdateProposal";
1145
- var definitions$2 = {
1146
- UpdateProposal: {
1147
- title: "Update Proposal",
1148
- type: "object",
1149
- properties: {
1150
- proposal: {
1151
- type: "string",
1152
- title: "proposal id"
1153
- },
1154
- name: {
1155
- type: "string",
1156
- title: "name",
1157
- minLength: 1,
1158
- maxLength: 256
1159
- },
1160
- body: {
1161
- type: "string",
1162
- title: "body",
1163
- minLength: 0
1164
- },
1165
- discussion: {
1166
- type: "string",
1167
- format: "customUrl",
1168
- title: "discussion",
1169
- maxLength: 256
1170
- },
1171
- choices: {
1172
- type: "array",
1173
- title: "choices",
1174
- minItems: 1
1175
- },
1176
- labels: {
1177
- type: "array",
1178
- title: "labels",
1179
- maxItems: 10,
1180
- uniqueItems: true,
1181
- items: {
1182
- type: "string",
1183
- minLength: 1,
1184
- maxLength: 8,
1185
- pattern: "^[a-zA-Z0-9]+$"
1186
- }
1187
- },
1188
- type: {
1189
- "enum": [
1190
- "single-choice",
1191
- "approval",
1192
- "ranked-choice",
1193
- "quadratic",
1194
- "weighted",
1195
- "custom",
1196
- "basic"
1197
- ]
1198
- },
1199
- metadata: {
1200
- type: "object",
1201
- title: "metadata"
1202
- },
1203
- privacy: {
1204
- type: "string",
1205
- "enum": [
1206
- "",
1207
- "shutter"
1208
- ]
1209
- }
1210
- },
1211
- required: [
1212
- "proposal",
1213
- "name",
1214
- "body",
1215
- "discussion",
1216
- "choices",
1217
- "type",
1218
- "metadata"
1219
- ],
1220
- additionalProperties: false
1221
- }
1222
- };
1223
- var updateProposal = {
1224
- $schema: $schema$2,
1225
- $ref: $ref$2,
1226
- definitions: definitions$2
1227
- };
1228
-
1229
- var $schema$3 = "http://json-schema.org/draft-07/schema#";
1230
- var $ref$3 = "#/definitions/Vote";
1231
- var definitions$3 = {
1232
- Vote: {
1233
- title: "Vote",
1234
- type: "object",
1235
- properties: {
1236
- proposal: {
1237
- type: "string",
1238
- title: "proposal"
1239
- },
1240
- choice: {
1241
- type: [
1242
- "number",
1243
- "array",
1244
- "object",
1245
- "boolean",
1246
- "string"
1247
- ],
1248
- title: "choice"
1249
- },
1250
- metadata: {
1251
- type: "object",
1252
- title: "metadata"
1253
- },
1254
- reason: {
1255
- type: "string",
1256
- title: "reason",
1257
- maxLength: 5000
1258
- },
1259
- app: {
1260
- type: "string",
1261
- title: "app",
1262
- maxLength: 24
1263
- }
1264
- },
1265
- required: [
1266
- "proposal",
1267
- "choice"
1268
- ],
1269
- additionalProperties: false
1270
- }
1271
- };
1272
- var vote = {
1273
- $schema: $schema$3,
1274
- $ref: $ref$3,
1275
- definitions: definitions$3
1276
- };
1277
-
1278
- var $schema$4 = "http://json-schema.org/draft-07/schema#";
1279
- var $ref$4 = "#/definitions/Profile";
1280
- var definitions$4 = {
1281
- Profile: {
1282
- title: "Profile",
1283
- type: "object",
1284
- properties: {
1285
- name: {
1286
- type: "string",
1287
- title: "name",
1288
- maxLength: 32
1289
- },
1290
- about: {
1291
- type: "string",
1292
- title: "about",
1293
- maxLength: 256
1294
- },
1295
- avatar: {
1296
- type: "string",
1297
- title: "avatar",
1298
- format: "customUrl",
1299
- maxLength: 256
1300
- },
1301
- cover: {
1302
- type: "string",
1303
- title: "avatar",
1304
- format: "customUrl",
1305
- maxLength: 256
1306
- },
1307
- twitter: {
1308
- type: "string",
1309
- title: "twitter",
1310
- pattern: "^[A-Za-z0-9_]*$",
1311
- maxLength: 15
1312
- },
1313
- github: {
1314
- type: "string",
1315
- title: "github",
1316
- pattern: "^[A-Za-z0-9_-]*$",
1317
- maxLength: 39
1318
- },
1319
- lens: {
1320
- type: "string",
1321
- title: "lens",
1322
- pattern: "^[A-Za-z0-9_]*$",
1323
- maxLength: 26
1324
- },
1325
- farcaster: {
1326
- type: "string",
1327
- title: "farcaster",
1328
- pattern: "^[a-z0-9-]*$",
1329
- maxLength: 17
1330
- }
1331
- },
1332
- required: [
1333
- ],
1334
- additionalProperties: false
1335
- }
1336
- };
1337
- var profile = {
1338
- $schema: $schema$4,
1339
- $ref: $ref$4,
1340
- definitions: definitions$4
1341
- };
1342
-
1343
- var $schema$5 = "http://json-schema.org/draft-07/schema#";
1344
- var $ref$5 = "#/definitions/Statement";
1345
- var definitions$5 = {
1346
- Statement: {
1347
- title: "Statement",
1348
- type: "object",
1349
- properties: {
1350
- about: {
1351
- type: "string",
1352
- format: "long",
1353
- title: "About",
1354
- maxLength: 140
1355
- },
1356
- statement: {
1357
- type: "string",
1358
- format: "long",
1359
- title: "Statement",
1360
- maxLength: 10000
1361
- },
1362
- discourse: {
1363
- type: "string",
1364
- title: "discourse",
1365
- pattern: "^[A-Za-z0-9-_.]*$",
1366
- maxLength: 30
1367
- },
1368
- network: {
1369
- type: "string",
1370
- title: "network",
1371
- pattern: "^[a-z0-9-]*$",
1372
- maxLength: 24
1373
- },
1374
- status: {
1375
- "enum": [
1376
- "ACTIVE",
1377
- "INACTIVE"
1378
- ],
1379
- title: "status"
1380
- }
1381
- },
1382
- required: [
1383
- ],
1384
- additionalProperties: false
1385
- }
1386
- };
1387
- var statement = {
1388
- $schema: $schema$5,
1389
- $ref: $ref$5,
1390
- definitions: definitions$5
1391
- };
1392
-
1393
- var $schema$6 = "http://json-schema.org/draft-07/schema#";
1394
- var $ref$6 = "#/definitions/Zodiac";
1395
- var definitions$6 = {
1396
- Zodiac: {
1397
- title: "Zodiac",
1398
- type: "object",
1399
- properties: {
1400
- safes: {
1401
- title: "Safe(s)",
1402
- type: "array",
1403
- maxItems: 8,
1404
- items: {
1405
- type: "object",
1406
- properties: {
1407
- network: {
1408
- title: "Network",
1409
- type: "string",
1410
- snapshotNetwork: true
1411
- },
1412
- multisend: {
1413
- title: "Multisend contract address",
1414
- type: "string"
1415
- },
1416
- realityAddress: {
1417
- title: "Reality module address",
1418
- type: "string"
1419
- },
1420
- umaAddress: {
1421
- title: "UMA module address",
1422
- type: "string"
1423
- }
1424
- },
1425
- additionalProperties: false
1426
- }
1427
- },
1428
- additionalProperties: false
1429
- }
1430
- }
1431
- };
1432
- var zodiac = {
1433
- $schema: $schema$6,
1434
- $ref: $ref$6,
1435
- definitions: definitions$6
1436
- };
1437
-
1438
- var $schema$7 = "http://json-schema.org/draft-07/schema#";
1439
- var $ref$7 = "#/definitions/Alias";
1440
- var definitions$7 = {
1441
- Alias: {
1442
- title: "Alias",
1443
- type: "object",
1444
- properties: {
1445
- alias: {
1446
- type: "string",
1447
- format: "address"
1448
- }
1449
- },
1450
- required: [
1451
- "alias"
1452
- ],
1453
- additionalProperties: false
1454
- }
1455
- };
1456
- var alias = {
1457
- $schema: $schema$7,
1458
- $ref: $ref$7,
1459
- definitions: definitions$7
1460
- };
1461
-
1462
- var schemas = {
1463
- space: space.definitions.Space,
1464
- proposal: proposal.definitions.Proposal,
1465
- updateProposal: updateProposal.definitions.UpdateProposal,
1466
- vote: vote.definitions.Vote,
1467
- profile: profile.definitions.Profile,
1468
- statement: statement.definitions.Statement,
1469
- zodiac: zodiac.definitions.Zodiac,
1470
- alias: alias.definitions.Alias
1471
- };
1472
-
1473
- class Multicaller {
1474
- constructor(network, provider, abi, options) {
1475
- this.options = {};
1476
- this.calls = [];
1477
- this.paths = [];
1478
- this.network = network;
1479
- this.provider = provider;
1480
- this.abi = abi;
1481
- this.options = options || {};
1482
- }
1483
- call(path, address, fn, params) {
1484
- this.calls.push([address, fn, params]);
1485
- this.paths.push(path);
1486
- return this;
1487
- }
1488
- execute(from) {
1489
- return __awaiter(this, void 0, void 0, function* () {
1490
- const obj = from || {};
1491
- const result = yield multicall(this.network, this.provider, this.abi, this.calls, this.options);
1492
- result.forEach((r, i) => set(obj, this.paths[i], r.length > 1 ? r : r[0]));
1493
- this.calls = [];
1494
- this.paths = [];
1495
- return obj;
1496
- });
1497
- }
1498
- }
1499
-
1500
- let cache = {};
1501
- let expirationTime = 0;
1502
- function getSnapshots(network_1, snapshot_1, provider_1, networks_1) {
1503
- return __awaiter(this, arguments, void 0, function* (network, snapshot, provider, networks, options = {}) {
1504
- // If snapshot is latest, return all latest
1505
- const snapshots = {};
1506
- networks.forEach((n) => (snapshots[n] = 'latest'));
1507
- if (snapshot === 'latest')
1508
- return snapshots;
1509
- // Check if cache is valid
1510
- const cacheKey = `${network}-${snapshot}-${networks.join('-')}`;
1511
- const cachedEntry = cache[cacheKey];
1512
- const now = Date.now();
1513
- if (cachedEntry && expirationTime > now) {
1514
- return cachedEntry;
1515
- }
1516
- // Reset cache every hour
1517
- if (expirationTime < now) {
1518
- cache = {};
1519
- // Set expiration time to next hour
1520
- expirationTime = now + 60 * 60 * 1000 - (now % (60 * 60 * 1000));
1521
- }
1522
- snapshots[network] = snapshot;
1523
- const networkIn = Object.keys(snapshots).filter((s) => network !== s);
1524
- if (networkIn.length === 0)
1525
- return snapshots;
1526
- const block = yield provider.getBlock(snapshot);
1527
- const query = {
1528
- blocks: {
1529
- __args: {
1530
- where: {
1531
- ts: block.timestamp,
1532
- network_in: networkIn
1533
- }
1534
- },
1535
- network: true,
1536
- number: true
1537
- }
1538
- };
1539
- const url = options.blockFinderUrl || 'https://blockfinder.snapshot.org';
1540
- const data = yield subgraphRequest(url, query);
1541
- data.blocks.forEach((block) => (snapshots[block.network] = block.number));
1542
- cache[cacheKey] = snapshots;
1543
- return snapshots;
1544
- });
341
+ };
342
+ const url = options.blockFinderUrl || 'https://blockfinder.snapshot.org';
343
+ const data = yield subgraphRequest(url, query);
344
+ data.blocks.forEach((block) => (snapshots[block.network] = block.number));
345
+ cache[cacheKey] = snapshots;
346
+ return snapshots;
347
+ });
1545
348
  }
1546
349
 
1547
350
  const providers = {};
@@ -5019,9 +3822,12 @@ function isEvmAddress(address) {
5019
3822
  return isAddress(address);
5020
3823
  }
5021
3824
  function getFormattedAddress(address, format) {
5022
- if (format === 'evm' && isEvmAddress(address))
3825
+ // Consider non-evm addresses as Starknet by default
3826
+ // as there's no other way to differentiate them
3827
+ const addressType = format !== null && format !== void 0 ? format : (isEvmAddress(address) ? 'evm' : 'starknet');
3828
+ if (addressType === 'evm' && isEvmAddress(address))
5023
3829
  return getAddress(address);
5024
- if (format === 'starknet' && isStarknetAddress(address))
3830
+ if (addressType === 'starknet' && isStarknetAddress(address))
5025
3831
  return validateAndParseAddress(address);
5026
3832
  throw new Error(`Invalid address: ${address}`);
5027
3833
  }
@@ -5062,6 +3868,1243 @@ var utils = {
5062
3868
  SNAPSHOT_SUBGRAPH_URL
5063
3869
  };
5064
3870
 
3871
+ const NAME = 'snapshot';
3872
+ const VERSION = '0.1.4';
3873
+ const domain = {
3874
+ name: NAME,
3875
+ version: VERSION
3876
+ // chainId: 1
3877
+ };
3878
+ class Client {
3879
+ constructor(address = constants.mainnet.sequencer, options = {}) {
3880
+ address = address.replace(constants.mainnet.hub, constants.mainnet.sequencer);
3881
+ address = address.replace(constants.testnet.hub, constants.testnet.sequencer);
3882
+ address = address.replace(constants.local.hub, constants.local.sequencer);
3883
+ this.address = address;
3884
+ this.options = options;
3885
+ }
3886
+ sign(web3, address, message, types) {
3887
+ return __awaiter(this, void 0, void 0, function* () {
3888
+ var _a;
3889
+ // @ts-ignore
3890
+ const signer = (web3 === null || web3 === void 0 ? void 0 : web3.getSigner) ? web3.getSigner() : web3;
3891
+ const checksumAddress = getFormattedAddress(address, 'evm');
3892
+ message.from = message.from
3893
+ ? getFormattedAddress(message.from)
3894
+ : checksumAddress;
3895
+ if (!message.timestamp)
3896
+ message.timestamp = parseInt((Date.now() / 1e3).toFixed());
3897
+ const domainData = Object.assign({}, domain);
3898
+ // @ts-ignore
3899
+ if (typeof window !== 'undefined' && ((_a = window.ethereum) === null || _a === void 0 ? void 0 : _a.isTrust)) {
3900
+ domainData.chainId = (yield signer.provider.getNetwork()).chainId;
3901
+ }
3902
+ const data = { domain: domainData, types, message };
3903
+ const sig = yield signer._signTypedData(domainData, data.types, message);
3904
+ return yield this.send({ address: checksumAddress, sig, data });
3905
+ });
3906
+ }
3907
+ send(envelop) {
3908
+ return __awaiter(this, void 0, void 0, function* () {
3909
+ let address = this.address;
3910
+ if (envelop.sig === '0x' && this.options.relayerURL)
3911
+ address = this.options.relayerURL;
3912
+ const init = {
3913
+ method: 'POST',
3914
+ headers: {
3915
+ Accept: 'application/json',
3916
+ 'Content-Type': 'application/json'
3917
+ },
3918
+ body: JSON.stringify(envelop)
3919
+ };
3920
+ return new Promise((resolve, reject) => {
3921
+ fetch(address, init)
3922
+ .then((res) => {
3923
+ var _a;
3924
+ if (res.ok)
3925
+ return resolve(res.json());
3926
+ if ((_a = res.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.includes('application/json'))
3927
+ return res.json().then(reject).catch(reject);
3928
+ throw res;
3929
+ })
3930
+ .catch(reject);
3931
+ });
3932
+ });
3933
+ }
3934
+ space(web3, address, message) {
3935
+ return __awaiter(this, void 0, void 0, function* () {
3936
+ return yield this.sign(web3, address, message, spaceTypes);
3937
+ });
3938
+ }
3939
+ proposal(web3, address, message) {
3940
+ return __awaiter(this, void 0, void 0, function* () {
3941
+ if (!message.labels)
3942
+ message.labels = [];
3943
+ if (!message.discussion)
3944
+ message.discussion = '';
3945
+ if (!message.app)
3946
+ message.app = '';
3947
+ if (!message.privacy)
3948
+ message.privacy = '';
3949
+ return yield this.sign(web3, address, message, proposalTypes);
3950
+ });
3951
+ }
3952
+ updateProposal(web3, address, message) {
3953
+ return __awaiter(this, void 0, void 0, function* () {
3954
+ if (!message.privacy)
3955
+ message.privacy = '';
3956
+ return yield this.sign(web3, address, message, updateProposalTypes);
3957
+ });
3958
+ }
3959
+ flagProposal(web3, address, message) {
3960
+ return __awaiter(this, void 0, void 0, function* () {
3961
+ return yield this.sign(web3, address, message, flagProposalTypes);
3962
+ });
3963
+ }
3964
+ cancelProposal(web3, address, message) {
3965
+ return __awaiter(this, void 0, void 0, function* () {
3966
+ const type2 = message.proposal.startsWith('0x');
3967
+ return yield this.sign(web3, address, message, type2 ? cancelProposal2Types : cancelProposalTypes);
3968
+ });
3969
+ }
3970
+ vote(web3, address, message) {
3971
+ return __awaiter(this, void 0, void 0, function* () {
3972
+ const isShutter = (message === null || message === void 0 ? void 0 : message.privacy) === 'shutter';
3973
+ if (!message.reason)
3974
+ message.reason = '';
3975
+ if (!message.app)
3976
+ message.app = '';
3977
+ if (!message.metadata)
3978
+ message.metadata = '{}';
3979
+ const type2 = message.proposal.startsWith('0x');
3980
+ let type = type2 ? vote2Types : voteTypes;
3981
+ if (['approval', 'ranked-choice'].includes(message.type))
3982
+ type = type2 ? voteArray2Types : voteArrayTypes;
3983
+ if (!isShutter && ['quadratic', 'weighted'].includes(message.type)) {
3984
+ type = type2 ? voteString2Types : voteStringTypes;
3985
+ message.choice = JSON.stringify(message.choice);
3986
+ }
3987
+ if (isShutter)
3988
+ type = type2 ? voteString2Types : voteStringTypes;
3989
+ delete message.privacy;
3990
+ // @ts-ignore
3991
+ delete message.type;
3992
+ return yield this.sign(web3, address, message, type);
3993
+ });
3994
+ }
3995
+ follow(web3, address, message) {
3996
+ return __awaiter(this, void 0, void 0, function* () {
3997
+ return yield this.sign(web3, address, message, followTypes);
3998
+ });
3999
+ }
4000
+ unfollow(web3, address, message) {
4001
+ return __awaiter(this, void 0, void 0, function* () {
4002
+ return yield this.sign(web3, address, message, unfollowTypes);
4003
+ });
4004
+ }
4005
+ subscribe(web3, address, message) {
4006
+ return __awaiter(this, void 0, void 0, function* () {
4007
+ return yield this.sign(web3, address, message, subscribeTypes);
4008
+ });
4009
+ }
4010
+ unsubscribe(web3, address, message) {
4011
+ return __awaiter(this, void 0, void 0, function* () {
4012
+ return yield this.sign(web3, address, message, unsubscribeTypes);
4013
+ });
4014
+ }
4015
+ profile(web3, address, message) {
4016
+ return __awaiter(this, void 0, void 0, function* () {
4017
+ return yield this.sign(web3, address, message, profileTypes);
4018
+ });
4019
+ }
4020
+ statement(web3, address, message) {
4021
+ return __awaiter(this, void 0, void 0, function* () {
4022
+ return yield this.sign(web3, address, message, statementTypes);
4023
+ });
4024
+ }
4025
+ alias(web3, address, message) {
4026
+ return __awaiter(this, void 0, void 0, function* () {
4027
+ return yield this.sign(web3, address, message, aliasTypes);
4028
+ });
4029
+ }
4030
+ deleteSpace(web3, address, message) {
4031
+ return __awaiter(this, void 0, void 0, function* () {
4032
+ return yield this.sign(web3, address, message, deleteSpaceType);
4033
+ });
4034
+ }
4035
+ }
4036
+
4037
+ var $schema = "http://json-schema.org/draft-07/schema#";
4038
+ var $ref = "#/definitions/Space";
4039
+ var definitions = {
4040
+ Space: {
4041
+ title: "Space",
4042
+ type: "object",
4043
+ properties: {
4044
+ name: {
4045
+ type: "string",
4046
+ title: "name",
4047
+ minLength: 1,
4048
+ maxLength: 32
4049
+ },
4050
+ "private": {
4051
+ type: "boolean"
4052
+ },
4053
+ about: {
4054
+ type: "string",
4055
+ title: "about",
4056
+ maxLength: 160
4057
+ },
4058
+ guidelines: {
4059
+ type: "string",
4060
+ format: "customUrl",
4061
+ title: "guidelines",
4062
+ maxLength: 256
4063
+ },
4064
+ template: {
4065
+ type: "string",
4066
+ title: "template",
4067
+ maxLength: 1024
4068
+ },
4069
+ terms: {
4070
+ type: "string",
4071
+ title: "terms",
4072
+ format: "customUrl",
4073
+ maxLength: 256
4074
+ },
4075
+ avatar: {
4076
+ type: "string",
4077
+ title: "avatar",
4078
+ format: "customUrl",
4079
+ maxLength: 256
4080
+ },
4081
+ cover: {
4082
+ type: "string",
4083
+ title: "avatar",
4084
+ format: "customUrl",
4085
+ maxLength: 256
4086
+ },
4087
+ location: {
4088
+ type: "string",
4089
+ title: "location",
4090
+ maxLength: 24
4091
+ },
4092
+ website: {
4093
+ type: "string",
4094
+ title: "website",
4095
+ format: "customUrl",
4096
+ maxLength: 256
4097
+ },
4098
+ twitter: {
4099
+ type: "string",
4100
+ title: "twitter",
4101
+ pattern: "^[A-Za-z0-9_]*$",
4102
+ maxLength: 15
4103
+ },
4104
+ coingecko: {
4105
+ type: "string",
4106
+ title: "coingecko",
4107
+ pattern: "^[a-z0-9-]*$",
4108
+ maxLength: 32
4109
+ },
4110
+ github: {
4111
+ type: "string",
4112
+ title: "github",
4113
+ pattern: "^[A-Za-z0-9_-]*$",
4114
+ maxLength: 39
4115
+ },
4116
+ farcaster: {
4117
+ type: "string",
4118
+ title: "farcaster"
4119
+ },
4120
+ email: {
4121
+ type: "string",
4122
+ title: "email",
4123
+ maxLength: 32
4124
+ },
4125
+ network: {
4126
+ type: "string",
4127
+ snapshotNetwork: true,
4128
+ title: "network",
4129
+ minLength: 1,
4130
+ maxLength: 32
4131
+ },
4132
+ symbol: {
4133
+ type: "string",
4134
+ title: "symbol",
4135
+ maxLength: 16
4136
+ },
4137
+ skin: {
4138
+ type: "string",
4139
+ title: "skin",
4140
+ maxLength: 32
4141
+ },
4142
+ domain: {
4143
+ type: "string",
4144
+ title: "domain",
4145
+ maxLength: 64,
4146
+ format: "domain"
4147
+ },
4148
+ discussions: {
4149
+ type: "string",
4150
+ format: "uri",
4151
+ title: "Discussions link",
4152
+ maxLength: 256
4153
+ },
4154
+ discourseCategory: {
4155
+ type: "integer",
4156
+ minimum: 1,
4157
+ title: "Discourse category"
4158
+ },
4159
+ strategies: {
4160
+ type: "array",
4161
+ minItems: 1,
4162
+ uniqueItems: true,
4163
+ items: {
4164
+ type: "object",
4165
+ properties: {
4166
+ name: {
4167
+ type: "string",
4168
+ maxLength: 64,
4169
+ title: "name"
4170
+ },
4171
+ network: {
4172
+ type: "string",
4173
+ maxLength: 12,
4174
+ title: "network",
4175
+ snapshotNetwork: true
4176
+ },
4177
+ params: {
4178
+ type: "object",
4179
+ title: "params"
4180
+ }
4181
+ },
4182
+ required: [
4183
+ "name"
4184
+ ],
4185
+ additionalProperties: false
4186
+ },
4187
+ title: "strategies"
4188
+ },
4189
+ members: {
4190
+ type: "array",
4191
+ maxItems: 100,
4192
+ items: {
4193
+ type: "string",
4194
+ anyOf: [
4195
+ {
4196
+ type: "string",
4197
+ format: "evmAddress"
4198
+ },
4199
+ {
4200
+ type: "string",
4201
+ format: "starknetAddress"
4202
+ }
4203
+ ],
4204
+ errorMessage: "Must be a valid address"
4205
+ },
4206
+ title: "members",
4207
+ uniqueItems: true
4208
+ },
4209
+ admins: {
4210
+ type: "array",
4211
+ maxItems: 100,
4212
+ items: {
4213
+ type: "string",
4214
+ anyOf: [
4215
+ {
4216
+ type: "string",
4217
+ format: "evmAddress"
4218
+ },
4219
+ {
4220
+ type: "string",
4221
+ format: "starknetAddress"
4222
+ }
4223
+ ],
4224
+ errorMessage: "Must be a valid address"
4225
+ },
4226
+ title: "admins",
4227
+ uniqueItems: true
4228
+ },
4229
+ moderators: {
4230
+ type: "array",
4231
+ maxItems: 100,
4232
+ items: {
4233
+ type: "string",
4234
+ anyOf: [
4235
+ {
4236
+ type: "string",
4237
+ format: "evmAddress"
4238
+ },
4239
+ {
4240
+ type: "string",
4241
+ format: "starknetAddress"
4242
+ }
4243
+ ],
4244
+ errorMessage: "Must be a valid address"
4245
+ },
4246
+ title: "moderators",
4247
+ uniqueItems: true
4248
+ },
4249
+ filters: {
4250
+ type: "object",
4251
+ properties: {
4252
+ defaultTab: {
4253
+ type: "string"
4254
+ },
4255
+ minScore: {
4256
+ type: "number",
4257
+ minimum: 0
4258
+ },
4259
+ onlyMembers: {
4260
+ type: "boolean"
4261
+ },
4262
+ invalids: {
4263
+ type: "array",
4264
+ items: {
4265
+ type: "string",
4266
+ maxLength: 64
4267
+ },
4268
+ title: "invalids"
4269
+ }
4270
+ },
4271
+ additionalProperties: false
4272
+ },
4273
+ validation: {
4274
+ type: "object",
4275
+ properties: {
4276
+ name: {
4277
+ type: "string",
4278
+ maxLength: 64,
4279
+ title: "name"
4280
+ },
4281
+ params: {
4282
+ type: "object",
4283
+ title: "params"
4284
+ }
4285
+ },
4286
+ required: [
4287
+ "name"
4288
+ ],
4289
+ additionalProperties: false
4290
+ },
4291
+ voteValidation: {
4292
+ type: "object",
4293
+ properties: {
4294
+ name: {
4295
+ type: "string",
4296
+ maxLength: 32,
4297
+ title: "name"
4298
+ },
4299
+ params: {
4300
+ type: "object",
4301
+ title: "params"
4302
+ }
4303
+ },
4304
+ required: [
4305
+ "name"
4306
+ ],
4307
+ additionalProperties: false
4308
+ },
4309
+ followValidation: {
4310
+ type: "object",
4311
+ properties: {
4312
+ name: {
4313
+ type: "string",
4314
+ maxLength: 32,
4315
+ title: "name"
4316
+ },
4317
+ params: {
4318
+ type: "object",
4319
+ title: "params"
4320
+ }
4321
+ },
4322
+ required: [
4323
+ "name"
4324
+ ],
4325
+ additionalProperties: false
4326
+ },
4327
+ delegationPortal: {
4328
+ type: "object",
4329
+ properties: {
4330
+ delegationType: {
4331
+ type: "string",
4332
+ title: "Delegation type",
4333
+ description: "Specify the type of delegation that you are using",
4334
+ anyOf: [
4335
+ {
4336
+ "const": "compound-governor",
4337
+ title: "Compound governor"
4338
+ },
4339
+ {
4340
+ "const": "split-delegation",
4341
+ title: "Split Delegation"
4342
+ },
4343
+ {
4344
+ "const": "apechain-delegate-registry",
4345
+ title: "ApeChain Delegate Registry"
4346
+ }
4347
+ ]
4348
+ },
4349
+ delegationContract: {
4350
+ type: "string",
4351
+ title: "Contract address",
4352
+ description: "The address of your delegation contract",
4353
+ examples: [
4354
+ "0x3901D0fDe202aF1427216b79f5243f8A022d68cf"
4355
+ ],
4356
+ anyOf: [
4357
+ {
4358
+ type: "string",
4359
+ format: "evmAddress"
4360
+ },
4361
+ {
4362
+ type: "string",
4363
+ format: "starknetAddress"
4364
+ }
4365
+ ],
4366
+ errorMessage: "Must be a valid EVM of Starknet address"
4367
+ },
4368
+ delegationNetwork: {
4369
+ type: "string",
4370
+ title: "Delegation network",
4371
+ description: "The network of your delegation contract",
4372
+ anyOf: [
4373
+ {
4374
+ snapshotNetwork: true
4375
+ },
4376
+ {
4377
+ starknetNetwork: true
4378
+ }
4379
+ ],
4380
+ errorMessage: "Must be a valid network"
4381
+ },
4382
+ delegationApi: {
4383
+ type: "string",
4384
+ format: "uri",
4385
+ title: "Delegation API",
4386
+ description: "The URL of your delegation API (e.g a subgraph)",
4387
+ examples: [
4388
+ "https://subgrapher.snapshot.org/subgraph/arbitrum/FTzC6VrZd8JhJgWfTJnwWgH1Z1dS3GxaosKkRbCqkZAZ"
4389
+ ]
4390
+ }
4391
+ },
4392
+ required: [
4393
+ "delegationType",
4394
+ "delegationApi",
4395
+ "delegationContract"
4396
+ ],
4397
+ additionalProperties: false
4398
+ },
4399
+ allowAlias: {
4400
+ type: "boolean"
4401
+ },
4402
+ plugins: {
4403
+ type: "object"
4404
+ },
4405
+ voting: {
4406
+ type: "object",
4407
+ properties: {
4408
+ delay: {
4409
+ type: "integer",
4410
+ minimum: 0,
4411
+ maximum: 2592000,
4412
+ errorMessage: {
4413
+ maximum: "Delay must be less than 30 days"
4414
+ }
4415
+ },
4416
+ period: {
4417
+ type: "integer",
4418
+ minimum: 0,
4419
+ maximum: 31622400,
4420
+ errorMessage: {
4421
+ maximum: "Delay must be less than a year"
4422
+ }
4423
+ },
4424
+ type: {
4425
+ type: "string",
4426
+ title: "type"
4427
+ },
4428
+ quorum: {
4429
+ type: "number",
4430
+ minimum: 0
4431
+ },
4432
+ quorumType: {
4433
+ type: "string",
4434
+ "enum": [
4435
+ "rejection"
4436
+ ]
4437
+ },
4438
+ blind: {
4439
+ type: "boolean"
4440
+ },
4441
+ hideAbstain: {
4442
+ type: "boolean"
4443
+ },
4444
+ aliased: {
4445
+ type: "boolean"
4446
+ },
4447
+ privacy: {
4448
+ type: "string",
4449
+ "enum": [
4450
+ "",
4451
+ "shutter",
4452
+ "any"
4453
+ ]
4454
+ }
4455
+ },
4456
+ additionalProperties: false
4457
+ },
4458
+ categories: {
4459
+ type: "array",
4460
+ maxItems: 2,
4461
+ items: {
4462
+ type: "string",
4463
+ "enum": [
4464
+ "protocol",
4465
+ "social",
4466
+ "investment",
4467
+ "grant",
4468
+ "service",
4469
+ "media",
4470
+ "creator",
4471
+ "collector",
4472
+ "ai-agent",
4473
+ "gaming",
4474
+ "wallet",
4475
+ "music",
4476
+ "layer-2",
4477
+ "defai",
4478
+ "defi",
4479
+ "rwa",
4480
+ "depin",
4481
+ "meme"
4482
+ ]
4483
+ }
4484
+ },
4485
+ treasuries: {
4486
+ type: "array",
4487
+ maxItems: 10,
4488
+ uniqueItems: true,
4489
+ items: {
4490
+ type: "object",
4491
+ properties: {
4492
+ name: {
4493
+ type: "string",
4494
+ title: "Name",
4495
+ examples: [
4496
+ "e.g. Balancer DAO 1"
4497
+ ],
4498
+ minLength: 1,
4499
+ maxLength: 64
4500
+ },
4501
+ address: {
4502
+ type: "string",
4503
+ title: "Contract address",
4504
+ examples: [
4505
+ "e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
4506
+ ],
4507
+ anyOf: [
4508
+ {
4509
+ type: "string",
4510
+ format: "evmAddress"
4511
+ },
4512
+ {
4513
+ type: "string",
4514
+ format: "starknetAddress"
4515
+ }
4516
+ ],
4517
+ errorMessage: "Must be a valid EVM of Starknet address"
4518
+ },
4519
+ network: {
4520
+ type: "string",
4521
+ title: "Network",
4522
+ anyOf: [
4523
+ {
4524
+ snapshotNetwork: true
4525
+ },
4526
+ {
4527
+ starknetNetwork: true
4528
+ }
4529
+ ],
4530
+ errorMessage: "Must be a valid network"
4531
+ }
4532
+ },
4533
+ required: [
4534
+ "name",
4535
+ "address",
4536
+ "network"
4537
+ ],
4538
+ additionalProperties: false
4539
+ }
4540
+ },
4541
+ labels: {
4542
+ type: "array",
4543
+ maxItems: 10,
4544
+ uniqueItems: true,
4545
+ items: {
4546
+ type: "object",
4547
+ properties: {
4548
+ id: {
4549
+ type: "string",
4550
+ title: "Id",
4551
+ minLength: 1,
4552
+ maxLength: 8
4553
+ },
4554
+ name: {
4555
+ type: "string",
4556
+ title: "Name",
4557
+ minLength: 1,
4558
+ maxLength: 32
4559
+ },
4560
+ description: {
4561
+ type: "string",
4562
+ title: "Description",
4563
+ maxLength: 100
4564
+ },
4565
+ color: {
4566
+ type: "string",
4567
+ title: "Color",
4568
+ format: "color"
4569
+ }
4570
+ },
4571
+ required: [
4572
+ "id",
4573
+ "name",
4574
+ "color"
4575
+ ],
4576
+ additionalProperties: false
4577
+ }
4578
+ },
4579
+ parent: {
4580
+ type: "string",
4581
+ title: "parent"
4582
+ },
4583
+ children: {
4584
+ type: "array",
4585
+ maxItems: 16,
4586
+ title: "children",
4587
+ items: {
4588
+ type: "string"
4589
+ },
4590
+ uniqueItems: true
4591
+ },
4592
+ boost: {
4593
+ type: "object",
4594
+ properties: {
4595
+ enabled: {
4596
+ type: "boolean"
4597
+ },
4598
+ bribeEnabled: {
4599
+ type: "boolean"
4600
+ }
4601
+ },
4602
+ required: [
4603
+ "enabled",
4604
+ "bribeEnabled"
4605
+ ],
4606
+ additionalProperties: false
4607
+ },
4608
+ skinSettings: {
4609
+ type: "object",
4610
+ properties: {
4611
+ bg_color: {
4612
+ type: "string",
4613
+ format: "color"
4614
+ },
4615
+ link_color: {
4616
+ type: "string",
4617
+ format: "color"
4618
+ },
4619
+ text_color: {
4620
+ type: "string",
4621
+ format: "color"
4622
+ },
4623
+ content_color: {
4624
+ type: "string",
4625
+ format: "color"
4626
+ },
4627
+ border_color: {
4628
+ type: "string",
4629
+ format: "color"
4630
+ },
4631
+ heading_color: {
4632
+ type: "string",
4633
+ format: "color"
4634
+ },
4635
+ primary_color: {
4636
+ type: "string",
4637
+ format: "color"
4638
+ },
4639
+ header_color: {
4640
+ type: "string",
4641
+ format: "color"
4642
+ },
4643
+ theme: {
4644
+ type: "string",
4645
+ "enum": [
4646
+ "light",
4647
+ "dark"
4648
+ ]
4649
+ },
4650
+ logo: {
4651
+ type: "string",
4652
+ title: "logo",
4653
+ format: "customUrl",
4654
+ maxLength: 256
4655
+ }
4656
+ },
4657
+ additionalProperties: false
4658
+ }
4659
+ },
4660
+ required: [
4661
+ "name",
4662
+ "network",
4663
+ "strategies"
4664
+ ],
4665
+ additionalProperties: false
4666
+ }
4667
+ };
4668
+ var space = {
4669
+ $schema: $schema,
4670
+ $ref: $ref,
4671
+ definitions: definitions
4672
+ };
4673
+
4674
+ var $schema$1 = "http://json-schema.org/draft-07/schema#";
4675
+ var $ref$1 = "#/definitions/Proposal";
4676
+ var definitions$1 = {
4677
+ Proposal: {
4678
+ title: "Proposal",
4679
+ type: "object",
4680
+ properties: {
4681
+ name: {
4682
+ type: "string",
4683
+ title: "name",
4684
+ minLength: 1,
4685
+ maxLength: 256
4686
+ },
4687
+ body: {
4688
+ type: "string",
4689
+ title: "body",
4690
+ minLength: 0
4691
+ },
4692
+ discussion: {
4693
+ type: "string",
4694
+ format: "customUrl",
4695
+ title: "discussion",
4696
+ maxLength: 256
4697
+ },
4698
+ choices: {
4699
+ type: "array",
4700
+ title: "choices",
4701
+ minItems: 1
4702
+ },
4703
+ labels: {
4704
+ type: "array",
4705
+ title: "labels",
4706
+ maxItems: 10,
4707
+ uniqueItems: true,
4708
+ items: {
4709
+ type: "string",
4710
+ minLength: 1,
4711
+ maxLength: 8,
4712
+ pattern: "^[a-zA-Z0-9]+$"
4713
+ }
4714
+ },
4715
+ type: {
4716
+ type: "string",
4717
+ "enum": [
4718
+ "single-choice",
4719
+ "approval",
4720
+ "ranked-choice",
4721
+ "quadratic",
4722
+ "copeland",
4723
+ "weighted",
4724
+ "custom",
4725
+ "basic"
4726
+ ]
4727
+ },
4728
+ snapshot: {
4729
+ type: "number",
4730
+ title: "snapshot"
4731
+ },
4732
+ start: {
4733
+ type: "number",
4734
+ title: "start",
4735
+ minimum: 1000000000,
4736
+ maximum: 2000000000
4737
+ },
4738
+ end: {
4739
+ type: "number",
4740
+ title: "end",
4741
+ minimum: 1000000000,
4742
+ maximum: 2000000000
4743
+ },
4744
+ metadata: {
4745
+ type: "object",
4746
+ title: "metadata"
4747
+ },
4748
+ app: {
4749
+ type: "string",
4750
+ title: "app",
4751
+ maxLength: 24
4752
+ },
4753
+ privacy: {
4754
+ type: "string",
4755
+ "enum": [
4756
+ "",
4757
+ "shutter"
4758
+ ]
4759
+ }
4760
+ },
4761
+ required: [
4762
+ "name",
4763
+ "body",
4764
+ "choices",
4765
+ "snapshot",
4766
+ "start",
4767
+ "end"
4768
+ ],
4769
+ additionalProperties: false
4770
+ }
4771
+ };
4772
+ var proposal = {
4773
+ $schema: $schema$1,
4774
+ $ref: $ref$1,
4775
+ definitions: definitions$1
4776
+ };
4777
+
4778
+ var $schema$2 = "http://json-schema.org/draft-07/schema#";
4779
+ var $ref$2 = "#/definitions/UpdateProposal";
4780
+ var definitions$2 = {
4781
+ UpdateProposal: {
4782
+ title: "Update Proposal",
4783
+ type: "object",
4784
+ properties: {
4785
+ proposal: {
4786
+ type: "string",
4787
+ title: "proposal id"
4788
+ },
4789
+ name: {
4790
+ type: "string",
4791
+ title: "name",
4792
+ minLength: 1,
4793
+ maxLength: 256
4794
+ },
4795
+ body: {
4796
+ type: "string",
4797
+ title: "body",
4798
+ minLength: 0
4799
+ },
4800
+ discussion: {
4801
+ type: "string",
4802
+ format: "customUrl",
4803
+ title: "discussion",
4804
+ maxLength: 256
4805
+ },
4806
+ choices: {
4807
+ type: "array",
4808
+ title: "choices",
4809
+ minItems: 1
4810
+ },
4811
+ labels: {
4812
+ type: "array",
4813
+ title: "labels",
4814
+ maxItems: 10,
4815
+ uniqueItems: true,
4816
+ items: {
4817
+ type: "string",
4818
+ minLength: 1,
4819
+ maxLength: 8,
4820
+ pattern: "^[a-zA-Z0-9]+$"
4821
+ }
4822
+ },
4823
+ type: {
4824
+ "enum": [
4825
+ "single-choice",
4826
+ "approval",
4827
+ "ranked-choice",
4828
+ "quadratic",
4829
+ "weighted",
4830
+ "custom",
4831
+ "basic"
4832
+ ]
4833
+ },
4834
+ metadata: {
4835
+ type: "object",
4836
+ title: "metadata"
4837
+ },
4838
+ privacy: {
4839
+ type: "string",
4840
+ "enum": [
4841
+ "",
4842
+ "shutter"
4843
+ ]
4844
+ }
4845
+ },
4846
+ required: [
4847
+ "proposal",
4848
+ "name",
4849
+ "body",
4850
+ "discussion",
4851
+ "choices",
4852
+ "type",
4853
+ "metadata"
4854
+ ],
4855
+ additionalProperties: false
4856
+ }
4857
+ };
4858
+ var updateProposal = {
4859
+ $schema: $schema$2,
4860
+ $ref: $ref$2,
4861
+ definitions: definitions$2
4862
+ };
4863
+
4864
+ var $schema$3 = "http://json-schema.org/draft-07/schema#";
4865
+ var $ref$3 = "#/definitions/Vote";
4866
+ var definitions$3 = {
4867
+ Vote: {
4868
+ title: "Vote",
4869
+ type: "object",
4870
+ properties: {
4871
+ proposal: {
4872
+ type: "string",
4873
+ title: "proposal"
4874
+ },
4875
+ choice: {
4876
+ type: [
4877
+ "number",
4878
+ "array",
4879
+ "object",
4880
+ "boolean",
4881
+ "string"
4882
+ ],
4883
+ title: "choice"
4884
+ },
4885
+ metadata: {
4886
+ type: "object",
4887
+ title: "metadata"
4888
+ },
4889
+ reason: {
4890
+ type: "string",
4891
+ title: "reason",
4892
+ maxLength: 5000
4893
+ },
4894
+ app: {
4895
+ type: "string",
4896
+ title: "app",
4897
+ maxLength: 24
4898
+ }
4899
+ },
4900
+ required: [
4901
+ "proposal",
4902
+ "choice"
4903
+ ],
4904
+ additionalProperties: false
4905
+ }
4906
+ };
4907
+ var vote = {
4908
+ $schema: $schema$3,
4909
+ $ref: $ref$3,
4910
+ definitions: definitions$3
4911
+ };
4912
+
4913
+ var $schema$4 = "http://json-schema.org/draft-07/schema#";
4914
+ var $ref$4 = "#/definitions/Profile";
4915
+ var definitions$4 = {
4916
+ Profile: {
4917
+ title: "Profile",
4918
+ type: "object",
4919
+ properties: {
4920
+ name: {
4921
+ type: "string",
4922
+ title: "name",
4923
+ maxLength: 32
4924
+ },
4925
+ about: {
4926
+ type: "string",
4927
+ title: "about",
4928
+ maxLength: 256
4929
+ },
4930
+ avatar: {
4931
+ type: "string",
4932
+ title: "avatar",
4933
+ format: "customUrl",
4934
+ maxLength: 256
4935
+ },
4936
+ cover: {
4937
+ type: "string",
4938
+ title: "avatar",
4939
+ format: "customUrl",
4940
+ maxLength: 256
4941
+ },
4942
+ twitter: {
4943
+ type: "string",
4944
+ title: "twitter",
4945
+ pattern: "^[A-Za-z0-9_]*$",
4946
+ maxLength: 15
4947
+ },
4948
+ github: {
4949
+ type: "string",
4950
+ title: "github",
4951
+ pattern: "^[A-Za-z0-9_-]*$",
4952
+ maxLength: 39
4953
+ },
4954
+ lens: {
4955
+ type: "string",
4956
+ title: "lens",
4957
+ pattern: "^[A-Za-z0-9_]*$",
4958
+ maxLength: 26
4959
+ },
4960
+ farcaster: {
4961
+ type: "string",
4962
+ title: "farcaster",
4963
+ pattern: "^[a-z0-9-]*$",
4964
+ maxLength: 17
4965
+ }
4966
+ },
4967
+ required: [
4968
+ ],
4969
+ additionalProperties: false
4970
+ }
4971
+ };
4972
+ var profile = {
4973
+ $schema: $schema$4,
4974
+ $ref: $ref$4,
4975
+ definitions: definitions$4
4976
+ };
4977
+
4978
+ var $schema$5 = "http://json-schema.org/draft-07/schema#";
4979
+ var $ref$5 = "#/definitions/Statement";
4980
+ var definitions$5 = {
4981
+ Statement: {
4982
+ title: "Statement",
4983
+ type: "object",
4984
+ properties: {
4985
+ about: {
4986
+ type: "string",
4987
+ format: "long",
4988
+ title: "About",
4989
+ maxLength: 140
4990
+ },
4991
+ statement: {
4992
+ type: "string",
4993
+ format: "long",
4994
+ title: "Statement",
4995
+ maxLength: 10000
4996
+ },
4997
+ discourse: {
4998
+ type: "string",
4999
+ title: "discourse",
5000
+ pattern: "^[A-Za-z0-9-_.]*$",
5001
+ maxLength: 30
5002
+ },
5003
+ network: {
5004
+ type: "string",
5005
+ title: "network",
5006
+ pattern: "^[a-z0-9-]*$",
5007
+ maxLength: 24
5008
+ },
5009
+ status: {
5010
+ "enum": [
5011
+ "ACTIVE",
5012
+ "INACTIVE"
5013
+ ],
5014
+ title: "status"
5015
+ }
5016
+ },
5017
+ required: [
5018
+ ],
5019
+ additionalProperties: false
5020
+ }
5021
+ };
5022
+ var statement = {
5023
+ $schema: $schema$5,
5024
+ $ref: $ref$5,
5025
+ definitions: definitions$5
5026
+ };
5027
+
5028
+ var $schema$6 = "http://json-schema.org/draft-07/schema#";
5029
+ var $ref$6 = "#/definitions/Zodiac";
5030
+ var definitions$6 = {
5031
+ Zodiac: {
5032
+ title: "Zodiac",
5033
+ type: "object",
5034
+ properties: {
5035
+ safes: {
5036
+ title: "Safe(s)",
5037
+ type: "array",
5038
+ maxItems: 8,
5039
+ items: {
5040
+ type: "object",
5041
+ properties: {
5042
+ network: {
5043
+ title: "Network",
5044
+ type: "string",
5045
+ snapshotNetwork: true
5046
+ },
5047
+ multisend: {
5048
+ title: "Multisend contract address",
5049
+ type: "string"
5050
+ },
5051
+ realityAddress: {
5052
+ title: "Reality module address",
5053
+ type: "string"
5054
+ },
5055
+ umaAddress: {
5056
+ title: "UMA module address",
5057
+ type: "string"
5058
+ }
5059
+ },
5060
+ additionalProperties: false
5061
+ }
5062
+ },
5063
+ additionalProperties: false
5064
+ }
5065
+ }
5066
+ };
5067
+ var zodiac = {
5068
+ $schema: $schema$6,
5069
+ $ref: $ref$6,
5070
+ definitions: definitions$6
5071
+ };
5072
+
5073
+ var $schema$7 = "http://json-schema.org/draft-07/schema#";
5074
+ var $ref$7 = "#/definitions/Alias";
5075
+ var definitions$7 = {
5076
+ Alias: {
5077
+ title: "Alias",
5078
+ type: "object",
5079
+ properties: {
5080
+ alias: {
5081
+ type: "string",
5082
+ format: "address"
5083
+ }
5084
+ },
5085
+ required: [
5086
+ "alias"
5087
+ ],
5088
+ additionalProperties: false
5089
+ }
5090
+ };
5091
+ var alias = {
5092
+ $schema: $schema$7,
5093
+ $ref: $ref$7,
5094
+ definitions: definitions$7
5095
+ };
5096
+
5097
+ var schemas = {
5098
+ space: space.definitions.Space,
5099
+ proposal: proposal.definitions.Proposal,
5100
+ updateProposal: updateProposal.definitions.UpdateProposal,
5101
+ vote: vote.definitions.Vote,
5102
+ profile: profile.definitions.Profile,
5103
+ statement: statement.definitions.Statement,
5104
+ zodiac: zodiac.definitions.Zodiac,
5105
+ alias: alias.definitions.Alias
5106
+ };
5107
+
5065
5108
  var index = {
5066
5109
  Client: Client,
5067
5110
  Client712: Client,