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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kyberswap/zap-migration-widgets

v1.0.14

Published

Kyber Zap Migration Widgets

Readme

Kyber Zap Migration Widgets

The @kyberswap/zap-migration-widgets package provides a React component to migrate liquidity from one position/pool to another (or reposition within the same pool) using KyberSwap's Zap engine. It is small, configurable, and easy to embed in a modal or page.

Exports: ZapMigration, ChainId, PoolType, ZapStatus.

Installation

Install with your preferred package manager.

pnpm add @kyberswap/zap-migration-widgets
yarn add @kyberswap/zap-migration-widgets
npm i --save @kyberswap/zap-migration-widgets

Usage

Minimal example:

import { ChainId, PoolType, ZapMigration } from '@kyberswap/zap-migration-widgets';
import '@kyberswap/zap-migration-widgets/dist/style.css';

export default function Example() {
  // Provide these from your wallet/context (e.g. wagmi, web3-react, rainbowkit)
  const connectedAccount = { address: '0xYourAddress', chainId: ChainId.MAINNET };

  const sendTx = async (txData: {
    from: string;
    to: string;
    value: string;
    data: string;
    gasLimit?: string;
  }): Promise<string> => {
    // Submit the transaction with your wallet/provider and return the tx hash
    return '0xTransactionHash';
  };

  return (
    <div style={{ width: 832, height: 680 }}>
      <ZapMigration
        chainId={ChainId.MAINNET}
        from={{
          poolType: PoolType.DEX_UNISWAPV3,
          poolAddress: '0xPoolAddress',
          positionId: '12345',
        }}
        // Optional target; omit to migrate into a new position on the same pool type
        to={{
          poolType: PoolType.DEX_UNISWAPV3,
          poolAddress: '0xTargetPool',
        }}
        connectedAccount={connectedAccount}
        client="my-dapp"
        onConnectWallet={() => {
          /* open your wallet modal */
        }}
        onSwitchChain={() => {
          /* switch network in your app */
        }}
        onSubmitTx={sendTx}
        onClose={() => {
          /* close modal */
        }}
      />
    </div>
  );
}

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

Props

| Property | Description | Type | Required / Default | | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------ | | chainId | Network for the migration workflow | ChainId | number | Required | | rpcUrl | Use your own RPC endpoint | string | Optional | | from | Source position to migrate from | { poolType: PoolType; poolAddress: string; positionId: string } | Required | | to | Target pool/position to migrate into. Omit to create a new position | { poolType: PoolType; poolAddress: string; positionId?: string } | Optional | | connectedAccount | Current connected account info | { address?: string; chainId: number } | Required | | client | Identifier for your integration (e.g. your dapp name) | string | Required | | referral | Referral code (if any) | string | Optional | | initialSlippage | Initial slippage percentage. Example: 1 = 1% | number | Optional | | rePositionMode | Enable migrate-with-reposition flow for the source position | boolean | Optional (false) | | initialTick | Initial tick range when creating/repositioning | { tickLower: number; tickUpper: number } | Optional | | aggregatorOptions | Restrict/allow specific liquidity sources for routes | { includedSources?: string[]; excludedSources?: string[] } | Optional | | feeConfig | Integration fee in per cent mille. 1 = 0.001% (1 in 100,000). Ignored if no feeAddress | { feePcm: number; feeAddress: string } | Optional | | theme | Optional theme tokens to override widget styles (CSS variables) | Theme | Optional | | className | Extra class on root container | string | Optional | | onExplorePools | Called from the success screen's Explore Pools action | () => void | Optional | | onViewPosition | Called after success with the tx hash | (txHash: string) => void | Optional | | onBack | Called when the back button is clicked | () => void | Optional | | onConnectWallet | Trigger your wallet connect flow | () => void | Required | | onSwitchChain | Trigger your chain switch flow | () => void | Required | | onSubmitTx | Submit the provided transaction object and return the tx hash. If gasLimit is omitted, your wallet/provider should estimate it | (txData: { from: string; to: string; value: string; data: string; gasLimit?: string }) => Promise<string> | Required | | onClose | Called when the widget is closed | () => void | Required | | zapStatus | Controls the widget's transaction state; pass a map of txHash -> TxStatus, or omit to let the widget poll itself | Record<string, TxStatus> | Optional | | txHashMapping | Maps original tx hash to current tx hash (for speed up/cancel replacements). Used to track transaction replacements when user speeds up or cancels a transaction | Record<string, string> | Optional |

  • Included/Excluded sources use KyberSwap Aggregator DEX IDs. See: https://docs.kyberswap.com/kyberswap-solutions/kyberswap-aggregator/dex-ids
  • PoolType enumerates supported protocols (e.g. Uniswap V3, PancakeSwap V3, Sushi V3, Algebra forks, Uniswap V2, Uniswap V4, etc.). Import it from this package and pick the one matching your pools.
  • txHashMapping: When a user speeds up or cancels a transaction, the original transaction hash is replaced with a new one. Pass a mapping object where keys are original tx hashes and values are the current (replaced) tx hashes. The widget will use the current hash for status checks and display. Example: { '0xabc...': '0xdef...' } means the original tx 0xabc... was replaced by 0xdef....

Styling

  • You must import the stylesheet once in your app: @kyberswap/zap-migration-widgets/dist/style.css.
  • You can override the theme via the theme prop (CSS variables under the --ks-lw-* namespace). Example keys include text, subText, icons, layer1, dialog, layer2, stroke, accent, warning, error, success, interactive, fontFamily, borderRadius, buttonRadius, boxShadow.