Voting app
This is an app connector for the Voting app (
voting.aragonpm.eth
). It only supports The Graph for now.To connect a Voting app, you need to pass it to
connectVoting()
:import connect from '@aragon/connect'
import connectVoting from '@aragon/connect-voting'
const org = await connect('myorg.aragonid.eth', 'thegraph')
const voting = await connectVoting(org.app('voting'))
It extends the
App
object, which means that every method and property of App
is also available on this object.Connects and returns a
Voting
instance.Name | Type | Description |
---|---|---|
app | App or Promise<App> | The app to extend with connected capabilities. |
connector | ["thegraph", Object] or "thegraph" | Accepts either a string describing the desired connector (only "thegraph" for now), or a tuple to also pass a configuration object to the connector. |
returns | Promise<Voting> | An Voting instance (see below). |
It can throw the following errors:
Error type | Description |
---|---|
Either the passed value is not a valid app object, or its name is not voting . | |
Either the connector configuration format is not valid, or the connector name is not supported. | |
A subgraph couldn’t be found with the current network. Pass a subgraphUrl directly, or use one of the supported networks. |
An object representing the Voting app, returned by
connectVoting()
. Use the following API to retrieve its data:Get the list of votes in the Voting app.
Name | Type | Description |
---|---|---|
filters | Object | Optional object allowing to filter the votes. |
filters.first | Number | Maximum number of votes. Defaults to 1000 . |
filters.skip | Number | Skip a number of votes. Defaults to 0 . |
returns | Promise<Vote[]> | The list of votes. |
This method can throw one of the following errors:
Error type | Description |
---|---|
The response seems incorrect. | |