diff --git a/packages/pancake-liquidity-widgets/src/components/Widget/index.tsx b/packages/pancake-liquidity-widgets/src/components/Widget/index.tsx index c9ae53ee..78762cce 100644 --- a/packages/pancake-liquidity-widgets/src/components/Widget/index.tsx +++ b/packages/pancake-liquidity-widgets/src/components/Widget/index.tsx @@ -23,6 +23,10 @@ export interface WidgetProps { chainId: number; networkChainId: number; + defaultTickLower?: number; + defaultTickUpper?: number; + defaultInputAmount?: string; + poolAddress: string; positionId?: string; onDismiss: () => void; @@ -42,6 +46,9 @@ export default function Widget({ chainId, networkChainId, + defaultTickLower, + defaultTickUpper, + poolAddress, positionId, onDismiss, @@ -109,6 +116,8 @@ export default function Widget({ includedSources={includedSources} excludedSources={excludedSources} source={source} + defaultTickLower={defaultTickLower} + defaultTickUpper={defaultTickUpper} >
diff --git a/packages/pancake-liquidity-widgets/src/hooks/useZapInState.tsx b/packages/pancake-liquidity-widgets/src/hooks/useZapInState.tsx index 686a6115..3444cfa8 100644 --- a/packages/pancake-liquidity-widgets/src/hooks/useZapInState.tsx +++ b/packages/pancake-liquidity-widgets/src/hooks/useZapInState.tsx @@ -227,11 +227,17 @@ export const ZapContextProvider = ({ source, excludedSources, includedSources, + + defaultTickLower, + defaultTickUpper, }: { children: ReactNode; source: string; includedSources?: string; excludedSources?: string; + + defaultTickLower?: number; + defaultTickUpper?: number; }) => { const { pool, poolAddress, position, positionId, feePcm, feeAddress } = useWidgetInfo(); @@ -249,10 +255,10 @@ export const ZapContextProvider = ({ const [revertPrice, setRevertPrice] = useState(false); const [tickLower, setTickLower] = useState( - position?.tickLower ?? null + position?.tickLower ?? defaultTickLower ?? null ); const [tickUpper, setTickUpper] = useState( - position?.tickUpper ?? null + position?.tickUpper ?? defaultTickUpper ?? null ); useEffect(() => {