Skip to main content

Class: ColonyTxCreator<C, M, E, MD>

An umbrella API for all kinds of transactions within colonies

The ColonyTxCreator allows for a simple API to cover all the different cases of transactions within a colony. Once a ColonyTxCreator is created using a method on the base contracts (e.g. Colony or extensions like VotingReputation) there are four options available:

Create a standard transaction ("force" in dApp)​

  • tx: force a Colony transaction, knowing you have the permissions to do so
  • metaTx: same as tx(), but send as a gasless metatransaction

Create a motion to trigger an action once it passes​

  • motion: create a motion (needs the motion's domain as a parameter)
  • metaMotion: same as motion(), but sends a gasless metatransaction

Learn more about these functions in their individual documentation

Type parameters​

NameType
Cextends MetaTxBaseContract
Mextends keyof C["functions"]
Eextends EventData
MDextends MetadataType

Hierarchy​

Constructors​

constructor​

• new ColonyTxCreator<C, M, E, MD>(config)

Type parameters​

NameType
Cextends MetaTxBaseContract
Mextends string | number | symbol
Eextends EventData
MDextends MetadataType

Parameters​

NameType
configMetaMotionsConfig<C, M, E, MD>

Overrides​

MetaTxCreator.constructor

Methods​

metaMotion​

▸ metaMotion(motionDomain?): ColonyMetaTransaction<TransactionResponse, MotionCreatedEventObject, ParsedLogTransactionReceipt, MD>

Creates a motion for an action, using a gasless transaction

You can specify a team (domain) this motion should be created in. It will be created in the Root team by default.

After creation, you can then send the transaction or wait for it to be mined. See also tx and https://docs.colony.io/colonysdk/guides/transactions for more information

Remarks

This will only work if the VotingReputation extension is installed for the Colony that's being acted on

Parameters​

NameTypeDefault value
motionDomainBigNumberishId.RootDomain

Returns​

ColonyMetaTransaction<TransactionResponse, MotionCreatedEventObject, ParsedLogTransactionReceipt, MD>

A motion transaction that can be send or mined or encoded.


metaTx​

▸ metaTx(): ColonyMetaTransaction<TransactionResponse, E, ParsedLogTransactionReceipt, MD>

Create a gasless MetaTransaction ("force" in dApp)

After creation, you can then send the transaction or wait for it to be mined. See also tx and https://docs.colony.io/colonysdk/guides/transactions for more information

Remarks

The user sending this transaction has to have the appropriate permissions to do so. Learn more about permissions in Colony here.

Returns​

ColonyMetaTransaction<TransactionResponse, E, ParsedLogTransactionReceipt, MD>

A transaction that can be send or mined.

Inherited from​

MetaTxCreator.metaTx


motion​

▸ motion(motionDomain?): ColonyTransaction<ContractTransaction, MotionCreatedEventObject, ContractReceipt, MD>

Creates a motion for an action

You can specify a team (domain) this motion should be created in. It will be created in the Root team by default.

After creation, you can then send the transaction or wait for it to be mined. See also ColonyTransaction and https://docs.colony.io/colonysdk/guides/transactions for more information

Remarks

This will only work if the VotingReputation extension is installed for the Colony that's being acted on

Parameters​

NameTypeDefault value
motionDomainBigNumberishId.RootDomain

Returns​

ColonyTransaction<ContractTransaction, MotionCreatedEventObject, ContractReceipt, MD>

A motion transaction that can be send or mined or encoded.


tx​

▸ tx(): ColonyTransaction<ContractTransaction, E, ContractReceipt, MD>

Create a standard transaction ("force" in dApp)

See also ColonyTransaction or https://docs.colony.io/colonysdk/guides/transactions for more information

Remarks

The user sending this transaction has to have the appropriate permissions to do so. Learn more about permissions in Colony here.

Returns​

ColonyTransaction<ContractTransaction, E, ContractReceipt, MD>

A transaction that can be send, mined or encoded.

Inherited from​

MetaTxCreator.tx