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)
- ColonyTxCreator.tx: force a Colony transaction, knowing you have the permissions to do so
- ColonyTxCreator.metaTx: same as
tx()
, but send as a gasless metatransaction
Create a motion to trigger an action once it passes
- ColonyTxCreator.motion: create a motion (needs the motion's domain as a parameter)
- ColonyTxCreator.metaMotion: same as
motion()
, but sends 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
MetaTxCreator
<C
,M
,E
,MD
>↳
ColonyTxCreator
Constructors
constructor
• new ColonyTxCreator<C
, M
, E
, MD
>(config
)
Type parameters
Name | Type |
---|---|
C | extends MetaTxBaseContract |
M | extends string | number | symbol |
E | extends EventData |
MD | extends MetadataType |
Parameters
Name | Type |
---|---|
config | MetaMotionsConfig <C , M , E , MD > |
Overrides
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
Name | Type | Default value |
---|---|---|
motionDomain | BigNumberish | Id.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
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
Name | Type | Default value |
---|---|---|
motionDomain | BigNumberish | Id.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)