ColonyNetworkClient

The ColonyNetworkClient is a standard interface for interactions with methods and events described in IColonyNetwork.sol. These interactions are generally concerned with the colony network as a whole. This includes operations like getting a count of all colonies on the network, querying for information about a skill, or registering an ENS label for a user.

See Clients for more information about initializing ColonyNetworkClient.

See ContractClient for more information about the ContractClient superclass.

Instance methods

getColonyAddress

Get the address of a Colony for the specified id of a deployed colony contract.

await colonyNetwork.getColonyAddress(id);

Input

PropertyTypeDescription
idnumberThe id of the colony

Response

Promise<Address>. The address of the given Colony contract

getColonyClient

Returns an initialized ColonyClient for the specified id of a deployed colony contract.

await colonyNetwork.getColonyClient(id);

Input

PropertyTypeDescription
idnumberThe id of the colony

Response

Promise<ColonyClient>. An instance of a ColonyClient associated with the given Colony contract

getColonyClientByAddress

Returns an initialized ColonyClient for the contract at address contractAddress

await colonyNetwork.getColonyClientByAddress(contractAddress);

Input

PropertyTypeDescription
contractAddressAdressAddress of a deployed Colony contract

Response

Promise<ColonyClient>. An instance of a ColonyClient associated with the given Colony contract

getMetaColonyClient

Gets the Meta Colony as an initialized ColonyClient

await colonyNetwork.getMetaColonyClient();

Response

Promise<ColonyClient>. An instance of a ColonyClient associated with the MetaColony contract

Callers

calculateMinerWeight

Calculate the raw miner weight in WADs.

await colonyNetworkClient.calculateMinerWeight.call({
  timeStaked,
  submissionIndexed,
});

Input

NameTypeDescription
timeStakednumberAmount of time (in seconds) that the miner has staked their CLNY.
submissionIndexednumberThe index of reputation hash submission (between 0 and 11).

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
minerWeightnumberThe weight of miner reward in WADs.

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IRecovery.sol

ensSupportsInterface

Check whether an ENS interface is supported.

await colonyNetworkClient.ensSupportsInterface.call({
  interfaceId,
});

Input

NameTypeDescription
interfaceIdhex stringThe hashed ID of the contract interface as specified in ERC-165.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
isSupportedbooleanA boolean indicating whether or not the ENS interface is supported.

Contract Information

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

getAddressForENSHash

Get the address of a registered ENS label. This function will return an empty address if an ENS label has not been registered.

await colonyNetworkClient.getAddressForENSHash.call({
  nameHash,
});

Input

NameTypeDescription
nameHashhex stringThe hached ENS label that will be checked.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
ensAddressaddressThe address associated with the ENS label.

Contract Information

Function: addr

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

getChildSkillId

Get the ID of a child skill.

await colonyNetworkClient.getChildSkillId.call({
  skillId,
  childSkillIndex,
});

Input

NameTypeDescription
skillIdnumberThe numberic ID of the skill that will be checked.
childSkillIndexnumberThe index of the child skill array to be checked.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
childSkillIdnumberThe ID of the child skill.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getColony

Get the colony contract address for a colony.

await colonyNetworkClient.getColony.call({
  id,
});

Input

NameTypeDescription
idnumberThe ID of the colony.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
addressaddressThe address of the colony contract.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getColonyCount

Get the total number of colonies on the network. The return value is also the ID of the last colony created.

await colonyNetworkClient.getColonyCount.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
countnumberThe total number of colonies.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getColonyVersionResolver

Get the address of the resolver contract for a specific colony version.

await colonyNetworkClient.getColonyVersionResolver.call({
  version,
});

Input

NameTypeDescription
versionnumberThe version number of the colony contract.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
addressaddressThe address of the resolver contract.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getCurrentColonyVersion

Get the latest colony contract version. This is the version used to create all new colonies.

await colonyNetworkClient.getCurrentColonyVersion.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
versionnumberThe version number of the latest colony contract.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getENSRegistrarAddress

Get the address of the ENS registrar.

await colonyNetworkClient.getENSRegistrarAddress.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
addressaddressThe address of the ENS registrar.

Contract Information

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

getFeeInverse

Get the inverse amount of the network fee. If the fee is 1% (or 0.01), the inverse amount will be 100.

await colonyNetworkClient.getFeeInverse.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
feeInversebig numberThe inverse amount of the network fee.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getMetaColonyAddress

Get the Meta Colony contract address.

await colonyNetworkClient.getMetaColonyAddress.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
addressaddressThe address of the Meta Colony contract.

Contract Information

Function: getMetaColony

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getMiningResolverAddress

Get the address of the mining resolver.

await colonyNetworkClient.getMiningResolverAddress.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
addressaddressThe address of the mining resolver.

Contract Information

Function: getMiningResolver

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getParentSkillId

Get the ID of a parent skill.

await colonyNetworkClient.getParentSkillId.call({
  skillId,
  parentSkillIndex,
});

Input

NameTypeDescription
skillIdnumberThe numberic ID of the skill that will be checked.
parentSkillIndexnumberThe index of the parent skill array to be checked.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
parentSkillIdnumberThe ID of the parent skill.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getProfileDBAddress

Get the address of the OrbitDB database associaated with a user profile.

await colonyNetworkClient.getProfileDBAddress.call({
  nameHash,
});

Input

NameTypeDescription
nameHashhex stringThe hashed ENS label that was registered for the user.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
orbitDBAddressstringThe path of the OrbitDB database associated with the user profile.

Contract Information

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

getRecoveryRolesCount

Get the total number of addresses that are assigned a RECOVERY role.

await colonyNetworkClient.getRecoveryRolesCount.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
countnumberThe total number of addresses that are assigned a RECOVERY role.

Contract Information

Function: numRecoveryRoles

Contract: ContractRecovery.sol

Interface: IRecovery.sol

getReplacementReputationUpdateLogEntry

Get replacement log entry that was set when the network was in recovery mode.

await colonyNetworkClient.getReplacementReputationUpdateLogEntry.call({
  reputationMiningCycle,
  id,
});

Input

NameTypeDescription
reputationMiningCycleaddress
idnumber

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
useraddress
amountbig number
skillIdnumber
colonyaddress
nUpdatesnumber
nPreviousUpdatesnumber

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IColonyNetwork.sol

getReplacementReputationUpdateLogsExist

Get whether any replacement log entries have been set for the supplied reputation mining cycle.

await colonyNetworkClient.getReplacementReputationUpdateLogsExist.call({
  reputationMiningCycle,
});

Input

NameTypeDescription
reputationMiningCycleaddress

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
logsExistboolean

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IColonyNetwork.sol

getReputationMiningCycle

Get the address of either the active or inactive reputation mining cycle. The active reputation mining cycle is the one currently under consideration by reputation miners. The inactive reputation cycle is the one with the log that is being appended.

await colonyNetworkClient.getReputationMiningCycle.call({
  active,
});

Input

NameTypeDescription
activebooleanA boolean indicating whether to get the active or inactive reputation mining cycle.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
addressaddressThe address of the reputation mining cycle.

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IColonyNetwork.sol

getReputationMiningSkillId

Get the ID of the skill associated with reputation mining.

await colonyNetworkClient.getReputationMiningSkillId.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
skillIdnumberThe ID of the skill associated with reputation mining.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getReputationRootHash

Get the root hash of the current reputation state tree.

await colonyNetworkClient.getReputationRootHash.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
rootHashstringThe root hash of the current reputation state tree.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getReputationRootHashNodeCount

Get the number of nodes in the current reputation state tree.

await colonyNetworkClient.getReputationRootHashNodeCount.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
nNodesnumberThe number of nodes in the current reputation state tree.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getSkill

Get information about a skill.

await colonyNetworkClient.getSkill.call({
  skillId,
});

Input

NameTypeDescription
skillIdnumberThe ID of the skill.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
nParentsnumberThe total number of parent skills.
nChildrennumberThe total number of child skills.
parentsarrayAn array of parent skill ids.
childrenarrayAn array of child skill ids.
isGlobalSkillbooleanA boolean indicating whether or not the skill is a global skill.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getSkillCount

Get the total number of global and local skills in the network.

await colonyNetworkClient.getSkillCount.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
countnumberThe total number of global and local skills in the network.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

getTokenLockingAddress

Get the token locking contract address.

await colonyNetworkClient.getTokenLockingAddress.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
addressaddressThe address of the token locking contract.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

isColony

Check whether or not an address is a colony contract.

await colonyNetworkClient.isColony.call({
  colony,
});

Input

NameTypeDescription
colonyaddressThe address that will be checked.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
isColonybooleanA boolean indicating whether or not an address is a colony contract.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

isInRecoveryMode

Check whether or not the network is in recovery mode.

await colonyNetworkClient.isInRecoveryMode.call();

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
inRecoveryModebooleanA boolean indicating whether or not the network is in recovery mode.

Contract Information

Contract: ContractRecovery.sol

Interface: IRecovery.sol

lookupRegisteredENSDomain

Lookup the registed ENS label for an address. This function will return an empty string if the address does not have a registered ENS label.

await colonyNetworkClient.lookupRegisteredENSDomain.call({
  ensAddress,
});

Input

NameTypeDescription
ensAddressaddressThe address that will checked.

Response

A promise which resolves to an object containing the following properties:

NameTypeDescription
domainstringThe ENS label associated with the address.

Contract Information

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

Senders

addColonyVersion

Add a new colony contract version and set the address of the resolver contract.

await colonyNetworkClient.addColonyVersion.send({
  version,
  resolver,
}, options);

Input

NameTypeDescription
versionnumberThe versions number of the colony contract.
resolveraddressThe address of the resolver contract.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
versionnumberThe version number of the colony contract that was added.
resolveraddressThe address of the resolver contract.
ColonyVersionAddedobjectContains the data defined in ColonyVersionAdded

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

addSkill

Add a new global or local skill to the skills tree.

await colonyNetworkClient.addSkill.send({
  parentSkillId,
}, options);

Input

NameTypeDescription
parentSkillIdnumberThe ID of the skill under which the new skill will be added.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
skillIdnumberThe ID of the skill that was added.
parentSkillIdnumberThe ID of the parent skill.
SkillAddedobjectContains the data defined in SkillAdded

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

appendReputationUpdateLog

Add a reputation update entry to the log.

await colonyNetworkClient.appendReputationUpdateLog.send({
  user,
  amount,
  skillId,
}, options);

Input

NameTypeDescription
useraddress
amountbig number
skillIdnumber

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

approveExitRecovery

Indicate approval to exit network recovery mode. This function can only be called by an address assigned the RECOVERY role.

await colonyNetworkClient.approveExitRecovery.send(options);

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ContractRecovery.sol

Interface: IRecovery.sol

createColony

Create a new colony on the network.

await colonyNetworkClient.createColony.send({
  tokenAddress,
}, options);

Input

NameTypeDescription
tokenAddressaddressThe address of the token contract that will become the native token for the colony.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
skillIdnumberThe ID of the skill that was added.
parentSkillIdnumberThe ID of the parent skill.
colonyIdnumberThe ID of the colony that was added.
colonyAddressaddressThe address of the colony contract that was created.
tokenAddressaddressThe address of the token contract that was assigned.
SkillAddedobjectContains the data defined in SkillAdded
ColonyAddedobjectContains the data defined in ColonyAdded

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

createMetaColony

Create the Meta Colony.

await colonyNetworkClient.createMetaColony.send({
  tokenAddress,
}, options);

Input

NameTypeDescription
tokenAddressaddressThe address of the token contract.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
skillIdnumberThe ID of the skill that was added.
parentSkillIdnumberThe ID of the parent skill.
colonyIdnumberThe ID of the colony that was added.
colonyAddressaddressThe address of the colony contract that was created.
tokenAddressaddressThe address of the token contract that was assigned.
rootSkillIdnumberThe ID of the root skill.
SkillAddedobjectContains the data defined in SkillAdded
ColonyAddedobjectContains the data defined in ColonyAdded
MetaColonyCreatedobjectContains the data defined in MetaColonyCreated

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

createToken

Create a new ERC20 token contract.

await colonyNetworkClient.createToken.send({
  name,
  symbol,
  decimals,
}, options);

Input

NameTypeDescription
namestringThe name of the token.
symbolstringThe symbol of the token.
decimalsnumber (optional)The number of decimals.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will receive a receipt with a contractAddress property.

See Sender for more information about ContractResponse.

Contract Information

Contract: Token.sol

deprecateSkill

Deprecate a skill.

await colonyNetworkClient.deprecateSkill.send({
  skillId,
}, options);

Input

NameTypeDescription
skillIdnumberThe ID of the skill that will be deprecated.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

enterRecoveryMode

Enter network recovery mode. This function can only be called by an address assigned the RECOVERY role.

await colonyNetworkClient.enterRecoveryMode.send(options);

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ContractRecovery.sol

Interface: IRecovery.sol

exitRecoveryMode

Exit network recovery mode. This function can be called by anyone if enough whitelist approvals are given.

await colonyNetworkClient.exitRecoveryMode.send(options);

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ContractRecovery.sol

Interface: IRecovery.sol

initialiseReputationMining

Create an initial inactive reputation mining cycle.

await colonyNetworkClient.initialiseReputationMining.send(options);

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IColonyNetwork.sol

registerColonyLabel

Register an ENS label for a colony.

await colonyNetworkClient.registerColonyLabel.send({
  colonyName,
  orbitDBPath,
}, options);

Input

NameTypeDescription
colonyNamestringThe ENS label that will be registered for the colony.
orbitDBPathstringThe path of the OrbitDB database associated with the colony.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
colonyaddressThe address of the colony that registered a label.
labelstringThe ENS label that was registered for the colony.
ColonyLabelRegisteredobjectContains the data defined in ColonyLabelRegistered

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

registerUserLabel

Register an ENS label for a user.

await colonyNetworkClient.registerUserLabel.send({
  username,
  orbitDBPath,
}, options);

Input

NameTypeDescription
usernamestringThe ENS label that will be registered for the user.
orbitDBPathstringThe path of the OrbitDB database associated with the user.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
useraddressThe address of the user that registered a label.
labelstringThe ENS label that was registered for the user.
UserLabelRegisteredobjectContains the data defined in UserLabelRegistered

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

removeRecoveryRole

Remove the RECOVERY role from an address. This function can only be called by an address assigned the ROOT role.

await colonyNetworkClient.removeRecoveryRole.send({
  address,
}, options);

Input

NameTypeDescription
addressaddressThe address that will be unassigned a RECOVERY role.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ContractRecovery.sol

Interface: IRecovery.sol

setFeeInverse

Set the inverse amount of the network fee. If the fee is 1% (or 0.01), the inverse amount will be 100.

await colonyNetworkClient.setFeeInverse.send({
  feeInverse,
}, options);

Input

NameTypeDescription
feeInversebig numberThe inverse amount of the network fee.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
feeInversebig numberThe inverse value of the network fee that was set.
NetworkFeeInverseSetobjectContains the data defined in NetworkFeeInverseSet

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

setMiningResolver

Set the address for the mining resolver.

await colonyNetworkClient.setMiningResolver.send({
  miningResolverAddress,
}, options);

Input

NameTypeDescription
miningResolverAddressaddressThe address that will be set for the mining resolver.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
miningCycleResolveraddressThe address of the resolver contract for the reputation mining cycle contract.
MiningCycleResolverSetobjectContains the data defined in MiningCycleResolverSet

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

setRecoveryRole

Assign a RECOVERY role to an address. This function can only be called by an address assigned the ROOT role.

await colonyNetworkClient.setRecoveryRole.send({
  address,
}, options);

Input

NameTypeDescription
addressaddressThe address that will be assigned a RECOVERY role.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ContractRecovery.sol

Interface: IRecovery.sol

setReplacementReputationUpdateLogEntry

Set replacement log entry when the network is in recovery mode.

await colonyNetworkClient.setReplacementReputationUpdateLogEntry.send({
  reputationMiningCycle,
  id,
  user,
  amount,
  skillId,
  colony,
  nUpdates,
  nPreviousUpdates,
}, options);

Input

NameTypeDescription
reputationMiningCycleaddress
idnumber
useraddress
amountbig number
skillIdnumber
colonyaddress
nUpdatesnumber
nPreviousUpdatesnumber

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IColonyNetwork.sol

setReputationRootHash

Set the root hash of the reputation mining cycle.

await colonyNetworkClient.setReputationRootHash.send({
  newHash,
  newNNodes,
  stakers,
  reward,
}, options);

Input

NameTypeDescription
newHashstring
newNNodesnumber
stakersarray
rewardnumber

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IColonyNetwork.sol

setStorageSlotRecovery

Set the value for a storage slot while in recovery mode. This can only be called by an address assigned the RECOVERY role.

await colonyNetworkClient.setStorageSlotRecovery.send({
  slot,
  value,
}, options);

Input

NameTypeDescription
slotnumberThe ID of the storage slot that will be modified.
valuehex stringThe hex string of data that will be set as the value.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ContractRecovery.sol

Interface: IRecovery.sol

setTokenLocking

Set the token locking address.

await colonyNetworkClient.setTokenLocking.send({
  tokenLockingAddress,
}, options);

Input

NameTypeDescription
tokenLockingAddressaddressThe address of the locking contract.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
tokenLockingaddressThe address of the token locking contract.
TokenLockingAddressSetobjectContains the data defined in TokenLockingAddressSet

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetwork.sol

Interface: IColonyNetwork.sol

setupRegistrar

Set up the registrar.

await colonyNetworkClient.setupRegistrar.send({
  ens,
  rootNode,
}, options);

Input

NameTypeDescription
ensaddressThe adddress of the ENS registrar.
rootNodestringThe namehash of the root node for the domain.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkENS.sol

Interface: IColonyNetwork.sol

startNextMiningCycle

Start the next reputation mining cycle.

await colonyNetworkClient.startNextMiningCycle.send(options);

Options

See Sender for more information about options.

Response

An instance of a ContractResponse.

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkMining.sol

Interface: IColonyNetwork.sol

startTokenAuction

Create and start an auction for a token owned by the Colony Network. The auction will be for the total amount of the specificed tokens that are owned by the Colony Network.

await colonyNetworkClient.startTokenAuction.send({
  tokenAddress,
}, options);

Input

NameTypeDescription
tokenAddressaddressThe address of the token contract.

Options

See Sender for more information about options.

Response

An instance of a ContractResponse which will eventually receive the following event data:

NameTypeDescription
auctionstringThe address of the auction contract that was created.
tokenaddressThe address of the token contract that was assigned.
quantitybig numberThe amount of tokens available for the auction.
AuctionCreatedobjectContains the data defined in AuctionCreated

See Sender for more information about ContractResponse.

Contract Information

Contract: ColonyNetworkAuction.sol

Interface: IColonyNetwork.sol

Events

AuctionCreated

Event Handler

const eventHandler = ({
  auction,
  token,
  quantity,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.AuctionCreated.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.AuctionCreated.removeListener(eventHandler);

Event Data

NameTypeDescription
auctionstringThe address of the auction contract that was created.
tokenaddressThe address of the token contract that was assigned.
quantitybig numberThe amount of tokens available for the auction.

ColonyAdded

Event Handler

const eventHandler = ({
  colonyId,
  colonyAddress,
  tokenAddress,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.ColonyAdded.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.ColonyAdded.removeListener(eventHandler);

Event Data

NameTypeDescription
colonyIdnumberThe ID of the colony that was added.
colonyAddressaddressThe address of the colony contract that was created.
tokenAddressaddressThe address of the token contract that was assigned.

ColonyLabelRegistered

Event Handler

const eventHandler = ({
  colony,
  label,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.ColonyLabelRegistered.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.ColonyLabelRegistered.removeListener(eventHandler);

Event Data

NameTypeDescription
colonyaddressThe address of the colony that registered a label.
labelstringThe ENS label that was registered for the colony.

ColonyNetworkInitialised

Event Handler

const eventHandler = ({
  resolver,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.ColonyNetworkInitialised.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.ColonyNetworkInitialised.removeListener(eventHandler);

Event Data

NameTypeDescription
resolveraddressThe address of the resolver contract.

ColonyVersionAdded

Event Handler

const eventHandler = ({
  version,
  resolver,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.ColonyVersionAdded.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.ColonyVersionAdded.removeListener(eventHandler);

Event Data

NameTypeDescription
versionnumberThe version number of the colony contract that was added.
resolveraddressThe address of the resolver contract.

MetaColonyCreated

Event Handler

const eventHandler = ({
  colonyAddress,
  tokenAddress,
  rootSkillId,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.MetaColonyCreated.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.MetaColonyCreated.removeListener(eventHandler);

Event Data

NameTypeDescription
colonyAddressnumberThe address of the Meta Colony.
tokenAddressaddressThe address of the CLNY token contract.
rootSkillIdnumberThe ID of the root skill.

MiningCycleResolverSet

Event Handler

const eventHandler = ({
  miningCycleResolver,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.MiningCycleResolverSet.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.MiningCycleResolverSet.removeListener(eventHandler);

Event Data

NameTypeDescription
miningCycleResolveraddressThe address of the resolver contract for the reputation mining cycle contract.

NetworkFeeInverseSet

Event Handler

const eventHandler = ({
  feeInverse,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.NetworkFeeInverseSet.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.NetworkFeeInverseSet.removeListener(eventHandler);

Event Data

NameTypeDescription
feeInversebig numberThe inverse value of the network fee that was set.

ReputationMiningCycleComplete

Event Handler

const eventHandler = ({
  hash,
  nNodes,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.ReputationMiningCycleComplete.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.ReputationMiningCycleComplete.removeListener(eventHandler);

Event Data

NameTypeDescription
hashhex stringThe root hash of the reputation state that was accepted.
nNodesnumberThe total number of nodes in the reputation state.

ReputationMiningInitialised

Event Handler

const eventHandler = ({
  inactiveReputationMiningCycle,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.ReputationMiningInitialised.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.ReputationMiningInitialised.removeListener(eventHandler);

Event Data

NameTypeDescription
inactiveReputationMiningCycleaddressThe address of the reputation mining cycle that was initialized.

ReputationRootHashSet

Event Handler

const eventHandler = ({
  newHash,
  newNNodes,
  stakers,
  reward,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.ReputationRootHashSet.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.ReputationRootHashSet.removeListener(eventHandler);

Event Data

NameTypeDescription
newHashhex stringThe reputation root hash that was set.
newNNodesnumberThe total number of nodes in the reputation state.
stakersarrayThe array of users who submitted or backed the accepted hash.
rewardarrayThe array of corresponding amounts of CLNY each user received.

SkillAdded

Event Handler

const eventHandler = ({
  skillId,
  parentSkillId,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.SkillAdded.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.SkillAdded.removeListener(eventHandler);

Event Data

NameTypeDescription
skillIdnumberThe ID of the skill that was added.
parentSkillIdnumberThe ID of the parent skill.

TokenLockingAddressSet

Event Handler

const eventHandler = ({
  tokenLocking,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.TokenLockingAddressSet.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.TokenLockingAddressSet.removeListener(eventHandler);

Event Data

NameTypeDescription
tokenLockingaddressThe address of the token locking contract.

UserLabelRegistered

Event Handler

const eventHandler = ({
  user,
  label,
}) => {
  // perform an action using the event data
};

Add Listener

colonyNetworkClient.events.UserLabelRegistered.addListener(eventHandler);

Remove Listener

colonyNetworkClient.events.UserLabelRegistered.removeListener(eventHandler);

Event Data

NameTypeDescription
useraddressThe address of the user that registered a label.
labelstringThe ENS label that was registered for the user.

Support

Questions? Problems? Existential dilemmas? We’re here to help!

Improve this doc.

All improvements to documentation are welcome and encouraged. Submit a PR for documentation on GitHub.