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 the Colony Network. This is the base class of the TxCreator that only supports the force() action and no metatransactions.

Create a standard transaction ("force" in dApp)

  • TxCreator.tx: force a Colony transaction, knowing you have the permissions to do so

Learn more about these functions in their individual documentation

Type parameters

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

Hierarchy

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.colonyNetworkColonyNetwork
__namedParameters.contractC
__namedParameters.eventData?(receipt: ContractReceipt) => Promise<E>
__namedParameters.metadataType?MD
__namedParameters.methodM
__namedParameters.txConfig?TxConfig<MD>

Methods

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)