Obyte.js
GitHub
Discord
Search…
0.1.19
Obyte.js
Getting started
Quick start
Testnet
API
Get witnesses
Get peers
Get joint
Get last MCI
Get history
Get attestation
Get attestations
Get bots
Get asset metadata
Get definition
Get balances
Get profile units
Get data feed
Autonomous Agents
Core
Post
Address definition change
Attestation
Asset
Asset attestors
Data
Data feed
Definition
Definition template
Payment
Poll
Vote
Profile
Text
Multi
Client
Subscribe
Just saying
Requests
Utils
Sign a message
Validate signed message
Generate a random address
Get definition address
Is valid address
Keep connection alive
About
About
Links
Tutorials
Powered By
GitBook
Vote
To cast votes, users send ‘vote’ messages
Arguments
unit
string
required
Hash of unit where the poll was defined.
choice
string
required
Indicate what the user want to vote for. The choice must be defined in the poll message.
Returns
Returns the unit hash.
Example
const
params
=
{
unit
:
'E0qMVlyvKUQ/H7QQjB1pEevprTUnl44cY/DPWyn3cF4='
,
choice
:
'stay'
};
client
.
post
.
vote
(
params
,
wif
,
function
(
err
,
result
)
{
if
(
err
)
return
console
.
error
(
err
);
console
.
log
(
result
);
});
Learn more
"29. Voting" (page 46)
https://obyte.org/Byteball.pdf
Post - Previous
Poll
Next - Post
Profile
Last modified
1yr ago
Copy link
Outline
Arguments
Returns
Example
Learn more