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.
GPv2Order API
TheGPv2Order library provides core order data structures and utilities for Gnosis Protocol v2, handling order hashing, UID packing, and parameter extraction.
Data Structure
| Field | Type | Description |
|---|---|---|
sellToken | IERC20 | Token to sell |
buyToken | IERC20 | Token to buy |
receiver | address | Recipient of buy tokens (address(0) defaults to owner) |
sellAmount | uint256 | Amount of sell token |
buyAmount | uint256 | Amount of buy token |
validTo | uint32 | Order expiration as Unix timestamp |
appData | bytes32 | Application-specific metadata |
feeAmount | uint256 | Fee amount in sell token |
kind | bytes32 | Order kind (KIND_SELL or KIND_BUY) |
partiallyFillable | bool | Whether partial fills are allowed |
sellTokenBalance | bytes32 | Source of sell tokens |
buyTokenBalance | bytes32 | Destination of buy tokens |
Constants
Functions
hash
Generates the EIP-712 signing digest for an order.actualReceiver
Resolves the receiver address, returning the owner if receiver isaddress(0).
packOrderUidParams
Encodes the 56-byte order UID from its components.extractOrderUidParams
Decodes UID components from a packed order UID.Order UID Format
The 56-byte UID is packed as:| Bytes | Field |
|---|---|
| 0-31 | Order digest (EIP-712 hash) |
| 32-51 | Owner address |
| 52-55 | validTo timestamp |