Skip to main content

Class: ColonyNetwork

Constructors

constructor

new ColonyNetwork(signerOrProvider, options?)

Creates a new instance to connect to the ColonyNetwork

This is your main entry point to talk to the Colony Network Smart Contracts. From here you should be able to instantiate all the required instances for Colonies and their extensions.

Example

import { providers } from 'ethers';
import { ColonyNetwork, Tokens } from '@colony/sdk';

// Connect directly to the deployed Colony Network on Gnosis Chain
const provider = new providers.JsonRpcProvider('https://xdai.colony.io/rpc2/');
const colonyNetwork = new ColonyNetwork(provider);
// Now you could call functions on the colonyNetwork, like `colonyNetwork.getMetaColony()`

Parameters

NameTypeDescription
signerOrProviderSignerOrProviderAn ethers compatible Signer or Provider instance
options?ColonyNetworkOptionsOptional custom ColonyNetworkOptions

Properties

config

config: ColonyNetworkConfig


ipfs

ipfs: IpfsMetadata


network

network: Network


networkClient

networkClient: ColonyNetworkClient

Methods

getColony

getColony(address): Promise<Colony>

Get a new instance of a Colony

Use this function to instantiate a new Colony by providing the Colony's address

Remarks

Colony contracts are versioned. If the deployed Colony version does not match the supported version an error will be thrown

Parameters

NameTypeDescription
addressstringThe Colony's address

Returns

Promise<Colony>

A Colony abstaction instance


getMetaColony

getMetaColony(): Promise<Colony>

Get a new instance of the MetaColony

Use this function to instantiate a new Colony for the deployed MetaColony

Returns

Promise<Colony>

A Colony abstaction instance of the MetaColony