Skip to main content

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

An umbrella API for all kinds of transactions

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

Force a transaction

Create a motion to trigger an action once it passes

Learn more about these functions in their individual documentation

Type parameters

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

Constructors

constructor

new TxCreator<C, M, E, MD>(__namedParameters)

Type parameters

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

Parameters

NameType
__namedParametersObject
__namedParameters.argsunknown[] | () => Promise<unknown[]>
__namedParameters.colonyColony
__namedParameters.contractC
__namedParameters.eventData?(receipt: ContractReceipt) => Promise<E>
__namedParameters.metadataType?MD
__namedParameters.methodM
__namedParameters.permissionConfig?PermissionConfig

Methods

force

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

Forces an action

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) => undefined | string = getAnnotationMsgFromResponse; colony: (res: string) => undefined | ColonyMetadata = getColonyMetadataFromResponse; decision: (res: string) => undefined | DecisionMetadata = getDecisionDetailsFromResponse; domain: (res: string) => undefined | DomainMetadata = getDomainMetadataFromResponse; misc: (res: string) => undefined | MiscMetadata = getMiscDataFromResponse }[MD]>>] | [E, ContractReceipt]>

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


forceMeta

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

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


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


motionMeta

motionMeta(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