@snapshot-labs/snapshot.js 0.3.57 → 0.3.60

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 CHANGED
@@ -12,9 +12,10 @@ export default class Client {
12
12
  choice: any;
13
13
  metadata?: {} | undefined;
14
14
  }): Promise<unknown>;
15
- proposal(web3: Web3Provider, address: string, space: string, { name, body, choices, start, end, snapshot, type, metadata }: {
15
+ proposal(web3: Web3Provider, address: string, space: string, { name, body, discussion, choices, start, end, snapshot, type, metadata }: {
16
16
  name: any;
17
17
  body: any;
18
+ discussion?: string | undefined;
18
19
  choices: any;
19
20
  start: any;
20
21
  end: any;
package/dist/index.d.ts CHANGED
@@ -235,6 +235,12 @@ declare const _default: {
235
235
  minLength: number;
236
236
  maxLength: number;
237
237
  };
238
+ discussion: {
239
+ type: string;
240
+ format: string;
241
+ title: string;
242
+ maxLength: number;
243
+ };
238
244
  choices: {
239
245
  type: string;
240
246
  title: string;
@@ -230,6 +230,12 @@ declare const _default: {
230
230
  minLength: number;
231
231
  maxLength: number;
232
232
  };
233
+ discussion: {
234
+ type: string;
235
+ format: string;
236
+ title: string;
237
+ maxLength: number;
238
+ };
233
239
  choices: {
234
240
  type: string;
235
241
  title: string;
@@ -11,6 +11,7 @@ export interface Proposal {
11
11
  type: string;
12
12
  title: string;
13
13
  body: string;
14
+ discussion: string;
14
15
  choices: string[];
15
16
  start: number;
16
17
  end: number;
@@ -123,6 +123,7 @@ var proposalTypes = {
123
123
  { name: 'type', type: 'string' },
124
124
  { name: 'title', type: 'string' },
125
125
  { name: 'body', type: 'string' },
126
+ { name: 'discussion', type: 'string' },
126
127
  { name: 'choices', type: 'string[]' },
127
128
  { name: 'start', type: 'uint64' },
128
129
  { name: 'end', type: 'uint64' },
@@ -318,7 +319,10 @@ var Client = /** @class */ (function () {
318
319
  return __awaiter(this, void 0, void 0, function () {
319
320
  return __generator(this, function (_a) {
320
321
  switch (_a.label) {
321
- case 0: return [4 /*yield*/, this.sign(web3, address, message, proposalTypes)];
322
+ case 0:
323
+ if (!message.discussion)
324
+ message.discussion = '';
325
+ return [4 /*yield*/, this.sign(web3, address, message, proposalTypes)];
322
326
  case 1: return [2 /*return*/, _a.sent()];
323
327
  }
324
328
  });
@@ -549,12 +553,13 @@ var Client$1 = /** @class */ (function () {
549
553
  });
550
554
  };
551
555
  Client.prototype.proposal = function (web3, address, space, _a) {
552
- var name = _a.name, body = _a.body, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot, _b = _a.type, type = _b === void 0 ? 'single-choice' : _b, _c = _a.metadata, metadata = _c === void 0 ? {} : _c;
556
+ var name = _a.name, body = _a.body, _b = _a.discussion, discussion = _b === void 0 ? '' : _b, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot, _c = _a.type, type = _c === void 0 ? 'single-choice' : _c, _d = _a.metadata, metadata = _d === void 0 ? {} : _d;
553
557
  return __awaiter(this, void 0, void 0, function () {
554
- return __generator(this, function (_d) {
558
+ return __generator(this, function (_e) {
555
559
  return [2 /*return*/, this.broadcast(web3, address, space, 'proposal', {
556
560
  name: name,
557
561
  body: body,
562
+ discussion: discussion,
558
563
  choices: choices,
559
564
  start: start,
560
565
  end: end,
@@ -847,6 +852,12 @@ var definitions$1 = {
847
852
  minLength: 0,
848
853
  maxLength: 14400
849
854
  },
855
+ discussion: {
856
+ type: "string",
857
+ format: "uri",
858
+ title: "discussion",
859
+ maxLength: 256
860
+ },
850
861
  choices: {
851
862
  type: "array",
852
863
  title: "choices",
@@ -1259,9 +1270,9 @@ var networks = {
1259
1270
  shortName: "Ethereum Classic",
1260
1271
  chainId: 61,
1261
1272
  network: "mainnet",
1262
- multicall: "",
1273
+ multicall: "0x51be3a92C56ae7E207C5b5Fd87F7798Ce82C1AC2",
1263
1274
  rpc: [
1264
- "https://ethereumclassic.network"
1275
+ "https://www.ethercluster.com/etc"
1265
1276
  ],
1266
1277
  explorer: "https://blockscout.com/etc/mainnet",
1267
1278
  imageIPFS: "QmVegc28DvA7LjKUFysab81c9BSuN4wQVDQkRXyAtuEBis"
@@ -1725,6 +1736,23 @@ var networks = {
1725
1736
  explorer: "https://scan.v2.testnet.pulsechain.com",
1726
1737
  start: 15123138,
1727
1738
  imageIPFS: "QmYqkn8pJUaV9KcEPYEvRPwgbfeozLEvcQ9aEwKNRUL3cR"
1739
+ },
1740
+ "941": {
1741
+ key: "941",
1742
+ name: "PulseChain Testnet V2B",
1743
+ shortName: "pulsechain",
1744
+ chainId: 941,
1745
+ network: "Testnet v2B",
1746
+ multicall: "0x959a437F1444DaDaC8aF997E71EAF0479c810267",
1747
+ rpc: [
1748
+ "https://rpc.testnet.pulsedisco.net"
1749
+ ],
1750
+ ws: [
1751
+ "wss://ws.rpc.testnet.pulsedisco.net"
1752
+ ],
1753
+ explorer: "https://scan.v2b.testnet.pulsechain.com",
1754
+ start: 14473847,
1755
+ imageIPFS: "QmYqkn8pJUaV9KcEPYEvRPwgbfeozLEvcQ9aEwKNRUL3cR"
1728
1756
  },
1729
1757
  "1088": {
1730
1758
  key: "1088",
@@ -114,6 +114,7 @@ var proposalTypes = {
114
114
  { name: 'type', type: 'string' },
115
115
  { name: 'title', type: 'string' },
116
116
  { name: 'body', type: 'string' },
117
+ { name: 'discussion', type: 'string' },
117
118
  { name: 'choices', type: 'string[]' },
118
119
  { name: 'start', type: 'uint64' },
119
120
  { name: 'end', type: 'uint64' },
@@ -309,7 +310,10 @@ var Client = /** @class */ (function () {
309
310
  return __awaiter(this, void 0, void 0, function () {
310
311
  return __generator(this, function (_a) {
311
312
  switch (_a.label) {
312
- case 0: return [4 /*yield*/, this.sign(web3, address, message, proposalTypes)];
313
+ case 0:
314
+ if (!message.discussion)
315
+ message.discussion = '';
316
+ return [4 /*yield*/, this.sign(web3, address, message, proposalTypes)];
313
317
  case 1: return [2 /*return*/, _a.sent()];
314
318
  }
315
319
  });
@@ -540,12 +544,13 @@ var Client$1 = /** @class */ (function () {
540
544
  });
541
545
  };
542
546
  Client.prototype.proposal = function (web3, address, space, _a) {
543
- var name = _a.name, body = _a.body, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot, _b = _a.type, type = _b === void 0 ? 'single-choice' : _b, _c = _a.metadata, metadata = _c === void 0 ? {} : _c;
547
+ var name = _a.name, body = _a.body, _b = _a.discussion, discussion = _b === void 0 ? '' : _b, choices = _a.choices, start = _a.start, end = _a.end, snapshot = _a.snapshot, _c = _a.type, type = _c === void 0 ? 'single-choice' : _c, _d = _a.metadata, metadata = _d === void 0 ? {} : _d;
544
548
  return __awaiter(this, void 0, void 0, function () {
545
- return __generator(this, function (_d) {
549
+ return __generator(this, function (_e) {
546
550
  return [2 /*return*/, this.broadcast(web3, address, space, 'proposal', {
547
551
  name: name,
548
552
  body: body,
553
+ discussion: discussion,
549
554
  choices: choices,
550
555
  start: start,
551
556
  end: end,
@@ -838,6 +843,12 @@ var definitions$1 = {
838
843
  minLength: 0,
839
844
  maxLength: 14400
840
845
  },
846
+ discussion: {
847
+ type: "string",
848
+ format: "uri",
849
+ title: "discussion",
850
+ maxLength: 256
851
+ },
841
852
  choices: {
842
853
  type: "array",
843
854
  title: "choices",
@@ -1250,9 +1261,9 @@ var networks = {
1250
1261
  shortName: "Ethereum Classic",
1251
1262
  chainId: 61,
1252
1263
  network: "mainnet",
1253
- multicall: "",
1264
+ multicall: "0x51be3a92C56ae7E207C5b5Fd87F7798Ce82C1AC2",
1254
1265
  rpc: [
1255
- "https://ethereumclassic.network"
1266
+ "https://www.ethercluster.com/etc"
1256
1267
  ],
1257
1268
  explorer: "https://blockscout.com/etc/mainnet",
1258
1269
  imageIPFS: "QmVegc28DvA7LjKUFysab81c9BSuN4wQVDQkRXyAtuEBis"
@@ -1716,6 +1727,23 @@ var networks = {
1716
1727
  explorer: "https://scan.v2.testnet.pulsechain.com",
1717
1728
  start: 15123138,
1718
1729
  imageIPFS: "QmYqkn8pJUaV9KcEPYEvRPwgbfeozLEvcQ9aEwKNRUL3cR"
1730
+ },
1731
+ "941": {
1732
+ key: "941",
1733
+ name: "PulseChain Testnet V2B",
1734
+ shortName: "pulsechain",
1735
+ chainId: 941,
1736
+ network: "Testnet v2B",
1737
+ multicall: "0x959a437F1444DaDaC8aF997E71EAF0479c810267",
1738
+ rpc: [
1739
+ "https://rpc.testnet.pulsedisco.net"
1740
+ ],
1741
+ ws: [
1742
+ "wss://ws.rpc.testnet.pulsedisco.net"
1743
+ ],
1744
+ explorer: "https://scan.v2b.testnet.pulsechain.com",
1745
+ start: 14473847,
1746
+ imageIPFS: "QmYqkn8pJUaV9KcEPYEvRPwgbfeozLEvcQ9aEwKNRUL3cR"
1719
1747
  },
1720
1748
  "1088": {
1721
1749
  key: "1088",