@snapshot-labs/snapshot.js 0.6.2 → 0.6.4

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.
@@ -1,6 +1,6 @@
1
1
  import { Web3Provider } from '@ethersproject/providers';
2
2
  import { Wallet } from '@ethersproject/wallet';
3
- import { Space, Proposal, UpdateProposal, CancelProposal, Vote, Follow, Unfollow, Subscribe, Unsubscribe, Profile, Alias, DeleteSpace, Statement } from './types';
3
+ import { Space, Proposal, UpdateProposal, FlagProposal, CancelProposal, Vote, Follow, Unfollow, Subscribe, Unsubscribe, Profile, Alias, DeleteSpace, Statement } from './types';
4
4
  export declare const domain: {
5
5
  name: string;
6
6
  version: string;
@@ -14,6 +14,7 @@ export default class Client {
14
14
  space(web3: Web3Provider | Wallet, address: string, message: Space): Promise<unknown>;
15
15
  proposal(web3: Web3Provider | Wallet, address: string, message: Proposal): Promise<unknown>;
16
16
  updateProposal(web3: Web3Provider | Wallet, address: string, message: UpdateProposal): Promise<unknown>;
17
+ flagProposal(web3: Web3Provider | Wallet, address: string, message: FlagProposal): Promise<unknown>;
17
18
  cancelProposal(web3: Web3Provider | Wallet, address: string, message: CancelProposal): Promise<unknown>;
18
19
  vote(web3: Web3Provider | Wallet, address: string, message: Vote): Promise<unknown>;
19
20
  follow(web3: Web3Provider | Wallet, address: string, message: Follow): Promise<unknown>;
@@ -22,9 +22,9 @@ export interface Proposal {
22
22
  }
23
23
  export interface UpdateProposal {
24
24
  proposal: string;
25
- from: string;
25
+ from?: string;
26
26
  space: string;
27
- timestamp: number;
27
+ timestamp?: number;
28
28
  type: ProposalType;
29
29
  title: string;
30
30
  body: string;
@@ -32,6 +32,12 @@ export interface UpdateProposal {
32
32
  choices: string[];
33
33
  plugins: string;
34
34
  }
35
+ export interface FlagProposal {
36
+ from: string;
37
+ space: string;
38
+ proposal: string;
39
+ timestamp?: number;
40
+ }
35
41
  export interface CancelProposal {
36
42
  from?: string;
37
43
  space: string;
@@ -112,6 +118,12 @@ export declare const updateProposalTypes: {
112
118
  type: string;
113
119
  }[];
114
120
  };
121
+ export declare const flagProposalTypes: {
122
+ FlagProposal: {
123
+ name: string;
124
+ type: string;
125
+ }[];
126
+ };
115
127
  export declare const cancelProposalTypes: {
116
128
  CancelProposal: {
117
129
  name: string;
@@ -159,6 +159,14 @@ var updateProposalTypes = {
159
159
  { name: 'plugins', type: 'string' }
160
160
  ]
161
161
  };
162
+ var flagProposalTypes = {
163
+ FlagProposal: [
164
+ { name: 'from', type: 'address' },
165
+ { name: 'space', type: 'string' },
166
+ { name: 'proposal', type: 'string' },
167
+ { name: 'timestamp', type: 'uint64' }
168
+ ]
169
+ };
162
170
  var cancelProposalTypes = {
163
171
  CancelProposal: [
164
172
  { name: 'from', type: 'address' },
@@ -418,6 +426,16 @@ var Client = /** @class */ (function () {
418
426
  });
419
427
  });
420
428
  };
429
+ Client.prototype.flagProposal = function (web3, address, message) {
430
+ return __awaiter(this, void 0, void 0, function () {
431
+ return __generator(this, function (_a) {
432
+ switch (_a.label) {
433
+ case 0: return [4 /*yield*/, this.sign(web3, address, message, flagProposalTypes)];
434
+ case 1: return [2 /*return*/, _a.sent()];
435
+ }
436
+ });
437
+ });
438
+ };
421
439
  Client.prototype.cancelProposal = function (web3, address, message) {
422
440
  return __awaiter(this, void 0, void 0, function () {
423
441
  var type2;
@@ -150,6 +150,14 @@ var updateProposalTypes = {
150
150
  { name: 'plugins', type: 'string' }
151
151
  ]
152
152
  };
153
+ var flagProposalTypes = {
154
+ FlagProposal: [
155
+ { name: 'from', type: 'address' },
156
+ { name: 'space', type: 'string' },
157
+ { name: 'proposal', type: 'string' },
158
+ { name: 'timestamp', type: 'uint64' }
159
+ ]
160
+ };
153
161
  var cancelProposalTypes = {
154
162
  CancelProposal: [
155
163
  { name: 'from', type: 'address' },
@@ -409,6 +417,16 @@ var Client = /** @class */ (function () {
409
417
  });
410
418
  });
411
419
  };
420
+ Client.prototype.flagProposal = function (web3, address, message) {
421
+ return __awaiter(this, void 0, void 0, function () {
422
+ return __generator(this, function (_a) {
423
+ switch (_a.label) {
424
+ case 0: return [4 /*yield*/, this.sign(web3, address, message, flagProposalTypes)];
425
+ case 1: return [2 /*return*/, _a.sent()];
426
+ }
427
+ });
428
+ });
429
+ };
412
430
  Client.prototype.cancelProposal = function (web3, address, message) {
413
431
  return __awaiter(this, void 0, void 0, function () {
414
432
  var type2;