Skip to main content

Installation

The CoW Protocol contracts package enables developers to integrate CoW Protocol functionality into their projects.

Package Installation

npm install @cowprotocol/contracts

Peer Dependencies

The package requires ethers version 5.4.0 or higher as a peer dependency:
npm install ethers@^5.4.0
The package targets ethers v5. Compatibility with ethers v6 is not assured.

Basic Setup

import {
  Order,
  OrderKind,
  signOrder,
  SigningScheme,
} from "@cowprotocol/contracts";

TypeScript Support

The package provides comprehensive TypeScript type definitions for all interfaces, enums, and functions. Contract artifacts with deployment information are accessible via a networks.json file.

Building from Source

For developers preferring to build from source:
git clone https://github.com/cowprotocol/contracts.git
cd contracts
yarn install
yarn build
The build generates both CommonJS and ESM modules.

Next Steps

Quickstart

Learn how to create and sign orders
Last modified on March 4, 2026