Secure the networkBug Bounty 2019

Clients

Clients are aggregations of all the interactions possible with the colonyNetwork smart contracts that can be used to easily integrate Colony into your JavaScript application or service.

ColonyNetworkClient

Use getNetworkClient to get an instance of ColonyNetworkClient:

// Get the network client using the rinkeby network
const networkClient = getNetworkClient(`rinkeby`, wallet);
// Get the network client using the local network
const networkClient = getNetworkClient(`local`, wallet);

See purser to learn how to create a wallet instance. If you are using this method with the "local" option, you will need to have TrufflePig installed and running.

Another way to create an instance of ColonyNetworkClient is by providing an adapter:

const networkClient = new ColonyNetworkClient({ adapter });

await networkClient.init();

See Adapters for more information about setting up an adapter.

ColonyClient

Ask the ColonyNetworkClient for an instance of ColonyClient:

const colonyClient = await networkClient.getColonyClient(colonyId);

Or create an instance of ColonyClient by providing an adapter and the contract address:

const colonyClient = new ColonyClient({
  adapter,
  query: {
    contractAddress: '0x0000000000000000000000000000000000000000',
  },
});

await colonyClient.init();

See Adapters for more information about setting up an adapter.

ColonyClient (Meta Colony)

Ask the ColonyNetworkClient for an instance of ColonyClient for the Meta Colony:

const metaColonyClient = await networkClient.getMetaColonyClient();

Or create an instance of ColonyClient by providing an adapter and the contract address:

const metaColonyClient = new ColonyClient({
  adapter,
  query: {
    contractAddress: '0x0000000000000000000000000000000000000000',
  },
});

await metaColonyClient.init();

See Adapters for more information about setting up an adapter.

TokenClient

The TokenClient is initialized for you when you ask for a new instance of ColonyClient:

const tokenClient = colonyClient.tokenClient;

Or create an instance of TokenClient by providing an adapter and the contract address:

const tokenClient = new TokenClient({
  adapter,
  query: {
    contractAddress: '0x0000000000000000000000000000000000000000',
  },
});

await tokenClient.init();

See Adapters for more information about setting up an adapter.

TokenLockingClient

The TokenLockingClient is initialized for you when you ask for a new instance of ColonyClient:

const tokenLockingClient = colonyClient.tokenLockingClient;

Or create an instance of TokenLockingClient by providing an adapter and the contract address:

const tokenLockingClient = new TokenLockingClient({
  adapter,
  query: {
    contractAddress: '0x0000000000000000000000000000000000000000',
  },
});

await tokenLockingClient.init();

See Adapters for more information about setting up an adapter.