@snapshot-labs/snapshot.js 0.6.1 → 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 +33 -0
- package/dist/snapshot.esm.js +33 -0
- package/dist/snapshot.min.js +5 -5
- package/package.json +1 -1
- package/src/networks.json +14 -0
- 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/networks.json
CHANGED
|
@@ -1918,6 +1918,20 @@
|
|
|
1918
1918
|
"start": 3368046,
|
|
1919
1919
|
"logo": "ipfs://QmSxXjvWng3Diz4YwXDV2VqSPgMyzLYBNfkjJcr7rzkxom"
|
|
1920
1920
|
},
|
|
1921
|
+
"29548": {
|
|
1922
|
+
"key": "29548",
|
|
1923
|
+
"name": "MCH Verse ",
|
|
1924
|
+
"shortName": "mainnet",
|
|
1925
|
+
"chainId": 29548,
|
|
1926
|
+
"network": "mainnet",
|
|
1927
|
+
"multicall": "0x1d39652386488CE1fE4254E105F5A42a04d43dB2",
|
|
1928
|
+
"rpc": [],
|
|
1929
|
+
"explorer": {
|
|
1930
|
+
"url": "https://explorer.oasys.mycryptoheroes.net"
|
|
1931
|
+
},
|
|
1932
|
+
"start": 27458402,
|
|
1933
|
+
"logo": "ipfs://QmZZnwR1y6cU1sare2TQmwqkNDLXQxD4GdPrmHLmUoPtbU"
|
|
1934
|
+
},
|
|
1921
1935
|
"32659": {
|
|
1922
1936
|
"key": "32659",
|
|
1923
1937
|
"name": "Fusion Mainnet",
|
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' },
|