This file documents the main exports of the library.
Connects and returns an Organization
for location
.
Name | Type | Description |
|
| The Ethereum address or ENS domain of an Aragon organization. |
|
| Accepts a |
|
| The optional configuration object. |
|
| An EIP-1193 compatible object. |
| The network to connect to. Defaults to | |
| The IPFS gateway and cached results. Defaults to | |
returns |
| An |
This function can throw the following errors:
Error type | Description |
An unsupported or invalid connector was provided. | |
The Ethereum provider doesn’t seem to be valid. | |
The provided location doesn’t seem to be valid. | |
The network is incorrect or unsupported. |
import connect from '@aragon/connect'// Connections should get wrapped in a try / catch to capture connection errorstry {// Connect to an org through The Graphconst org1 = await connect('org1.aragonid.eth', 'thegraph')// Specify a different Chain IDconst org3 = await connect('org3.aragonid.eth', 'thegraph', { network: 4 })// Specify a configuration for the connectorconst org3 = await connect('org3.aragonid.eth', ['thegraph',{ orgSubgraphUrl: 'http://…' },])// Custom connectorconst org4 = await connect('org4.aragonid.eth',// CustomConnector implements IConnectornew CustomConnector())} catch (err) {if (err instanceof ConnectionError) {console.error('Connection error')} else {console.error(err)}}