An open API service indexing awesome lists of open source software.

https://github.com/cowprotocol/cow-sdk

CoW protocol SDK
https://github.com/cowprotocol/cow-sdk

Last synced: about 1 month ago
JSON representation

CoW protocol SDK

Awesome Lists containing this project

README

          



## Test coverage

| Statements | Branches | Functions | Lines |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| ![Statements](https://img.shields.io/badge/statements-94.77%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-76.78%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-97.43%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-97.67%25-brightgreen.svg?style=flat) |

## Use CoW Protocol

> Check [**@cowprotocol/cow-sdk**](https://github.com/cowprotocol/cow-sdk/tree/main/packages/sdk/README.md) to learn how to trade on the CoW Protocol (get quote, verify amounts, sign and send order)

### Supported chains

CoW Swap is currently available on the following chains:

- **Ethereum** (1)
- **BNB** (56)
- **Gnosis Chain** (100)
- **Polygon** (137)
- **Base** (8453)
- **Plasma** (9745)
- **Arbitrum One** (42161)
- **Avalanche** (43114)
- **Ink** (57073)
- **Linea** (59144)
- **Sepolia** (11155111) (Testnet)

## Technical Overview

This is a **TypeScript monorepo** containing the complete CoW Protocol SDK ecosystem. The repository is organized into multiple packages that provide different levels of abstraction and functionality for interacting with CoW Protocol.

### Monorepo Architecture

The project uses modern tooling for efficient development and publishing:

- **๐Ÿ—๏ธ Build System**: [Turbo](https://turbo.build/) for fast, incremental builds and task orchestration
- **๐Ÿ“ฆ Package Manager**: [pnpm](https://pnpm.io/) v10.8+ with workspaces for efficient dependency management
- **๐Ÿ”ง TypeScript**: Shared TypeScript configuration across all packages
- **๐Ÿงช Testing**: Jest for unit testing with coverage reporting
- **๐Ÿ“‹ Linting**: ESLint v9+ with TypeScript support and unused imports detection
- **๐ŸŽจ Formatting**: Prettier for consistent code formatting
- **๐Ÿ“ฆ Publishing**: Release Please for automated versioning and publishing
- **โšก Development**: Node.js 22+ required

### Package Structure

#### ๐ŸŽฏ Main SDK Package

- **[`@cowprotocol/cow-sdk`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/sdk/README.md)** - Complete package that re-exports all other packages for easy consumption

#### ๐Ÿ”ง Core Trading Packages

- **[`@cowprotocol/sdk-trading`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/trading/README.md)** - High-level trading SDK with built-in quote fetching, order signing, and posting
- **[`@cowprotocol/sdk-order-book`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/order-book/README.md)** - Order book API client for retrieving orders, trades, and posting orders
- **[`@cowprotocol/sdk-order-signing`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/order-signing/README.md)** - Cryptographic utilities for signing orders and cancellations

#### ๐ŸŒ‰ Advanced Features

- **[`@cowprotocol/sdk-bridging`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/bridging/README.md)** - Cross-chain token transfers and bridging functionality
- **[`@cowprotocol/sdk-composable`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/composable/README.md)** - Programmatic orders (TWAP, conditional orders, etc.)
- **[`@cowprotocol/sdk-cow-shed`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/cow-shed/README.md)** - Account abstraction with smart contract capabilities

#### ๐Ÿ”Œ Provider Adapters

- **[`@cowprotocol/sdk-viem-adapter`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/providers/viem-adapter/README.md)** - Viem blockchain library adapter
- **[`@cowprotocol/sdk-ethers-v6-adapter`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/providers/ethers-v6-adapter/README.md)** - Ethers.js v6 adapter
- **[`@cowprotocol/sdk-ethers-v5-adapter`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/providers/ethers-v5-adapter/README.md)** - Ethers.js v5 adapter

#### ๐Ÿ“š Supporting Packages

- **[`@cowprotocol/sdk-app-data`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/app-data/README.md)** - AppData schema definitions and metadata handling
- **[`@cowprotocol/sdk-config`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/config/README.md)** - Configuration constants and chain settings
- **[`@cowprotocol/sdk-common`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/common/README.md)** - Common utilities, types, and shared functionality
- **[`@cowprotocol/sdk-contracts-ts`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/contracts-ts/README.md)** - TypeScript contract bindings and ABI definitions
- **[`@cowprotocol/sdk-subgraph`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/subgraph/README.md)** - GraphQL client for CoW Protocol subgraph data
- **[`@cowprotocol/sdk-weiroll`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/weiroll/README.md)** - Weiroll integration utilities

#### ๐Ÿ› ๏ธ Development Packages

- **[`@cow-sdk/typescript-config`](https://github.com/cowprotocol/cow-sdk/tree/main/packages/typescript-config)** - Shared TypeScript configuration

### Development Workflow

```bash
# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

# Run linting
pnpm lint

# Format code
pnpm format

# Type checking
pnpm typecheck

# Clean build artifacts
pnpm clean
```

## Contributing

We welcome contributions to the CoW Protocol SDK! Here's how to get started:

### ๐Ÿš€ **Quick Start**

1. **Fork the repository** on GitHub
2. **Clone your fork** locally:
```bash
git clone https://github.com/YOUR_USERNAME/cow-sdk.git
cd cow-sdk
```
3. **Follow the [Development Workflow](#development-workflow)** above to set up your environment
4. **Make your changes** following our [Contributor Guidelines](CONTRIBUTING.md)
5. **Create a pull request** short after creating it, you will be asked to sign the CLA (Contributor License Agreement). A comment with instructions will be added to the PR.

### ๐Ÿ“š **Need Help?**

- Check existing [issues](https://github.com/cowprotocol/cow-sdk/issues) for similar problems
- Join our [Discord](https://discord.gg/cowprotocol) for community support
- Read the [CoW Protocol documentation](https://docs.cow.fi)