Quickstart
This guide walks you through creating and signing CoW Protocol orders using TypeScript.Prerequisites
@cowprotocol/contractsinstalledethers@^5.4.0installed- A wallet or signer
Setup
Step 1: Define Your Order
Orders specify trading parameters: the tokens being exchanged, amounts, validity period, and balance types.Order Kinds
- SELL - Exchange an exact amount of sell tokens for a minimum amount of buy tokens
- BUY - Purchase an exact amount of buy tokens spending at most a specified amount of sell tokens
Step 2: Create Domain Separator
A domain separator ensures orders remain valid only for specific blockchain networks and settlement contracts.Step 3: Sign the Order
CoW Protocol supports multiple signing schemes:- EIP712 - Recommended for best user experience
- ETHSIGN - For compatibility with wallets that don’t support EIP-712
- EIP1271 - For smart contract wallets (e.g., Gnosis Safe)
- PRESIGN - For on-chain order placement
Step 4: Compute Order UID
Complete Example
Next Steps
Orders
Learn about order types and lifecycle
Signing
Explore advanced signing schemes