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