import { providers, utils, Wallet } from 'ethers';
import { getColonyNetworkClient, Id, Network, Tokens } from '@colony/colony-js';
const { formatEther } = utils;
const provider = new providers.JsonRpcProvider('https://xdai.colony.io/rpc/');
const start = async () => {
const wallet = new Wallet(
'0x0355596cdb5e5242ad082c4fe3f8bbe48c9dba843fe1f99dd8272f487e70efae',
provider,
);
console.log('Wallet Address:', wallet.address);
const networkClient = await getColonyNetworkClient(
Network.Gnosis,
wallet,
);
const metaColonyClient = await networkClient.getMetaColonyClient()
const funding = await metaColonyClient.getFundingPotBalance(Id.RootPot, Tokens.Gnosis.CLNY);
const { address } = metaColonyClient;
console.info(`${formatEther(funding)} CLNY in root domain of MetaColony with address: ${address}`);
};
start();