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)

Create a motion to trigger an action once it passes

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?): Promise<[{ creator?: string ; domainId?: BigNumber ; motionId?: BigNumber }, ParsedLogTransactionReceipt]>

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.

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

Promise<[{ creator?: string ; domainId?: BigNumber ; motionId?: BigNumber }, ParsedLogTransactionReceipt]>

A tupel of motion event data and contract receipt


metaTx

metaTx(): Promise<[E, ParsedLogTransactionReceipt, () => Promise<ReturnType<{ None: () => void ; annotation: (res: string) => string = getAnnotationMsgFromResponse; colony: (res: string) => ColonyMetadata = getColonyMetadataFromResponse; decision: (res: string) => DecisionMetadata = getDecisionDetailsFromResponse; domain: (res: string) => DomainMetadata = getDomainMetadataFromResponse; misc: (res: string) => MiscMetadata = getMiscDataFromResponse }[MD]>>] | [E, ParsedLogTransactionReceipt]>

Forces an action using a gasless metatransaction

Remarks

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

Returns

Promise<[E, ParsedLogTransactionReceipt, () => Promise<ReturnType<{ None: () => void ; annotation: (res: string) => string = getAnnotationMsgFromResponse; colony: (res: string) => ColonyMetadata = getColonyMetadataFromResponse; decision: (res: string) => DecisionMetadata = getDecisionDetailsFromResponse; domain: (res: string) => DomainMetadata = getDomainMetadataFromResponse; misc: (res: string) => MiscMetadata = getMiscDataFromResponse }[MD]>>] | [E, ParsedLogTransactionReceipt]>

A tupel of event data and contract receipt (and a function to retrieve metadata if applicable)

Inherited from

MetaTxCreator.metaTx


motion

motion(motionDomain?): Promise<[{ creator?: string ; domainId?: BigNumber ; motionId?: BigNumber }, ContractReceipt]>

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.

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

Promise<[{ creator?: string ; domainId?: BigNumber ; motionId?: BigNumber }, ContractReceipt]>

A tupel of motion event data and contract receipt


tx

tx(): Promise<[E, ContractReceipt, () => Promise<ReturnType<{ None: () => void ; annotation: (res: string) => string = getAnnotationMsgFromResponse; colony: (res: string) => ColonyMetadata = getColonyMetadataFromResponse; decision: (res: string) => DecisionMetadata = getDecisionDetailsFromResponse; domain: (res: string) => DomainMetadata = getDomainMetadataFromResponse; misc: (res: string) => MiscMetadata = getMiscDataFromResponse }[MD]>>] | [E, ContractReceipt]>

Create a standard transaction ("force" in dApp)

Remarks

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

Returns

Promise<[E, ContractReceipt, () => Promise<ReturnType<{ None: () => void ; annotation: (res: string) => string = getAnnotationMsgFromResponse; colony: (res: string) => ColonyMetadata = getColonyMetadataFromResponse; decision: (res: string) => DecisionMetadata = getDecisionDetailsFromResponse; domain: (res: string) => DomainMetadata = getDomainMetadataFromResponse; misc: (res: string) => MiscMetadata = getMiscDataFromResponse }[MD]>>] | [E, ContractReceipt]>

A tupel of event data and contract receipt (and a function to retrieve metadata if applicable)

Inherited from

MetaTxCreator.tx