@snapshot-labs/snapshot.js 0.3.91 → 0.3.94
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 +39 -20
- package/dist/snapshot.esm.js +39 -20
- package/dist/snapshot.min.js +2 -2
- package/package.json +1 -1
- package/src/client.ts +2 -8
- package/src/networks.json +45 -16
- 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
|
});
|
|
@@ -1982,6 +1972,21 @@ var networks = {
|
|
|
1982
1972
|
explorer: "https://moonbase-blockscout.testnet.moonbeam.network",
|
|
1983
1973
|
start: 859041,
|
|
1984
1974
|
logo: "ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"
|
|
1975
|
+
},
|
|
1976
|
+
"1818": {
|
|
1977
|
+
key: "1818",
|
|
1978
|
+
name: "Cubechain mainnet",
|
|
1979
|
+
shortName: "cube",
|
|
1980
|
+
chainId: 1818,
|
|
1981
|
+
network: "mainnet",
|
|
1982
|
+
testnet: false,
|
|
1983
|
+
multicall: "0x28d2ebdb36369db1c51355cdc0898754d1a1c3c5",
|
|
1984
|
+
rpc: [
|
|
1985
|
+
"https://http-mainnet-archive.cube.network"
|
|
1986
|
+
],
|
|
1987
|
+
explorer: "https://www.cubescan.network",
|
|
1988
|
+
start: 0,
|
|
1989
|
+
logo: "ipfs://QmbENgHTymTUUArX5MZ2XXH69WGenirU3oamkRD448hYdz"
|
|
1985
1990
|
},
|
|
1986
1991
|
"1819": {
|
|
1987
1992
|
key: "1819",
|
|
@@ -2206,6 +2211,20 @@ var networks = {
|
|
|
2206
2211
|
explorer: "https://explorer.emerald.oasis.dev",
|
|
2207
2212
|
start: 176517,
|
|
2208
2213
|
logo: "ipfs://QmQrZjZZyAcQmPXJM2cUh1KaaDeM8Sfcg3HnvZpBj8wTnG"
|
|
2214
|
+
},
|
|
2215
|
+
"43113": {
|
|
2216
|
+
key: "43113",
|
|
2217
|
+
name: "Avalanche FUJI Testnet",
|
|
2218
|
+
chainId: 43113,
|
|
2219
|
+
network: "testnet",
|
|
2220
|
+
testnet: true,
|
|
2221
|
+
multicall: "0x984476ea55e32e785A9D8FF14329f99D74E3d2A2",
|
|
2222
|
+
rpc: [
|
|
2223
|
+
"https://api.avax-test.network/ext/bc/C/rpc"
|
|
2224
|
+
],
|
|
2225
|
+
explorer: "https://testnet.snowtrace.io",
|
|
2226
|
+
start: 10528153,
|
|
2227
|
+
logo: "ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"
|
|
2209
2228
|
},
|
|
2210
2229
|
"43114": {
|
|
2211
2230
|
key: "43114",
|
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
|
});
|
|
@@ -1973,6 +1963,21 @@ var networks = {
|
|
|
1973
1963
|
explorer: "https://moonbase-blockscout.testnet.moonbeam.network",
|
|
1974
1964
|
start: 859041,
|
|
1975
1965
|
logo: "ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"
|
|
1966
|
+
},
|
|
1967
|
+
"1818": {
|
|
1968
|
+
key: "1818",
|
|
1969
|
+
name: "Cubechain mainnet",
|
|
1970
|
+
shortName: "cube",
|
|
1971
|
+
chainId: 1818,
|
|
1972
|
+
network: "mainnet",
|
|
1973
|
+
testnet: false,
|
|
1974
|
+
multicall: "0x28d2ebdb36369db1c51355cdc0898754d1a1c3c5",
|
|
1975
|
+
rpc: [
|
|
1976
|
+
"https://http-mainnet-archive.cube.network"
|
|
1977
|
+
],
|
|
1978
|
+
explorer: "https://www.cubescan.network",
|
|
1979
|
+
start: 0,
|
|
1980
|
+
logo: "ipfs://QmbENgHTymTUUArX5MZ2XXH69WGenirU3oamkRD448hYdz"
|
|
1976
1981
|
},
|
|
1977
1982
|
"1819": {
|
|
1978
1983
|
key: "1819",
|
|
@@ -2197,6 +2202,20 @@ var networks = {
|
|
|
2197
2202
|
explorer: "https://explorer.emerald.oasis.dev",
|
|
2198
2203
|
start: 176517,
|
|
2199
2204
|
logo: "ipfs://QmQrZjZZyAcQmPXJM2cUh1KaaDeM8Sfcg3HnvZpBj8wTnG"
|
|
2205
|
+
},
|
|
2206
|
+
"43113": {
|
|
2207
|
+
key: "43113",
|
|
2208
|
+
name: "Avalanche FUJI Testnet",
|
|
2209
|
+
chainId: 43113,
|
|
2210
|
+
network: "testnet",
|
|
2211
|
+
testnet: true,
|
|
2212
|
+
multicall: "0x984476ea55e32e785A9D8FF14329f99D74E3d2A2",
|
|
2213
|
+
rpc: [
|
|
2214
|
+
"https://api.avax-test.network/ext/bc/C/rpc"
|
|
2215
|
+
],
|
|
2216
|
+
explorer: "https://testnet.snowtrace.io",
|
|
2217
|
+
start: 10528153,
|
|
2218
|
+
logo: "ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"
|
|
2200
2219
|
},
|
|
2201
2220
|
"43114": {
|
|
2202
2221
|
key: "43114",
|