Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
paraswap-widget
Advanced tools
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:
Install the lib using npm or yarn
yarn install paraswap-widget
//or require
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
Unknown package
The npm package paraswap-widget receives a total of 1 weekly downloads. As such, paraswap-widget popularity was classified as not popular.
We found that paraswap-widget demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.