/build/rpc / cosign / governance
cosign.publish_ballot
cosign.publish_ballot {"proposal_id":"hex","asset_id":"hex","signed_psbt":"str","ballot_units":n} Publish a signed ballot (holder's vote) to the bulletin board. Holders call this after signing a governance PSBT with the ballot RPC. Arguments: 1. ballot (json object, required) Ballot object { "proposal_id": "hex", (string, required) Proposal ID being voted on "asset_id": "hex", (string, required) Asset ID "signed_psbt": "str", (string, required) Signed PSBT with holder's ballot inputs "ballot_units": n, (numeric, required) Voting units contributed } Result: { (json object) "ballot_id" : "str", (string) Unique ballot identifier "nostr_event_id" : "str" (string) Nostr event ID where ballot was published } Examples: > bitcoin-cli cosign.publish_ballot "{\"proposal_id\":\"...\", \"signed_psbt\":\"...\", \"ballot_units\":100}" > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "cosign.publish_ballot", "params": ["{\"proposal_id\":\"...\", \"signed_psbt\":\"...\", \"ballot_units\":100}"]}' -H 'content-type: application/json' http://127.0.0.1:8332/
Signature
cosign.publish_ballot(ballot: object) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.publish_ballot","params":[{}]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| ballot | object | yes | Ballot object { "proposal_id": "hex", (string, required) Proposal ID being voted on "asset_id": "hex", (string, required) Asset ID "signed_psbt": "str", (string, required) Signed PSBT with holder's ballot inputs "ballot_units": n, (numeric, required) Voting units contributed } |
Result
Type: any
{ (json object) "ballot_id" : "str", (string) Unique ballot identifier "nostr_event_id" : "str" (string) Nostr event ID where ballot was published }
Source: services/core-node/bcore/src/rpc/cosign.cpp:2662
C++ symbol: cosign_publish_ballot