Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cow-sdk/advanced/cross-chain-bridging.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Cross-Chain Bridging"
description: "Enable seamless token transfers across different blockchain networks using the CoW Protocol SDK"

Check warning on line 3 in cow-sdk/advanced/cross-chain-bridging.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/cross-chain-bridging.mdx#L3

Did you really mean 'blockchain'?
---

# Cross-Chain Bridging

The CoW Protocol SDK provides seamless cross-chain token transfers through integration with multiple bridge providers. This enables you to swap tokens across different blockchain networks in a single transaction.

Check warning on line 8 in cow-sdk/advanced/cross-chain-bridging.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/cross-chain-bridging.mdx#L8

Did you really mean 'blockchain'?

## Installation

Expand All @@ -17,6 +17,10 @@

### Initialize the BridgingSdk

<Warning>
The `CowSdk` class shown in the "With CoW SDK" tab below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) or the standalone `BridgingSdk` instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

<CodeGroup>
```typescript Standalone
import {
Expand Down Expand Up @@ -339,7 +343,7 @@

<CardGroup cols={2}>
<Card title="Programmatic Orders" icon="code" href="/cow-sdk/advanced/programmatic-orders">
Learn about conditional and composable orders

Check warning on line 346 in cow-sdk/advanced/cross-chain-bridging.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/cross-chain-bridging.mdx#L346

Did you really mean 'composable'?
</Card>

<Card title="Hooks" icon="webhook" href="/cow-sdk/advanced/hooks">
Expand Down
8 changes: 8 additions & 0 deletions cow-sdk/advanced/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- **Execute pre-order logic**: Approve tokens, wrap/unwrap assets, or setup flash loans
- **Execute post-order logic**: Stake tokens, compound yields, or trigger other contracts
- **Chain complex operations**: Combine multiple DeFi protocols in a single transaction
- **Integrate with dApps**: Enable seamless integration with other protocols

Check warning on line 17 in cow-sdk/advanced/hooks.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/hooks.mdx#L17

Did you really mean 'dApps'?

## Hook Structure

Expand Down Expand Up @@ -80,6 +80,10 @@

### Using TradingSdk with Hooks

<Warning>
The `CowSdk` class shown below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

```typescript
import { CowSdk } from '@cowprotocol/cow-sdk'
import { encodeFunctionData } from 'viem'
Expand Down Expand Up @@ -245,7 +249,11 @@

## Complete Example

<Warning>
The `CowSdk` class shown below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

Here's a complete example with pre and post hooks:

Check warning on line 256 in cow-sdk/advanced/hooks.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/hooks.mdx#L256

Did you really mean 'pre'?

```typescript
import { CowSdk, OrderKind } from '@cowprotocol/cow-sdk'
Expand Down Expand Up @@ -353,7 +361,7 @@

<AccordionGroup>
<Accordion title="Test hooks thoroughly">
Always test your hooks on testnets before production:

Check warning on line 364 in cow-sdk/advanced/hooks.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/hooks.mdx#L364

Did you really mean 'testnets'?

```typescript
// Test on Sepolia first
Expand Down Expand Up @@ -554,7 +562,7 @@
</Card>

<Card title="Hook Store" icon="store" href="/cow-swap/hooks/hook-store">
Browse pre-built hooks or publish your own hook dApp

Check warning on line 565 in cow-sdk/advanced/hooks.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/hooks.mdx#L565

Did you really mean 'dApp'?
</Card>

<Card title="Hooks: Getting Started" icon="play" href="/cow-swap/hooks/getting-started">
Expand All @@ -562,7 +570,7 @@
</Card>

<Card title="Hook dApp Development" icon="code" href="/cow-swap/hooks/hook-dapp">
Build custom hook dApps for the CoW Swap interface

Check warning on line 573 in cow-sdk/advanced/hooks.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/hooks.mdx#L573

Did you really mean 'dApps'?
</Card>

<Card title="Partner Fee" icon="coins" href="/cow-sdk/advanced/partner-fee">
Expand Down
4 changes: 4 additions & 0 deletions cow-sdk/advanced/partner-fee.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

## Fee Types

### Volume-Based Fee (volumeBps)

Check warning on line 21 in cow-sdk/advanced/partner-fee.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/partner-fee.mdx#L21

Did you really mean 'volumeBps'?

A fixed percentage of the order's sell or buy amount:

Expand All @@ -33,7 +33,7 @@
Volume-based fees are capped at 100 BPS (1%) at the protocol level.
</Info>

### Surplus-Based Fee (surplusBps)

Check warning on line 36 in cow-sdk/advanced/partner-fee.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/partner-fee.mdx#L36

Did you really mean 'surplusBps'?

A percentage of the order's surplus (the difference between limit price and execution price):

Expand All @@ -59,6 +59,10 @@

## Configuration

<Warning>
The `CowSdk` class shown in examples below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

### Single Fee Structure

```typescript
Expand All @@ -73,7 +77,7 @@
buyToken: '0xAnotherTokenAddress',
sellAmount: '1000000000000000000',
partnerFee: {
volumeBps: 50, // 0.5%

Check warning on line 80 in cow-sdk/advanced/partner-fee.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/partner-fee.mdx#L80

Did you really mean 'volumeBps'?
recipient: '0xPartnerAddress',
},
})
Expand All @@ -87,7 +91,7 @@
const partnerFee = [
// Primary: Take 50% of surplus, capped at 1% volume
{
surplusBps: 5000,

Check warning on line 94 in cow-sdk/advanced/partner-fee.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/partner-fee.mdx#L94

Did you really mean 'surplusBps'?
maxVolumeBps: 100,
recipient: '0xPartnerAddress',
},
Expand Down
4 changes: 4 additions & 0 deletions cow-sdk/advanced/programmatic-orders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Programmatic Orders

The CoW Protocol Composable SDK enables sophisticated trading strategies through programmatic orders that execute automatically when specified conditions are met. The `ComposableCoW` contract implements these orders, allowing you to build advanced trading logic without constant monitoring.

Check warning on line 8 in cow-sdk/advanced/programmatic-orders.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/programmatic-orders.mdx#L8

Did you really mean 'Composable'?

## Installation

Expand All @@ -28,7 +28,7 @@

### Multiplexer

Manages batches of programmatic orders using merkle trees:

Check warning on line 31 in cow-sdk/advanced/programmatic-orders.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/programmatic-orders.mdx#L31

Did you really mean 'merkle'?

```typescript
import { Multiplexer } from '@cowprotocol/sdk-composable'
Expand Down Expand Up @@ -103,6 +103,10 @@

### With CoW SDK

<Warning>
The `CowSdk` class shown below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

```typescript
import {
CowSdk,
Expand Down Expand Up @@ -190,9 +194,9 @@

Each part sells 100 USDC for WETH once per day. See the [TWAP Orders guide](/cow-sdk/advanced/twap-orders) for full configuration options including price protection.

## Merkle Tree Management

Check warning on line 197 in cow-sdk/advanced/programmatic-orders.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/programmatic-orders.mdx#L197

Did you really mean 'Merkle'?

Programmatic orders are stored in merkle trees for efficient on-chain verification:

Check warning on line 199 in cow-sdk/advanced/programmatic-orders.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/programmatic-orders.mdx#L199

Did you really mean 'merkle'?

```typescript
// Create multiplexer with multiple orders
Expand Down Expand Up @@ -368,7 +372,7 @@

### Store proofs off-chain

Generate and store merkle proofs off-chain to enable watchtowers to execute your orders:

Check warning on line 375 in cow-sdk/advanced/programmatic-orders.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/programmatic-orders.mdx#L375

Did you really mean 'merkle'?

```typescript
const proofs = multiplexer.dumpProofsAndParams()
Expand All @@ -389,4 +393,4 @@
## Next Steps

- **TWAP Orders**: Learn about Time-Weighted Average Price orders
- **Hooks**: Execute custom logic with pre and post hooks

Check warning on line 396 in cow-sdk/advanced/programmatic-orders.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/advanced/programmatic-orders.mdx#L396

Did you really mean 'pre'?
4 changes: 4 additions & 0 deletions cow-sdk/api/adapters/ethers-v5.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Ethers v5 Adapter"

Check warning on line 2 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L2

Did you really mean 'Ethers'?
description: "Integration between the CoW Protocol SDK and ethers.js v5"
---

# Ethers v5 Adapter

Check warning on line 6 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L6

Did you really mean 'Ethers'?

The Ethers v5 Adapter provides integration with [ethers.js v5](https://docs.ethers.org/v5/), enabling you to use all CoW Protocol SDK packages with ethers providers and signers.

Check warning on line 8 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L8

Did you really mean 'Ethers'?

Check warning on line 8 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L8

Did you really mean 'ethers'?

## Installation

Expand All @@ -28,11 +28,11 @@
### Parameters

<ResponseField name="provider" type="Provider | string" required>
An ethers v5 `Provider` instance or an RPC URL string. If a string is provided, a `JsonRpcProvider` will be created automatically.

Check warning on line 31 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L31

Did you really mean 'ethers'?
</ResponseField>

<ResponseField name="signer" type="Signer | string">
An ethers v5 `Signer` instance (e.g., `Wallet`) or a private key string.

Check warning on line 35 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L35

Did you really mean 'ethers'?
</ResponseField>

## Properties
Expand All @@ -45,9 +45,9 @@
const signerAdapter = adapter.signer
```

### utils

Check warning on line 48 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L48

Did you really mean 'utils'?

Utility methods for working with ethers v5 types and contracts.

Check warning on line 50 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L50

Did you really mean 'ethers'?

```typescript
const iface = adapter.utils.createInterface(abi)
Expand Down Expand Up @@ -77,7 +77,7 @@

Returns: `Promise<number>`

### getCode

Check warning on line 80 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L80

Did you really mean 'getCode'?

Returns the bytecode at a given address.

Expand Down Expand Up @@ -130,9 +130,9 @@

Returns: `Promise<string>`

### readContract

Check warning on line 133 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L133

Did you really mean 'readContract'?

Reads from a contract function using callStatic.

Check warning on line 135 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L135

Did you really mean 'callStatic'?

```typescript
const result = await adapter.readContract({
Expand All @@ -151,7 +151,7 @@

Returns: `Promise<unknown>`

### getBlock

Check warning on line 154 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L154

Did you really mean 'getBlock'?

Returns block information for a given block tag.

Expand All @@ -164,7 +164,7 @@

Returns: `Promise<Block>`

### getContract

Check warning on line 167 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L167

Did you really mean 'getContract'?

Creates a contract instance.

Expand All @@ -178,7 +178,7 @@

Returns: `GenericContract`

### setSigner

Check warning on line 181 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L181

Did you really mean 'setSigner'?

Sets or updates the signer for the adapter.

Expand All @@ -189,7 +189,7 @@

- `signer` (`Signer | string`) - New signer or private key

### setProvider

Check warning on line 192 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L192

Did you really mean 'setProvider'?

Sets or updates the provider for the adapter.

Expand All @@ -213,7 +213,7 @@

Returns: `EthersV5SignerAdapter | null`

### createSigner

Check warning on line 216 in cow-sdk/api/adapters/ethers-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v5.mdx#L216

Did you really mean 'createSigner'?

Creates a new signer adapter from a Signer instance or private key.

Expand Down Expand Up @@ -252,6 +252,10 @@

### With CoW SDK

<Warning>
The `CowSdk` class shown below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

```typescript
import { CowSdk, SupportedChainId } from '@cowprotocol/cow-sdk'
import { EthersV5Adapter } from '@cowprotocol/sdk-ethers-v5-adapter'
Expand Down
4 changes: 4 additions & 0 deletions cow-sdk/api/adapters/ethers-v6.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: "Ethers v6 Adapter"

Check warning on line 2 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L2

Did you really mean 'Ethers'?
description: "Integration between the CoW Protocol SDK and ethers.js v6"
---

# Ethers v6 Adapter

Check warning on line 6 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L6

Did you really mean 'Ethers'?

## Overview

The Ethers v6 Adapter integrates the CoW Protocol SDK with ethers.js v6, enabling usage of all SDK packages with ethers v6 providers and signers.

Check warning on line 10 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L10

Did you really mean 'Ethers'?

Check warning on line 10 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L10

Did you really mean 'ethers'?

## Installation

Expand All @@ -29,13 +29,13 @@
```

**Constructor Parameters:**
- `provider`: An ethers v6 Provider instance or RPC URL string (automatically creates JsonRpcProvider)

Check warning on line 32 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L32

Did you really mean 'ethers'?
- `signer`: Optional ethers v6 Signer instance or private key string

Check warning on line 33 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L33

Did you really mean 'ethers'?

## Core Properties

- **signer**: Returns the EthersV6SignerAdapter instance; throws error if unavailable
- **utils**: Utility methods for working with ethers v6 types and contracts

Check warning on line 38 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L38

Did you really mean 'utils'?

Check warning on line 38 in cow-sdk/api/adapters/ethers-v6.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/ethers-v6.mdx#L38

Did you really mean 'ethers'?
- **TypedDataVersionedSigner**: EIP-712 signer with version support
- **TypedDataV3Signer**: EIP-712 version 3 legacy signer
- **IntChainIdTypedDataV4Signer**: EIP-712 version 4 signer with MetaMask compatibility fixes
Expand Down Expand Up @@ -76,6 +76,10 @@

### Integration with CoW SDK

<Warning>
The `CowSdk` class shown below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

```typescript
import { CowSdk, SupportedChainId } from '@cowprotocol/cow-sdk'
import { EthersV6Adapter } from '@cowprotocol/sdk-ethers-v6-adapter'
Expand Down
4 changes: 4 additions & 0 deletions cow-sdk/api/adapters/viem.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Viem Adapter"

Check warning on line 2 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L2

Did you really mean 'Viem'?
description: "Integration between the CoW Protocol SDK and the Viem library"

Check warning on line 3 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L3

Did you really mean 'Viem'?
---

# Viem Adapter

Check warning on line 6 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L6

Did you really mean 'Viem'?

The Viem Adapter provides integration with the [viem](https://viem.sh) library, enabling you to use all CoW Protocol SDK packages with viem clients and accounts.

Check warning on line 8 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L8

Did you really mean 'Viem'?

Check warning on line 8 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L8

Did you really mean 'viem'?

## Installation

Expand All @@ -30,15 +30,15 @@
### Parameters

<ResponseField name="provider" type="PublicClient" required>
A viem `createPublicClient` instance

Check warning on line 33 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L33

Did you really mean 'viem'?
</ResponseField>

<ResponseField name="signer" type="Account | `0x${string}`">
A viem account from `privateKeyToAccount` or similar

Check warning on line 37 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L37

Did you really mean 'viem'?
</ResponseField>

<ResponseField name="walletClient" type="WalletClient">
A viem WalletClient, useful with wagmi's `useWalletClient` hook

Check warning on line 41 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L41

Did you really mean 'viem'?

Check warning on line 41 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L41

Did you really mean 'wagmi's'?
</ResponseField>

## Properties
Expand All @@ -51,9 +51,9 @@
const signerAdapter = adapter.signer
```

### utils

Check warning on line 54 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L54

Did you really mean 'utils'?

Utility methods for working with viem types and contracts.

Check warning on line 56 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L56

Did you really mean 'viem'?

```typescript
const iface = adapter.utils.createInterface(abi)
Expand Down Expand Up @@ -83,7 +83,7 @@

Returns: `Promise<number>`

### getCode

Check warning on line 86 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L86

Did you really mean 'getCode'?

Returns the bytecode at a given address.

Expand Down Expand Up @@ -136,7 +136,7 @@

Returns: `Promise<string>`

### readContract

Check warning on line 139 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L139

Did you really mean 'readContract'?

Reads from a contract function.

Expand All @@ -157,7 +157,7 @@

Returns: `Promise<unknown>`

### getBlock

Check warning on line 160 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L160

Did you really mean 'getBlock'?

Returns block information for a given block tag.

Expand All @@ -170,7 +170,7 @@

Returns: `Promise<Block>`

### getContract

Check warning on line 173 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L173

Did you really mean 'getContract'?

Creates a contract instance with a compatible interface.

Expand All @@ -184,7 +184,7 @@

Returns: `GenericContract`

### setSigner

Check warning on line 187 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L187

Did you really mean 'setSigner'?

Sets or updates the signer for the adapter.

Expand All @@ -195,7 +195,7 @@

- `signer` (`Account | PrivateKey | WalletClient`) - New signer

### setProvider

Check warning on line 198 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L198

Did you really mean 'setProvider'?

Sets or updates the provider for the adapter.

Expand All @@ -219,7 +219,7 @@

Returns: `ViemSignerAdapter | null`

### createSigner

Check warning on line 222 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L222

Did you really mean 'createSigner'?

Creates a new signer adapter from an account or private key.

Expand All @@ -233,7 +233,7 @@

## Usage Examples

### With Wagmi

Check warning on line 236 in cow-sdk/api/adapters/viem.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/api/adapters/viem.mdx#L236

Did you really mean 'Wagmi'?

```typescript
import { useWalletClient, usePublicClient } from 'wagmi'
Expand Down Expand Up @@ -270,6 +270,10 @@

### With CoW SDK

<Warning>
The `CowSdk` class shown below has been removed in v8. Use [`TradingSdk`](/cow-sdk/api/trading-sdk) instead. See the [quickstart guide](/cow-sdk/quickstart) for updated usage patterns.
</Warning>

```typescript
import { CowSdk, SupportedChainId } from '@cowprotocol/cow-sdk'
import { ViemAdapter } from '@cowprotocol/sdk-viem-adapter'
Expand Down
4 changes: 2 additions & 2 deletions cow-sdk/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Quick Overview

The CoW Protocol SDK enables blockchain interaction through three adapter options. Installation involves the main package plus your chosen adapter framework.

Check warning on line 10 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L10

Did you really mean 'blockchain'?

## Core Installation

Expand All @@ -21,13 +21,13 @@

You must choose one of three adapters based on your Web3 library:

**Viem** - Modern, lightweight TypeScript library requiring viem 1.x+

Check warning on line 24 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L24

Did you really mean 'Viem'?

Check warning on line 24 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L24

Did you really mean 'viem'?

**Ethers v6** - The current ethers.js version (recommended for ethers users)

Check warning on line 26 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L26

Did you really mean 'Ethers'?

Check warning on line 26 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L26

Did you really mean 'ethers'?

**Ethers v5** - Legacy version; consider upgrading to v6 or using Viem

Check warning on line 28 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L28

Did you really mean 'Ethers'?

Check warning on line 28 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L28

Did you really mean 'Viem'?

Each adapter installation differs slightly. For Viem, you'd run:

Check warning on line 30 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L30

Did you really mean 'Viem'?

```bash
npm install @cowprotocol/sdk-viem-adapter viem
Expand All @@ -35,14 +35,14 @@

## Essential Dependencies

The SDK requires `cross-fetch` (^3.x). Optional packages include `ipfs-only-hash`, `multiformats`, and `@openzeppelin/merkle-tree` for specialized features like app-data metadata and merkle operations.

Check warning on line 38 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L38

Did you really mean 'merkle'?

## Environment Requirements

Node.js 16+ is mandatory. TypeScript support includes built-in type definitions with standard `tsconfig.json` settings (moduleResolution: "node", esModuleInterop: true).
Node.js 22+ is mandatory. TypeScript support includes built-in type definitions with standard `tsconfig.json` settings (moduleResolution: "node", esModuleInterop: true).

Check warning on line 42 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L42

Did you really mean 'moduleResolution'?

## Framework Integration

React/Next.js users typically integrate via wagmi, while Node.js backends use direct Viem initialization with environment variables for sensitive credentials.

Check warning on line 46 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L46

Did you really mean 'wagmi'?

Check warning on line 46 in cow-sdk/installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-sdk/installation.mdx#L46

Did you really mean 'Viem'?

The current SDK version is **v7.4.1**, with migration guidance available for v6 upgrades.
The current SDK version is **v8.0.4**, with migration guidance available for prior version upgrades.
2 changes: 1 addition & 1 deletion cow-swap/hooks/hook-dapp.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "CoW Hook dApp"

Check warning on line 2 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L2

Did you really mean 'dApp'?
---

### [What are CoW Hooks?](/cow-protocol/explanation/order-types/cow-hooks)
Expand All @@ -13,9 +13,9 @@
| ![Demo](/images/cow-protocol/tutorials/img/tutorials/hooks-store.png) | ![Demo](/images/cow-protocol/tutorials/img/tutorials/hooks-store-list.png) |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------- |

**Hook dApp** - is an application that allows you to conveniently program an order to perform any action before or after a swap.

Check warning on line 16 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L16

Did you really mean 'dApp'?

In the CoW Swap interface you can find several hooks for different tasks. For example, you can claim GNO from Gnosis validators before your swap. You can also specify an arbitrary call to a smart contract before or after your swap using the "Build your own hooks" dApp.

Check warning on line 18 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L18

Did you really mean 'validators'?

Check warning on line 18 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L18

Did you really mean 'dApp'?

But that's not all. You can also develop your own application that will install a hook in CoW Swap! For this purpose, there is a custom application based on [iframe](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).

Expand All @@ -23,7 +23,7 @@

* Click "add Pre/Post-Hook Action"
* Go to "My Custom Hooks" tab
* Paste a URL of the hook dApp

Check warning on line 26 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L26

Did you really mean 'dApp'?

![Demo](/images/cow-protocol/tutorials/img/tutorials/hooks-store-custom-hooks.png)

Expand All @@ -31,9 +31,9 @@
CoW Hooks are still under development! But you can test it by switching "Enable hooks" toggle ON in the Swap settings.
</Note>

## How to develop CoW Hook dApps

Check warning on line 34 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L34

Did you really mean 'dApps'?

CoW Hook dApp is a web application that communicates with CoW Swap using [post-messages](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage). For your convenience there is a npm library [`@cowprotocol/hook-dapp-lib`](https://www.npmjs.com/package/@cowprotocol/hook-dapp-lib) which provides everything necessary to get started with your hook dApp development.

Check warning on line 36 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L36

Did you really mean 'dApp'?

Check warning on line 36 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L36

Did you really mean 'dApp'?

### Install

Expand All @@ -48,7 +48,7 @@
It provides:

* [`EIP-1193`](https://eips.ethereum.org/EIPS/eip-1193) provider to interact with a user wallet
* `HookDappContext` which contains environment parameters (chainId, account, etc.) and current order parameters (sell token, validTo, etc.)

Check warning on line 51 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L51

Did you really mean 'chainId'?

Check warning on line 51 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L51

Did you really mean 'validTo'?

And it expects calling following callbacks:

Expand All @@ -58,7 +58,7 @@

### Quick start

Let's create a simple hook dApp that checks the COW token balance of the order creator.

Check warning on line 61 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L61

Did you really mean 'dApp'?

```html
<html>
Expand Down Expand Up @@ -126,7 +126,7 @@
// context: HookDappContext
// actions: CoWHookDappActions
// provider: EIP-1193
const { actions, provider } = initCoWHookDapp({

Check warning on line 129 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L129

Did you really mean 'Dapp'?
onContext(context: HookDappContext) {},
})
```
Expand All @@ -137,7 +137,7 @@

| Parameter | Type | Optional | Description |
| ----------------- | ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `chainId` | `number` | false | Current chainId in CoW Swap. |

Check warning on line 140 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L140

Did you really mean 'chainId'?
| `account` | `string` | true | The user's account address. If not set, the wallet is not connected yet. |
| `orderParams` | `HookDappOrderParams \| null` | false | The parameters for the order. If value is `null`, the order is not ready yet. See [HookDappOrderParams](https://github.com/cowprotocol/cowswap/blob/develop/libs/hook-dapp-lib/src/types.ts#L29) for more details. |
| `hookToEdit` | `CowHookDetails` | true | CoW Swap supports editing hooks that have been created already. If the parameter is set, then it's in edit mode. See [CowHookDetails](https://github.com/cowprotocol/cowswap/blob/develop/libs/hook-dapp-lib/src/types.ts#L18) for more details. |
Expand Down Expand Up @@ -170,7 +170,7 @@
"image": "http://your-cow-hook.dapp/logo.png",
"conditions": {
"position": "pre",
"smartContractWalletSupported": false,
"walletCompatibility": ["EOA"],
"supportedNetworks": [1, 100, 42161]
}
}
Expand All @@ -179,18 +179,18 @@

| Parameter | Type | Description |
| -------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | `string` | 64-bit hex application identifier `(keccak256(YOUR_APP_NAME))`. This value is used to match hooks in an order with the dApp that generated the hook. |

Check warning on line 182 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L182

Did you really mean 'dApp'?
| `name` | `string` | The name of the Hook Dapp. |

Check warning on line 183 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L183

Did you really mean 'Dapp'?
| `descriptionShort` | `string` | A short description. |
| `description` | `string` | A full, detailed description of the Hook Dapp. |
| `version` | `string` | The version number of the Hook Dapp, typically following semantic versioning. |

Check warning on line 186 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L186

Did you really mean 'Dapp'?
| `website` | `string` (URL) | The URL link to the Hook Dapp's official website. |

Check warning on line 187 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L187

Did you really mean 'Dapp's'?
| `image` | `string` (URL) | The URL link to the Hook Dapp's logo or representative image. |

Check warning on line 188 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L188

Did you really mean 'Dapp's'?
| `conditions.position` | `pre \| post` | Specifies the execution position of the hook, `pre` or `post`. If not set, then the Hook Dapp supports both positions. |

Check warning on line 189 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L189

Did you really mean 'Dapp'?
| `conditions.walletCompatibility` | `HookDappWalletCompatibility[]` | Indicates whether the Hook Dapp supports smart contract wallets or EOAs. |

Check warning on line 190 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L190

Did you really mean 'Dapp'?

Check warning on line 190 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L190

Did you really mean 'EOAs'?
| `conditions.supportedNetworks` | `array` of `integers` | List of supported network IDs (e.g., `1` for Ethereum mainnet, `100` for Gnosis chain, `42161` for Arbitrum, `8453` for Base). If not set, then the Hook Dapp will be available for any network supported by CoW Swap. |

Check warning on line 191 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L191

Did you really mean 'Ethereum'?

Check warning on line 191 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L191

Did you really mean 'mainnet'?

Check warning on line 191 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L191

Did you really mean 'Arbitrum'?

Check warning on line 191 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L191

Did you really mean 'Dapp'?

## Advanced Hook Dapps

Check warning on line 193 in cow-swap/hooks/hook-dapp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-dapp.mdx#L193

Did you really mean 'Dapps'?

For more complex scenarios — such as post-hooks that need to act on received tokens (staking, bridging, depositing into DeFi protocols) — you need **CoW Shed**. CoW Shed is a deterministic smart account that holds tokens on behalf of the user and executes pre-signed operations during settlement.

Expand Down
2 changes: 1 addition & 1 deletion cow-swap/hooks/hook-store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
description: "Browse, use, and publish pre-built hooks in the CoW Swap Hook Store"
---

The **Hook Store** is a feature in CoW Swap that lets you extend your swaps with pre-built hooks created by third parties. Instead of manually encoding callData, you can browse a catalog of hook dApps — each with its own UI — that generate the hook data for you.

Check warning on line 6 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L6

Did you really mean 'callData'?

Check warning on line 6 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L6

Did you really mean 'dApps'?

## Using the Hook Store

Expand All @@ -13,55 +13,55 @@
2. Navigate to the hook controls (pre-hook or post-hook section)
3. Click **"Add Pre/Post-Hook Action"** to open the Hook Store

You'll see a list of available hook dApps. Each dApp provides a focused UI for a specific action — for example, claiming validator rewards or building a custom hook.

Check warning on line 16 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L16

Did you really mean 'dApps'?

Check warning on line 16 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L16

Did you really mean 'dApp'?

Check warning on line 16 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L16

Did you really mean 'validator'?

### Available hook dApps

Check warning on line 18 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L18

Did you really mean 'dApps'?

The Hook Store ships with several built-in dApps:

Check warning on line 20 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L20

Did you really mean 'dApps'?

| Hook dApp | Description | Networks |

Check warning on line 22 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L22

Did you really mean 'dApp'?
|---|---|---|
| **Build your own hooks** | Manually enter target, callData, and gasLimit for any contract call | All |

Check warning on line 24 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L24

Did you really mean 'callData'?

Check warning on line 24 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L24

Did you really mean 'gasLimit'?
| **Claim GNO from validators** | Claim unclaimed GNO rewards from Gnosis Chain validators as a pre-hook | Gnosis Chain |

Check warning on line 25 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L25

Did you really mean 'validators'?

Check warning on line 25 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L25

Did you really mean 'validators'?

<Tip>
The list of available hook dApps varies by network. Connect to a specific network to see which hooks are available there.

Check warning on line 28 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L28

Did you really mean 'dApps'?
</Tip>

### Custom hook dApps

Check warning on line 31 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L31

Did you really mean 'dApps'?

You can also load any hook dApp by URL:

Check warning on line 33 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L33

Did you really mean 'dApp'?

1. Click **"Add Pre/Post-Hook Action"**
2. Go to the **"My Custom Hooks"** tab
3. Paste the URL of the hook dApp

Check warning on line 37 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L37

Did you really mean 'dApp'?

The dApp loads in an iframe and communicates with CoW Swap via [post-messages](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage). CoW Swap handles fee estimation (including hook gas costs) and includes the hook in your order automatically.

Check warning on line 39 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L39

Did you really mean 'dApp'?

## How hook dApps work

Check warning on line 41 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L41

Did you really mean 'dApps'?

Each hook dApp is a lightweight web application that:

Check warning on line 43 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L43

Did you really mean 'dApp'?

1. **Receives context** from CoW Swap — connected wallet, chain ID, order parameters
2. **Presents a UI** for the user to configure the hook (e.g., select a vault, choose an amount)
3. **Generates hook data** (target, callData, gasLimit) and sends it back to CoW Swap via the `addHook` callback

Check warning on line 47 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L47

Did you really mean 'callData'?

Check warning on line 47 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L47

Did you really mean 'gasLimit'?

CoW Swap then:
- Includes the hook gas cost in the fee estimation shown to the user
- Attaches the hook to the order's [appData](/cow-protocol/reference/core/intents/app-data)
- Ensures solvers execute the hook as part of the settlement

## Publishing a hook dApp

Check warning on line 54 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L54

Did you really mean 'dApp'?

To make your hook dApp available in the Hook Store:

Check warning on line 56 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L56

Did you really mean 'dApp'?

### 1. Build the dApp

Check warning on line 58 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L58

Did you really mean 'dApp'?

Create a web application using the [`@cowprotocol/hook-dapp-lib`](https://www.npmjs.com/package/@cowprotocol/hook-dapp-lib) library. See the [Hook dApp development guide](/cow-swap/hooks/hook-dapp) for the full API reference and a working example.

### 2. Add a manifest

Your dApp must serve a `manifest.json` file that describes its capabilities:

Check warning on line 64 in cow-swap/hooks/hook-store.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/hooks/hook-store.mdx#L64

Did you really mean 'dApp'?

```json
{
Expand All @@ -75,7 +75,7 @@
"image": "https://my-hook-dapp.example.com/logo.png",
"conditions": {
"position": "pre",
"smartContractWalletSupported": false,
"walletCompatibility": ["EOA"],
"supportedNetworks": [1, 100, 42161]
}
}
Expand Down
2 changes: 1 addition & 1 deletion cow-swap/tutorials/twap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

* **Reduce price impact on large orders**: For example, buying `$1M` of ETH over 3 hours in 6 parts; the TWAP will place an order of `$166k` every `30min`, significantly reducing the price impact and allowing the market to recover.
* **Average buy price over time**: This strategy reduces the risk of buying at a high price by averaging the prices over a selected period.
* **Ideal for recurring or big trades**: The minimum required order size is `$1k` on Mainnet or `$5` on Gnosis Chain, Arbitrum One and Base.

Check warning on line 14 in cow-swap/tutorials/twap.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/tutorials/twap.mdx#L14

Did you really mean 'Mainnet'?

Check warning on line 14 in cow-swap/tutorials/twap.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/tutorials/twap.mdx#L14

Did you really mean 'Arbitrum'?

## Placing a TWAP Order

Expand Down Expand Up @@ -40,7 +40,7 @@

1. **Price Protection**: This is a measure to prevent your order from being executed at a price that's too far from the market price when the order was placed. Set the percentage of price protection to define the acceptable price range for your trades. For instance, a 10% price protection means that your order will not execute if the price moves unfavorably by more than 10% from the price at the time the order was made.

2. **Number of Parts**: Decide how many discrete parts you want to divide your order into. This choice will determine the granularity of your TWAP strategy. For example, if you choose to split your order into 2 parts and you are selling a total of 2 WETH, each part will involve selling 1 WETH. The parts have a minimum size of `$5k` on Mainnet or `$5` on Gnosis Chain because each part will need to be executed on-chain, meaning there's a cost associated with each execution.
2. **Number of Parts**: Decide how many discrete parts you want to divide your order into. This choice will determine the granularity of your TWAP strategy. For example, if you choose to split your order into 2 parts and you are selling a total of 2 WETH, each part will involve selling 1 WETH. The parts have a minimum size of `$1,000` on Mainnet or `$1` on other supported chains because each part will need to be executed on-chain, meaning there's a cost associated with each execution.

Check warning on line 43 in cow-swap/tutorials/twap.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/tutorials/twap.mdx#L43

Did you really mean 'Mainnet'?

3. **Total Duration**: Choose the total time frame over which your order should be executed. The TWAP strategy will distribute your trades evenly across this duration. Select from predefined durations like 1 hour, or set a custom duration based on your trading strategy.

Expand All @@ -63,7 +63,7 @@
Check all the details of your order, including price protection and limit price. Once you have reviewed the details, sign the transaction in your Safe interface.

<Warning>
A user should be careful when signing approval transactions. Verify carefully that the spender address is correct (in this case TWAPContract's address).

Check warning on line 66 in cow-swap/tutorials/twap.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/tutorials/twap.mdx#L66

Did you really mean 'TWAPContract's'?

If in doubt about any of the above, do *not* sign the transaction. To review your approvals, you can use [https://revoke.cash/](https://revoke.cash/).
</Warning>
Expand Down
15 changes: 2 additions & 13 deletions cow-swap/widget/params.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
description: "Integrate the power of into your product! With the widget, you can create an incredible trading interface. Specify the required pair of currencies, customize the look and much more!"
---

Create your own widget using the configurator [https://widget.cow.fi](https://widget.cow.fi).

Check warning on line 6 in cow-swap/widget/params.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/widget/params.mdx#L6

Did you really mean 'configurator'?

![Demo](/images/cow-protocol/tutorials/assets/images/widget-bc5358690765bdbc5b2bc9d2a13a20b5.png)

Expand Down Expand Up @@ -35,7 +35,7 @@
import { createCowSwapWidget, CowSwapWidgetParams } from '@cowprotocol/widget-lib'const widgetContainer = document.getElementById('cowswap-widget')const params: CowSwapWidgetParams = { partnerFee: { bps: 50, // 0.5% recipient: '0x0000000000000000000000000000000000000000', // Fee destination address },}createCowSwapWidget(widgetContainer, { params })
```

This configuration will apply a partner fee for all networks and trade types (swaps, limit orders, TWAPs, etc.). You can use [Flexible config](#flexible-config) for having more flexibility, or [Advanced configuration](#advanced-configuration) to have even more control over the partner fee configuration parameters.

Check warning on line 38 in cow-swap/widget/params.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/widget/params.mdx#L38

Did you really mean 'TWAPs'?

### Flexible config

Expand Down Expand Up @@ -69,7 +69,7 @@

The recipient is the address to which the fee will be sent.

Make sure that the fee recipient address exists on the respective network defined in the parameters. For example, if you use a Safe as a recipient and the Safe was created on Ethereum mainnet, then for Gnosis Chain you must create **another** Safe and set it as a fee recipient.

Check warning on line 72 in cow-swap/widget/params.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/widget/params.mdx#L72

Did you really mean 'Ethereum'?

Check warning on line 72 in cow-swap/widget/params.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/widget/params.mdx#L72

Did you really mean 'mainnet'?

As a fee recipient, you can specify either string or a key-value pair in the format `chainId: recipientAddress`:

Expand Down Expand Up @@ -120,9 +120,9 @@
| **Ranges** | `min ≥ 0`, `max ≤ 5000` (50 %), `min ≤ defaultValue ≤ max`, `min < max` |
| **Defaults** | If the user doesn’t specify a slippage, the widget falls back to `defaultValue` |
| **Auto slippage** | If the auto-slippage is less than or equal to `defaultValue`, the swap will use `defaultValue` |
| **ETH‑Flow floor** | When `defaultValue < 200` bps (2 %) for Ethereum Mainnet or `defaultValue < 50` (0.5 %) for other networks and the trade is *ETH‑Flow*, the widget will force the slippage to **2 %**/**0.5 %** |

Check warning on line 123 in cow-swap/widget/params.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/widget/params.mdx#L123

Did you really mean 'Ethereum'?

Check warning on line 123 in cow-swap/widget/params.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/widget/params.mdx#L123

Did you really mean 'Mainnet'?

### Example JSON (Configurator ready)

Check warning on line 125 in cow-swap/widget/params.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cowswap) - vale-spellcheck

cow-swap/widget/params.mdx#L125

Did you really mean 'Configurator'?

```
{ "slippage": { "1": { "min": 1, "max": 3900, "defaultValue": 3000 }, "8453": { "min": 500, "max": 5000, "defaultValue": 600 } }}
Expand Down Expand Up @@ -163,13 +163,12 @@
| `provider` | `EthereumProvider` | --- | The Ethereum provider to be used for interacting with a wallet. To connect, for example, to Rabby Wallet or Metamask, just set `window.ethereum`. You also might like to use [https://web3modal.com](https://web3modal.com). |
| `chainId` | `number` | 1 | The blockchain ID on which the trade will take place. Supported chains: 1 (Ethereum), 100 (Gnosis Chain), 42161 (Arbitrum One), 8453 (Base), 137 (Polygon), 43114 (Avalanche), 56 (BNB), 59144 (Linea), 9745 (Plasma), 57073 (Ink), 11155111 (Sepolia). See [supported networks](/snippets/supported-networks) for the full list. |
| `tradeType` | `TradeType` | 'swap' | The type of trade. Can be `swap` or `limit` or `advanced`. |
| `env` | `CowSwapWidgetEnv` | 'prod' | The environment of the widget (`local` , `prod` , `dev` , `pr`). See [`COWSWAP_URLS`](https://github.com/cowprotocol/cowswap/blob/develop/libs/widget-lib/src/consts.ts) const value for urls. |
| `baseUrl` | `string` | 'https://swap.cow.fi' | The base URL of the widget implementation. Defaults to the production environment (`https://swap.cow.fi`). |
| `sell` | `TradeAsset` | Same as in swap.cow\.fi | An object containing information about the sell asset. Example: `{ asset: 'WBTC', amount: 12 }` or `{ asset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' }`. |
| `buy` | `TradeAsset` | --- | An object containing information about the buy asset. Example: `{ asset: 'WBTC', amount: 12 }` or `{ asset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' }`. |
| `theme` | `CowSwapTheme` | 'light' | The theme of the widget (`'dark'` for dark theme or `'light'` for light theme). It is also possible to set your own colors (`CowSwapWidgetPalette`). See [Custom theme](#custom-theme) section for more details. |
| `sounds` | `CowSwapWidgetSounds` | --- | The famous MOOO! sound can be changed to something else, just provide a link to a media file (mp3 or any other audio format supported by your browser). You can also specify a value of `null` to disable the sound. |
| `images` | `CowSwapWidgetImages` | --- | To make your widget unique, you can replace some of the images. For example, a stub image when there are no limit orders. |
| `banners` | `CowSwapWidgetBanners` | --- | With this option you can control the display of some banners in the CoW Swap interface. |
| `tokenLists` | `string[]` | --- | CoW Swap uses the [token lists standard](https://tokenlists.org), which allows flexible and decentralized management of assets for trading. Using this option you can set any token list you want. You also might want to use `customTokens` option for more flexible configuration. |
| `customTokens` | `TokenInfo[]` | --- | In the case when you want to use tokens that are not included in the default token lists, you can add them programmatically by simply passing an array of ERC-20 tokens info. There is also `tokenLists` option to set a ready-made list of tokens. |
| `disableToastMessages` | `boolean` | false | CoW Swap displays a pop-up notification when certain events occur, for example: an order has been filled. You may want to handle these events yourself and disable the display of notifications in the widget, to do this you need to enable this option. See [Events handling](#events-handling) section for more details. |
Expand Down Expand Up @@ -250,7 +249,7 @@
You can change all possible widget options on the fly:

```
import { createCowSwapWidget, CowSwapWidgetParams } from '@cowprotocol/widget-lib'const container = document.getElementById('cowswap-widget')const params: CowSwapWidgetParams = { appCode: 'NAME-OF-YOU-APP', // Add here the name of your app. e.g. "Pig Swap" logoUrl: 'YOUR_LOGO_URL',}const updateWidget = createCowSwapWidget(container, { params })// Update the widgetupdateWidget({ ...params, theme: 'dark', // <- Change theme to dark hideNetworkSelector: true, // <- Hide the network selector})
import { createCowSwapWidget, CowSwapWidgetParams } from '@cowprotocol/widget-lib'const container = document.getElementById('cowswap-widget')const params: CowSwapWidgetParams = { appCode: 'NAME-OF-YOU-APP', // Add here the name of your app. e.g. "Pig Swap"}const updateWidget = createCowSwapWidget(container, { params })// Update the widgetupdateWidget({ ...params, theme: 'dark', // <- Change theme to dark hideNetworkSelector: true, // <- Hide the network selector})
```

## Widget URL
Expand Down Expand Up @@ -279,15 +278,5 @@

![Custom image](/images/cow-protocol/tutorials/assets/images/widget-custom-img-7dbd8236292401203767488f8583d4c9.png)

### Banners

In some cases, you may want to hide some banners in the CoW Swap interface. To do this, you need to specify the `banners` parameter in the widget configuration.

```
import { createCowSwapWidget, CowSwapWidgetParams } from '@cowprotocol/widget-lib'const container = document.getElementById('cowswap-widget')const params: CowSwapWidgetParams = { banners: { hideSafeWebAppBanner: true } }createCowSwapWidget(container, { params })
```

This banner will be hidden:

![Hidden banner](/images/cow-protocol/tutorials/assets/images/widget-hidden-banner-9eecdcc1ebbcde86d089eef5d5d7c9e1.png)