Language

Choose a language

/build/rpc / cosign / governance

cosign.list_ballots

cosign.list_ballots "proposal_id" List ballots (holder votes) for a governance proposal. Arguments: 1. proposal_id (string, required) Proposal ID to get ballots for Result: [ (json array) { (json object) "proposal_id" : "str", (string) Proposal ID "signed_psbt" : "str", (string) Signed ballot PSBT "ballot_units" : n, (numeric) Voting units "voter_timestamp" : n (numeric) Unix timestamp when ballot was signed }, ... ] Examples: > bitcoin-cli cosign.list_ballots "a1b2c3d4e5f6..." > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "cosign.list_ballots", "params": ["a1b2c3d4e5f6..."]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

cosign.list_ballots(proposal_id: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.list_ballots","params":["\"<proposal_id>\""]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
proposal_idstringyesProposal ID to get ballots for

Result

Type:  any

[ (json array) { (json object) "proposal_id" : "str", (string) Proposal ID "signed_psbt" : "str", (string) Signed ballot PSBT "ballot_units" : n, (numeric) Voting units "voter_timestamp" : n (numeric) Unix timestamp when ballot was signed }, ... ]

Source: services/core-node/bcore/src/rpc/cosign.cpp:2711

C++ symbol: cosign_list_ballots