Registry / defi / kane6-zap-migration-widgets

kane6-zap-migration-widgets

JSON →
library1.0.11jsnpmunverified

React components for migrating liquidity positions using KyberSwap's Zap Protocol. Current version 1.0.11, released as needed. Provides ready-to-use UI elements for adding/increasing liquidity in PancakeSwap pools via zap. Differentiates by supporting KyberSwap Aggregator as a routing source, configurable fee addresses, and theme support (dark/light). Ships TypeScript types and requires React 16.8+.

npm install kane6-zap-migration-widgets
INSTALL
IMPORT
SIG · KANE6-ZAP-MIGRATIO
K
kane6-zap-migration-widgets
defijavascriptv1.0.11
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default import
import KyberLiquidityWidget from '@kyberswap/pancake-liquidity-widgets'
const KyberLiquidityWidget = require('@kyberswap/pancake-liquidity-widgets')
ESM-only; no default export documented — likely named export
ZapWidget
import { ZapWidget } from '@kyberswap/pancake-liquidity-widgets'
import ZapWidget from '@kyberswap/pancake-liquidity-widgets'
Named export per package structure; default import not available
types
import type { ZapWidgetProps } from '@kyberswap/pancake-liquidity-widgets'
import { ZapWidgetProps } from '@kyberswap/pancake-liquidity-widgets'
Type-only imports should use `import type` to avoid bundling issues with TypeScript

Basic integration of ZapWidget for adding liquidity to a PancakeSwap pool on BSC mainnet.

import React from 'react'; import { ZapWidget } from '@kyberswap/pancake-liquidity-widgets'; const App = () => { const chainId = 56; // BSC mainnet const poolAddress = '0x...'; // PancakeSwap pool address const account = '0xYourWallet'; const onConnectWallet = () => console.log('Connect wallet'); const onTxSubmit = (txHash: string) => console.log(txHash); const onDismiss = () => console.log('Widget dismissed'); return ( <ZapWidget source="my-dapp" account={account} networkChainId={chainId} chainId={chainId} poolAddress={poolAddress} theme="dark" onDismiss={onDismiss} onTxSubmit={onTxSubmit} onConnectWallet={onConnectWallet} /> ); }; export default App;
Debug
Known issues
breakingThe package name `kane6-zap-migration-widgets` is a fork or copy of `@kyberswap/pancake-liquidity-widgets`. Use the official package for compatibility.
fix
Replace with `@kyberswap/pancake-liquidity-widgets`
affects: >=1.0.0
breakingReact 16.8+ required (hooks). Versions below 16.8 will cause 'Invalid hook call' error.
fix
Upgrade React to 16.8+ or install react@^16.8.0
affects: all
deprecatedThe `account` prop expects a string, but passing `undefined` leads to runtime errors.
fix
Provide an empty string or valid address: `account={account ?? ''}`
affects: all
gotcha`networkChainId` and `chainId` must match the connected wallet's chain; mismatch causes 'Wrong network' error.
fix
Set both to the same chain ID derived from the wallet provider.
affects: all
Errors
Common errors & fixes
Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
React version < 16.8 or mismatched React versions between package and app.
fix
Ensure React and React DOM are version 16.8+ and only one copy is installed.
Uncaught TypeError: Cannot read properties of undefined (reading 'toLowerCase')
`account` prop is undefined or not a string.
fix
Provide a valid address string or empty string: `account={account || ''}`
FetchError: 405 Method Not Allowed for 'https://api.kyberswap.com/...'
Missing or incorrect networkChainId/chainId causing request to wrong endpoint.
fix
Use a valid chain ID (e.g., 56 for BSC) and ensure networkChainId matches.
Upgrade
Version history
1.0.11latest on npm
Audit
Dependencies
reactrequiredPeer dependency; UI components
react-domrequiredPeer dependency; DOM rendering
Agent activity
6 hits · last 30 days
node
6
Resources
kane6-zap-migration-widgets — npm install kane6-zap-migration-widgets · libregistry