npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kyberswap/pancake-liquidity-widgets

v2.0.6

Published

The `@kyberswap/pancake-liquidity-widgets` package provides a React component to add or increase liquidity into PancakeSwap pools using KyberSwap's Zap engine. It supports PancakeSwap V3 and Pancake Infinity CL variants with a small, configurable UI.

Readme

Kyber Pancake Liquidity Widgets

The @kyberswap/pancake-liquidity-widgets package provides a React component to add or increase liquidity into PancakeSwap pools using KyberSwap's Zap engine. It supports PancakeSwap V3 and Pancake Infinity CL variants with a small, configurable UI.

Exports: LiquidityWidget, PoolType.

Demo: https://pancake-liq-widget-demo.vercel.app/

Installation

Install with your preferred package manager.

pnpm add @kyberswap/pancake-liquidity-widgets
yarn add @kyberswap/pancake-liquidity-widgets
npm i --save @kyberswap/pancake-liquidity-widgets

Usage

Minimal example:

import {
  LiquidityWidget,
  PoolType,
} from "@kyberswap/pancake-liquidity-widgets";
import "@kyberswap/pancake-liquidity-widgets/dist/style.css";
import { useAccount, useChainId, useWalletClient } from "wagmi";

export default function Example() {
  const { address } = useAccount();
  const chainId = useChainId();
  const { data: walletClient } = useWalletClient();

  return (
    <div style={{ width: 840, height: 720 }}>
      <LiquidityWidget
        // Theme: 'dark' | 'light' or omit for default
        theme="dark"
        walletClient={walletClient}
        account={address as any}
        chainId={chainId}
        networkChainId={chainId}
        poolType={PoolType.DEX_PANCAKESWAPV3}
        poolAddress={"0xPoolAddress"}
        // Optional: to increase liquidity into an existing position
        positionId={"12345"}
        source="my-dapp"
        // Comma-separated token addresses and amounts
        initDepositTokens={""}
        initAmounts={""}
        onConnectWallet={() => {
          /* open your wallet modal */
        }}
        onAddTokens={(tokenAddresses: string) => {
          /* update initDepositTokens */
        }}
        onRemoveToken={(tokenAddress: string) => {
          /* remove from initDepositTokens */
        }}
        onAmountChange={(tokenAddress: string, amount: string) => {
          /* update initAmounts */
        }}
        onOpenTokenSelectModal={() => {
          /* open your token selector */
        }}
        onTxSubmit={(txHash?: string) => {
          /* optional tx hash callback */
        }}
        onDismiss={() => {
          /* close modal */
        }}
      />
    </div>
  );
}

For a more detailed example, refer to PancakeZapIn.tsx (demo).

Props

| Property | Description | Type | Required / Default | | ---------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------ | ------------------ | | theme | Theme mode or theme object | 'dark' \| 'light' \| Theme | Optional | | walletClient | Wallet client (e.g. wagmi useWalletClient()) | WalletClient \| undefined | Required | | account | Connected account address | Address \| undefined | Required | | chainId | ChainId to route and add liquidity | number | Required | | networkChainId | Current network of user wallet (for mismatch detection) | number | Required | | poolType | Pancake pool type | PoolType | Required | | poolAddress | Pool address | string | Required | | positionId | Existing position to increase liquidity into | string | Optional | | source | Identifier for your integration | string | Required | | includedSources | Restrict liquidity sources (comma-separated) | string | Optional | | excludedSources | Exclude liquidity sources (comma-separated) | string | Optional | | initTickLower | Initial lower tick (new position) | number | Optional | | initTickUpper | Initial upper tick (new position) | number | Optional | | initDepositTokens | Initial deposit token addresses, separated by commas | string | Required | | initAmounts | Initial deposit token amounts, separated by commas | string | Required | | feeAddress | Fee receiver address | string | Optional | | feePcm | Fee in per cent mille. 1 = 0.001% (1 in 100,000). Ignored if no feeAddress | number | Optional | | onDismiss | Called when the widget is closed | () => void | Required | | onTxSubmit | Called when a tx was submitted (optional) | (txHash: string) => void | Optional | | onConnectWallet | Trigger your wallet connect flow | () => void | Required | | onAddTokens | Called when tokens are added (update initDepositTokens) | (tokenAddresses: string) => void | Required | | onRemoveToken | Called when a token is removed (update initDepositTokens/initAmounts) | (tokenAddress: string) => void | Required | | onAmountChange | Called when a token amount changes (update initAmounts) | (tokenAddress: string, amount: string) => void | Required | | onOpenTokenSelectModal | Open your token selection modal | () => void | Required | | farmContractAddresses | Additional farm contracts to detect deposit eligibility | string[] | Optional |

Notes:

  • PoolType for Pancake variants is exported from this package. See constants for supported values.
  • Included/Excluded sources use KyberSwap Aggregator DEX IDs. See: https://docs.kyberswap.com/kyberswap-solutions/kyberswap-aggregator/dex-ids

Styling

  • You must import the stylesheet once in your app: @kyberswap/pancake-liquidity-widgets/dist/style.css.
  • You can override the theme via the theme prop (CSS variables under the --pcs-lw-* namespace). A light theme is available via theme="light".