@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/package.json
CHANGED
package/src/sign/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Space,
|
|
7
7
|
Proposal,
|
|
8
8
|
UpdateProposal,
|
|
9
|
+
FlagProposal,
|
|
9
10
|
CancelProposal,
|
|
10
11
|
Vote,
|
|
11
12
|
Follow,
|
|
@@ -19,6 +20,7 @@ import {
|
|
|
19
20
|
spaceTypes,
|
|
20
21
|
proposalTypes,
|
|
21
22
|
updateProposalTypes,
|
|
23
|
+
flagProposalTypes,
|
|
22
24
|
cancelProposalTypes,
|
|
23
25
|
cancelProposal2Types,
|
|
24
26
|
voteTypes,
|
|
@@ -121,6 +123,14 @@ export default class Client {
|
|
|
121
123
|
return await this.sign(web3, address, message, updateProposalTypes);
|
|
122
124
|
}
|
|
123
125
|
|
|
126
|
+
async flagProposal(
|
|
127
|
+
web3: Web3Provider | Wallet,
|
|
128
|
+
address: string,
|
|
129
|
+
message: FlagProposal
|
|
130
|
+
) {
|
|
131
|
+
return await this.sign(web3, address, message, flagProposalTypes);
|
|
132
|
+
}
|
|
133
|
+
|
|
124
134
|
async cancelProposal(
|
|
125
135
|
web3: Web3Provider | Wallet,
|
|
126
136
|
address: string,
|
package/src/sign/types.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"9ff8af4cfb586e2c7962d792b99328fb47e8a4e73cc89873c0980484bc1063a5": "delete-proposal",
|
|
6
6
|
"734df82cdad586386defa4cb55adda7cb1b2a56929c4e6c3dc676f9901947288": "delete-proposal",
|
|
7
7
|
"4e5fa89616761defa1274103441809c8445f8404306890ad36ec653d90201d58": "update-proposal",
|
|
8
|
+
"4bbf83a627c4afc26a1b9490127c1712d844fb0806131ee9860e7b298b0a828e": "flag-proposal",
|
|
8
9
|
"50084aae0fe117c83ddf855557dde35ae2872e9045443a15f72aa6c68ea3943b": "vote",
|
|
9
10
|
"1dfe3863f6333a85581fb150d4ee77c95a6d026c518ca1b11c08ae1d98acd598": "vote-array",
|
|
10
11
|
"1814c3dd303c5919ce488b924f92b9a42a0834972f514e55b1879fda48e67736": "vote-string",
|
package/src/sign/types.ts
CHANGED
|
@@ -42,6 +42,13 @@ export interface UpdateProposal {
|
|
|
42
42
|
plugins: string;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export interface FlagProposal {
|
|
46
|
+
from: string;
|
|
47
|
+
space: string;
|
|
48
|
+
proposal: string;
|
|
49
|
+
timestamp?: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
45
52
|
export interface CancelProposal {
|
|
46
53
|
from?: string;
|
|
47
54
|
space: string;
|
|
@@ -154,6 +161,15 @@ export const updateProposalTypes = {
|
|
|
154
161
|
]
|
|
155
162
|
};
|
|
156
163
|
|
|
164
|
+
export const flagProposalTypes = {
|
|
165
|
+
FlagProposal: [
|
|
166
|
+
{ name: 'from', type: 'address' },
|
|
167
|
+
{ name: 'space', type: 'string' },
|
|
168
|
+
{ name: 'proposal', type: 'string' },
|
|
169
|
+
{ name: 'timestamp', type: 'uint64' }
|
|
170
|
+
]
|
|
171
|
+
};
|
|
172
|
+
|
|
157
173
|
export const cancelProposalTypes = {
|
|
158
174
|
CancelProposal: [
|
|
159
175
|
{ name: 'from', type: 'address' },
|