@snapshot-labs/snapshot.js 0.12.65 → 0.13.1

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