Skip to main content

Voting & SRs

tokenviewAbout 2 min

Voting & SRs

listwitnesses

GET https://services.tokenview.io/vipapi/nodeservice/trx/wallet/listwitnesses?apikey={apikey}

List all Super Representatives.

Request

curl --location https://services.tokenview.io/vipapi/nodeservice/trx/wallet/listwitnesses?apikey={apikey}

Response


createwitness

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/createwitness?apikey={apikey}

Apply to become a witness.

Parameters:

  • owner_address: string. Owner address, default hexString
  • url: string. Website url, default hexString
  • permission_id: int32. Optional, for multi-signature use
  • visible: boolean. Optional, Whether the address is in base58 format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/createwitness?apikey={apikey}' \
--data '{
  "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
  "url": "007570646174654e616d6531353330363038383733343633",
  "permission_id": 0,
  "visible": true
}'

Response


updatewitness

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/updatewitness?apikey={apikey}

Edit the URL of the witness's official website.

Arguments:

ArgumentDescriptionType
owner_addressThe creator's addressstring (hex)
update_urlUpdated URLstring (hex)

Parameters:

  • owner_address: string. Owner address, default hexString
  • update_url: string. Website url, default hexString
  • permission_id: int32. Optional, for multi-signature use
  • visible: boolean. Optional, Whether the address is in base58 format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/updatewitness?apikey={apikey}' \
--data '{
  "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
  "update_url": "string",
  "permission_id": 0,
  "visible": true
}'

Response


getBrokerage

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getBrokerage?apikey={apikey}

Get SR brokerage ratio. Parameters:

  • address: string. Super representative's account address
  • visible: boolean. Optional, Whether the address is in base58 format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getBrokerage?apikey={apikey}' \
--data '{
  "address": "TGj1Ej1qRzL9feLTLhjwgxXF4Ct6GTWg2U",
  "visible": true
}'

Response

{
    "brokerage": 20
}

updateBrokerage

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/updateBrokerage?apikey={apikey}

Update the witness's brokerage setting.

Parameters:

  • owner_address: string. Super representative's account address
  • brokerage: int32. The brokerage ratio of the super representative, for example: 20 means 20%, 100 means 100%
  • visible: boolean. Optional, Whether the address is in base58 format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/updateBrokerage?apikey={apikey}' \
--data '{
  "owner_address": "414A193C92CD631C1911B99CA964DA8FD342F4CDDD",
  "brokerage": 20,
  "visible": true
}'

Response


votewitnessaccount

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/votewitnessaccount?apikey={apikey}

Vote for witnesses

Parameters:

  • owner_address: string. Owner address, default hexString
  • votes: array of objects. '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
  • permission_id: int32. Optional, for multi-signature use
  • visible: boolean. Optional, Whether the address is in base58 format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/votewitnessaccount?apikey={apikey}' \
--data '{
  "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
  "votes": [
    {
      "vote_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
      "vote_count": 0
    }
  ],
  "permission_id": 0,
  "visible": true
}'

Response


getReward

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getReward?apikey={apikey}

Get the rewards that a witness or a user has not yet withdrawn.

Parameters:

  • address: string. User's address
  • visible: boolean. Optional, Whether the address is in base58 format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getReward?apikey={apikey}' \
--data '{
  "address": "TGj1Ej1qRzL9feLTLhjwgxXF4Ct6GTWg2U",
  "visible": true
}'

Response

{
    "reward": 14369299546
}

withdrawbalance

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/withdrawbalance?apikey={apikey}

Super Representative or user withdraw rewards, usable every 24 hours.

Super representatives can withdraw the balance from the account allowance into the account balance,

Users can claim the voting reward from the SRs and deposit into his account balance.

Parameters:

  • owner_address: string. Super representative or user address
  • visible: boolean. Optional, Whether the address is in base58 format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/withdrawbalance?apikey={apikey}' \
--data '{
  "owner_address": "TGj1Ej1qRzL9feLTLhjwgxXF4Ct6GTWg2U",
  "visible": true
}'

Response


getnextmaintenancetime

GET https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getnextmaintenancetime?apikey={apikey}

Returns the timestamp of the next voting time in milliseconds.

Request

curl --location https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getnextmaintenancetime?apikey={apikey}

Response


Last update: