votewitnessaccount - Tron
votewitnessaccount. Creates a transaction to cast votes for one or more Super Representative candidates.
votewitnessaccount - tron [Value: 20CU]
Creates a transaction to cast votes for one or more Super Representative candidates.
Use cases
- Cast votes for Super Representative candidates using staked TRX voting power
- Redistribute votes across multiple candidates in a single transaction
Constraints
- Total vote_count across all entries cannot exceed the account's available staked TRX voting power
- Casting new votes replaces the account's previous vote allocation entirely
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url https://lb.drpc.live/tron/{API-KEY}/wallet/votewitnessaccount \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"owner_address": "41dd791d6b49e190062d650e6a23c575510d35f2f9",
"votes": [
{
"vote_address": "419c7c7049d26108be0dcb5f78479c6ff27ba101d1",
"vote_count": 100
}
]
}'Response
200
{
"visible": false,
"txID": "<computed from raw_data>",
"raw_data": {
"contract": [
{
"parameter": {
"value": {
"owner_address": "41dd791d6b49e190062d650e6a23c575510d35f2f9",
"votes": [
{
"vote_address": "419c7c7049d26108be0dcb5f78479c6ff27ba101d1",
"vote_count": 100
}
]
},
"type_url": "type.googleapis.com/protocol.VoteWitnessContract"
},
"type": "VoteWitnessContract"
}
],
"ref_block_bytes": "<latest solidified block at construction time>",
"ref_block_hash": "<latest solidified block at construction time>",
"expiration": "<timestamp + 60_000>",
"timestamp": "<construction moment>"
},
"raw_data_hex": "<protobuf encoding of raw_data>"
}Request params
idinteger
jsonrpcstring
methodstring
object
owner_addressstring
[Required] The voting account's address
votesarray_of_objects
[Required] List of { vote_address, vote_count } pairs for each candidate voted for
object
vote_addressstring
SR candidate address
vote_countint64
Vote count (consumes TRON Power)
visibleboolean
When true, addresses/strings are human-readable; when false (default), hex-encoded
Response
200
Creates a transaction to cast votes for one or more Super Representative candidates.Response params
object
visibleboolean
Indicates whether addresses in this transaction are represented in base58 format (true) or hex format (false).
txIDstring
The unique transaction hash (transaction ID), computed as the SHA256 of raw_data.
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
contractarray_of_objects
The list of contract instructions to be executed by this transaction.
object
parameterobject
The typed payload describing the specific contract call being made.
object
valueobject
The decoded fields of the contract — here, a request to cast TRON Power votes for one or more Super Representative candidates.
object
owner_addressstring
[Required] The address casting the votes, in hex format.
votesarray_of_objects
[Required] The list of witness candidates being voted for, along with the number of votes allocated to each.
object
vote_addressstring
The address of the witness (SR candidate) receiving these votes, in hex format.
vote_countinteger
The number of votes being allocated to this witness candidate.
type_urlstring
The fully qualified protobuf type identifier describing which contract schema `value` should be decoded with.
typestring
The human-readable name of the contract type being executed (here, VoteWitnessContract).
ref_block_bytesstring
The last two bytes of the reference block number, taken from the latest solidified block at the time the transaction was built, used for replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, taken from the same solidified block, paired with ref_block_bytes for replay protection.
expirationinteger
Unix timestamp, in ms, after which this transaction is no longer valid; typically set to the construction timestamp plus 60,000 ms.
timestampinteger
Unix timestamp, in ms, marking the moment the transaction was constructed.
raw_data_hexstring
The hex-encoded protobuf serialization of raw_data, used as the actual payload to sign and broadcast.