CoW Swap React widget
React component that creates a CoW Swap widget. It is based on https://npmjs.com/package/@cowprotocol/widget-lib
Use it
Install dependency
yarn add @cowprotocol/widget-react
npm install @cowprotocol/widget-react
Import component and some convenient types
import { CowSwapWidget, CowSwapWidgetParams } from '@cowprotocol/widget-react'
Prepare the config for the widget:
const cowSwapWidgetParams: CowSwapWidgetParams = {
appCode: 'NAME-OF-YOU-APP',
width: '600px',
height: '700px',
tradeType: 'swap',
}
Render the component:
<CowSwapWidget params={cowSwapWidgetParams} />
Developers
nx test widget-react
nx build widget-react
nx publish widget-react --ver x.y.z --tag latest