mirror of
https://github.com/status-im/dappconnect-vote-poll-sdk.git
synced 2025-02-17 07:37:33 +00:00
Introduce poll init proposal (#1)
This commit is contained in:
parent
bce7cf74f0
commit
ae8ea050a3
@ -0,0 +1,28 @@
|
|||||||
|
#Gassless voting over waku
|
||||||
|
|
||||||
|
##Polls
|
||||||
|
|
||||||
|
###Creating time-limited poll
|
||||||
|
|
||||||
|
To create a poll user has to send a message over waku network on specific topic
|
||||||
|
|
||||||
|
`/{dapp name}/waku-polling/polls-init/proto`
|
||||||
|
|
||||||
|
For a poll to be started waku message has to have specific fields:
|
||||||
|
|
||||||
|
```proto
|
||||||
|
message PollInit {
|
||||||
|
bytes owner = 1; // Address of a poll owner/initializer
|
||||||
|
int64 timestamp = 2; // Timestamp of a waku message
|
||||||
|
string question = 3;// Question of a poll
|
||||||
|
repeated answers = 4; // Possible answers to poll
|
||||||
|
enum PollType {
|
||||||
|
WEIGHTED = 0;
|
||||||
|
NON_WEIGHTED = 1;
|
||||||
|
}
|
||||||
|
PollType pollType = 5 // type of poll
|
||||||
|
optional bytes minToken = 6 // amount of token needed for NON_WEIGHTED poll to be able to vote
|
||||||
|
int64 endTime = 7 // UNIX timestamp of poll end
|
||||||
|
bytes signature = 8 // signature of all above fields
|
||||||
|
}
|
||||||
|
```
|
@ -28,5 +28,7 @@
|
|||||||
"ts-node": "^10.1.0",
|
"ts-node": "^10.1.0",
|
||||||
"typescript": "^4.3.5"
|
"typescript": "^4.3.5"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {
|
||||||
|
"js-waku": "^0.10.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user