Getting Started with the SDK

Install the SDK:
yarn add @cowprotocol/cow-sdk
Instantiate the SDK:
import { CowSdk } from '@cowprotocol/cow-sdk'
const chainId = 4 // Rinkeby
const cowSdk = new CowSdk(chainId)
The SDK will expose:
  • The CoW API (cowSdk.cowApi)
  • The CoW Subgraph (cowSdk.cowSubgraphApi)
  • Convenient method to facilitate signing orders (i.e cowSdk.signOrder)
💡 For a quick snippet with the full process on posting an order see the Post an Order Example​
Now you should have a ready to use SDK instance. Let's explore in the next section, how we can use it to query the CoW API.
Last modified 1mo ago