VoteWitnessAccount

POST: http://172.104.51.182:16667/wallet/votewitnessaccount

Vote for witnesses

BODY PARAMS {

owner_address string

votes array of objects

visible boolean (Optional)

permission_id int32 (Optional)

}

Note:

  • owner address is transaction creator address, in hex string format.

  • votes is 'vote_address' stands for the address of the witness you want to vote, default hexString, 'vote_count' stands for the number of votes you want to vote.

  • visible: whether the address is in base58check format.

  • permission_id, whether the address is in base58 format.

Example:

curl --request POST --url http://172.104.51.182:16667/wallet/votewitnessaccount --header 'Accept: application/json' --header 'Content-Type: application/json' --data ' { "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "votes": [ { "vote_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "vote_count": "0" } ] }

Input:

{

"owner_address": "414203485a535a4072C9FBFaADDfe2A010AD0BcdB0",

"votes":

[

{ "vote_address": "412588712Fb3C470587350640e90265ff02af9c1e2", "vote_count": 2 } ]

}

Response:

{

"visible": false, "txID": "24f412c2b45ecf038450df4df518fa57985d8312d82fd086e3d81ad0a8fe1dea", "raw_data": { "contract": [ { "parameter": { "value": { "owner_address": "414203485a535a4072c9fbfaaddfe2a010ad0bcdb0", "votes": [ { "vote_address": "412588712fb3c470587350640e90265ff02af9c1e2", "vote_count": 2 } ] }, "type_url": "type.googleapis.com/protocol.VoteWitnessContract" }, "type": "VoteWitnessContract" } ], "ref_block_bytes": "ece7", "ref_block_hash": "62ae1e9517669514", "expiration": 1640076456000, "timestamp": 1640076397714 }, "raw_data_hex": "0a02ece7220862ae1e951766951440c0e0b2e1dd2f5a6a080412660a30747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e566f74655769746e657373436f6e747261637412320a15414203485a535a4072c9fbfaaddfe2a010ad0bcdb012190a15412588712fb3c470587350640e90265ff02af9c1e21002709299afe1dd2f"

}

==> Continue you call gettransactionsign API then call broadcasttransaction API

We will the final result: The transaction created success on WEL network.

{"result":true,"txid":"24f412c2b45ecf038450df4df518fa57985d8312d82fd086e3d81ad0a8fe1dea"}

Last updated