Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-seo-audit-1777280932.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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:| Error | Description |
|---|---|
PollTryNextBlock | Condition not met yet; retry next block |
PollTryAtBlock / PollTryAtEpoch | Retry at specified block number or timestamp |
PollNever | Permanent failure; stop monitoring |
OrderNotValid | Condition check failed (e.g., insufficient balance) |
Event Monitoring
Watchtowers track three primary events:ConditionalOrderCreated- New order registeredMerkleRootSet- Merkle tree authorization updatedSwapGuardSet- Guard configuration changed