Skip to main content

Getting started

import { providers, utils, Wallet } from 'ethers';
import { getColonyNetworkClient, Id, Network, Tokens } from '@colony/colony-js';

const { formatEther } = utils;

const provider = new providers.JsonRpcProvider('');

const start = async () => {
// Get a wallet instance
const wallet = new Wallet(
// This is a random private key (don't use this one for anything else and _definitely_ do not send valuables to the corresponding address)

// Check out the logs to see the wallet address
console.log('Wallet Address:', wallet.address);

// Get a network client instance for Gnosis Chain
const networkClient = await getColonyNetworkClient(

// Let's connect to the Meta Colony
const metaColonyClient = await networkClient.getMetaColonyClient()
// And check out it's CLNY funding
const funding = await metaColonyClient.getFundingPotBalance(Id.RootPot, Tokens.Gnosis.CLNY);
// We can also see its address
const { address } = metaColonyClient;`${formatEther(funding)} CLNY in root domain of MetaColony with address: ${address}`);