Skip to content

Commit e6fd947

Browse files
bonustrackChaituVR
andauthored
Add discussion url input for proposal (#541)
* Add discussion input for proposal * Add discussion field by default * Update package.json Co-authored-by: Chaitanya <[email protected]>
1 parent 42572df commit e6fd947

File tree

7 files changed

+13
-1
lines changed

7 files changed

+13
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@snapshot-labs/snapshot.js",
3-
"version": "0.3.57",
3+
"version": "0.3.58",
44
"repository": "snapshot-labs/snapshot.js",
55
"license": "MIT",
66
"main": "dist/snapshot.cjs.js",

src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export default class Client {
103103
{
104104
name,
105105
body,
106+
discussion = '',
106107
choices,
107108
start,
108109
end,
@@ -114,6 +115,7 @@ export default class Client {
114115
return this.broadcast(web3, address, space, 'proposal', {
115116
name,
116117
body,
118+
discussion,
117119
choices,
118120
start,
119121
end,

src/schemas/proposal.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
"minLength": 0,
1919
"maxLength": 14400
2020
},
21+
"discussion": {
22+
"type": "string",
23+
"title": "discussion",
24+
"maxLength": 256
25+
},
2126
"choices": {
2227
"type": "array",
2328
"title": "choices",

src/sign/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export default class Client {
8686
address: string,
8787
message: Proposal
8888
) {
89+
if (!message.discussion) message.discussion = '';
8990
return await this.sign(web3, address, message, proposalTypes);
9091
}
9192

src/sign/types.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"110b37d3e2625cd6e1ec7b921e77773083b2a2949e69bd3a35fd9f1031ca5666": "settings",
33
"a7bf2991bf4ff9053f1b19085ddc6febaa711e7a95cf90a797605dadc40b4079": "proposal",
4+
"6fee59b7db10fabbb0c6420c0a18c9d2c36306e342042826a355bfc7fe733870": "proposal",
45
"9ff8af4cfb586e2c7962d792b99328fb47e8a4e73cc89873c0980484bc1063a5": "delete-proposal",
56
"734df82cdad586386defa4cb55adda7cb1b2a56929c4e6c3dc676f9901947288": "delete-proposal",
67
"50084aae0fe117c83ddf855557dde35ae2872e9045443a15f72aa6c68ea3943b": "vote",

src/sign/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface Proposal {
1212
type: string;
1313
title: string;
1414
body: string;
15+
discussion: string;
1516
choices: string[];
1617
start: number;
1718
end: number;
@@ -86,6 +87,7 @@ export const proposalTypes = {
8687
{ name: 'type', type: 'string' },
8788
{ name: 'title', type: 'string' },
8889
{ name: 'body', type: 'string' },
90+
{ name: 'discussion', type: 'string' },
8991
{ name: 'choices', type: 'string[]' },
9092
{ name: 'start', type: 'uint64' },
9193
{ name: 'end', type: 'uint64' },

test/examples/proposal.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"start": 1619884800,
99
"end": 1620316800,
1010
"snapshot": 12345167,
11+
"discussion": "https://...",
1112
"metadata": {
1213
"network": "1",
1314
"strategies": [

0 commit comments

Comments
 (0)