📜 The Colony TypeScript reference implementation
@colony/colony-js
colonyJS is a JavaScript library with a simple and predictable interface for application-layer integrations with the colonyNetwork smart contracts. To learn more about Colony, you can visit colony.io or read the White Paper.
Documentation
📑 Click here for docs!
You should check out the getColonyNetworkClient
function in ColonyNetworkClient
and the docs for the extended colony contracts clients/Colony/ColonyClientVX
.
Get Started
import { providers, utils, Wallet } from 'ethers';
import { getColonyNetworkClient, ColonRpcEndpoint, Id, Network, Tokens } from '@colony/colony-js';
const { formatEther } = utils;
const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis);
const start = async () => {
const wallet = new Wallet(
'0x0355596cdb5e5242ad082c4fe3f8bbe48c9dba843fe1f99dd8272f487e70efae',
provider,
);
console.log('Wallet Address:', wallet.address);
const networkClient = 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();
Too complicated? Need more guidance?
Try Colony SDK.
License
GPL-3.0