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