Getting started
Last updated
Was this helpful?
Last updated
Was this helpful?
Aragon Connect is a suite of tools that allow you to easily supercharge apps and websites by integrating them with an Aragon organization (most often a DAO). It provides a unified interface for fetching data, subscribing to updates, and generating transactions in the context of Aragon organizations. By default, it balances performance with decentralization, but can be extended and configured to strongly prefer one over the other (if you learn how to do both--let us know!). It is compatible with web and Node.js environments.
This guide assumes that you are familiar with the way Aragon organizations work. If that’s not the case, we invite you to get up to charge with the guide.
This is how to connect to an organization and list its apps:
Aragon Connect allows for injecting any type of connector, and includes two by default:
Ethereum (WIP): fetch data from an Ethereum node directly.
A connector can be of two types: organization or app, to fetch data from one or the other. The main package of Aragon Connect only provides organization connectors: app connectors need to be imported separately.
Aragon Connect consists of a few parts:
@aragon/connect
: this is the main library. It provides the main features to connect and interact with organizations, and includes the basic organization connectors.
@aragon/connect-finance
: an app connector for fetching data from the Finance app.
@aragon/connect-voting
: an app connector for fetching data from the Voting app.
@aragon/connect-tokens
: an app connector for fetching data from the Tokens app.
Additional app connectors published by individual app authors
You can now import it:
If you want to interact with the Finance, Voting or the Tokens app, you should also install their respective connectors:
As seen above, connecting to an organization can be done by calling the connect()
function.
It requires two parameters:
The connector you want to use.
Aragon Connect connects to the Ethereum mainnet by default, but other networks are also available.
Let’s see how to retrieve all the votes from a Voting app:
It is also possible to subscribe to receive data updates as they arrive.
For example, this is how it can be done for the list of apps:
The returned handler can be used to stop receiving updates:
App connectors also support subscriptions in an identical way:
Generating a transaction is done in three steps. First, call a method returning a TransactionIntent
object:
Then to retrieve the path you want, pass the account that will be signing the transaction. Aragon Connect will go through the permissions of the organization, and return the shortest path:
The Graph: fetch data from , hosted on by default.
are also published, but they are only needed to author or extend connectors and not to use the library.
Start by adding to your project:
See below to understand how to use these app connectors.
The address of the organization, which can be any valid Ethereum address (0x…
) or (….eth
).
It returns an instance.
To do so, use the assigned to the network:
Note: other than the Ethereum main network (default), only and are supported by the thegraph
connector at the moment.
Apps can be obtained from an instance, but they only contain basic information. Alone, an App
instance doesn’t provide the state of the app: you need an app connector to achieve this.
Methods generating a transaction return an object, that can be used to generate the final transaction for a user to sign.
Finally, you can sign the different transactions associated to this path. Aragon Connect doesn’t handle any signing itself, but returns an object that is ready to use with the library of your choice: , , or even a .
Now that you are familiar with the basics of Aragon Connect, you may want to explore the and the .
If you are using React, you might want to have a look at the guide.