Class: ConditionalOrder<D, S>
An abstract base class from which all conditional orders should inherit.
This class provides some basic functionality to help with handling conditional orders, such as:
- Validating the conditional order
- Creating a human-readable string representation of the conditional order
- Serializing the conditional order for use with the
IConditionalOrderstruct - Getting any dependencies for the conditional order
- Getting the off-chain input for the conditional order
NOTE: Instances of conditional orders have an id property that is a keccak256 hash of
the serialized conditional order.
Type parameters
| Name |
|---|
D |
S |
Hierarchy
-
ConditionalOrder↳
Twap
Constructors
constructor
• new ConditionalOrder<D, S>(params): ConditionalOrder<D, S>
A constructor that provides some basic validation for the conditional order.
This constructor MUST be called by any class that inherits from ConditionalOrder.
NOTE: The salt is optional and will be randomly generated if not provided.
Type parameters
| Name |
|---|
D |
S |
Parameters
| Name | Type |
|---|---|
params | ConditionalOrderArguments<D> |
Returns
ConditionalOrder<D, S>
Throws
If the handler is not a valid ethereum address.
Throws
If the salt is not a valid 32-byte string.
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:54
Properties
data
• Readonly data: D
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:37
handler
• Readonly handler: string
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:35
hasOffChainInput
• Readonly hasOffChainInput: boolean
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:39
salt
• Readonly salt: string
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:36
staticInput
• Readonly staticInput: S
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:38
Accessors
context
• get context(): undefined | ContextFactory
Get the context dependency for the conditional order.
This is used when calling createWithContext or setRootWithContext on a ComposableCoW-enabled Safe.
Returns
undefined | ContextFactory
The context dependency.
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:91
createCalldata
• get createCalldata(): string
Get the calldata for creating the conditional order.
This will automatically determine whether or not to use create or createWithContext based on the
order type's context dependency.
NOTE: By default, this will cause the create to emit the ConditionalOrderCreated event.
Returns
string
The calldata for creating the conditional order.
Defined in
external/cow-sdk/src/composable/ConditionalOrder.ts:113