The GraphQL API
Read spaces, proposals, votes and delegations from hub.raad.vote.
The hub serves everything Raad stores, to anyone, at:
https://hub.raad.vote/graphql
Send a POST with a JSON body: query and, if you use them, variables. No key is needed. Each IP may send up to 600 requests a minute.
A space
query {
space(id: "walletconnect.eth") {
id
name
about
network
symbol
strategies { name network params }
voting { delay period type quorum }
proposalsCount
followersCount
}
}
Its latest proposals
query {
proposals(
first: 10
where: { space: "walletconnect.eth" }
orderBy: "created"
orderDirection: desc
) {
id
title
state
choices
scores
scores_total
end
}
}
A proposal's votes
query {
votes(
first: 1000
where: { proposal: "PROPOSAL_ID" }
orderBy: "vp"
orderDirection: desc
) {
voter
choice
vp
reason
created
}
}
A page holds at most 1,000 votes, and skip goes up to 5,000. For more, page by time: ask again with created_lte set to the last vote's created.
Voting power
query {
vp(voter: "0xADDRESS", space: "walletconnect.eth") {
vp
vp_by_strategy
}
}
Delegates and delegations
Raad's hub also serves the delegations its spaces count:
query {
delegates(
first: 20
where: { space: "walletconnect.eth", global: false }
orderBy: "delegatedVp"
) {
id
delegatorsCount
delegatedVp
vpBlock
vpState
}
}
global: falsecounts only the delegations made for the space; leave it out to include those made for every space.orderByisdelegatedVpordelegatorsCount.vpStateisfinal(counted atvpBlock),pending(being counted, values are null) ornone(the space counts no delegation).delegations(where: { space, delegate })lists a delegate's delegators, withorderBy: "vp"for most power first.