Govern.js API
Usage with default config
The default config uses the Govern servers deployed by Aragon
1
import { dao } from '@aragon/govern'
2
3
const response = await dao('0x0...')
4
5
console.log(response)
Copied!
Usage with custom config
1
import { dao, configure } from '@aragon/govern'
2
3
configure({ governURL: 'https://myOwnGovernServer.io' })
4
5
const response = await dao('0x0...')
6
7
console.log(response)
Copied!

dao(name) ⇒ Promise<Dao>

Returns details about a DAO by his address.
Param
Type
Description
name
string
The name of the DAO
Example:
1
import { dao } from '@aragon/govern'
2
3
const response = await dao('0x0...')
Copied!

daos() ⇒ Promise<Dao[]>

Returns all DAOs.
Example:
1
import { daos } from '@aragon/govern'
2
3
const response = await daos()
Copied!

query(query, args) ⇒ Promise<object>

Returns the desired data.
Param
Type
Description
query
string
GraphQL query
args
object
Object with parameters
Example:
1
import { query } from '@aragon/govern'
2
3
const query = await query(myQuery, {...});
Copied!

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:
1
import { createDao } from '@aragon/govern'
2
3
const result = await createDao(args, options)
Copied!

configure(config) ⇒ void

Overwrites the default configuration of govern.
Param
Type
Description
config
Object with all config options
Example:
1
import { configure } from '@aragon/govern'
2
3
configure({ governURL: 'https://myOwnGovernServer.io' })
Copied!
Last modified 8d ago