Skip to content

Instantly share code, notes, and snippets.

@luisivan
Created June 17, 2020 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisivan/b3d356513aa2e306f94fafb1142c9a38 to your computer and use it in GitHub Desktop.
Save luisivan/b3d356513aa2e306f94fafb1142c9a38 to your computer and use it in GitHub Desktop.
Aragon Connect examples
// 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