@snapshot-labs/snapshot.js 0.3.92 → 0.3.93
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/client.d.ts +1 -2
- package/dist/sign/types.d.ts +0 -3
- package/dist/snapshot.cjs.js +10 -19
- package/dist/snapshot.esm.js +10 -19
- package/dist/snapshot.min.js +1 -1
- package/package.json +1 -1
- package/src/client.ts +2 -8
- package/src/sign/types.json +8 -1
- package/src/sign/types.ts +7 -18
package/dist/client.d.ts
CHANGED
|
@@ -7,10 +7,9 @@ export default class Client {
|
|
|
7
7
|
getSpaces(): Promise<unknown>;
|
|
8
8
|
broadcast(web3: Web3Provider, account: string, space: string, type: string, payload: any): Promise<unknown>;
|
|
9
9
|
sign(web3: Web3Provider, account: string, space: string, type: string, payload: any): Promise<any>;
|
|
10
|
-
vote(web3: Web3Provider, address: string, space: any, { proposal, choice
|
|
10
|
+
vote(web3: Web3Provider, address: string, space: any, { proposal, choice }: {
|
|
11
11
|
proposal: any;
|
|
12
12
|
choice: any;
|
|
13
|
-
metadata?: {} | undefined;
|
|
14
13
|
}): Promise<unknown>;
|
|
15
14
|
proposal(web3: Web3Provider, address: string, space: string, { name, body, discussion, choices, start, end, snapshot, type, metadata }: {
|
|
16
15
|
name: any;
|
package/dist/sign/types.d.ts
CHANGED
|
@@ -17,9 +17,7 @@ export interface Proposal {
|
|
|
17
17
|
end: number;
|
|
18
18
|
snapshot: number;
|
|
19
19
|
network: string;
|
|
20
|
-
strategies: string;
|
|
21
20
|
plugins: string;
|
|
22
|
-
metadata: string;
|
|
23
21
|
}
|
|
24
22
|
export interface CancelProposal {
|
|
25
23
|
from?: string;
|
|
@@ -34,7 +32,6 @@ export interface Vote {
|
|
|
34
32
|
proposal: string;
|
|
35
33
|
type: string;
|
|
36
34
|
choice: number | number[] | string;
|
|
37
|
-
metadata: string;
|
|
38
35
|
}
|
|
39
36
|
export interface Follow {
|
|
40
37
|
from?: string;
|
package/dist/snapshot.cjs.js
CHANGED
|
@@ -129,9 +129,7 @@ var proposalTypes = {
|
|
|
129
129
|
{ name: 'end', type: 'uint64' },
|
|
130
130
|
{ name: 'snapshot', type: 'uint64' },
|
|
131
131
|
{ name: 'network', type: 'string' },
|
|
132
|
-
{ name: '
|
|
133
|
-
{ name: 'plugins', type: 'string' },
|
|
134
|
-
{ name: 'metadata', type: 'string' }
|
|
132
|
+
{ name: 'plugins', type: 'string' }
|
|
135
133
|
]
|
|
136
134
|
};
|
|
137
135
|
var cancelProposalTypes = {
|
|
@@ -156,8 +154,7 @@ var voteTypes = {
|
|
|
156
154
|
{ name: 'space', type: 'string' },
|
|
157
155
|
{ name: 'timestamp', type: 'uint64' },
|
|
158
156
|
{ name: 'proposal', type: 'string' },
|
|
159
|
-
{ name: 'choice', type: 'uint32' }
|
|
160
|
-
{ name: 'metadata', type: 'string' }
|
|
157
|
+
{ name: 'choice', type: 'uint32' }
|
|
161
158
|
]
|
|
162
159
|
};
|
|
163
160
|
var voteArrayTypes = {
|
|
@@ -166,8 +163,7 @@ var voteArrayTypes = {
|
|
|
166
163
|
{ name: 'space', type: 'string' },
|
|
167
164
|
{ name: 'timestamp', type: 'uint64' },
|
|
168
165
|
{ name: 'proposal', type: 'string' },
|
|
169
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
170
|
-
{ name: 'metadata', type: 'string' }
|
|
166
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
171
167
|
]
|
|
172
168
|
};
|
|
173
169
|
var voteStringTypes = {
|
|
@@ -176,8 +172,7 @@ var voteStringTypes = {
|
|
|
176
172
|
{ name: 'space', type: 'string' },
|
|
177
173
|
{ name: 'timestamp', type: 'uint64' },
|
|
178
174
|
{ name: 'proposal', type: 'string' },
|
|
179
|
-
{ name: 'choice', type: 'string' }
|
|
180
|
-
{ name: 'metadata', type: 'string' }
|
|
175
|
+
{ name: 'choice', type: 'string' }
|
|
181
176
|
]
|
|
182
177
|
};
|
|
183
178
|
var vote2Types = {
|
|
@@ -186,8 +181,7 @@ var vote2Types = {
|
|
|
186
181
|
{ name: 'space', type: 'string' },
|
|
187
182
|
{ name: 'timestamp', type: 'uint64' },
|
|
188
183
|
{ name: 'proposal', type: 'bytes32' },
|
|
189
|
-
{ name: 'choice', type: 'uint32' }
|
|
190
|
-
{ name: 'metadata', type: 'string' }
|
|
184
|
+
{ name: 'choice', type: 'uint32' }
|
|
191
185
|
]
|
|
192
186
|
};
|
|
193
187
|
var voteArray2Types = {
|
|
@@ -196,8 +190,7 @@ var voteArray2Types = {
|
|
|
196
190
|
{ name: 'space', type: 'string' },
|
|
197
191
|
{ name: 'timestamp', type: 'uint64' },
|
|
198
192
|
{ name: 'proposal', type: 'bytes32' },
|
|
199
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
200
|
-
{ name: 'metadata', type: 'string' }
|
|
193
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
201
194
|
]
|
|
202
195
|
};
|
|
203
196
|
var voteString2Types = {
|
|
@@ -206,8 +199,7 @@ var voteString2Types = {
|
|
|
206
199
|
{ name: 'space', type: 'string' },
|
|
207
200
|
{ name: 'timestamp', type: 'uint64' },
|
|
208
201
|
{ name: 'proposal', type: 'bytes32' },
|
|
209
|
-
{ name: 'choice', type: 'string' }
|
|
210
|
-
{ name: 'metadata', type: 'string' }
|
|
202
|
+
{ name: 'choice', type: 'string' }
|
|
211
203
|
]
|
|
212
204
|
};
|
|
213
205
|
var followTypes = {
|
|
@@ -558,13 +550,12 @@ var Client$1 = /** @class */ (function () {
|
|
|
558
550
|
});
|
|
559
551
|
};
|
|
560
552
|
Client.prototype.vote = function (web3, address, space, _a) {
|
|
561
|
-
var proposal = _a.proposal, choice = _a.choice
|
|
553
|
+
var proposal = _a.proposal, choice = _a.choice;
|
|
562
554
|
return __awaiter(this, void 0, void 0, function () {
|
|
563
|
-
return __generator(this, function (
|
|
555
|
+
return __generator(this, function (_b) {
|
|
564
556
|
return [2 /*return*/, this.broadcast(web3, address, space, 'vote', {
|
|
565
557
|
proposal: proposal,
|
|
566
|
-
choice: choice
|
|
567
|
-
metadata: metadata
|
|
558
|
+
choice: choice
|
|
568
559
|
})];
|
|
569
560
|
});
|
|
570
561
|
});
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -120,9 +120,7 @@ var proposalTypes = {
|
|
|
120
120
|
{ name: 'end', type: 'uint64' },
|
|
121
121
|
{ name: 'snapshot', type: 'uint64' },
|
|
122
122
|
{ name: 'network', type: 'string' },
|
|
123
|
-
{ name: '
|
|
124
|
-
{ name: 'plugins', type: 'string' },
|
|
125
|
-
{ name: 'metadata', type: 'string' }
|
|
123
|
+
{ name: 'plugins', type: 'string' }
|
|
126
124
|
]
|
|
127
125
|
};
|
|
128
126
|
var cancelProposalTypes = {
|
|
@@ -147,8 +145,7 @@ var voteTypes = {
|
|
|
147
145
|
{ name: 'space', type: 'string' },
|
|
148
146
|
{ name: 'timestamp', type: 'uint64' },
|
|
149
147
|
{ name: 'proposal', type: 'string' },
|
|
150
|
-
{ name: 'choice', type: 'uint32' }
|
|
151
|
-
{ name: 'metadata', type: 'string' }
|
|
148
|
+
{ name: 'choice', type: 'uint32' }
|
|
152
149
|
]
|
|
153
150
|
};
|
|
154
151
|
var voteArrayTypes = {
|
|
@@ -157,8 +154,7 @@ var voteArrayTypes = {
|
|
|
157
154
|
{ name: 'space', type: 'string' },
|
|
158
155
|
{ name: 'timestamp', type: 'uint64' },
|
|
159
156
|
{ name: 'proposal', type: 'string' },
|
|
160
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
161
|
-
{ name: 'metadata', type: 'string' }
|
|
157
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
162
158
|
]
|
|
163
159
|
};
|
|
164
160
|
var voteStringTypes = {
|
|
@@ -167,8 +163,7 @@ var voteStringTypes = {
|
|
|
167
163
|
{ name: 'space', type: 'string' },
|
|
168
164
|
{ name: 'timestamp', type: 'uint64' },
|
|
169
165
|
{ name: 'proposal', type: 'string' },
|
|
170
|
-
{ name: 'choice', type: 'string' }
|
|
171
|
-
{ name: 'metadata', type: 'string' }
|
|
166
|
+
{ name: 'choice', type: 'string' }
|
|
172
167
|
]
|
|
173
168
|
};
|
|
174
169
|
var vote2Types = {
|
|
@@ -177,8 +172,7 @@ var vote2Types = {
|
|
|
177
172
|
{ name: 'space', type: 'string' },
|
|
178
173
|
{ name: 'timestamp', type: 'uint64' },
|
|
179
174
|
{ name: 'proposal', type: 'bytes32' },
|
|
180
|
-
{ name: 'choice', type: 'uint32' }
|
|
181
|
-
{ name: 'metadata', type: 'string' }
|
|
175
|
+
{ name: 'choice', type: 'uint32' }
|
|
182
176
|
]
|
|
183
177
|
};
|
|
184
178
|
var voteArray2Types = {
|
|
@@ -187,8 +181,7 @@ var voteArray2Types = {
|
|
|
187
181
|
{ name: 'space', type: 'string' },
|
|
188
182
|
{ name: 'timestamp', type: 'uint64' },
|
|
189
183
|
{ name: 'proposal', type: 'bytes32' },
|
|
190
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
191
|
-
{ name: 'metadata', type: 'string' }
|
|
184
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
192
185
|
]
|
|
193
186
|
};
|
|
194
187
|
var voteString2Types = {
|
|
@@ -197,8 +190,7 @@ var voteString2Types = {
|
|
|
197
190
|
{ name: 'space', type: 'string' },
|
|
198
191
|
{ name: 'timestamp', type: 'uint64' },
|
|
199
192
|
{ name: 'proposal', type: 'bytes32' },
|
|
200
|
-
{ name: 'choice', type: 'string' }
|
|
201
|
-
{ name: 'metadata', type: 'string' }
|
|
193
|
+
{ name: 'choice', type: 'string' }
|
|
202
194
|
]
|
|
203
195
|
};
|
|
204
196
|
var followTypes = {
|
|
@@ -549,13 +541,12 @@ var Client$1 = /** @class */ (function () {
|
|
|
549
541
|
});
|
|
550
542
|
};
|
|
551
543
|
Client.prototype.vote = function (web3, address, space, _a) {
|
|
552
|
-
var proposal = _a.proposal, choice = _a.choice
|
|
544
|
+
var proposal = _a.proposal, choice = _a.choice;
|
|
553
545
|
return __awaiter(this, void 0, void 0, function () {
|
|
554
|
-
return __generator(this, function (
|
|
546
|
+
return __generator(this, function (_b) {
|
|
555
547
|
return [2 /*return*/, this.broadcast(web3, address, space, 'vote', {
|
|
556
548
|
proposal: proposal,
|
|
557
|
-
choice: choice
|
|
558
|
-
metadata: metadata
|
|
549
|
+
choice: choice
|
|
559
550
|
})];
|
|
560
551
|
});
|
|
561
552
|
});
|