{"version":3,"file":"static/chunks/4965-7da29bc7bed25778.js","mappings":"gOAGO,IAAMA,EAET,CACF,CAACC,EAAAA,wBAAAA,CAAAA,qBAA8C,CAAC,CAC9C,6CACF,CAACA,EAAAA,wBAAAA,CAAAA,yBAAkD,CAAC,CAClD,4CACJ,EAEO,eAAeC,EACpBC,CAAmC,CACnCC,CAAqB,CACrBC,CAAkB,CAClBC,CAAsB,CACtBC,CAA0B,CAC1B,CACA,OAAO,MAAMA,EAAaC,aAAa,CAAC,CACtCC,MAAOF,EAAaE,KAAK,CACzBC,QAASV,CAAqB,CAACG,EAAU,CACzCQ,IAAK,CACH,CACEC,OAAQ,CACN,CACEC,aAAc,UACdC,KAAM,KACNC,KAAM,SACR,EACA,CACEF,aAAc,UACdC,KAAM,UACNC,KAAM,SACR,EACD,CACDD,KAAM,UACNE,QAAS,EAAE,CACXC,gBAAiB,aACjBF,KAAM,UACR,EACD,CACDG,aAAc,UACdC,QAASb,EACTc,KAAM,CAAChB,EAAcC,EAAW,EAEpC,CAEO,eAAegB,EACpBjB,CAAqB,CACrBC,CAAkB,CAClBC,CAAsB,CACtBC,CAA0B,CAC1B,CACA,OAAO,MAAMA,EAAaC,aAAa,CAAC,CACtCC,MAAOF,EAAaE,KAAK,CACzBC,QAASN,EACTO,IAAK,CACH,CACEC,OAAQ,CACN,CACEC,aAAc,UACdC,KAAM,UACNC,KAAM,SACR,EACD,CACDD,KAAM,UACNE,QAAS,EAAE,CACXC,gBAAiB,aACjBF,KAAM,UACR,EACD,CACDG,aAAc,UACdC,QAASb,EACTc,KAAM,CAACf,EAAW,EAEtB,CAEO,eAAeiB,EACpBlB,CAAqB,CACrBC,CAAkB,CAClBC,CAAsB,CACtBC,CAA0B,CAC1B,CACA,OAAO,MAAMA,EAAaC,aAAa,CAAC,CACtCC,MAAOF,EAAaE,KAAK,CACzBC,QAASN,EACTO,IAAK,CACH,CACEC,OAAQ,CAAC,CAAEC,aAAc,UAAWC,KAAM,UAAWC,KAAM,SAAU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+D,EAAI,0BAA2DI,MAAAA,CAAnCnE,EAAQ,6BAAwD6D,MAAA,CAA7BM,EAAAA,cAAAA,CAAAA,IAAAA,CAAAA,QAA4B,CAAC,UAClL,MAAO,CACL,MAAMC,MACJ,GAAiDF,MAAAA,CAA9CF,EAAgB,gCAA4CH,MAAA,CAAdK,GAAAA,EAEnDG,IAAI,EACR,kHC3BO,SAASlG,GAA4B,CAC1C,GAAM,CAAE1G,QAASJ,CAAAA,CAAe+J,YAAAA,CAAAA,CAAa,CAAGxH,CAAAA,EAAAA,EAAAA,CAAAA,IAC1C,CAAE0K,aAAAA,CAAAA,CAAcpN,UAAAA,CAAAA,CAAW,CAAG2C,CAAAA,EAAAA,EAAAA,CAAAA,IAC9B,CAAEC,KAAMkE,CAAAA,CAAiB,CAAGC,CAAAA,EAAAA,EAAAA,CAAAA,IAGlC,MAAO0F,CAAAA,EAAAA,EAAAA,CAAAA,EACLC,GAF+BvM,GAAmB2G,EAG9C,8BAA+C9G,MAAAA,CAAjBG,EAAc,KAAawM,MAAA,CAAV3M,GAC/C,IAAI,CACR,IACEqN,EACElN,EACAH,EACAoN,EACAtG,GAGR,CAEA,eAAeuG,EACblN,CAAsB,CACtBH,CAAmC,CACnCoN,CAA0B,CAC1BtG,CAAsC,CACnB,CACnB,IAAMwG,EAAiBxG,EAAgByG,GAAG,CAAC,GAAUC,EAAKvN,YAAY,EACtE,OAAOwN,EAAAA,IAAAA,CAAAA,2BAAgC,CACrCtN,EACAH,EACAoN,EACAE,EAEJ","sources":["webpack://_N_E/./utils/position/stake.ts","webpack://_N_E/./components/Button/StakePositionBtn/PureStakePositionBtn.tsx","webpack://_N_E/./components/Button/StakePositionBtn/StakePositionBtn.tsx","webpack://_N_E/./components/Button/StakePositionBtn/UnstakePositionBtn.tsx","webpack://_N_E/./components/Button/StakePositionBtn/index.tsx","webpack://_N_E/./components/Context/UnstakePositionContext.tsx","webpack://_N_E/./components/Button/DeleteStrategyBtn.tsx","webpack://_N_E/./components/Modal/DeleteStrategyModal.tsx","webpack://_N_E/./helper/trigger/constants.ts","webpack://_N_E/./helper/trigger/index.ts","webpack://_N_E/./hooks/globalState/useIsChainAccountReady.ts","webpack://_N_E/./hooks/trigger/usePositionTrigger.ts","webpack://_N_E/./hooks/trigger/useSignAndCUDTrigger.ts","webpack://_N_E/./hooks/urls/useSelected.ts","webpack://_N_E/./hooks/useFetch/useFetchUserStrategies.ts","webpack://_N_E/./hooks/useFetchStakePositionsIds.ts","webpack://_N_E/<anon>"],"sourcesContent":["import { ApertureSupportedChainId } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { Address, WalletClient } from \"viem\";\n\nexport const APPROVE_STAKE_ADDRESS: {\n [chainId: number]: Address;\n} = {\n [ApertureSupportedChainId.BASE_MAINNET_CHAIN_ID]:\n \"0x827922686190790b37229fd06084350E74485b72\",\n [ApertureSupportedChainId.OPTIMISM_MAINNET_CHAIN_ID]:\n \"0x416b433906b1b72fa758e166e239c43d68dc6f29\",\n};\n\nexport async function approveStake(\n networkId: ApertureSupportedChainId,\n gaugeAddress: Address,\n positionId: bigint,\n walletAddress: Address,\n walletClient: WalletClient\n) {\n return await walletClient.writeContract({\n chain: walletClient.chain,\n address: APPROVE_STAKE_ADDRESS[networkId],\n abi: [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n ],\n functionName: \"approve\",\n account: walletAddress,\n args: [gaugeAddress, positionId],\n });\n}\n\nexport async function stake(\n gaugeAddress: Address,\n positionId: bigint,\n walletAddress: Address,\n walletClient: WalletClient\n) {\n return await walletClient.writeContract({\n chain: walletClient.chain,\n address: gaugeAddress,\n abi: [\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"deposit\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n ],\n functionName: \"deposit\",\n account: walletAddress,\n args: [positionId],\n });\n}\n\nexport async function unstake(\n gaugeAddress: Address,\n positionId: bigint,\n walletAddress: Address,\n walletClient: WalletClient\n) {\n return await walletClient.writeContract({\n chain: walletClient.chain,\n address: gaugeAddress,\n abi: [\n {\n inputs: [{ internalType: \"uint256\", name: \"tokenId\", type: \"uint256\" }],\n name: \"withdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n { stateMutability: \"payable\", type: \"receive\" },\n ],\n functionName: \"withdraw\",\n account: walletAddress,\n args: [positionId],\n });\n}\n","import { Button, Spinner } from \"@ui/components\";\nimport styled from \"styled-components\";\n\nconst StyledButton = styled(Button)`\n font-weight: 500;\n font-size: 16px;\n line-height: 16px;\n`;\n\nexport interface PureStakePositionProps {\n width?: string;\n minWidth?: string;\n isLoading: boolean;\n disabled: boolean;\n btnText: string;\n onClick: () => void;\n}\n\nexport const PureStakePositionBtn: React.FC<PureStakePositionProps> = ({\n width = \"100%\",\n minWidth,\n isLoading,\n disabled,\n btnText,\n onClick,\n ...props\n}) => {\n return (\n <StyledButton\n variant=\"contained\"\n color=\"primary\"\n width={width}\n minWidth={minWidth}\n size=\"circle\"\n disabled={isLoading || disabled}\n onClick={onClick}\n {...props}\n >\n {isLoading ? <Spinner /> : btnText}\n </StyledButton>\n );\n};\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { useSnackbarV2 } from \"@/components/SnackbarContext/SnackbarContextV2\";\nimport { useEventCallback } from \"@/hooks/useEventCallback\";\nimport { useWaitForTransaction } from \"@/hooks/useWaitForTransaction\";\nimport { approveStake, stake } from \"@/utils/position/stake\";\nimport { getLogger } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { useEffect, useState } from \"react\";\nimport { Address } from \"viem\";\nimport { useAccount, useWalletClient } from \"wagmi\";\nimport { PureStakePositionBtn } from \"./PureStakePositionBtn\";\n\nexport interface ApproveAndStakeBtnProps {\n atStake: boolean;\n gaugeAddress: Address;\n positionId: bigint;\n handleTxSuccess: () => void;\n}\n\nexport const StakePositionBtn: React.FC<ApproveAndStakeBtnProps> = ({\n atStake,\n gaugeAddress,\n positionId,\n handleTxSuccess: handlePositionStake,\n ...props\n}) => {\n const { address: walletAddress } = useAccount();\n const { networkId } = useNetwork();\n const { data: walletClient } = useWalletClient();\n const { addSnackbar } = useSnackbarV2();\n const [approving, setApproving] = useState<boolean>(false);\n const [approved, setApproved] = useState<boolean>(false);\n const [approveTxHash, setApproveTxHash] = useState<Address>(undefined);\n const [staking, setStaking] = useState<boolean>(false);\n const [staked, setStaked] = useState<boolean>(atStake);\n const [stakeTxHash, setStakeTxHash] = useState<Address>(undefined);\n useEffect(() => {\n setApproved(false);\n setStaked(atStake);\n }, [atStake]);\n\n const onPositionStake = useEventCallback(() => handlePositionStake());\n const {\n data: waitApproveTxData,\n error: waitApproveTxError,\n isError: isWaitApproveTxError,\n isLoading: isWaitApproveTxLoading,\n } = useWaitForTransaction({\n hash: approveTxHash,\n });\n\n useEffect(() => {\n if (\n !isWaitApproveTxLoading &&\n waitApproveTxData &&\n waitApproveTxData.status === \"success\"\n ) {\n setApproved(true);\n setApproving(false);\n setApproveTxHash(undefined);\n getLogger().info(\"StakePosition.Approved\", {\n positionId,\n gaugeAddress,\n approveTxHash,\n });\n }\n }, [waitApproveTxData, isWaitApproveTxLoading]);\n\n useEffect(() => {\n if (isWaitApproveTxError) {\n setApproving(false);\n setApproveTxHash(undefined);\n getLogger().error(\"StakePosition.WaitApproveStakePositionFailed: \", {\n positionId,\n gaugeAddress,\n error: waitApproveTxError,\n });\n }\n }, [isWaitApproveTxError]);\n\n const handleApprove = () => {\n setApproving(true);\n approveStake(\n networkId,\n gaugeAddress,\n positionId,\n walletAddress,\n walletClient\n )\n .then((hash) => {\n setApproveTxHash(hash);\n addSnackbar({\n info: \"Your approve request has been sent.\",\n status: \"completed\",\n transaction: {\n hash,\n successMsg: \"You have successfully approved to stake position!\",\n failureMsg: \"Failed to approve to stake position.\",\n },\n });\n })\n .catch((error) => {\n setApproving(false);\n getLogger().error(\"StakePosition.ApproveStakePositionFailed: \", {\n positionId,\n gaugeAddress,\n error: (error as Error).message,\n });\n addSnackbar({\n info: error.message.includes(\"reject\")\n ? \"User rejected the transaction.\"\n : \"Failed to approve to stake position.\",\n status: \"failed\",\n });\n });\n };\n\n const {\n data: waitStakeTxData,\n error: waitStakeTxError,\n isError: isWaitStakeTxError,\n isLoading: isWaitStakeTxLoading,\n } = useWaitForTransaction({\n hash: stakeTxHash,\n });\n\n useEffect(() => {\n if (\n !isWaitStakeTxLoading &&\n waitStakeTxData &&\n waitStakeTxData.status === \"success\"\n ) {\n setStaked(true);\n setStaking(false);\n setStakeTxHash(undefined);\n getLogger().info(\"StakePosition.Staked\", {\n positionId,\n gaugeAddress,\n stakeTxHash,\n });\n onPositionStake();\n }\n }, [waitStakeTxData, isWaitStakeTxLoading]);\n\n useEffect(() => {\n if (isWaitStakeTxError) {\n setStaking(false);\n setStakeTxHash(undefined);\n getLogger().error(\"StakePosition.WaitStakePositionFailed: \", {\n positionId,\n gaugeAddress,\n error: waitStakeTxError,\n });\n }\n }, [isWaitStakeTxError]);\n\n const handleStake = () => {\n setStaking(true);\n stake(gaugeAddress, positionId, walletAddress, walletClient)\n .then((hash) => {\n setStakeTxHash(hash);\n addSnackbar({\n info: \"Your stake position request has been sent.\",\n status: \"completed\",\n transaction: {\n hash,\n successMsg: \"You have successfully staked position!\",\n failureMsg: \"Failed to stake position.\",\n },\n });\n })\n .catch((error) => {\n setStaking(false);\n getLogger().error(\"StakePosition.StakePositionFailed: \", {\n positionId,\n gaugeAddress,\n error: (error as Error).message,\n });\n addSnackbar({\n info: error.message.includes(\"reject\")\n ? \"User rejected the transaction.\"\n : \"Failed to stake position.\",\n status: \"failed\",\n });\n });\n };\n\n return (\n <PureStakePositionBtn\n {...(approved\n ? {\n isLoading: staking,\n disabled: !gaugeAddress || staked,\n btnText: staked ? \"Position At Stake\" : \"Stake Position\",\n onClick: handleStake,\n }\n : {\n isLoading: approving,\n disabled: !gaugeAddress || approved,\n btnText: \"Approve to Stake\",\n onClick: handleApprove,\n })}\n {...props}\n />\n );\n};\n","import { useSnackbarV2 } from \"@/components/SnackbarContext/SnackbarContextV2\";\nimport { useEventCallback } from \"@/hooks/useEventCallback\";\nimport { useWaitForTransaction } from \"@/hooks/useWaitForTransaction\";\nimport { unstake } from \"@/utils/position/stake\";\nimport { getLogger } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { useEffect, useState } from \"react\";\nimport { Address } from \"viem\";\nimport { useAccount, useWalletClient } from \"wagmi\";\nimport { PureStakePositionBtn } from \"./PureStakePositionBtn\";\n\nexport interface UnstakeBtnProps {\n width?: string;\n minWidth?: string;\n atStake: boolean;\n gaugeAddress: Address;\n positionId: bigint;\n handleTxSuccess: () => void;\n}\n\nexport const UnstakePositionBtn: React.FC<UnstakeBtnProps> = ({\n width = \"100%\",\n minWidth,\n atStake,\n gaugeAddress,\n positionId,\n handleTxSuccess: handlePositionUnstake,\n ...props\n}) => {\n const { address: walletAddress } = useAccount();\n const { data: walletClient } = useWalletClient();\n const { addSnackbar } = useSnackbarV2();\n const [unstaking, setUnstaking] = useState<boolean>(false);\n const [unstaked, setUnstaked] = useState<boolean>(!atStake);\n const [unstakeTxHash, setUnstakeTxHash] = useState<Address>(undefined);\n const onPositionUnstake = useEventCallback(() => handlePositionUnstake());\n\n const {\n data: waitUnstakeTxData,\n error: waitUnstakeTxError,\n isError: isWaitUnstakeTxError,\n isLoading: isWaitUnstakeTxLoading,\n } = useWaitForTransaction({\n hash: unstakeTxHash,\n });\n\n useEffect(() => {\n if (\n !isWaitUnstakeTxLoading &&\n waitUnstakeTxData &&\n waitUnstakeTxData.status === \"success\"\n ) {\n setUnstaked(true);\n setUnstaking(false);\n setUnstakeTxHash(undefined);\n getLogger().info(\"StakePosition.Unstaked\", {\n positionId,\n gaugeAddress,\n unstakeTxHash,\n });\n onPositionUnstake();\n }\n }, [waitUnstakeTxData, isWaitUnstakeTxLoading]);\n\n useEffect(() => {\n if (isWaitUnstakeTxError) {\n setUnstaking(false);\n setUnstakeTxHash(undefined);\n getLogger().error(\"StakePosition.WaitUnstakePositionFailed: \", {\n positionId,\n gaugeAddress,\n error: waitUnstakeTxError,\n });\n }\n }, [isWaitUnstakeTxError]);\n\n const handleUnstake = () => {\n if (!walletClient) {\n addSnackbar({\n info: \"Wallet not connected. Please reconnect and try again.\",\n status: \"failed\",\n });\n return;\n }\n setUnstaking(true);\n unstake(gaugeAddress, positionId, walletAddress, walletClient)\n .then((hash) => {\n setUnstakeTxHash(hash);\n addSnackbar({\n info: \"Your unstake position request has been sent.\",\n status: \"completed\",\n transaction: {\n hash,\n successMsg: \"You have successfully unstaked position!\",\n failureMsg: \"Failed to unstake position.\",\n },\n });\n })\n .catch((error) => {\n setUnstaking(false);\n getLogger().error(\"StakePosition.UnstakePositionFailed: \", {\n positionId,\n gaugeAddress,\n error: (error as Error).message,\n });\n addSnackbar({\n info: error.message.includes(\"reject\")\n ? \"User rejected the transaction.\"\n : \"Failed to unstake position.\",\n status: \"failed\",\n });\n });\n };\n\n return (\n !unstaked && (\n <PureStakePositionBtn\n width={width}\n minWidth={minWidth}\n isLoading={unstaking}\n disabled={!gaugeAddress || unstaked}\n btnText={unstaked ? \"Position Unstaked\" : \"Unstake Position\"}\n onClick={handleUnstake}\n {...props}\n />\n )\n );\n};\n","export * from \"./StakePositionBtn\";\nexport * from \"./UnstakePositionBtn\";\n","import {\n getSlipStreamPool,\n useFetchSlipstreamPools,\n} from \"@/hooks/useFetchSlipstreamPools\";\nimport { useFetchStakePositionsIds } from \"@/hooks/useFetchStakePositionsIds\";\nimport { viem } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { Address } from \"viem\";\n\nexport interface IUnstakePositionContext {\n positionId: bigint;\n stakePool: viem.SlipStreamPool;\n staked: boolean;\n setStaked: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\nconst UnstakePositionContext = React.createContext<IUnstakePositionContext>(\n null as any\n);\n\ninterface UnstakePositionProviderProps {\n positionId: bigint;\n token0Address: Address;\n token1Address: Address;\n feeTier: number;\n}\n\nexport const UnstakePositionProvider: React.FC<\n React.PropsWithChildren<UnstakePositionProviderProps>\n> = ({ children, positionId, token0Address, token1Address, feeTier }) => {\n const { data: slipStreamPools } = useFetchSlipstreamPools();\n const { data: stakePositionIds } = useFetchStakePositionsIds();\n const [staked, setStaked] = useState<boolean>(false);\n\n const stakePool = useMemo(() => {\n if (token0Address && token1Address && feeTier && slipStreamPools) {\n return getSlipStreamPool(\n slipStreamPools,\n token0Address,\n token1Address,\n feeTier\n );\n }\n }, [token0Address, token1Address, feeTier, slipStreamPools]);\n\n useEffect(() => {\n setStaked((stakePositionIds ?? []).includes(positionId));\n }, [stakePositionIds, positionId]);\n\n return (\n <UnstakePositionContext.Provider\n value={{ positionId, stakePool, staked, setStaked }}\n >\n {children}\n </UnstakePositionContext.Provider>\n );\n};\n\nexport const useUnstakePositionContext = () => {\n return React.useContext(UnstakePositionContext);\n};\n","import { useSignAndCUDTrigger } from \"@/hooks/trigger/useSignAndCUDTrigger\";\nimport { useFetchUserStrategies } from \"@/hooks/useFetch/useFetchUserStrategies\";\nimport { useFetchAllChainUserTriggers } from \"@/hooks/useFetchAllChainUserTriggers\";\nimport { Button, Spinner } from \"@aperture/uikit\";\nimport {\n DeleteTriggerPayload,\n TriggerItem,\n} from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { useCallback } from \"react\";\nimport styled from \"styled-components\";\nimport { useAccount } from \"wagmi\";\nimport { useSnackbarV2 } from \"../SnackbarContext/SnackbarContextV2\";\n\nconst StyledButton = styled(Button)<{ isDeletingLastTrigger }>`\n background: ${({ theme, isDeletingLastTrigger }) =>\n !isDeletingLastTrigger && theme.colors.errorWarning.pink};\n color: ${({ theme, isDeletingLastTrigger }) =>\n !isDeletingLastTrigger && theme.colors.errorWarning.red};\n :hover,\n :active,\n :disabled {\n background: ${({ theme, isDeletingLastTrigger }) =>\n !isDeletingLastTrigger && theme.colors.errorWarning.pink}CC !important;\n }\n`;\n\nconst DeleteStrategyBtn: React.FC<{\n taskId: TriggerItem[\"taskId\"];\n width: string;\n onClose: () => void;\n onDelete?: () => void;\n isDeletingLastTrigger?: boolean;\n}> = ({\n taskId,\n onClose,\n onDelete,\n isDeletingLastTrigger = false,\n width = \"226px\",\n}) => {\n const { isLoading, signAndDeleteTrigger } = useSignAndCUDTrigger();\n const { address, chain } = useAccount();\n const { addSnackbar } = useSnackbarV2();\n\n const { mutate: mutateTriggers } = useFetchAllChainUserTriggers();\n const { mutate: mutateStrategies } = useFetchUserStrategies();\n\n const handleDelete = useCallback(\n (taskId: number) => {\n const deletePayload: DeleteTriggerPayload = {\n ownerAddr: address!,\n chainId: chain!.id,\n taskId,\n };\n\n signAndDeleteTrigger({\n payload: deletePayload,\n beforeRequest: () => {\n addSnackbar({\n info: \"Your delete strategy request has been sent.\",\n status: \"completed\",\n });\n onClose();\n },\n })\n .then(() => {\n onDelete && onDelete();\n mutateTriggers();\n mutateStrategies();\n })\n .catch((err) => {\n console.error(err);\n });\n },\n [\n addSnackbar,\n address,\n chain,\n mutateTriggers,\n mutateStrategies,\n onClose,\n onDelete,\n signAndDeleteTrigger,\n ]\n );\n\n return (\n <StyledButton\n onClick={() => handleDelete(taskId)}\n disabled={taskId === undefined || isLoading}\n variant=\"contained\"\n color=\"primary\"\n size=\"lg\"\n width={width}\n isDeletingLastTrigger={isDeletingLastTrigger}\n >\n {isLoading ? (\n <Spinner />\n ) : isDeletingLastTrigger ? (\n \"Yes, Delete\"\n ) : (\n \"Yes, delete strategy\"\n )}\n </StyledButton>\n );\n};\n\nexport default DeleteStrategyBtn;\n","import {\n Button,\n DeleteStrategyContent,\n DualTriggerContent,\n E_StrategyModalType,\n IDeleteStrategyProps,\n} from \"@aperture/uikit\";\nimport { TriggerItem } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport styled from \"styled-components\";\nimport DeleteStrategyBtn from \"../Button/DeleteStrategyBtn\";\n\ninterface IDeleteStrategyModal {\n onClose: () => void;\n onDelete?: () => void;\n taskId: TriggerItem[\"taskId\"];\n isDeletingLastTrigger?: boolean;\n strategyInfo?: IDeleteStrategyProps;\n}\nconst ButtonWrapper = styled.div`\n display: flex;\n padding-top: 24px;\n gap: ${({ theme }) => theme.spacing.md};\n`;\nconst ButtonBox = styled(Button)`\n padding-block: 10px;\n font-size: 16px;\n line-height: 20px;\n font-weight: 500;\n`;\n\nexport const DeleteStrategyModal: React.FC<IDeleteStrategyModal> = ({\n onClose,\n onDelete,\n taskId,\n isDeletingLastTrigger = false,\n strategyInfo = undefined,\n}) => {\n return (\n <>\n {isDeletingLastTrigger ? (\n <DualTriggerContent type={E_StrategyModalType.Delete_Last_Trigger} />\n ) : (\n <DeleteStrategyContent {...strategyInfo} />\n )}\n <ButtonWrapper>\n {isDeletingLastTrigger && (\n <ButtonBox\n width=\"216px\"\n variant=\"contained\"\n color=\"default\"\n size=\"lg\"\n onClick={onClose}\n >\n No\n </ButtonBox>\n )}\n <DeleteStrategyBtn\n width={isDeletingLastTrigger ? \"216px\" : \"100%\"}\n {...{\n taskId,\n onClose,\n onDelete,\n isDeletingLastTrigger,\n }}\n />\n {!isDeletingLastTrigger && (\n <Button\n onClick={onClose}\n variant=\"contained\"\n color=\"secondary\"\n size=\"lg\"\n width=\"100%\"\n >\n Not now\n </Button>\n )}\n </ButtonWrapper>\n </>\n );\n};\n","import { ActionTypeEnum } from \"@aperture_finance/uniswap-v3-automation-sdk\";\n\nexport const strategyActionTypes: ActionTypeEnum[] = [\n ActionTypeEnum.Values.RecurringPercentage,\n ActionTypeEnum.Values.RecurringPrice,\n ActionTypeEnum.Values.RecurringRatio,\n ActionTypeEnum.Values.RecurringDualAction,\n];\n","export * from \"./constants\";\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { useAccount } from \"wagmi\";\n\nexport const useIsChainAndWalletReady = () => {\n const { isConnected } = useAccount();\n const { isChainSupported } = useNetwork();\n\n return {\n isReady: isConnected && isChainSupported,\n };\n};\n","import { strategyActionTypes } from \"@/helper/trigger\";\nimport { filterTriggers } from \"@/helper/triggerHelper\";\nimport { ApertureSupportedChainId } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { useMemo } from \"react\";\nimport { useFetchAllChainUserTriggers } from \"../useFetchAllChainUserTriggers\";\n\nexport const usePositionStrategy = (\n positionId: string,\n chainId: ApertureSupportedChainId\n) => {\n const { data: allChainsTriggerObj } = useFetchAllChainUserTriggers();\n\n return useMemo(\n () =>\n filterTriggers(\n allChainsTriggerObj?.[chainId],\n strategyActionTypes,\n positionId\n )[0],\n [positionId, allChainsTriggerObj]\n );\n};\n\nexport const usePositionAutoCompound = (\n positionId: string,\n chainId: ApertureSupportedChainId\n) => {\n const { data: allChainsTriggerObj } = useFetchAllChainUserTriggers();\n\n return useMemo(\n () =>\n filterTriggers(allChainsTriggerObj?.[chainId], \"Reinvest\", positionId)[0],\n [positionId, allChainsTriggerObj]\n );\n};\n","import { useSnackbarV2 } from \"@/components/SnackbarContext/SnackbarContextV2\";\nimport {\n createTrigger,\n deleteTrigger,\n getCreateTriggerFailure,\n updateTrigger,\n} from \"@/helper/triggerHelper\";\nimport { useEventCallback } from \"@/hooks/useEventCallback\";\nimport {\n CreateTriggerPayload,\n DeleteTriggerPayload,\n PermitInfo,\n UpdateTriggerPayload,\n} from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport stringify from \"json-stable-stringify\";\nimport { useState } from \"react\";\nimport { useAccount, useSignMessage } from \"wagmi\";\n\ninterface IProps {\n successTip?: string;\n errorTip?: string;\n beforeRequest?: () => void;\n}\n\n// create / update / delete trigger\nexport function useSignAndCUDTrigger() {\n const { address } = useAccount();\n const { signMessageAsync } = useSignMessage();\n const { addSnackbar } = useSnackbarV2();\n const [isLoading, setIsLoading] = useState(false);\n\n const signPayload = (\n payload: CreateTriggerPayload | UpdateTriggerPayload | DeleteTriggerPayload\n ) => {\n setIsLoading(true);\n return signMessageAsync({\n account: address,\n message: stringify(payload),\n }).catch((err) => {\n throw new Error(err!.message);\n });\n };\n\n const handleResponse = (res: string, successTip: string) => {\n if (res === \"Success\") {\n addSnackbar({ info: successTip, status: \"completed\" });\n return res;\n } else {\n throw new Error(res);\n }\n };\n\n const handleError = (err: string, template: string) => {\n addSnackbar({ info: template + err, status: \"failed\" });\n throw new Error(err);\n };\n\n const stopLoading = () => {\n setIsLoading(false);\n };\n\n const signAndCreateTrigger = useEventCallback(\n async (\n props: IProps & {\n payload: CreateTriggerPayload;\n permitInfo?: PermitInfo;\n }\n ) => {\n const {\n payload,\n successTip,\n errorTip = \"Your create strategy request has failed: \",\n permitInfo,\n } = props;\n\n return signPayload(payload)\n .then((signature) => createTrigger(payload, signature, permitInfo))\n .catch((err) => {\n throw new Error(getCreateTriggerFailure(err));\n })\n .then((res) => handleResponse(res, successTip))\n .catch((err) => {\n handleError(err.message ?? err, errorTip);\n })\n .finally(stopLoading);\n }\n );\n\n const signAndUpdateTrigger = useEventCallback(\n async (props: IProps & { payload: UpdateTriggerPayload }) => {\n const {\n payload,\n successTip,\n errorTip = \"Your strategy update request has failed: \",\n } = props;\n\n return signPayload(payload)\n .then((signature) => updateTrigger(payload, signature))\n .then((res) => handleResponse(res, successTip))\n .catch((err) => {\n handleError(err, errorTip);\n })\n .finally(stopLoading);\n }\n );\n\n const signAndDeleteTrigger = useEventCallback(\n async (\n props: IProps & {\n payload: DeleteTriggerPayload;\n }\n ) => {\n const {\n payload,\n successTip = \"Your strategy has been deleted.\",\n errorTip = \"Your strategy delete request has failed: \",\n beforeRequest,\n } = props;\n\n return signPayload(payload)\n .then((signature) => {\n beforeRequest && beforeRequest();\n return deleteTrigger(payload, signature);\n })\n .then((res) => handleResponse(res, successTip))\n .catch((err) => {\n handleError(err, errorTip);\n })\n .finally(stopLoading);\n }\n );\n\n return {\n isLoading,\n signAndCreateTrigger,\n signAndUpdateTrigger,\n signAndDeleteTrigger,\n };\n}\n","import { useURLContext } from \"@/components/Context/URLContext\";\nimport { CommonQueryKey } from \"@/utils/browserHistory\";\nimport { useRouter } from \"next/router\";\nimport { useEventCallback } from \"../useEventCallback\";\n\nexport function useSelected(queryKey: CommonQueryKey) {\n const router = useRouter();\n const selected = router.query[queryKey] as string;\n const { updateUrlQuery } = useURLContext();\n\n const setSelected = useEventCallback((_selected: string) => {\n updateUrlQuery(queryKey, _selected);\n });\n\n return {\n selected,\n setSelected,\n };\n}\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { config } from \"@/config\";\nimport {\n ApertureSupportedChainId,\n ClientTypeEnum,\n GetStrategiesDetailResponse,\n} from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { AmmEnum } from \"@ui/utils\";\nimport useSWR from \"swr\";\nimport { Address } from \"viem\";\nimport { useAccount } from \"wagmi\";\n\nexport const useFetchUserStrategies = () => {\n const { ammEnum, networkId } = useNetwork();\n const { address: walletAddress } = useAccount();\n\n const showFetch = walletAddress && ammEnum && networkId;\n return useSWR(\n showFetch\n ? `user-strategies-${walletAddress}-${ammEnum}-${networkId}`\n : null,\n () => getUserStrategies(ammEnum, networkId, walletAddress)\n );\n};\n\nconst getUserStrategies = async (\n amm: AmmEnum,\n chainId: ApertureSupportedChainId,\n walletAddress: Address\n) => {\n const requestEndpoint = config.strategyEndpoint;\n const requestParams = `%7B%22ownerAddr%22%3A%22${walletAddress}%22%2C%22amm%22%3A%22${amm}%22%2C%22chainId%22%3A${chainId}%2C%22clientType%22%3A%22${ClientTypeEnum.Enum.FRONTEND}%22%7D`;\n return (\n await fetch(\n `${requestEndpoint}getStrategiesDetail?request=${requestParams}`\n )\n ).json() as Promise<GetStrategiesDetailResponse>;\n};\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport {\n ApertureSupportedChainId,\n viem,\n} from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport useSWR from \"swr/immutable\";\nimport { Address, PublicClient } from \"viem\";\nimport { useAccount } from \"wagmi\";\nimport { useFetchSlipstreamPools } from \"./useFetchSlipstreamPools\";\n\nexport function useFetchStakePositionsIds() {\n const { address: walletAddress, isConnected } = useAccount();\n const { publicClient, networkId } = useNetwork();\n const { data: slipStreamPools } = useFetchSlipstreamPools();\n\n const showFetch = isConnected && walletAddress && !!slipStreamPools;\n return useSWR(\n showFetch\n ? `slipstream-stake-positions-${walletAddress}-${networkId}`\n : null,\n () =>\n getStakePositionIds(\n walletAddress,\n networkId,\n publicClient,\n slipStreamPools\n )\n );\n}\n\nasync function getStakePositionIds(\n walletAddress: Address,\n networkId: ApertureSupportedChainId,\n publicClient: PublicClient,\n slipStreamPools: viem.SlipStreamPool[]\n): Promise<bigint[]> {\n const gaugeAddresses = slipStreamPools.map((pool) => pool.gaugeAddress);\n return viem.getSlipStreamStakePositions(\n walletAddress,\n networkId,\n publicClient,\n gaugeAddresses\n ) as Promise<bigint[]>;\n}\n"],"names":["APPROVE_STAKE_ADDRESS","ApertureSupportedChainId","approveStake","networkId","gaugeAddress","positionId","walletAddress","walletClient","writeContract","chain","address","abi","inputs","internalType","name","type","outputs","stateMutability","functionName","account","args","stake","unstake","StyledButton","styled","Button","PureStakePositionBtn","width","minWidth","isLoading","disabled","btnText","onClick","props","param","jsx_runtime","jsx","variant","color","size","Spinner","StakePositionBtn","atStake","handleTxSuccess","handlePositionStake","useAccount","useNetwork","data","useWalletClient","addSnackbar","useSnackbarV2","approving","setApproving","useState","approved","setApproved","approveTxHash","setApproveTxHash","undefined","staking","setStaking","staked","setStaked","stakeTxHash","setStakeTxHash","useEffect","onPositionStake","useEventCallback","waitApproveTxData","error","waitApproveTxError","isError","isWaitApproveTxError","isWaitApproveTxLoading","useWaitForTransaction","hash","status","getLogger","info","handleApprove","then","transaction","successMsg","failureMsg","catch","message","includes","waitStakeTxData","waitStakeTxError","isWaitStakeTxError","isWaitStakeTxLoading","handleStake","UnstakePositionBtn","handlePositionUnstake","unstaking","setUnstaking","unstaked","setUnstaked","unstakeTxHash","setUnstakeTxHash","onPositionUnstake","waitUnstakeTxData","waitUnstakeTxError","isWaitUnstakeTxError","isWaitUnstakeTxLoading","handleUnstake","UnstakePositionContext","React","UnstakePositionProvider","children","token0Address","token1Address","feeTier","slipStreamPools","useFetchSlipstreamPools","stakePositionIds","useFetchStakePositionsIds","stakePool","useMemo","getSlipStreamPool","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","Provider","value","useUnstakePositionContext","theme","isDeletingLastTrigger","colors","errorWarning","pink","red","DeleteStrategyBtn","taskId","onClose","onDelete","signAndDeleteTrigger","useSignAndCUDTrigger","mutate","mutateTriggers","useFetchAllChainUserTriggers","mutateStrategies","useFetchUserStrategies","handleDelete","useCallback","deletePayload","ownerAddr","chainId","id","payload","beforeRequest","console","err","ButtonWrapper","spacing","md","ButtonBox","DeleteStrategyModal","strategyInfo","jsxs","Fragment","DualTriggerContent","E_StrategyModalType","DeleteStrategyContent","strategyActionTypes","ActionTypeEnum","useIsChainAndWalletReady","isConnected","isChainSupported","isReady","usePositionStrategy","allChainsTriggerObj","filterTriggers","usePositionAutoCompound","signMessageAsync","useSignMessage","setIsLoading","signPayload","stringify","handleResponse","res","successTip","handleError","template","stopLoading","signAndCreateTrigger","errorTip","permitInfo","createTrigger","signature","getCreateTriggerFailure","finally","signAndUpdateTrigger","updateTrigger","deleteTrigger","useSelected","queryKey","router","useRouter","selected","query","updateUrlQuery","useURLContext","setSelected","_selected","ammEnum","useSWR","showFetch","concat","getUserStrategies","amm","requestEndpoint","config","requestParams","ClientTypeEnum","fetch","json","publicClient","getStakePositionIds","gaugeAddresses","map","pool","viem"],"sourceRoot":""}