2.0.1 • Published 12 months ago

@kyberswap/pancake-liquidity-widgets v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Kyber Liquidity Widgets

The @kyberswap/pancake-liquidity-widgets package is an npm package of React components used to provide subsets of the Zap Protocol functionality in a small and configurable user interface element. Demo: https://pancake-liq-widget-demo.vercel.app/

Installation

Install the widgets library via npm or yarn.

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

Usage

Example usage: https://github.com/KyberNetwork/kyberswap-interface/blob/pancake-zap-in-widget/src/pages/LiquidityWidget.tsx#L118-L143

Params

PropertyDescriptionTypeDefault Value
sourceTo identify the dapp that integrating with liquidity widgetstring
accountCurrent connected walletstring""
networkChainIdCurrent network chainIdnumberRequired
chainIdnetwork of selected poolnumberRequired
poolAddressaddress of pool to zapstringRequired
poolTypetype of pool to zapenumRequired
positionIdOptional, in case “Increasing Liquidity into an existing position”, pass the position id. The position should belong to the poolAddress. Otherwise, it considers as “Adding Liquidity into a new position”numberundefined
initTickLowerinit tick lower in case add liquidity into a new positionnumberundefined
initTickUpperinit tick upper in case add liquidity into a new positionnumberundefined
initDepositTokensInitial deposit tokens's address, separated by commasstring""
initAmountsInitial amounts for the deposit tokens, separated by commasstring""
themematching with pancake theme. accept 'dark' or 'light'stringdark
feeAddressWallet Address if you want to charge zap feestringundefined
feePcmfee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty. From 0 to 100,000 inclusively. Example: 1 for 0.001%.numberundefined
includedSourcesList of liquidty sources you want to include from your zap, separate by commaKyberSwap Aggregator Dex Ids
excludedSourcesList of liquidty sources you want to exclude from your zap, separate by commaKyberSwap Aggregator Dex Ids
onDismissCallback function when click cancel or close widget() => void
onTxSubmitCallback function when tx was submited(txHash: string) => void
onConnectWalletfunction when user click connect wallet() => void
onAddTokensCallback function when tokens are added, need to add theses tokens's address into initDepositTokens. Example(tokenAddresses: string) => voidRequired
onRemoveTokenCallback function when a token is removed, need to remove this token's address from initDepositTokens and corresponding amount in initAmounts. Example(tokenAddress: string) => voidRequired
onAmountChangeCallback function when the amount of a token changes, need to update this amount into initAmounts corresponding with initDepositTokens. Example(tokenAddress: string, amount: string) => voidRequired
onOpenTokenSelectModalCallback function to open the token selection modal. For example. The token selection modal should be implemented by the main app. Refer to this example for guidance() => voidRequired
1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

2.0.1

12 months ago

2.0.0

12 months ago

0.1.0-rc1

2 years ago

0.1.0-rc

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago

0.0.1-tsup1

2 years ago

0.1.1

2 years ago

0.0.1-tsup

2 years ago

0.0.1-rc10

2 years ago

0.0.1-rc9

2 years ago

0.0.1-rc8

2 years ago

0.0.1-rc7

2 years ago

0.0.1-rc6

2 years ago

0.0.1-rc5

2 years ago

0.0.1-rc4

2 years ago

0.0.1-rc3

2 years ago

0.0.1-rc2

2 years ago

0.0.1-rc1

2 years ago

0.0.1-rc

2 years ago