Govern.js API

Usage with default config

The default config uses the Govern servers deployed by Aragon.

import { dao } from '@aragon/govern'

const response = await dao('0x0...')

console.log(response)

Usage with custom config

import { dao, configure } from '@aragon/govern'

configure({ governURL: 'https://myOwnGovernServer.io' })

const response = await dao('0x0...')

console.log(response)

dao(name) ⇒ Promise<Dao>

Returns details about a DAO by his address.

Param
Type
Description

name

string

The name of the DAO

Example:

import { dao } from '@aragon/govern'

const response = await dao('0x0...')

daos() ⇒ Promise<Dao[]>

Returns all DAOs.

Example:

import { daos } from '@aragon/govern'

const response = await daos()

query(query, args) ⇒ Promise<object>

Returns the desired data.

Param
Type
Description

query

string

GraphQL query

args

object

Object with parameters

Example:

import { query } from '@aragon/govern'

const query = await query(myQuery, {...});

createDao(args, options) ⇒ Promise<TransactionResponse>

Create

Param
Type
Description

args

CreateDaoParams

Dao name, Dao token, useProxies option

options

CreateDaoOptions

EIP 1193 provider, Dao factory address

Examples:

For Node.js:

import { createDao } from '@aragon/govern'

const result = await createDao(args, options)

configure(config) ⇒ void

Overwrites the default configuration of govern.

Param
Type
Description

config

Object with all config options

Example:

import { configure } from '@aragon/govern'

configure({ governURL: 'https://myOwnGovernServer.io' })

Last updated

Was this helpful?