Skip to content
docs

CowProviderConfig

Defined in: protocol-swap2-cow/src/provider.ts:97

optional appCode?: string

Defined in: protocol-swap2-cow/src/provider.ts:106

appCode of the orders’ appData document (how CoW’s explorer names the app). Default “AnyWalletKit”.


optional baseUrl?: string

Defined in: protocol-swap2-cow/src/api.ts:64

Orderbook base URL (https). Default https://api.cow.fi.

CowApiConfig.baseUrl


optional chains?: Readonly<Record<number, CowDeployment>>

Defined in: protocol-swap2-cow/src/provider.ts:120

Chains CoW added after this release — see cowDeployments.


optional defaultSlippageBps?: number

Defined in: protocol-swap2-cow/src/provider.ts:114

Slippage when the caller names none (bps). Default 50.


optional enabled?: boolean

Defined in: protocol-swap2-cow/src/provider.ts:102

Master switch. Default off: the module ships dark and an app turns it on (COW_ENABLED) chain by chain. Cancelling an order placed earlier works while it is off.


optional enabledChains?: readonly number[]

Defined in: protocol-swap2-cow/src/provider.ts:104

The chains offered, by EVM chain id. Default: every chain of the deployment table.


optional now?: () => number

Defined in: protocol-swap2-cow/src/provider.ts:122

The clock, unix milliseconds (tests).

number


optional permit?: boolean

Defined in: protocol-swap2-cow/src/provider.ts:118

Offer the EIP-2612 permit where the token has one. Default true; false always takes the approval transaction.


optional rpcUrls?: Readonly<Record<number, readonly string[]>>

Defined in: protocol-swap2-cow/src/provider.ts:112

JSON-RPC endpoints per EVM chain id, tried in order. Optional — without them the module still quotes, signs and tracks through the orderbook; with them it also offers the gasless permit, reads eth-flow orders from the contract (status and refunds while the orderbook is down) and checks a native payout’s receiver.


optional timeoutMs?: number

Defined in: protocol-swap2-cow/src/api.ts:65

CowApiConfig.timeoutMs


optional validForSeconds?: number

Defined in: protocol-swap2-cow/src/provider.ts:116

How long an order trades, seconds (120..1500). Default 1200 — 20 minutes.