baking-bad / tzkt

😼 Awesome Tezos blockchain indexer and API
https://tzkt.io
MIT License
183 stars 35 forks source link

Looking for a way to know if a delegate has upvoted for proposals, in proposal period #129

Closed BearCooder closed 2 years ago

BearCooder commented 2 years ago

I'm looking for a way to know if a delegate has upvoted for proposals, in proposal period.

In short, I want to know if a delegate is in this list: https://tzkt.io/governance/41/proposal

For ballot vote, we have GET ..//votes/ballot_list on tezos-client. Anything similar for proposals upvoting ?

Lima now prevents replay of governance proposals (gitlab.com/tezos/tezos/-/merge_requests/5828). I assume this means that the proposals per baker are now stored in the context and there could be a RPC for it. But I don't think there is such a RPC now?

https://tezos.stackexchange.com/questions/4452/proposal-upvotes-list

Groxan commented 2 years ago

You can use this API endpoint: https://api.tzkt.io/#operation/Voting_GetPeriodVoter and check the status field. Example: https://api.tzkt.io/v1/voting/periods/82/voters/tz1WPcUcQrjfw1s9S6RqVeFRkT3oRkiyuWLU

{
  "delegate": {
    "address": "tz1WPcUcQrjfw1s9S6RqVeFRkT3oRkiyuWLU"
  },
  "votingPower": 6301997948,
  "status": "upvoted"
}