@snapshot-labs/snapshot.js 0.3.92 → 0.3.95
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 -4
- package/dist/snapshot.cjs.js +25 -20
- package/dist/snapshot.esm.js +25 -20
- package/dist/snapshot.min.js +2 -2
- package/package.json +1 -1
- package/src/client.ts +2 -8
- package/src/networks.json +15 -0
- package/src/sign/types.json +9 -1
- package/src/sign/types.ts +7 -20
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
|
@@ -16,10 +16,7 @@ export interface Proposal {
|
|
|
16
16
|
start: number;
|
|
17
17
|
end: number;
|
|
18
18
|
snapshot: number;
|
|
19
|
-
network: string;
|
|
20
|
-
strategies: string;
|
|
21
19
|
plugins: string;
|
|
22
|
-
metadata: string;
|
|
23
20
|
}
|
|
24
21
|
export interface CancelProposal {
|
|
25
22
|
from?: string;
|
|
@@ -34,7 +31,6 @@ export interface Vote {
|
|
|
34
31
|
proposal: string;
|
|
35
32
|
type: string;
|
|
36
33
|
choice: number | number[] | string;
|
|
37
|
-
metadata: string;
|
|
38
34
|
}
|
|
39
35
|
export interface Follow {
|
|
40
36
|
from?: string;
|
package/dist/snapshot.cjs.js
CHANGED
|
@@ -128,10 +128,7 @@ var proposalTypes = {
|
|
|
128
128
|
{ name: 'start', type: 'uint64' },
|
|
129
129
|
{ name: 'end', type: 'uint64' },
|
|
130
130
|
{ name: 'snapshot', type: 'uint64' },
|
|
131
|
-
{ name: '
|
|
132
|
-
{ name: 'strategies', type: 'string' },
|
|
133
|
-
{ name: 'plugins', type: 'string' },
|
|
134
|
-
{ name: 'metadata', type: 'string' }
|
|
131
|
+
{ name: 'plugins', type: 'string' }
|
|
135
132
|
]
|
|
136
133
|
};
|
|
137
134
|
var cancelProposalTypes = {
|
|
@@ -156,8 +153,7 @@ var voteTypes = {
|
|
|
156
153
|
{ name: 'space', type: 'string' },
|
|
157
154
|
{ name: 'timestamp', type: 'uint64' },
|
|
158
155
|
{ name: 'proposal', type: 'string' },
|
|
159
|
-
{ name: 'choice', type: 'uint32' }
|
|
160
|
-
{ name: 'metadata', type: 'string' }
|
|
156
|
+
{ name: 'choice', type: 'uint32' }
|
|
161
157
|
]
|
|
162
158
|
};
|
|
163
159
|
var voteArrayTypes = {
|
|
@@ -166,8 +162,7 @@ var voteArrayTypes = {
|
|
|
166
162
|
{ name: 'space', type: 'string' },
|
|
167
163
|
{ name: 'timestamp', type: 'uint64' },
|
|
168
164
|
{ name: 'proposal', type: 'string' },
|
|
169
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
170
|
-
{ name: 'metadata', type: 'string' }
|
|
165
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
171
166
|
]
|
|
172
167
|
};
|
|
173
168
|
var voteStringTypes = {
|
|
@@ -176,8 +171,7 @@ var voteStringTypes = {
|
|
|
176
171
|
{ name: 'space', type: 'string' },
|
|
177
172
|
{ name: 'timestamp', type: 'uint64' },
|
|
178
173
|
{ name: 'proposal', type: 'string' },
|
|
179
|
-
{ name: 'choice', type: 'string' }
|
|
180
|
-
{ name: 'metadata', type: 'string' }
|
|
174
|
+
{ name: 'choice', type: 'string' }
|
|
181
175
|
]
|
|
182
176
|
};
|
|
183
177
|
var vote2Types = {
|
|
@@ -186,8 +180,7 @@ var vote2Types = {
|
|
|
186
180
|
{ name: 'space', type: 'string' },
|
|
187
181
|
{ name: 'timestamp', type: 'uint64' },
|
|
188
182
|
{ name: 'proposal', type: 'bytes32' },
|
|
189
|
-
{ name: 'choice', type: 'uint32' }
|
|
190
|
-
{ name: 'metadata', type: 'string' }
|
|
183
|
+
{ name: 'choice', type: 'uint32' }
|
|
191
184
|
]
|
|
192
185
|
};
|
|
193
186
|
var voteArray2Types = {
|
|
@@ -196,8 +189,7 @@ var voteArray2Types = {
|
|
|
196
189
|
{ name: 'space', type: 'string' },
|
|
197
190
|
{ name: 'timestamp', type: 'uint64' },
|
|
198
191
|
{ name: 'proposal', type: 'bytes32' },
|
|
199
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
200
|
-
{ name: 'metadata', type: 'string' }
|
|
192
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
201
193
|
]
|
|
202
194
|
};
|
|
203
195
|
var voteString2Types = {
|
|
@@ -206,8 +198,7 @@ var voteString2Types = {
|
|
|
206
198
|
{ name: 'space', type: 'string' },
|
|
207
199
|
{ name: 'timestamp', type: 'uint64' },
|
|
208
200
|
{ name: 'proposal', type: 'bytes32' },
|
|
209
|
-
{ name: 'choice', type: 'string' }
|
|
210
|
-
{ name: 'metadata', type: 'string' }
|
|
201
|
+
{ name: 'choice', type: 'string' }
|
|
211
202
|
]
|
|
212
203
|
};
|
|
213
204
|
var followTypes = {
|
|
@@ -558,13 +549,12 @@ var Client$1 = /** @class */ (function () {
|
|
|
558
549
|
});
|
|
559
550
|
};
|
|
560
551
|
Client.prototype.vote = function (web3, address, space, _a) {
|
|
561
|
-
var proposal = _a.proposal, choice = _a.choice
|
|
552
|
+
var proposal = _a.proposal, choice = _a.choice;
|
|
562
553
|
return __awaiter(this, void 0, void 0, function () {
|
|
563
|
-
return __generator(this, function (
|
|
554
|
+
return __generator(this, function (_b) {
|
|
564
555
|
return [2 /*return*/, this.broadcast(web3, address, space, 'vote', {
|
|
565
556
|
proposal: proposal,
|
|
566
|
-
choice: choice
|
|
567
|
-
metadata: metadata
|
|
557
|
+
choice: choice
|
|
568
558
|
})];
|
|
569
559
|
});
|
|
570
560
|
});
|
|
@@ -1739,6 +1729,21 @@ var networks = {
|
|
|
1739
1729
|
explorer: "https://hscan.org",
|
|
1740
1730
|
start: 13960096,
|
|
1741
1731
|
logo: "ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"
|
|
1732
|
+
},
|
|
1733
|
+
"280": {
|
|
1734
|
+
key: "280",
|
|
1735
|
+
name: "zkSync 2 testnet",
|
|
1736
|
+
shortName: "zkSync2",
|
|
1737
|
+
chainId: 280,
|
|
1738
|
+
network: "zkSync alpha testnet",
|
|
1739
|
+
testnet: true,
|
|
1740
|
+
multicall: "0xD2CF10EF0b64B2C9B7147740AEda677d3EfeD2f8",
|
|
1741
|
+
rpc: [
|
|
1742
|
+
"https://zksync2-testnet.zksync.dev"
|
|
1743
|
+
],
|
|
1744
|
+
explorer: "https://zksync2-testnet.zkscan.io/",
|
|
1745
|
+
start: 1374275,
|
|
1746
|
+
logo: "ipfs://QmPDbdmwpEeenaLHAbqcAerXdH9Z4Gfd7gm9M8tbkkjcAS"
|
|
1742
1747
|
},
|
|
1743
1748
|
"288": {
|
|
1744
1749
|
key: "288",
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -119,10 +119,7 @@ var proposalTypes = {
|
|
|
119
119
|
{ name: 'start', type: 'uint64' },
|
|
120
120
|
{ name: 'end', type: 'uint64' },
|
|
121
121
|
{ name: 'snapshot', type: 'uint64' },
|
|
122
|
-
{ name: '
|
|
123
|
-
{ name: 'strategies', type: 'string' },
|
|
124
|
-
{ name: 'plugins', type: 'string' },
|
|
125
|
-
{ name: 'metadata', type: 'string' }
|
|
122
|
+
{ name: 'plugins', type: 'string' }
|
|
126
123
|
]
|
|
127
124
|
};
|
|
128
125
|
var cancelProposalTypes = {
|
|
@@ -147,8 +144,7 @@ var voteTypes = {
|
|
|
147
144
|
{ name: 'space', type: 'string' },
|
|
148
145
|
{ name: 'timestamp', type: 'uint64' },
|
|
149
146
|
{ name: 'proposal', type: 'string' },
|
|
150
|
-
{ name: 'choice', type: 'uint32' }
|
|
151
|
-
{ name: 'metadata', type: 'string' }
|
|
147
|
+
{ name: 'choice', type: 'uint32' }
|
|
152
148
|
]
|
|
153
149
|
};
|
|
154
150
|
var voteArrayTypes = {
|
|
@@ -157,8 +153,7 @@ var voteArrayTypes = {
|
|
|
157
153
|
{ name: 'space', type: 'string' },
|
|
158
154
|
{ name: 'timestamp', type: 'uint64' },
|
|
159
155
|
{ name: 'proposal', type: 'string' },
|
|
160
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
161
|
-
{ name: 'metadata', type: 'string' }
|
|
156
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
162
157
|
]
|
|
163
158
|
};
|
|
164
159
|
var voteStringTypes = {
|
|
@@ -167,8 +162,7 @@ var voteStringTypes = {
|
|
|
167
162
|
{ name: 'space', type: 'string' },
|
|
168
163
|
{ name: 'timestamp', type: 'uint64' },
|
|
169
164
|
{ name: 'proposal', type: 'string' },
|
|
170
|
-
{ name: 'choice', type: 'string' }
|
|
171
|
-
{ name: 'metadata', type: 'string' }
|
|
165
|
+
{ name: 'choice', type: 'string' }
|
|
172
166
|
]
|
|
173
167
|
};
|
|
174
168
|
var vote2Types = {
|
|
@@ -177,8 +171,7 @@ var vote2Types = {
|
|
|
177
171
|
{ name: 'space', type: 'string' },
|
|
178
172
|
{ name: 'timestamp', type: 'uint64' },
|
|
179
173
|
{ name: 'proposal', type: 'bytes32' },
|
|
180
|
-
{ name: 'choice', type: 'uint32' }
|
|
181
|
-
{ name: 'metadata', type: 'string' }
|
|
174
|
+
{ name: 'choice', type: 'uint32' }
|
|
182
175
|
]
|
|
183
176
|
};
|
|
184
177
|
var voteArray2Types = {
|
|
@@ -187,8 +180,7 @@ var voteArray2Types = {
|
|
|
187
180
|
{ name: 'space', type: 'string' },
|
|
188
181
|
{ name: 'timestamp', type: 'uint64' },
|
|
189
182
|
{ name: 'proposal', type: 'bytes32' },
|
|
190
|
-
{ name: 'choice', type: 'uint32[]' }
|
|
191
|
-
{ name: 'metadata', type: 'string' }
|
|
183
|
+
{ name: 'choice', type: 'uint32[]' }
|
|
192
184
|
]
|
|
193
185
|
};
|
|
194
186
|
var voteString2Types = {
|
|
@@ -197,8 +189,7 @@ var voteString2Types = {
|
|
|
197
189
|
{ name: 'space', type: 'string' },
|
|
198
190
|
{ name: 'timestamp', type: 'uint64' },
|
|
199
191
|
{ name: 'proposal', type: 'bytes32' },
|
|
200
|
-
{ name: 'choice', type: 'string' }
|
|
201
|
-
{ name: 'metadata', type: 'string' }
|
|
192
|
+
{ name: 'choice', type: 'string' }
|
|
202
193
|
]
|
|
203
194
|
};
|
|
204
195
|
var followTypes = {
|
|
@@ -549,13 +540,12 @@ var Client$1 = /** @class */ (function () {
|
|
|
549
540
|
});
|
|
550
541
|
};
|
|
551
542
|
Client.prototype.vote = function (web3, address, space, _a) {
|
|
552
|
-
var proposal = _a.proposal, choice = _a.choice
|
|
543
|
+
var proposal = _a.proposal, choice = _a.choice;
|
|
553
544
|
return __awaiter(this, void 0, void 0, function () {
|
|
554
|
-
return __generator(this, function (
|
|
545
|
+
return __generator(this, function (_b) {
|
|
555
546
|
return [2 /*return*/, this.broadcast(web3, address, space, 'vote', {
|
|
556
547
|
proposal: proposal,
|
|
557
|
-
choice: choice
|
|
558
|
-
metadata: metadata
|
|
548
|
+
choice: choice
|
|
559
549
|
})];
|
|
560
550
|
});
|
|
561
551
|
});
|
|
@@ -1730,6 +1720,21 @@ var networks = {
|
|
|
1730
1720
|
explorer: "https://hscan.org",
|
|
1731
1721
|
start: 13960096,
|
|
1732
1722
|
logo: "ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"
|
|
1723
|
+
},
|
|
1724
|
+
"280": {
|
|
1725
|
+
key: "280",
|
|
1726
|
+
name: "zkSync 2 testnet",
|
|
1727
|
+
shortName: "zkSync2",
|
|
1728
|
+
chainId: 280,
|
|
1729
|
+
network: "zkSync alpha testnet",
|
|
1730
|
+
testnet: true,
|
|
1731
|
+
multicall: "0xD2CF10EF0b64B2C9B7147740AEda677d3EfeD2f8",
|
|
1732
|
+
rpc: [
|
|
1733
|
+
"https://zksync2-testnet.zksync.dev"
|
|
1734
|
+
],
|
|
1735
|
+
explorer: "https://zksync2-testnet.zkscan.io/",
|
|
1736
|
+
start: 1374275,
|
|
1737
|
+
logo: "ipfs://QmPDbdmwpEeenaLHAbqcAerXdH9Z4Gfd7gm9M8tbkkjcAS"
|
|
1733
1738
|
},
|
|
1734
1739
|
"288": {
|
|
1735
1740
|
key: "288",
|