@snapshot-labs/snapshot.js 0.6.2 → 0.6.3
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/sign/index.d.ts +2 -1
- package/dist/sign/types.d.ts +12 -0
- package/dist/snapshot.cjs.js +18 -0
- package/dist/snapshot.esm.js +18 -0
- package/dist/snapshot.min.js +5 -5
- package/package.json +1 -1
- package/src/sign/index.ts +10 -0
- package/src/sign/types.json +1 -0
- package/src/sign/types.ts +16 -0
package/dist/sign/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Web3Provider } from '@ethersproject/providers';
|
|
2
2
|
import { Wallet } from '@ethersproject/wallet';
|
|
3
|
-
import { Space, Proposal, UpdateProposal, CancelProposal, Vote, Follow, Unfollow, Subscribe, Unsubscribe, Profile, Alias, DeleteSpace, Statement } from './types';
|
|
3
|
+
import { Space, Proposal, UpdateProposal, FlagProposal, CancelProposal, Vote, Follow, Unfollow, Subscribe, Unsubscribe, Profile, Alias, DeleteSpace, Statement } from './types';
|
|
4
4
|
export declare const domain: {
|
|
5
5
|
name: string;
|
|
6
6
|
version: string;
|
|
@@ -14,6 +14,7 @@ export default class Client {
|
|
|
14
14
|
space(web3: Web3Provider | Wallet, address: string, message: Space): Promise<unknown>;
|
|
15
15
|
proposal(web3: Web3Provider | Wallet, address: string, message: Proposal): Promise<unknown>;
|
|
16
16
|
updateProposal(web3: Web3Provider | Wallet, address: string, message: UpdateProposal): Promise<unknown>;
|
|
17
|
+
flagProposal(web3: Web3Provider | Wallet, address: string, message: FlagProposal): Promise<unknown>;
|
|
17
18
|
cancelProposal(web3: Web3Provider | Wallet, address: string, message: CancelProposal): Promise<unknown>;
|
|
18
19
|
vote(web3: Web3Provider | Wallet, address: string, message: Vote): Promise<unknown>;
|
|
19
20
|
follow(web3: Web3Provider | Wallet, address: string, message: Follow): Promise<unknown>;
|
package/dist/sign/types.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export interface UpdateProposal {
|
|
|
32
32
|
choices: string[];
|
|
33
33
|
plugins: string;
|
|
34
34
|
}
|
|
35
|
+
export interface FlagProposal {
|
|
36
|
+
from: string;
|
|
37
|
+
space: string;
|
|
38
|
+
proposal: string;
|
|
39
|
+
timestamp?: number;
|
|
40
|
+
}
|
|
35
41
|
export interface CancelProposal {
|
|
36
42
|
from?: string;
|
|
37
43
|
space: string;
|
|
@@ -112,6 +118,12 @@ export declare const updateProposalTypes: {
|
|
|
112
118
|
type: string;
|
|
113
119
|
}[];
|
|
114
120
|
};
|
|
121
|
+
export declare const flagProposalTypes: {
|
|
122
|
+
FlagProposal: {
|
|
123
|
+
name: string;
|
|
124
|
+
type: string;
|
|
125
|
+
}[];
|
|
126
|
+
};
|
|
115
127
|
export declare const cancelProposalTypes: {
|
|
116
128
|
CancelProposal: {
|
|
117
129
|
name: string;
|
package/dist/snapshot.cjs.js
CHANGED
|
@@ -159,6 +159,14 @@ var updateProposalTypes = {
|
|
|
159
159
|
{ name: 'plugins', type: 'string' }
|
|
160
160
|
]
|
|
161
161
|
};
|
|
162
|
+
var flagProposalTypes = {
|
|
163
|
+
FlagProposal: [
|
|
164
|
+
{ name: 'from', type: 'address' },
|
|
165
|
+
{ name: 'space', type: 'string' },
|
|
166
|
+
{ name: 'proposal', type: 'string' },
|
|
167
|
+
{ name: 'timestamp', type: 'uint64' }
|
|
168
|
+
]
|
|
169
|
+
};
|
|
162
170
|
var cancelProposalTypes = {
|
|
163
171
|
CancelProposal: [
|
|
164
172
|
{ name: 'from', type: 'address' },
|
|
@@ -418,6 +426,16 @@ var Client = /** @class */ (function () {
|
|
|
418
426
|
});
|
|
419
427
|
});
|
|
420
428
|
};
|
|
429
|
+
Client.prototype.flagProposal = function (web3, address, message) {
|
|
430
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
431
|
+
return __generator(this, function (_a) {
|
|
432
|
+
switch (_a.label) {
|
|
433
|
+
case 0: return [4 /*yield*/, this.sign(web3, address, message, flagProposalTypes)];
|
|
434
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
};
|
|
421
439
|
Client.prototype.cancelProposal = function (web3, address, message) {
|
|
422
440
|
return __awaiter(this, void 0, void 0, function () {
|
|
423
441
|
var type2;
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -150,6 +150,14 @@ var updateProposalTypes = {
|
|
|
150
150
|
{ name: 'plugins', type: 'string' }
|
|
151
151
|
]
|
|
152
152
|
};
|
|
153
|
+
var flagProposalTypes = {
|
|
154
|
+
FlagProposal: [
|
|
155
|
+
{ name: 'from', type: 'address' },
|
|
156
|
+
{ name: 'space', type: 'string' },
|
|
157
|
+
{ name: 'proposal', type: 'string' },
|
|
158
|
+
{ name: 'timestamp', type: 'uint64' }
|
|
159
|
+
]
|
|
160
|
+
};
|
|
153
161
|
var cancelProposalTypes = {
|
|
154
162
|
CancelProposal: [
|
|
155
163
|
{ name: 'from', type: 'address' },
|
|
@@ -409,6 +417,16 @@ var Client = /** @class */ (function () {
|
|
|
409
417
|
});
|
|
410
418
|
});
|
|
411
419
|
};
|
|
420
|
+
Client.prototype.flagProposal = function (web3, address, message) {
|
|
421
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
422
|
+
return __generator(this, function (_a) {
|
|
423
|
+
switch (_a.label) {
|
|
424
|
+
case 0: return [4 /*yield*/, this.sign(web3, address, message, flagProposalTypes)];
|
|
425
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
};
|
|
412
430
|
Client.prototype.cancelProposal = function (web3, address, message) {
|
|
413
431
|
return __awaiter(this, void 0, void 0, function () {
|
|
414
432
|
var type2;
|