Managing Orders
Key Management Functions
Status Checking
You can verify order existence by examining thesingleOrders mapping for authorization status or checking if a merkle root is set via the roots mapping.
Retrieving Orders
ThegetTradeableOrderWithSignature() function converts programmatic orders into discrete GPv2 orders ready for submission to CoW Protocol API. Single orders use empty proofs, while merkle-based orders require proof arrays.
Order Removal
Individual orders are deleted by calculating their hash and callingremove(), which clears both the authorization flag and cabinet storage. Multiple removals can be batched using MultiSend for efficiency.
Error Handling
ComposableCoW uses custom errors to signal order status:Event Monitoring
Watchtowers track three primary events:ConditionalOrderCreated- New order registeredMerkleRootSet- Merkle tree authorization updatedSwapGuardSet- Guard configuration changed