Class: MetaTxCreator<C, M, E, MD>
An umbrella API for all kinds of transactions
The MetaTxCreator
allows for a simple API to cover all the different cases of transactions within the Colony Network. The MetaTxCreator
supports sending a standard transaction (MetaTxCreator.tx) as well as metatransactions (MetaTxCreator.metaTx).
Create a standard transaction ("force" in dApp)
- MetaTxCreator.tx: force a Colony transaction, knowing you have the permissions to do so
- MetaTxCreator.metaTx: same as
tx()
, but send as a gasless metatransaction
Learn more about these functions in their individual documentation
Type parameters
Name | Type |
---|---|
C | extends MetaTxBaseContract |
M | extends keyof C ["functions" ] |
E | extends EventData |
MD | extends MetadataType |
Hierarchy
TxCreator
<C
,M
,E
,MD
>↳
MetaTxCreator
Constructors
constructor
• new MetaTxCreator<C
, M
, E
, MD
>(__namedParameters
)
Type parameters
Name | Type |
---|---|
C | extends MetaTxBaseContract |
M | extends string | number | symbol |
E | extends EventData |
MD | extends MetadataType |
Parameters
Name | Type |
---|---|
__namedParameters | Object |
__namedParameters.args | unknown [] | () => Promise <unknown []> |
__namedParameters.colonyNetwork | ColonyNetwork |
__namedParameters.contract | C |
__namedParameters.eventData? | (receipt : ContractReceipt ) => Promise <E > |
__namedParameters.metadataType? | MD |
__namedParameters.method | M |
__namedParameters.txConfig? | TxConfig <MD > |
Inherited from
Methods
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)
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)