@snapshot-labs/snapshot.js 0.3.57-beta1 → 0.3.58
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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/client.d.ts +2 -1
- package/dist/index.d.ts +5 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/sign/types.d.ts +1 -0
- package/dist/snapshot.cjs.js +14 -4
- package/dist/snapshot.esm.js +14 -4
- package/dist/snapshot.min.js +7 -7
- package/package.json +1 -1
- package/src/client.ts +2 -0
- package/src/schemas/proposal.json +5 -0
- package/src/sign/index.ts +1 -0
- package/src/sign/types.json +1 -0
- package/src/sign/types.ts +2 -0
- package/src/utils.ts +1 -1
- package/src/dist/utils.js +0 -346
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/dist/client.d.ts
CHANGED
|
@@ -12,9 +12,10 @@ export default class Client {
|
|
|
12
12
|
choice: any;
|
|
13
13
|
metadata?: {} | undefined;
|
|
14
14
|
}): Promise<unknown>;
|
|
15
|
-
proposal(web3: Web3Provider, address: string, space: string, { name, body, choices, start, end, snapshot, type, metadata }: {
|
|
15
|
+
proposal(web3: Web3Provider, address: string, space: string, { name, body, discussion, choices, start, end, snapshot, type, metadata }: {
|
|
16
16
|
name: any;
|
|
17
17
|
body: any;
|
|
18
|
+
discussion?: string | undefined;
|
|
18
19
|
choices: any;
|
|
19
20
|
start: any;
|
|
20
21
|
end: any;
|
package/dist/index.d.ts
CHANGED
package/dist/schemas/index.d.ts
CHANGED
package/dist/sign/types.d.ts
CHANGED
package/dist/snapshot.cjs.js
CHANGED
|
@@ -123,6 +123,7 @@ var proposalTypes = {
|
|
|
123
123
|
{ name: 'type', type: 'string' },
|
|
124
124
|
{ name: 'title', type: 'string' },
|
|
125
125
|
{ name: 'body', type: 'string' },
|
|
126
|
+
{ name: 'discussion', type: 'string' },
|
|
126
127
|
{ name: 'choices', type: 'string[]' },
|
|
127
128
|
{ name: 'start', type: 'uint64' },
|
|
128
129
|
{ name: 'end', type: 'uint64' },
|
|
@@ -318,7 +319,10 @@ var Client = /** @class */ (function () {
|
|
|
318
319
|
return __awaiter(this, void 0, void 0, function () {
|
|
319
320
|
return __generator(this, function (_a) {
|
|
320
321
|
switch (_a.label) {
|
|
321
|
-
case 0:
|
|
322
|
+
case 0:
|
|
323
|
+
if (!message.discussion)
|
|
324
|
+
message.discussion = '';
|
|
325
|
+
return [4 /*yield*/, this.sign(web3, address, message, proposalTypes)];
|
|
322
326
|
case 1: return [2 /*return*/, _a.sent()];
|
|
323
327
|
}
|
|
324
328
|
});
|
|
@@ -549,12 +553,13 @@ var Client$1 = /** @class */ (function () {
|
|
|
549
553
|
});
|
|
550
554
|
};
|
|
551
555
|
Client.prototype.proposal = function (web3, address, space, _a) {
|
|
552
|
-
var name = _a.name, body = _a.body, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot,
|
|
556
|
+
var name = _a.name, body = _a.body, _b = _a.discussion, discussion = _b === void 0 ? '' : _b, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot, _c = _a.type, type = _c === void 0 ? 'single-choice' : _c, _d = _a.metadata, metadata = _d === void 0 ? {} : _d;
|
|
553
557
|
return __awaiter(this, void 0, void 0, function () {
|
|
554
|
-
return __generator(this, function (
|
|
558
|
+
return __generator(this, function (_e) {
|
|
555
559
|
return [2 /*return*/, this.broadcast(web3, address, space, 'proposal', {
|
|
556
560
|
name: name,
|
|
557
561
|
body: body,
|
|
562
|
+
discussion: discussion,
|
|
558
563
|
choices: choices,
|
|
559
564
|
start: start,
|
|
560
565
|
end: end,
|
|
@@ -847,6 +852,11 @@ var definitions$1 = {
|
|
|
847
852
|
minLength: 0,
|
|
848
853
|
maxLength: 14400
|
|
849
854
|
},
|
|
855
|
+
discussion: {
|
|
856
|
+
type: "string",
|
|
857
|
+
title: "discussion",
|
|
858
|
+
maxLength: 256
|
|
859
|
+
},
|
|
850
860
|
choices: {
|
|
851
861
|
type: "array",
|
|
852
862
|
title: "choices",
|
|
@@ -2642,7 +2652,7 @@ var voting = {
|
|
|
2642
2652
|
};
|
|
2643
2653
|
|
|
2644
2654
|
var SNAPSHOT_SUBGRAPH_URL = {
|
|
2645
|
-
'1': 'https://gateway.thegraph.com/api/
|
|
2655
|
+
'1': 'https://gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/subgraphs/id/3Q4vnuSqemXnSNHoiLD7wdBbGCXszUYnUbTz191kDMNn',
|
|
2646
2656
|
'4': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-rinkeby',
|
|
2647
2657
|
'42': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-kovan',
|
|
2648
2658
|
'97': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain',
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -114,6 +114,7 @@ var proposalTypes = {
|
|
|
114
114
|
{ name: 'type', type: 'string' },
|
|
115
115
|
{ name: 'title', type: 'string' },
|
|
116
116
|
{ name: 'body', type: 'string' },
|
|
117
|
+
{ name: 'discussion', type: 'string' },
|
|
117
118
|
{ name: 'choices', type: 'string[]' },
|
|
118
119
|
{ name: 'start', type: 'uint64' },
|
|
119
120
|
{ name: 'end', type: 'uint64' },
|
|
@@ -309,7 +310,10 @@ var Client = /** @class */ (function () {
|
|
|
309
310
|
return __awaiter(this, void 0, void 0, function () {
|
|
310
311
|
return __generator(this, function (_a) {
|
|
311
312
|
switch (_a.label) {
|
|
312
|
-
case 0:
|
|
313
|
+
case 0:
|
|
314
|
+
if (!message.discussion)
|
|
315
|
+
message.discussion = '';
|
|
316
|
+
return [4 /*yield*/, this.sign(web3, address, message, proposalTypes)];
|
|
313
317
|
case 1: return [2 /*return*/, _a.sent()];
|
|
314
318
|
}
|
|
315
319
|
});
|
|
@@ -540,12 +544,13 @@ var Client$1 = /** @class */ (function () {
|
|
|
540
544
|
});
|
|
541
545
|
};
|
|
542
546
|
Client.prototype.proposal = function (web3, address, space, _a) {
|
|
543
|
-
var name = _a.name, body = _a.body, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot,
|
|
547
|
+
var name = _a.name, body = _a.body, _b = _a.discussion, discussion = _b === void 0 ? '' : _b, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot, _c = _a.type, type = _c === void 0 ? 'single-choice' : _c, _d = _a.metadata, metadata = _d === void 0 ? {} : _d;
|
|
544
548
|
return __awaiter(this, void 0, void 0, function () {
|
|
545
|
-
return __generator(this, function (
|
|
549
|
+
return __generator(this, function (_e) {
|
|
546
550
|
return [2 /*return*/, this.broadcast(web3, address, space, 'proposal', {
|
|
547
551
|
name: name,
|
|
548
552
|
body: body,
|
|
553
|
+
discussion: discussion,
|
|
549
554
|
choices: choices,
|
|
550
555
|
start: start,
|
|
551
556
|
end: end,
|
|
@@ -838,6 +843,11 @@ var definitions$1 = {
|
|
|
838
843
|
minLength: 0,
|
|
839
844
|
maxLength: 14400
|
|
840
845
|
},
|
|
846
|
+
discussion: {
|
|
847
|
+
type: "string",
|
|
848
|
+
title: "discussion",
|
|
849
|
+
maxLength: 256
|
|
850
|
+
},
|
|
841
851
|
choices: {
|
|
842
852
|
type: "array",
|
|
843
853
|
title: "choices",
|
|
@@ -2633,7 +2643,7 @@ var voting = {
|
|
|
2633
2643
|
};
|
|
2634
2644
|
|
|
2635
2645
|
var SNAPSHOT_SUBGRAPH_URL = {
|
|
2636
|
-
'1': 'https://gateway.thegraph.com/api/
|
|
2646
|
+
'1': 'https://gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/subgraphs/id/3Q4vnuSqemXnSNHoiLD7wdBbGCXszUYnUbTz191kDMNn',
|
|
2637
2647
|
'4': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-rinkeby',
|
|
2638
2648
|
'42': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-kovan',
|
|
2639
2649
|
'97': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain',
|