Comment on page
Getting Started with the SDK
Install the SDK:
yarn add @cowprotocol/cow-sdk
Instantiate the SDK:
import { OrderBookApi, OrderSigningUtils, SubgraphApi } from '@cowprotocol/cow-sdk'
const chainId = 100 // Gnosis chain
const orderBookApi = new OrderBookApi({ chainId })
const subgraphApi = new SubgraphApi({ chainId })
const orderSigningUtils = new OrderSigningUtils()
The SDK will expose:
OrderBookApi
- provides the ability to retrieve orders and trades from the CowSap order-book, as well as add and cancel themSubgraphApi
- provides statistics data about CoW protocol from Subgraph, such as trading volume, trades count and others
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 7mo ago