Created
June 17, 2020 07:58
-
-
Save luisivan/b3d356513aa2e306f94fafb1142c9a38 to your computer and use it in GitHub Desktop.
Aragon Connect examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Aragon DAOs are like LEGOs, and apps are their pieces | |
// Let's get apps for a DAO! | |
const apps = await org.apps() | |
// Let's find the Tokens app, for example | |
const { address: tokenManagerAddress } = apps.find( | |
({ appName }) => appName && appName.startsWith("token-manager") | |
) | |
// Initialize the TheGraph connector for Tokens | |
const tokenManager = new TokenManager(tokenManagerAddress, TOKENS_SUBGRAPH_URL) | |
// Let's get all the token details and holders! | |
const tokenDetails = await tokenManager.token() | |
const tokenHolders = await tokenDetails.holders() | |
// Let's get all the votes in the DAO! | |
const voting = new Voting(votingAppAddress, VOTING_SUBGRAPH_URL) | |
const votes = await voting.votes() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment