Govern.js API

triangle-exclamation

Usage with default config

circle-info

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:

daos() ⇒ Promise<Dao[]>

Returns all DAOs.

Example:

query(query, args) ⇒ Promise<object>

Returns the desired data.

Param
Type
Description

query

string

GraphQL query

args

object

Object with parameters

Example:

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:

configure(config) ⇒ void

Overwrites the default configuration of govern.

Param
Type
Description

Example:

Last updated

Was this helpful?