Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

paraswap-widget

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paraswap-widget

  • 1.0.10
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ParaSwap Widget


ParaSwap Widget allows you to provide the best ERC20 prices for your users and earn fees on every trade.

You can monetize by using the referrer field. Reach out to us on Telegram for more info: https://t.me/paraswap

Here is how it looks:


How to use ParaSwap Widget :

Install the lib using npm or yarn

yarn install paraswap-widget
const {PSWidget} = require("paraswap-widget");
//or
import {PSWidget} from "paraswap-widget";

<PSWidget referrer={"my_company"} providerUrl={"MY_INFURA_URL"} />

Those are the properties you can use to customize the widget:

interface IPSWidgetProps {
  providerUrl: string;  //Required
  referrer: string;  //Required
  defaultSlippage: number;
  defaultPair: { from: string, to: string, amount: string };
  unlimitedAllowance: boolean;
  hasReceiver: boolean;
  bgColor: string;
  fixedFrom: boolean,
  fixedTo: boolean,
}

You can also customize it a bit more

<PSWidget 
  referrer={"my_company"} 
  providerUrl={"MY_INFURA_URL"}
  unlimitedAllowance={false} 
  bgColor={"#DDD"} 
  defaultPair={{from: 'cDAI', to: 'aDAI', amount: '100'}} 
/>

If you wan to fix the from and/or to token, you can use fixedFrom and fixedTo params

<PSWidget 
  referrer={"my_company"} 
  providerUrl={"MY_INFURA_URL"}
  defaultPair={{from: 'cDAI', to: 'JRT', amount: '100'}} 
  fixedFrom={true}
  fixedTo={true}
/>

And you're good to go :)

FAQs

Package last updated on 15 Jun 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc