@cowprotocol/widget-react
TypeScript icon, indicating that this package has built-in type declarations

0.13.0 • Public • Published

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', // Add here the name of your app. e.g. "Pig Swap"
  width: '600px',
  height: '700px',
  tradeType: 'swap',
}

Render the component:

<CowSwapWidget params={cowSwapWidgetParams} />

Developers

# Test
nx test widget-react

# Build the library
nx build widget-react

# Publish to NPM
nx publish widget-react --ver x.y.z --tag latest

Package Sidebar

Install

npm i @cowprotocol/widget-react

Weekly Downloads

967

Version

0.13.0

License

ISC

Unpacked Size

31.1 kB

Total Files

6

Last publish

Collaborators

  • fairlighteth
  • cowprotocol_dev
  • harisang
  • fedgiac
  • anxolin