
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@cowprotocol/widget-lib
Advanced tools
CoW Swap Widget Library. Allows you to easily embed a CoW Swap widget on your website.
Integrate the power of CowSwap
into your product!
With the widget, you can create an incredible trading interface. Specify the required pair of currencies, customize the
look and much more!
See the widget in action in the widget configurator
You can find a detailed description of all widget parameters in the documentation
npm install @cowprotocol/widget-lib --save
yarn add @cowprotocol/widget-lib
Create a container somewhere in your website, the widget will be rendered inside it:
<div id="cowswap-widget"></div>
Import the widget and initialise it:
import { createCowSwapWidget, CowSwapWidgetParams } from '@cowprotocol/widget-lib'
// Initialise the widget
const widgetContainer = document.getElementById('cowswap-widget')
// instantiate your own web3 provider
const provider = window.ethereum
const params: CowSwapWidgetParams = {
appCode: 'NAME-OF-YOU-APP', // Add here the name of your app. e.g. "Pig Swap"
sell: { asset: 'DAI' },
buy: { asset: 'USDC', amount: '0.1' },
}
const {updateParams} = createCowSwapWidget(
widgetContainer,
// Optionally, you can provide some additional params to customise your widget
{params, provider}
)
// You also can change widget configuration on the fly
updateParams({ ...params, tradeType: 'limit' })
nx test widget-lib
nx build widget-lib
FAQs
CoW Swap Widget Library. Allows you to easily embed a CoW Swap widget on your website.
The npm package @cowprotocol/widget-lib receives a total of 1,368 weekly downloads. As such, @cowprotocol/widget-lib popularity was classified as popular.
We found that @cowprotocol/widget-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.