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n.tsx","webpack://_N_E/./components/Button/SignPayloadBtn.tsx","webpack://_N_E/./hooks/position/useFetchPositionTypedData.ts","webpack://_N_E/./node_modules/@wagmi/core/dist/esm/actions/signTypedData.js","webpack://_N_E/./node_modules/@wagmi/core/dist/esm/query/signTypedData.js","webpack://_N_E/./node_modules/wagmi/dist/esm/hooks/useSignTypedData.js","webpack://_N_E/./components/Button/SignPositionPermitBtn.tsx","webpack://_N_E/./components/Modal/TokenSelectModal.tsx","webpack://_N_E/./views/LimitOrder/OpenOrder/LimitOrderCard.tsx","webpack://_N_E/./views/LimitOrder/OpenOrder/OpenOrderContent.tsx","webpack://_N_E/./views/LimitOrder/OpenOrder/index.tsx","webpack://_N_E/./components/Modal/StepsModal.tsx","webpack://_N_E/./views/LimitOrder/ConfirmLimitOrder/index.tsx","webpack://_N_E/./views/LimitOrder/LimitOrderPreview.tsx","webpack://_N_E/./views/LimitOrder/PlaceOrder/style.ts","webpack://_N_E/./views/LimitOrder/PlaceOrder/PlaceOrderContent.tsx","webpack://_N_E/./views/LimitOrder/PlaceOrder/index.tsx","webpack://_N_E/./pages/limit-orders.tsx","webpack://_N_E/./views/Swap/style.ts","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/signMessage.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/signTypedData.js","webpack://_N_E/<anon>"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/limit-orders\",\n function () {\n return require(\"private-next-pages/limit-orders.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/limit-orders\"])\n });\n }\n ","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { useWaitForTransaction } from \"@/hooks/useWaitForTransaction\";\nimport { useSendTransactionWithGas } from \"@/hooks/wagmi/useSendTransactionWithGas\";\nimport { Button, Spinner } from \"@aperture/uikit\";\nimport {\n ICommonNonfungiblePositionManager__factory,\n getChainInfo,\n} from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { Color } from \"@ui/components/Button/types\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { useSnackbarV2 } from \"../SnackbarContext/SnackbarContextV2\";\n\nconst SpinnerWrapper = styled.div`\n margin: auto;\n`;\n\nconst StyledButton = styled(Button)`\n font-size: 16px;\n line-height: 20px;\n`;\n\nconst ApproveOnChainBtn: React.FC<{\n text: string;\n positionIdBN: bigint;\n color?: Color;\n tokenPair?: string;\n disabled?: boolean;\n onApproved: () => void;\n handleError?: (error: string) => void;\n}> = ({\n text,\n positionIdBN,\n color = \"primary\",\n tokenPair,\n disabled,\n onApproved,\n handleError,\n ...props\n}) => {\n const { ammEnum, networkId } = useNetwork();\n const { addSnackbar } = useSnackbarV2();\n const [txnHash, setTxnHash] = useState<any>(undefined);\n\n const approveRequest = useMemo(() => {\n const chainInfo = getChainInfo(networkId);\n return {\n to: chainInfo.amms[ammEnum].nonfungiblePositionManager,\n data: ICommonNonfungiblePositionManager__factory.createInterface().encodeFunctionData(\n \"approve\",\n [chainInfo.amms[ammEnum].apertureAutoman, positionIdBN]\n ),\n };\n }, [networkId, positionIdBN]);\n\n const {\n ready,\n data: txData,\n sendTransaction,\n error: txErrorMsg,\n isError: isTxError,\n isPending: isTxLoading,\n isSuccess: isTxSuccess,\n } = useSendTransactionWithGas(approveRequest);\n\n const {\n data: waitTxData,\n error: waitTxErrorMsg,\n isError: isWaitTxError,\n isLoading: isWaitTxLoading,\n isSuccess: isWaitTxSuccess,\n } = useWaitForTransaction({\n hash: txnHash,\n });\n\n const onError = useCallback(\n (err: string) => {\n handleError?.(err);\n addSnackbar({ info: \"Failed: \" + err, status: \"failed\" });\n },\n [addSnackbar, handleError]\n );\n\n useEffect(() => {\n if (isTxSuccess && txData) {\n setTxnHash(txData);\n }\n }, [isTxSuccess, txData]);\n\n useEffect(() => {\n if (isWaitTxSuccess && waitTxData) {\n onApproved();\n addSnackbar({\n info: `You have successfully set up on-chain approval for your ${\n tokenPair ?? positionIdBN.toString()\n } position.`,\n status: \"completed\",\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isWaitTxSuccess, waitTxData]);\n\n useEffect(() => {\n if (isTxError) {\n onError(txErrorMsg!.message);\n }\n }, [isTxError, onError, txErrorMsg]);\n\n useEffect(() => {\n if (isWaitTxError) {\n onError(waitTxErrorMsg!.message);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isWaitTxError, waitTxErrorMsg]);\n\n return (\n <StyledButton\n onClick={() => sendTransaction?.()}\n disabled={\n !ready ||\n isTxLoading ||\n isWaitTxLoading ||\n isTxSuccess ||\n isWaitTxSuccess ||\n disabled\n }\n variant=\"contained\"\n color={color}\n size=\"lg\"\n invalid={false}\n width=\"100%\"\n {...props}\n >\n {isTxLoading || isWaitTxLoading ? (\n <SpinnerWrapper>\n <Spinner />\n </SpinnerWrapper>\n ) : (\n text\n )}\n </StyledButton>\n );\n};\n\nexport default ApproveOnChainBtn;\n","import { AccessoryIcons } from \"@aperture/assetkit\";\nimport { Button, Spinner } from \"@aperture/uikit\";\nimport { Color } from \"@ui/components/Button/types\";\nimport stringify from \"json-stable-stringify\";\nimport { useEffect } from \"react\";\nimport styled from \"styled-components\";\nimport { useAccount, useSignMessage } from \"wagmi\";\nimport { useSnackbarV2 } from \"../SnackbarContext/SnackbarContextV2\";\n\nconst SpinnerWrapper = styled.div`\n margin: auto;\n`;\n\nconst SignPayloadBtn: React.FC<{\n isLoading?: boolean;\n text: string;\n payload: any;\n color?: Color;\n setSignedPayload: React.Dispatch<React.SetStateAction<any>>;\n handleError?: (error: string) => void;\n showStartIcon?: boolean;\n noFeeNotification?: React.ReactNode;\n width?: string;\n disabled?: boolean;\n}> = ({\n isLoading,\n text,\n payload,\n color = \"primary\",\n setSignedPayload,\n handleError,\n showStartIcon = false,\n noFeeNotification = <></>,\n width = \"100%\",\n disabled = false,\n ...props\n}) => {\n const { address } = useAccount();\n const { addSnackbar } = useSnackbarV2();\n const payloadInString = stringify(payload);\n const {\n data,\n error,\n isPending: isSignLoading,\n isSuccess,\n signMessage,\n isError,\n } = useSignMessage();\n\n useEffect(() => {\n if (isSuccess) {\n setSignedPayload(data);\n }\n }, [isSuccess]);\n\n useEffect(() => {\n if (isError && error) {\n handleError?.(error!.message);\n addSnackbar({ info: \"Failed: \" + error!.message, status: \"failed\" });\n }\n }, [isError]);\n\n const isLoadingStatus = isSignLoading || isLoading;\n\n return (\n <Button\n {...props}\n onClick={() =>\n !isLoadingStatus &&\n signMessage({ account: address, message: payloadInString })\n }\n disabled={isLoadingStatus || disabled}\n variant=\"contained\"\n color={color}\n size=\"lg\"\n invalid={false}\n width={width}\n startIcon={\n !isLoadingStatus &&\n showStartIcon && <AccessoryIcons.CheckMarkIcon width={16} height={16} />\n }\n >\n {isLoadingStatus ? (\n <SpinnerWrapper>\n <Spinner />\n </SpinnerWrapper>\n ) : (\n text\n )}\n {!isLoadingStatus && noFeeNotification}\n </Button>\n );\n};\n\nexport default SignPayloadBtn;\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { getPositionDeadline } from \"@/helper/deadlineHelper\";\nimport { AmmEnum } from \"@aperture/uikit\";\nimport {\n ApertureSupportedChainId,\n viem,\n} from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport useSWR from \"swr\";\nimport { PublicClient } from \"viem\";\nimport { useAccount } from \"wagmi\";\n\nexport const useFetchPositionTypedData = (positionId: bigint) => {\n const { ammEnum, networkId, publicClient } = useNetwork();\n const { address: walletAddress, isConnected } = useAccount();\n\n const shouldFetch = walletAddress && isConnected && ammEnum && networkId;\n\n return useSWR(\n shouldFetch\n ? `position-typed-data-${positionId}-${ammEnum}-${networkId}`\n : null,\n () => getPositionTypedData(positionId, ammEnum, networkId, publicClient)\n );\n};\n\nasync function getPositionTypedData(\n positionId: bigint,\n amm: AmmEnum,\n chainId: ApertureSupportedChainId,\n client: PublicClient\n) {\n const deadline = BigInt(getPositionDeadline());\n return viem.generateTypedDataForPermit(\n chainId,\n amm,\n positionId,\n deadline,\n client\n );\n}\n","import { signTypedData as viem_signTypedData, } from 'viem/actions';\nimport { getAction } from '../utils/getAction.js';\nimport { getConnectorClient, } from './getConnectorClient.js';\n/** https://wagmi.sh/core/api/actions/signTypedData */\nexport async function signTypedData(config, parameters) {\n const { account, connector, ...rest } = parameters;\n let client;\n if (typeof account === 'object' && account.type === 'local')\n client = config.getClient();\n else\n client = await getConnectorClient(config, { account, connector });\n const action = getAction(client, viem_signTypedData, 'signTypedData');\n return action({\n ...rest,\n ...(account ? { account } : {}),\n });\n}\n//# sourceMappingURL=signTypedData.js.map","import { signTypedData, } from '../actions/signTypedData.js';\nexport function signTypedDataMutationOptions(config) {\n return {\n mutationFn(variables) {\n return signTypedData(config, variables);\n },\n mutationKey: ['signTypedData'],\n };\n}\n//# sourceMappingURL=signTypedData.js.map","'use client';\nimport { useMutation } from '@tanstack/react-query';\nimport { signTypedDataMutationOptions, } from '@wagmi/core/query';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useSignTypedData */\nexport function useSignTypedData(parameters = {}) {\n const { mutation } = parameters;\n const config = useConfig(parameters);\n const mutationOptions = signTypedDataMutationOptions(config);\n const { mutate, mutateAsync, ...result } = useMutation({\n ...mutation,\n ...mutationOptions,\n });\n return {\n ...result,\n signTypedData: mutate,\n signTypedDataAsync: mutateAsync,\n };\n}\n//# sourceMappingURL=useSignTypedData.js.map","import { useFetchPositionTypedData } from \"@/hooks/position/useFetchPositionTypedData\";\nimport { useEventCallback } from \"@/hooks/useEventCallback\";\nimport { Button, Spinner } from \"@aperture/uikit\";\nimport { PermitInfo } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { ButtonProps } from \"@ui/components/Button/types\";\nimport React, { useEffect } from \"react\";\nimport styled from \"styled-components\";\nimport { useSignTypedData } from \"wagmi\";\nimport { useSnackbarV2 } from \"../SnackbarContext/SnackbarContextV2\";\n\nconst SpinnerWrapper = styled.div`\n margin: auto;\n`;\n\nconst StyledButton = styled(Button)`\n font-size: 16px;\n line-height: 20px;\n`;\n\nexport const SignPositionPermitBtn: React.FC<\n ButtonProps & {\n positionId: bigint;\n tokenPair?: string;\n setPermitInfo: (permitInfo: PermitInfo) => void;\n handleError?: (error: string) => void;\n }\n> = ({\n positionId,\n tokenPair,\n disabled,\n setPermitInfo,\n handleError,\n ...props\n}) => {\n const { isPending, disabledSign, signPositionPermit } = useSignPositionPermit(\n {\n positionId,\n setPermitInfo,\n successTips: `You have successfully set up a single-use authorization for your ${\n tokenPair ?? positionId.toString()\n } position.`,\n onError: handleError,\n }\n );\n\n return (\n <PureSignPositionPermitBtn\n {...props}\n disabled={disabled || disabledSign}\n onClick={signPositionPermit}\n isLoading={isPending}\n />\n );\n};\n\nconst PureSignPositionPermitButtonComponent = (\n props: ButtonProps & {\n isLoading: boolean;\n }\n) => {\n const {\n color = \"primary\",\n isLoading,\n children = \"Sign Position Permit\",\n } = props;\n\n return (\n <StyledButton\n variant=\"contained\"\n size=\"lg\"\n color={color}\n invalid={false}\n width=\"100%\"\n {...props}\n >\n {isLoading ? (\n <SpinnerWrapper>\n <Spinner />\n </SpinnerWrapper>\n ) : (\n children\n )}\n </StyledButton>\n );\n};\n\nconst PureSignPositionPermitBtn = React.memo(\n PureSignPositionPermitButtonComponent\n);\n\ntype SignPositionPermitProps = {\n positionId: bigint;\n setPermitInfo: (permitInfo: PermitInfo) => void;\n onError?: (err: string) => void;\n successTips: string;\n};\n\nfunction useSignPositionPermit(props: SignPositionPermitProps) {\n const { positionId, setPermitInfo, successTips } = props;\n const { addSnackbar } = useSnackbarV2();\n\n const handleError = useEventCallback((err: string) => {\n props.onError?.(err);\n addSnackbar({ info: \"Failed: \" + err, status: \"failed\" });\n });\n\n const { data: signTypedDataConfig, error } =\n useFetchPositionTypedData(positionId);\n\n useEffect(() => {\n if (error) {\n handleError(error);\n }\n }, [error, handleError]);\n\n const { signTypedData, isPending, isSuccess } = useSignTypedData();\n\n const signPositionPermit = useEventCallback(() => {\n signTypedData(signTypedDataConfig as any, {\n onSuccess: (data) => {\n if (data) {\n setPermitInfo({\n signature: data,\n deadline: signTypedDataConfig?.message.deadline as string, // deadline is actually a bigint, should be fine here\n });\n addSnackbar({ info: successTips, status: \"completed\" });\n }\n },\n onError: (err) => handleError(err.message),\n });\n });\n\n return {\n signPositionPermit,\n isPending,\n disabledSign: !signTypedDataConfig || isPending || isSuccess,\n };\n}\n\nexport default SignPositionPermitBtn;\n","import { ITokenSelectContentProps, TokenSelectContent } from \"@aperture/uikit\";\n\nexport const TokenSelectModal: React.FC<ITokenSelectContentProps> = ({\n commonTokens,\n selectedToken = null,\n selectToken,\n selectUnknownToken,\n handleUnknownAddress,\n customClose,\n onClose,\n}) => {\n return (\n <TokenSelectContent\n commonTokens={commonTokens}\n selectedToken={selectedToken}\n selectToken={selectToken}\n selectUnknownToken={selectUnknownToken}\n handleUnknownAddress={handleUnknownAddress}\n customClose={customClose}\n onClose={onClose}\n />\n );\n};\n","import SignPayloadBtn from \"@/components/Button/SignPayloadBtn\";\nimport { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { usePage } from \"@/components/PageContext/PageContext\";\nimport { useSnackbarV2 } from \"@/components/SnackbarContext/SnackbarContextV2\";\nimport { LimitedOrderDetails } from \"@/config/order/orderConfig\";\nimport { getTokenIcon } from \"@/config/token/tokenIconConfig\";\nimport { deleteTrigger } from \"@/helper/triggerHelper\";\nimport { useFetchAllChainUserTriggers } from \"@/hooks/useFetchAllChainUserTriggers\";\nimport { CommonQueryKey } from \"@/utils/browserHistory\";\nimport { formatPrice, formatTokenAmount } from \"@/utils/numberFormat\";\nimport { timestampFormat } from \"@/utils/timeFormat\";\nimport { OrderCard } from \"@aperture/uikit\";\nimport { DeleteTriggerPayload } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { useRouter } from \"next/router\";\nimport React, { useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { useAccount } from \"wagmi\";\n\nconst StyledSignPayloadBtn = styled(SignPayloadBtn)`\n width: 200px;\n height: 38px;\n padding: 0 12px;\n font-size: 14px;\n background: ${({ theme }) => theme.colors.global.background.BG2};\n color: ${({ theme }) => theme.colors.global.primary};\n border: 1px solid ${({ theme }) => theme.colors.global.primary};\n &:hover {\n background: ${({ theme }) => theme.colors.global.background.BG2};\n opacity: 0.8;\n }\n`;\n\nconst LimitOrderCard: React.FC<{\n order: LimitedOrderDetails;\n}> = ({ order }) => {\n const { address } = useAccount();\n const { networkId } = useNetwork();\n const { addSnackbar } = useSnackbarV2();\n const { mutate } = useFetchAllChainUserTriggers(true);\n const [payloadSig, setPayloadSig] = useState(\"\");\n const cancelPayload: DeleteTriggerPayload = {\n ownerAddr: address!,\n chainId: networkId,\n taskId: Number(order.orderId),\n };\n const router = useRouter();\n const { setPositionPage } = usePage();\n\n useEffect(() => {\n if (payloadSig) {\n deleteTrigger(cancelPayload, payloadSig)\n .then((res) => {\n addSnackbar({\n info: `Your ${order.tokenBuy.ticker}-${order.tokenSell.ticker} limit order has been canceled.`,\n status: \"completed\",\n });\n mutate();\n })\n .catch((e) => {\n addSnackbar({\n info: \"Your limit order cancel request has failed: \" + e,\n status: \"failed\",\n });\n });\n }\n }, [payloadSig]);\n\n return (\n <OrderCard\n key={`Order-${order.orderId}-${order.chainId}`}\n from={{\n ticker: order.tokenBuy.ticker,\n Icon: getTokenIcon(\n order.tokenBuy.address,\n order.tokenBuy.ticker,\n order.chainId\n ),\n }}\n to={{\n ticker: order.tokenSell.ticker,\n Icon: getTokenIcon(\n order.tokenSell.address,\n order.tokenSell.ticker,\n order.chainId\n ),\n }}\n dateTime={timestampFormat(order.timestamp)}\n info={{\n buyAmount: formatTokenAmount(order.buyAmount),\n sellAmount: formatTokenAmount(order.sellAmount),\n limitPrice: formatPrice(order.buyRatio),\n feeTier: order.feeTier,\n min: formatPrice(order.amountMinimum),\n max: formatPrice(order.amountMaximum),\n revenue: {\n earnedFeeInputToken: order.feeRevenue.earnedFeeInputToken,\n earnedFeeOutputToken: order.feeRevenue.earnedFeeOutputToken,\n },\n }}\n status={order.status}\n notification={order.notification}\n Btn={\n <StyledSignPayloadBtn\n text=\"Cancel Order\"\n payload={cancelPayload}\n setSignedPayload={setPayloadSig}\n width={\"200px\"}\n />\n }\n navTo={() => {\n setPositionPage(\"details\");\n router.push({\n pathname: \"/liquidity-management\",\n query: {\n [CommonQueryKey.PID]: `${order.chainId}-${order.nftId}`,\n },\n });\n }}\n />\n );\n};\n\nexport default LimitOrderCard;\n","import { ApertureLogos } from \"@aperture/assetkit\";\nimport {\n FlexColumn,\n Headline5,\n LinearLoaderGroup,\n OrderStatus,\n} from \"@aperture/uikit\";\nimport React from \"react\";\nimport styled, { useTheme } from \"styled-components\";\nimport { LayoutProps, SpaceProps, compose, layout, space } from \"styled-system\";\nimport { LimitedOrderDetails } from \"../../../config/order/orderConfig\";\nimport LimitOrderCard from \"./LimitOrderCard\";\n\nconst LoaderWrapper = styled.div`\n margin-top: 12px;\n color: ${({ theme }) => theme.colors.global.text.T1};\n`;\n\nconst OrderListBox = styled.div`\n width: 100%;\n min-height: 318px;\n max-height: 747px;\n overflow-y: auto;\n margin-top: 12px;\n gap: ${({ theme }) => theme.spacing.md};\n background: ${({ theme }) => theme.colors.global.background.BG1};\n color: ${({ theme }) => theme.colors.global.text.T1};\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n > div {\n width: calc(100% - 32px);\n }\n ::-webkit-scrollbar {\n width: 0;\n }\n padding: 1px;\n`;\nexport const EmptyBox = styled(FlexColumn)<LayoutProps & SpaceProps>`\n width: 100%;\n height: 276px;\n margin-top: 12px;\n font-weight: 500;\n border-radius: ${({ theme }) => theme.radii.md};\n justify-content: center;\n align-items: center;\n gap: ${({ theme }) => theme.spacing.lg};\n border: 1px solid ${({ theme }) => theme.colors.global.line.Line1};\n color: ${({ theme }) => theme.colors.global.text.T3};\n ${compose(layout, space)}\n`;\n\nconst OpenOrderContent: React.FC<{\n showFulfilled: boolean;\n isLoading: boolean;\n limitOrders: LimitedOrderDetails[];\n}> = ({ showFulfilled, isLoading, limitOrders }) => {\n const theme = useTheme();\n const filteredLimitOrders = showFulfilled\n ? limitOrders\n : limitOrders.filter(\n (x: LimitedOrderDetails) =>\n x.status === OrderStatus.ACTIVE ||\n x.status === OrderStatus.UNAUTHORIZED\n );\n\n return (\n <>\n {isLoading ? (\n <LoaderWrapper>\n <LinearLoaderGroup size=\"100%\" height=\"85px\" />\n </LoaderWrapper>\n ) : filteredLimitOrders && filteredLimitOrders.length > 0 ? (\n <OrderListBox>\n {filteredLimitOrders.map((order: LimitedOrderDetails) => (\n <LimitOrderCard\n key={\"limit-order-id\" + order.orderId}\n {...{ order }}\n />\n ))}\n </OrderListBox>\n ) : (\n <EmptyBox height={\"318px\"}>\n <ApertureLogos.OutlineLogo fill={theme.colors.global.text.T1} />\n <Headline5>Your Limit Order will appear here.</Headline5>\n </EmptyBox>\n )}\n </>\n );\n};\n\nexport default OpenOrderContent;\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { triggerToLimitOrder } from \"@/helper/triggerHelper\";\nimport { useMutateWarningTokens } from \"@/hooks/globalState/useWarningTokens\";\nimport { useFetchAllChainUserTriggers } from \"@/hooks/useFetchAllChainUserTriggers\";\nimport { Headline } from \"@/views/style\";\nimport { Flex } from \"@aperture/uikit\";\nimport { StatusTab } from \"@ui/components\";\nimport { useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { useAccount } from \"wagmi\";\nimport { LimitedOrderDetails } from \"../../../config/order/orderConfig\";\nimport OpenOrderContent from \"./OpenOrderContent\";\n\nexport const HeaderTag = styled.div`\n color: ${({ theme }) => theme.colors.global.text.T1};\n width: 100%;\n height: 124px;\n text-align: left;\n font-family: \"Dunbar Tall\";\n font-size: 24px;\n font-style: normal;\n font-weight: 500;\n line-height: 32px;\n text-transform: capitalize;\n`;\n\nconst FlexDiv = styled(Flex)`\n align-items: center;\n color: ${({ theme }) => theme.colors.global.text.T1};\n font-family: \"Roboto Flex\";\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n text-transform: capitalize;\n`;\n\nconst Text = styled.div`\n color: ${({ theme }) => theme.colors.global.text.T1};\n width: 168px;\n text-align: right;\n font-family: \"Roboto Flex\";\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n text-transform: capitalize;\n`;\n\nexport default function OpenOrder() {\n const { ammEnum, networkId, publicClient } = useNetwork();\n const { data: allChainsTriggerObj, isLoading } =\n useFetchAllChainUserTriggers(true);\n const { isConnected } = useAccount();\n const [show, setShow] = useState(true);\n const [isFiltering, setIsFiltering] = useState<boolean>(false);\n const [limitOrders, setLimitOrders] = useState<LimitedOrderDetails[]>([]);\n\n const { mutateWarningTokens } = useMutateWarningTokens();\n\n useEffect(() => {\n if (allChainsTriggerObj) {\n setIsFiltering(true);\n triggerToLimitOrder(\n allChainsTriggerObj[networkId]?.triggers ?? [],\n networkId,\n ammEnum,\n mutateWarningTokens,\n publicClient\n ).then((limitOrders: LimitedOrderDetails[]) => {\n setLimitOrders(limitOrders);\n setIsFiltering(false);\n });\n }\n }, [allChainsTriggerObj]);\n\n return (\n <div>\n <HeaderTag></HeaderTag>\n <Headline>\n Open Orders\n <FlexDiv>\n <StatusTab\n noText\n onStatus={show}\n onChange={(status) => {\n setShow(status);\n }}\n />\n <Text>{show ? \"Show\" : \"Hide\"} Fulfilled Orders</Text>\n </FlexDiv>\n </Headline>\n <OpenOrderContent\n showFulfilled={show}\n isLoading={isLoading || isFiltering}\n limitOrders={isConnected ? limitOrders : []}\n />\n </div>\n );\n}\n","import ApproveOnChainBtn from \"@/components/Button/ApproveOnChainBtn\";\nimport SignPayloadBtn from \"@/components/Button/SignPayloadBtn\";\nimport { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { getDeadline, getPositionDeadline } from \"@/helper/deadlineHelper\";\nimport { useCurrentChainToken } from \"@/hooks/globalState/useCurrentChainToken\";\nimport { useMutatePositionMap } from \"@/hooks/useCurrentChainPositions\";\nimport { useIfAuthorized } from \"@/hooks/useFetchUserAuthentication\";\nimport { useFetchUserTokensBalance } from \"@/hooks/useFetchUserTokensBalance\";\nimport { useIsWalletContract } from \"@/hooks/useIsWalletContract\";\nimport { useWaitForTransaction } from \"@/hooks/useWaitForTransaction\";\nimport { getTokenMap } from \"@/utils/helper\";\nimport {\n IPermitForm,\n IPositionForm,\n} from \"@/views/LimitOrder/ConfirmLimitOrder\";\nimport { Button, Spinner, StepsContent } from \"@aperture/uikit\";\nimport { PermitInfo, viem } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport bigDecimal from \"js-big-decimal\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { TransactionReceipt, getAddress } from \"viem\";\nimport { useAccount } from \"wagmi\";\nimport SignPositionPermitBtn from \"../Button/SignPositionPermitBtn\";\nimport { useSnackbarV2 } from \"../SnackbarContext/SnackbarContextV2\";\n\ninterface StepsModalProps {\n txdata: { outerLimitPrice?: string; inputCurrencyAmount?: string };\n txHash: any;\n tokenPair: string;\n gasCeiling: string;\n deadlineInDays: number;\n createTrigger: (\n payload: any,\n signedPayload: any,\n signatureInfo?: {\n deadline: string;\n signature: any;\n }\n ) => void;\n onclose: () => void;\n}\n\nconst ButtonWrapper = styled.div`\n display: flex;\n padding-top: 24px;\n gap: ${({ theme }) => theme.spacing.md};\n\n > div {\n width: 100%;\n }\n`;\n\nexport const StepsModal: React.FC<StepsModalProps> = ({\n txdata,\n txHash,\n tokenPair,\n gasCeiling,\n deadlineInDays,\n createTrigger,\n onclose,\n}) => {\n const { address } = useAccount();\n const { ammEnum, networkId, publicClient } = useNetwork();\n const { ifAuthorized } = useIfAuthorized();\n const { data: isWalletContract } = useIsWalletContract();\n const { addSnackbar } = useSnackbarV2();\n const { mutate: balanceMutate } = useFetchUserTokensBalance();\n const { mutatePositionMap } = useMutatePositionMap();\n const { currentTokenPrice: tokensPrice } = useCurrentChainToken(networkId);\n const {\n data: txReceipt,\n isLoading,\n isSuccess,\n } = useWaitForTransaction({ hash: txHash });\n const [step, setStep] = useState(0);\n const [positionId, setPositionId] = useState<bigint>(0n);\n const [positionForm, setPositionForm] = useState<IPositionForm>({\n onSuccess: false,\n outerLimitPrice: undefined,\n inputCurrencyAmount: undefined,\n txReceipt: undefined,\n });\n const [payload, setPayload] = useState<any>(undefined);\n const [signedPayload, setSignedPayload] = useState(undefined);\n const [onChainApproved, setOnChainApproved] = useState<boolean>(false);\n const [permitForm, setPermitForm] = useState<IPermitForm>({\n approved: false,\n positionId,\n deadline: getPositionDeadline(),\n signature: undefined,\n });\n const isPayloadReady = useMemo(\n () =>\n positionForm.onSuccess &&\n (ifAuthorized || onChainApproved || permitForm.approved),\n [ifAuthorized, onChainApproved, permitForm.approved, positionForm.onSuccess]\n );\n\n useEffect(() => {\n const trackLimitOrderOpen = async (positionId: bigint) => {\n const tokenMap = getTokenMap(networkId);\n const positionDetails = await viem.PositionDetails.fromPositionId(\n networkId,\n ammEnum,\n positionId,\n publicClient\n );\n // Get token annotation, such as symbol from token map.\n const token0 = tokenMap.get(positionDetails.token0.address);\n const token1 = tokenMap.get(positionDetails.token1.address);\n const amount0 = positionDetails.position.amount0.toExact();\n const amount1 = positionDetails.position.amount1.toExact();\n\n // Get token prices.\n const token0Price = tokensPrice?.[token0.address]?.price;\n const token1Price = tokensPrice?.[token1.address]?.price;\n\n const token0Value = bigDecimal.multiply(amount0, token0Price);\n const token1Value = bigDecimal.multiply(amount1, token1Price);\n const totalValue = bigDecimal.add(token0Value, token1Value);\n };\n if (txReceipt && !isLoading && isSuccess && tokensPrice) {\n balanceMutate();\n mutatePositionMap();\n txReceipt.logs.forEach((log: any) => {\n log.blockNumber = Number(log.blockNumber);\n log.address = getAddress(log.address);\n });\n const positionId = viem.getMintedPositionIdFromTxReceipt(\n networkId,\n ammEnum,\n txReceipt as TransactionReceipt,\n address!\n );\n if (positionId === undefined) {\n addSnackbar({ info: \"Failed: No position found\", status: \"failed\" });\n onclose();\n } else {\n trackLimitOrderOpen(positionId);\n setPositionForm({\n onSuccess: true,\n outerLimitPrice: txdata.outerLimitPrice,\n inputCurrencyAmount: txdata.inputCurrencyAmount,\n txReceipt: txReceipt as TransactionReceipt,\n });\n setPositionId(positionId);\n setStep(ifAuthorized || onChainApproved ? 2 : 1);\n }\n }\n }, [txReceipt]);\n\n const handleError = (txErrorMsg: string) => {\n onclose();\n };\n\n useEffect(() => {\n if (isPayloadReady) {\n const payload = viem.generateLimitOrderCloseRequestPayload(\n address ?? \"0x\",\n networkId,\n ammEnum,\n positionId!.toString(),\n positionForm.outerLimitPrice,\n Number(gasCeiling) / 100,\n getDeadline(deadlineInDays)\n );\n setPayload(payload);\n }\n }, [isPayloadReady]);\n\n useEffect(() => {\n if (signedPayload) {\n createTrigger(\n payload!,\n signedPayload,\n ifAuthorized || onChainApproved\n ? undefined\n : {\n deadline: String(permitForm.deadline),\n signature: permitForm.signature!,\n }\n );\n onclose();\n }\n }, [signedPayload]);\n\n return (\n <>\n <StepsContent\n amm={ammEnum}\n step={step}\n approveOnChain={isWalletContract}\n />\n {step === 0 && (\n <ButtonWrapper>\n <Button\n disabled={true}\n variant=\"contained\"\n color=\"primary\"\n size=\"lg\"\n invalid={false}\n width=\"100%\"\n >\n <Spinner />\n </Button>\n </ButtonWrapper>\n )}\n {step === 1 && (\n <ButtonWrapper>\n {isWalletContract ? (\n <ApproveOnChainBtn\n text=\"Approve on-chain\"\n color=\"secondary\"\n tokenPair={tokenPair}\n positionIdBN={BigInt(positionId)}\n onApproved={() => {\n setOnChainApproved(true);\n setStep(2);\n }}\n />\n ) : (\n <SignPositionPermitBtn\n color=\"secondary\"\n positionId={positionId}\n setPermitInfo={(permitInfo: PermitInfo) => {\n setPermitForm({\n approved: true,\n positionId,\n deadline: parseFloat(permitInfo.deadline),\n signature: permitInfo.signature,\n });\n setStep(2);\n }}\n handleError={handleError}\n >\n Sign Position\n </SignPositionPermitBtn>\n )}\n </ButtonWrapper>\n )}\n {step === 2 && (\n <ButtonWrapper>\n <SignPayloadBtn\n text=\"Sign Payload\"\n color=\"secondary\"\n payload={payload}\n setSignedPayload={setSignedPayload}\n handleError={handleError}\n />\n </ButtonWrapper>\n )}\n </>\n );\n};\n","import { useTheme } from \"@/Providers\";\nimport { StepsModal } from \"@/components/Modal/StepsModal\";\nimport { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { useSnackbarV2 } from \"@/components/SnackbarContext/SnackbarContextV2\";\nimport {\n LOToken,\n getTransactionForLimitOrder,\n} from \"@/helper/limitOrderHelper\";\nimport { createTrigger, getCreateTriggerFailure } from \"@/helper/triggerHelper\";\nimport { useFetchAllChainUserTriggers } from \"@/hooks/useFetchAllChainUserTriggers\";\nimport { useSendTransactionWithGas } from \"@/hooks/wagmi/useSendTransactionWithGas\";\nimport { calculateGasMargin } from \"@/utils/helper\";\nimport { Button, Spinner, openSnackBar } from \"@aperture/uikit\";\nimport { E_ModalKey, Modal, useModal } from \"@aperture/uikitv2\";\nimport { getLogger } from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport { FeeAmount } from \"@aperture_finance/uniswap-v3-sdk\";\nimport { useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { EstimateGasExecutionError, TransactionReceipt } from \"viem\";\nimport { useAccount } from \"wagmi\";\n\nconst ButtonBox = styled(Button)`\n background-color: ${({ theme, disabled }) =>\n disabled\n ? theme.colors.global.primaryDisable\n : theme.colors.global.primary};\n\n :hover {\n background-color: ${({ theme, disabled }) =>\n disabled\n ? theme.colors.global.primaryDisable\n : theme.colors.global.primary};\n opacity: 0.8;\n }\n`;\n\nexport interface IPositionForm {\n onSuccess: boolean;\n outerLimitPrice: any;\n inputCurrencyAmount: any;\n txReceipt: TransactionReceipt | undefined;\n}\n\nexport interface IPermitForm {\n approved: boolean;\n positionId: bigint;\n deadline: number;\n signature: string | undefined;\n}\n\nexport interface IConfirmLimitOrder {\n sellToken: LOToken;\n buyToken: LOToken;\n feeTier: FeeAmount;\n rangeWidth: number;\n gasCeiling: string;\n deadlineInDays: number;\n goBack: () => void;\n}\n\nexport const ConfirmLimitOrder: React.FC<IConfirmLimitOrder> = (props) => {\n const {\n sellToken,\n buyToken,\n feeTier,\n rangeWidth,\n gasCeiling,\n deadlineInDays,\n goBack,\n } = props;\n\n const { address } = useAccount();\n const { ammEnum, networkId, publicClient } = useNetwork();\n const { addSnackbar } = useSnackbarV2();\n const { theme } = useTheme();\n const { state, setModalState } = useModal();\n const { isOpen } = state.STEPS_MODAL;\n const [tx, setTx] = useState<any>(undefined);\n const [txdata, setData] = useState({\n outerLimitPrice: undefined,\n inputCurrencyAmount: undefined,\n });\n const [error, setError] = useState(undefined);\n\n const { mutate } = useFetchAllChainUserTriggers(true);\n const { ready, data, sendTransaction, isError, isPending, isSuccess } =\n useSendTransactionWithGas(tx);\n\n const handleCreateTrigger = (\n payload: any,\n signedPayload: any,\n signatureInfo?: {\n deadline: string;\n signature: any;\n }\n ) => {\n openSnackBar({\n status: \"completed\",\n info: \"Setting up limit order in progress.\",\n currentTheme: theme,\n });\n createTrigger(payload, signedPayload, signatureInfo)\n .then((res) => {\n addSnackbar({\n info: `You have successfully set up an ${buyToken.ticker}-${sellToken.ticker} limit order.`,\n status: \"completed\",\n });\n mutate();\n })\n .catch((err) => {\n addSnackbar({ info: getCreateTriggerFailure(err), status: \"failed\" });\n });\n };\n\n useEffect(() => {\n // when is success, send success message to snack bar\n if (data && isSuccess) {\n addSnackbar({\n info: \"Your limit order set up request has been sent.\",\n status: \"completed\",\n transaction: {\n hash: data,\n },\n });\n\n setModalState(E_ModalKey.STEPS_MODAL, true);\n }\n }, [isSuccess]);\n\n useEffect(() => {\n // when is error, send error message to snack bar\n if (isError) {\n addSnackbar({ info: \"Failed: \" + error, status: \"failed\" });\n }\n }, [isError]);\n\n useEffect(() => {\n getTransactionForLimitOrder(\n ammEnum,\n networkId,\n address!,\n sellToken,\n buyToken,\n feeTier,\n rangeWidth,\n publicClient\n )\n .then(({ tx, outerLimitPrice, inputCurrencyAmount }) => {\n publicClient\n .estimateGas({\n ...tx,\n account: address,\n })\n .then((gas) => {\n setTx({ ...tx, gas: calculateGasMargin(gas) });\n setData({\n outerLimitPrice: outerLimitPrice,\n inputCurrencyAmount: inputCurrencyAmount,\n });\n })\n .catch((gasError) => {\n const error = gasError as EstimateGasExecutionError;\n getLogger().error(\n \"Failed to estimate gas on CreatePositionTxForLimitOrder: \",\n {\n error: JSON.stringify(error.message),\n }\n );\n setError(error.details);\n });\n })\n .catch((err) => {\n setError(err.toString());\n getLogger().error(\"Failed to getTransactionForLimitOrder: \", {\n ammEnum,\n networkId,\n address,\n sellToken,\n buyToken,\n feeTier,\n rangeWidth,\n error: JSON.stringify(err),\n });\n });\n }, [sellToken, buyToken, feeTier]);\n\n return (\n <>\n <ButtonBox\n onClick={() => {\n sendTransaction?.();\n }}\n variant=\"contained\"\n color=\"primary\"\n size=\"lg\"\n invalid={false}\n disabled={!tx || !ready || isPending || error || isPending || isSuccess}\n width=\"100%\"\n >\n {error ? (\n error\n ) : isError ? (\n \"Execution Reverted\"\n ) : isPending ? (\n <Spinner />\n ) : (\n \"Confirm Limit Order\"\n )}\n </ButtonBox>\n <Modal\n isModalOpen={isOpen}\n disableBackgroundOnClose={true}\n closeIcon={false}\n onClose={() => setModalState(E_ModalKey.STEPS_MODAL, false)}\n >\n <StepsModal\n {...{\n txdata: txdata,\n txHash: data ?? undefined,\n tokenPair: `${buyToken.ticker}-${sellToken.ticker}`,\n gasCeiling: gasCeiling,\n createTrigger: handleCreateTrigger,\n deadlineInDays: deadlineInDays,\n onclose: () => {\n setModalState(E_ModalKey.STEPS_MODAL, false);\n goBack();\n },\n }}\n />\n </Modal>\n </>\n );\n};\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { useOnNetworkAccountChange } from \"@/hooks/globalState/useOnNetworkAccountChange\";\nimport { DEFAULT_APERTURE_FEE, DEFAULT_FEE_TIER } from \"@/utils/helper\";\nimport { formatTokenAmount, formatUSDAmount } from \"@/utils/numberFormat\";\nimport {\n Body1,\n DrawerTitle,\n FeeInfoCard,\n FlexColumn,\n Headline4,\n InfoCard,\n SwitchMenuTab,\n TokenCard,\n TokenCardProps,\n} from \"@aperture/uikit\";\nimport { FeeAmount } from \"@aperture_finance/uniswap-v3-sdk\";\nimport bigDecimal from \"js-big-decimal\";\nimport moment from \"moment\";\nimport momentTimeZone from \"moment-timezone\";\nimport { useState } from \"react\";\nimport styled from \"styled-components\";\nimport { ConfirmLimitOrder } from \"./ConfirmLimitOrder\";\nimport { IPlaceOrderForm } from \"./PlaceOrder/types\";\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-top: 12px;\n gap: ${({ theme }) => theme.spacing.xl};\n`;\nconst TokenWrapper = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spacing.md};\n`;\nconst TokenTitle = styled(Body1)`\n font-weight: 500;\n color: ${({ theme }) => theme.colors.global.text.T1};\n`;\nconst InfoCards = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spacing.sm2};\n`;\nconst TabWrapper = styled.div`\n position: relative;\n height: 37px;\n`;\nconst Tab = styled(SwitchMenuTab)`\n position: absolute;\n right: 0;\n`;\nconst CutLine = styled.div`\n height: 1px;\n width: 100%;\n background: ${({ theme }) => theme.colors.global.line.Line2};\n margin: 8px 0;\n`;\nconst TimeZone = styled.div`\n font-size: 12px;\n line-height: 12px;\n color: ${({ theme }) => theme.colors.global.text.T2};\n width: 100%;\n text-align: right;\n margin-top: -4px;\n`;\n\nexport const LimitOrderPreview: React.FC<{\n sellToken: TokenCardProps;\n buyToken: TokenCardProps;\n feeTier: FeeAmount;\n rangeWidth: number;\n feeRevenue: string;\n gasCeiling: string;\n form: IPlaceOrderForm;\n onTitleClick: () => void;\n}> = ({\n form,\n sellToken,\n buyToken,\n feeTier,\n rangeWidth,\n feeRevenue,\n gasCeiling,\n onTitleClick,\n}) => {\n const { ammEnum } = useNetwork();\n const [tab, setTab] = useState<\"Buy\" | \"Sell\">(\"Sell\");\n const ifBuy = tab === \"Buy\";\n const timeZone = momentTimeZone.tz.guess();\n const getMinTriggerPrice = () => {\n return ifBuy\n ? formatTokenAmount(form.buy.minPrice)\n : formatTokenAmount(form.sell.maxPrice);\n };\n const deadline = new Date().getTime() + form.deadline * 24 * 60 * 60 * 1000;\n\n useOnNetworkAccountChange(() => {\n onTitleClick();\n });\n\n return (\n <Container>\n <DrawerTitle onClick={onTitleClick} isDrawer>\n <Headline4 fontWeight={500}>Preview Limit Order</Headline4>\n </DrawerTitle>\n <FlexColumn gap=\"md\">\n <TokenWrapper>\n <TokenTitle>You Sell</TokenTitle>\n <TokenCard {...sellToken} />\n </TokenWrapper>\n <TokenWrapper>\n <TokenTitle>You Buy</TokenTitle>\n <TokenCard {...buyToken} />\n </TokenWrapper>\n </FlexColumn>\n <TabWrapper>\n <Tab\n width={140}\n menu={[buyToken.ticker, sellToken.ticker]}\n defaultSelected={[buyToken.ticker, sellToken.ticker].indexOf(\n buyToken.ticker\n )}\n onSelect={(value: string) =>\n setTab(buyToken.ticker === value ? \"Buy\" : \"Sell\")\n }\n />\n </TabWrapper>\n <InfoCards>\n <InfoCard\n title={`${tab} ${ifBuy ? buyToken.ticker : sellToken.ticker} Price`}\n content={`${formatTokenAmount(\n bigDecimal.divide(\n !ifBuy ? buyToken.amount : sellToken.amount,\n !ifBuy ? sellToken.amount : buyToken.amount,\n 18\n )\n )} ${ifBuy ? sellToken.ticker : buyToken.ticker}`}\n />\n <InfoCard\n title={`${ifBuy ? buyToken.ticker : sellToken.ticker} Market Price`}\n content={`${formatTokenAmount(\n ifBuy ? form.marketPrice.buy : form.marketPrice.sell\n )} ${ifBuy ? sellToken.ticker : buyToken.ticker}`}\n />\n <InfoCard\n title={`Min. Trigger Price`}\n content={`${getMinTriggerPrice()} ${\n ifBuy ? sellToken.ticker : buyToken.ticker\n }`}\n />\n <InfoCard\n title={`Underlying Range`}\n content={`${formatTokenAmount(\n ifBuy ? form.buy.minPrice : form.sell.minPrice\n )} - ${formatTokenAmount(\n ifBuy ? form.buy.maxPrice : form.sell.maxPrice\n )} ${ifBuy ? sellToken.ticker : buyToken.ticker}`}\n />\n <CutLine />\n <InfoCard\n title=\"LP Fee Tier\"\n content={`${feeTier / 10000}%`}\n hint={`Default fee tier is set to ${\n DEFAULT_FEE_TIER[ammEnum] / 10000\n }%.`}\n />\n <InfoCard\n title=\"Min. Fee Revenue To Earn\"\n content={`${formatTokenAmount(feeRevenue)} ${sellToken.ticker}`}\n />\n <InfoCard\n title=\"Gas Ceiling\"\n content={`${gasCeiling}% of Limit Order (${formatUSDAmount(\n form.gasInDollar\n )})`}\n />\n <InfoCard\n title=\"Expiration Date\"\n content={`${moment(deadline).format(\"MMM Do, YYYY\")} (${moment(\n deadline\n ).diff(moment(), \"days\")} Days)`}\n />\n <TimeZone>\n {`${timeZone} (GMT${momentTimeZone.tz(timeZone).format(\"Z\")})`}\n </TimeZone>\n <FeeInfoCard\n styles={{ size: \"md\" }}\n amm={ammEnum}\n feeInfo={{\n fee: DEFAULT_APERTURE_FEE,\n amount:\n form.sell.token?.price && form.sell.token?.price !== \"-\"\n ? bigDecimal.multiply(form.sell.value, form.sell.token?.price)\n : \"-\",\n }}\n hint={`${DEFAULT_APERTURE_FEE * 100}% of the order size.`}\n />\n </InfoCards>\n <ConfirmLimitOrder\n {...{\n sellToken,\n buyToken,\n feeTier,\n rangeWidth,\n gasCeiling,\n deadlineInDays: form.deadline,\n }}\n goBack={onTitleClick}\n />\n </Container>\n );\n};\n","import { AccessoryIcons } from \"@aperture/assetkit\";\nimport { ChainAMMLabel, Headline1, Subtitle2 } from \"@aperture/uikit\";\nimport styled from \"styled-components\";\n\nexport const HeaderTag = styled(Headline1)`\n color: ${({ theme }) => theme.colors.global.text.T1};\n font-family: \"Dunbar Tall\";\n font-weight: 500;\n text-transform: capitalize;\n`;\n\nexport const ContentContainer = styled.div`\n width: 420px;\n margin-top: 12px;\n color: ${({ theme }) => theme.colors.global.text.T1};\n`;\n\nexport const SwapButton = styled.button`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 40px;\n height: 40px;\n padding: 2px;\n cursor: pointer;\n border-radius: ${({ theme }) => theme.radii.round};\n background: ${({ theme }) => theme.colors.global.primary};\n border: 0;\n position: absolute;\n top: 112px;\n`;\n\nexport const SwapButtonIcon = styled(AccessoryIcons.ExchangeIcon2)`\n fill: ${({ theme }) => theme.colors.global.textAlt.T1};\n transition: transform ${({ theme }) => theme.transitions.default} ease;\n`;\n\nexport const Gap = styled.div`\n height: 16px;\n`;\n\nexport const GapSmall = styled.div`\n height: 8px;\n`;\n\nexport const TokenWrapper = styled.div`\n display: flex;\n gap: ${({ theme }) => theme.spacing.sm};\n`;\n\nexport const RevenueValue = styled(Subtitle2)`\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const ButtonWrapper = styled.div`\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n gap: ${({ theme }) => theme.spacing.lg};\n`;\n\nexport const StyledChainAMMLabel = styled(ChainAMMLabel)`\n margin: ${({ theme }) => `${theme.spacing[\"2xl\"]} 0`};\n`;\n","import { ApproveTokenBtn } from \"@/components/Button/ApprovalBtn\";\nimport { TokenSelectModal } from \"@/components/Modal/TokenSelectModal\";\nimport { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { getExplorerURL } from \"@/config/chain\";\nimport { getNewTick } from \"@/helper/liquiditySelectorHelper\";\nimport { useMutateWarningTokens } from \"@/hooks/globalState/useWarningTokens\";\nimport { useFetchCurrentChainMarketPrice } from \"@/hooks/useFetchMarketPrice\";\nimport { fetchUnknownToken, useFetchTokenMap } from \"@/hooks/useFetchTokenMap\";\nimport {\n DEFAULT_FEE_TIER,\n DEFAULT_REVENUE,\n checkAddresses,\n gasCeilingButtonError,\n gasCeilingInputError,\n getGasCeiling,\n isProdEnv,\n} from \"@/utils/helper\";\nimport { formatTokenAmount, trimNumber } from \"@/utils/numberFormat\";\nimport { SwapInputWrapper } from \"@/views/Swap/style\";\nimport { IToken } from \"@aperture/types\";\nimport {\n AdvancedSetting,\n Button,\n Notification,\n SupportedFeeAmount,\n SwapInput,\n TokenSwap,\n TokenWarningContent,\n} from \"@aperture/uikit\";\nimport { E_ModalKey, Modal, useModal } from \"@aperture/uikitv2\";\nimport {\n AUTOMATION_EXPIRATION_IN_DAYS,\n getChainInfo,\n parsePrice,\n priceToClosestTickSafe,\n tickToLimitOrderRange,\n viem,\n} from \"@aperture_finance/uniswap-v3-automation-sdk\";\nimport {\n FeeAmount,\n Pool,\n TICK_SPACINGS,\n tickToPrice,\n} from \"@aperture_finance/uniswap-v3-sdk\";\nimport { Token } from \"@uniswap/sdk-core\";\nimport bigDecimal from \"js-big-decimal\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { Address } from \"viem\";\nimport { useAccount } from \"wagmi\";\nimport {\n ButtonWrapper,\n ContentContainer,\n Gap,\n GapSmall,\n SwapButton,\n SwapButtonIcon,\n} from \"./style\";\nimport { IPlaceOrder } from \"./types\";\n\ninterface ITokenWarning {\n token: IToken;\n isSell: boolean;\n}\n\nconst PlaceOrderContent = ({ onConfirm }: IPlaceOrder) => {\n const { isConnected, address: walletAddress } = useAccount();\n const { ammEnum, networkId, publicClient, isChainSupported } = useNetwork();\n const { data: tokenMap, isLoading: isTokenMapLoading } = useFetchTokenMap();\n\n const { mutateWarningTokens } = useMutateWarningTokens();\n const { state, setModalState } = useModal();\n const { isOpen } = state[E_ModalKey.TOKEN_SELECT_MODAL];\n const [isSell, setIsSell] = useState<boolean>();\n const { isOpen: isTokenWarningOpen } = state[E_ModalKey.TOKEN_WARNING_MODAL];\n const [tokenWarning, setTokenWarning] = useState<ITokenWarning>();\n\n const [disabled, setDisabled] = useState(true);\n const [sellToken, setSellToken] = useState<IToken | null>(null);\n const [buyToken, setBuyToken] = useState<IToken | null>(null);\n const [sellAmount, setSellAmount] = useState<string | null>(null);\n const [buyAmount, setBuyAmount] = useState<string | null>(null);\n const [price, setPrice] = useState<string>(\"\");\n const [base, setBase] = useState<\"sell\" | \"buy\">(\"buy\");\n const [approved, setApproved] = useState<boolean>(false);\n const [feeTier, setFeeTier] = useState<FeeAmount | undefined>(undefined);\n const [rangeWidth, setRangeWidth] = useState<number | undefined>(1);\n const gasCeilingAmount = useMemo(\n () =>\n bigDecimal.multiply(\n sellAmount ?? \"0\",\n sellToken?.price && sellToken?.price !== \"-\" ? sellToken.price : \"0\"\n ),\n [sellAmount, sellToken]\n );\n const [gasCeiling, setGasCeiling] = useState(\n getGasCeiling(networkId, gasCeilingAmount)\n );\n const [showNotification, setShowNotification] = useState<boolean>(false);\n const [error, setError] = useState(\"\");\n const [pool, setPool] = useState<Pool | null>(null);\n const [tick, setTick] = useState<number | null>(null);\n const [priorityList, setPriorityList] = useState<string[]>([\n \"sell\",\n \"buy\",\n \"price\",\n ]);\n const [expireDays, setExpireDays] = useState<string>(\"\");\n const [expireDaysOnError, setExpireDaysOnError] = useState<boolean>(false);\n const [poolError, setPoolError] = useState<string | null>(null);\n\n const ifSellToken0 =\n sellToken && buyToken\n ? sellToken.address.toLowerCase() < buyToken.address.toLowerCase()\n : null;\n\n const { data: marketPrice, isLoading: marketPriceLoading } =\n useFetchCurrentChainMarketPrice(\n ifSellToken0 ? sellToken?.address : buyToken?.address,\n ifSellToken0 ? buyToken?.address : sellToken?.address,\n [], // TODO: support slipstream\n !!sellToken && !!buyToken\n );\n\n const supportedFeeTier = useMemo(() => {\n const feeTierMatch: Set<FeeAmount> = new Set();\n SupportedFeeAmount[ammEnum].map((feeAmount) => {\n if (marketPrice && marketPrice[feeAmount]) {\n feeTierMatch.add(feeAmount);\n }\n });\n return feeTierMatch;\n }, [marketPrice]);\n\n const commonTokens = useMemo(\n () =>\n Object.values(tokenMap ?? {}).sort((a, b) =>\n bigDecimal.compareTo(b.amount, a.amount)\n ),\n [tokenMap]\n );\n\n useEffect(() => {\n setDisabled(true);\n setSellToken(null);\n setBuyToken(null);\n setSellAmount(null);\n setBuyAmount(null);\n setPrice(\"\");\n setBase(\"buy\");\n setApproved(false);\n setGasCeiling(0);\n setShowNotification(false);\n setError(\"\");\n setPool(null);\n setTick(null);\n setPriorityList([\"sell\", \"buy\", \"price\"]);\n setExpireDays(\"\");\n setExpireDaysOnError(false);\n }, [networkId]);\n\n const tickSpacing = feeTier ? TICK_SPACINGS[feeTier] : 0;\n\n useEffect(() => {\n if (sellToken && buyToken && !marketPriceLoading) {\n if (supportedFeeTier?.size) {\n if (supportedFeeTier.has(feeTier)) {\n setShowNotification(false);\n viem\n .getPool(\n sellToken.address,\n buyToken.address,\n feeTier,\n networkId,\n ammEnum,\n publicClient\n )\n .then((pool) => {\n setPool(pool);\n const newTick = tickToLimitOrderRange(\n getNewTick(\n null,\n ifSellToken0 ? \"Increment\" : \"Decrement\",\n tickSpacing,\n pool,\n rangeWidth\n ),\n pool.fee,\n rangeWidth\n ).tickAvg;\n setTick(newTick);\n setPoolError(null);\n })\n .catch((e) => {\n setPoolError(\"No pools found for this token pair\");\n });\n }\n } else {\n // else show notification\n setShowNotification(true);\n }\n } else {\n // when selection has not been completed yet, don't show notification\n setShowNotification(false);\n setPool(null);\n setTick(null);\n }\n }, [sellToken, buyToken, feeTier, rangeWidth, marketPriceLoading]);\n\n const updatePriceByTick = () => {\n const newPrice = tickToPrice(pool.token0, pool.token1, tick);\n if (\n (ifSellToken0 && base === \"buy\") ||\n (!ifSellToken0 && base === \"sell\")\n ) {\n setPrice(trimNumber(newPrice.toFixed(18)));\n } else {\n setPrice(trimNumber(newPrice.invert().toFixed(18)));\n }\n if (sellAmount && buyAmount) {\n if (\n priorityList[0] === \"sell\" ||\n (priorityList[0] === \"price\" && priorityList[1] === \"sell\")\n ) {\n setSellAmount(\n trimNumber(\n bigDecimal.multiply(\n buyAmount,\n ifSellToken0\n ? newPrice.invert().toFixed(18)\n : newPrice.toFixed(18)\n )\n )\n );\n } else {\n setBuyAmount(\n trimNumber(\n bigDecimal.multiply(\n !ifSellToken0\n ? newPrice.invert().toFixed(18)\n : newPrice.toFixed(18),\n sellAmount\n )\n )\n );\n }\n }\n };\n\n useEffect(() => {\n if (pool && tick) updatePriceByTick();\n }, [tick]);\n\n useEffect(() => {\n if (!isConnected || !isChainSupported) setDisabled(true);\n else setDisabled(false);\n // eslint-disable-next-line\n }, [isConnected, isChainSupported]);\n\n useEffect(() => {\n if (sellToken && sellAmount) {\n setGasCeiling(getGasCeiling(networkId, gasCeilingAmount));\n }\n }, [sellToken, sellAmount]);\n\n const handleSwap = () => {\n setError(\"\");\n\n const tempSell = sellToken;\n setSellToken(buyToken);\n setBuyToken(tempSell);\n\n const tempSellAmount = sellAmount;\n setSellAmount(buyAmount);\n setBuyAmount(tempSellAmount);\n\n const buyIndex = priorityList.findIndex((item) => item === \"buy\");\n const sellIndex = priorityList.findIndex((item) => item === \"sell\");\n priorityList[buyIndex] = \"sell\";\n priorityList[sellIndex] = \"buy\";\n setPriorityList(priorityList);\n };\n\n useEffect(() => {\n if (sellToken && sellToken.native) {\n setApproved(true);\n }\n }, [sellToken]);\n\n useEffect(() => {\n if (!sellToken) setError(`Select Sell Token`);\n else if (!sellAmount) setError(`Enter Sell Amount`);\n else if (\n bigDecimal.compareTo(sellAmount ?? \"0\", sellToken?.amount ?? \"0\") > 0\n )\n setError(`Insufficient ${sellToken?.ticker} Balance`);\n else\n setError(gasCeilingButtonError(networkId, gasCeiling, gasCeilingAmount));\n }, [sellToken, sellAmount, gasCeiling]);\n\n const handleConfirm = () => {\n const marketPrice = tickToPrice(pool.token0, pool.token1, pool.tickCurrent);\n const tickRange = tickToLimitOrderRange(tick, pool.fee, rangeWidth);\n const form = {\n sell: {\n value: sellAmount || \"0\",\n token: sellToken || null,\n minPrice: ifSellToken0\n ? tickToPrice(pool.token0, pool.token1, tickRange.tickLower).toFixed(\n 18\n )\n : tickToPrice(pool.token0, pool.token1, tickRange.tickUpper)\n .invert()\n .toFixed(18),\n maxPrice: ifSellToken0\n ? tickToPrice(pool.token0, pool.token1, tickRange.tickUpper).toFixed(\n 18\n )\n : tickToPrice(pool.token0, pool.token1, tickRange.tickLower)\n .invert()\n .toFixed(18),\n },\n buy: {\n value: buyAmount || \"0\",\n token: buyToken || null,\n minPrice: !ifSellToken0\n ? tickToPrice(pool.token0, pool.token1, tickRange.tickLower).toFixed(\n 18\n )\n : tickToPrice(pool.token0, pool.token1, tickRange.tickUpper)\n .invert()\n .toFixed(18),\n maxPrice: !ifSellToken0\n ? tickToPrice(pool.token0, pool.token1, tickRange.tickUpper).toFixed(\n 18\n )\n : tickToPrice(pool.token0, pool.token1, tickRange.tickLower)\n .invert()\n .toFixed(18),\n },\n marketPrice: {\n sell: ifSellToken0\n ? marketPrice.toFixed(18)\n : marketPrice.invert().toFixed(18),\n buy: !ifSellToken0\n ? marketPrice.toFixed(18)\n : marketPrice.invert().toFixed(18),\n },\n feeTier: feeTier,\n rangeWidth: rangeWidth,\n gasCeiling: gasCeiling,\n gasInDollar: bigDecimal.multiply(gasCeilingAmount, gasCeiling),\n deadline:\n Number(expireDays.replace(\" Days\", \"\")) === 0\n ? 30\n : Number(expireDays.replace(\" Days\", \"\")),\n };\n onConfirm(form);\n };\n\n const getMarketPrice = () => {\n if (sellToken && buyToken && pool) {\n const marketPrice = tickToPrice(\n pool.token0,\n pool.token1,\n pool.tickCurrent\n );\n\n return {\n sell: formatTokenAmount(\n ifSellToken0\n ? marketPrice.toFixed(18)\n : marketPrice.invert().toFixed(18)\n ),\n buy: formatTokenAmount(\n !ifSellToken0\n ? marketPrice.toFixed(18)\n : marketPrice.invert().toFixed(18)\n ),\n };\n } else {\n return {\n sell: \"0\",\n buy: \"0\",\n };\n }\n };\n\n const updatePriority = (priority: \"sell\" | \"buy\" | \"price\") => {\n // if update sell => [buy, price, sell]\n const newPriorityList = [...priorityList]; // Create a copy of the priorityList\n const index = newPriorityList.indexOf(priority);\n\n if (index !== -1) {\n newPriorityList.splice(index, 1); // Remove the element at index position\n newPriorityList.push(priority); // Add the priority at the end of the array\n setPriorityList(newPriorityList);\n }\n };\n\n useEffect(() => {\n if (\n sellToken &&\n !isTokenMapLoading &&\n tokenMap &&\n tokenMap[`${sellToken.address}-${sellToken.native}`]\n ) {\n setSellToken(tokenMap[`${sellToken.address}-${sellToken.native}`]);\n }\n if (\n buyToken &&\n !isTokenMapLoading &&\n tokenMap &&\n tokenMap[`${buyToken.address}-${buyToken.native}`]\n ) {\n setBuyToken(tokenMap[`${buyToken.address}-${buyToken.native}`]);\n }\n }, [isConnected, isTokenMapLoading, tokenMap]);\n\n const onPlusMinusClick = (action: \"plus\" | \"minus\") => {\n updatePriority(\"price\");\n if (sellToken && buyToken && pool) {\n let newTickRange;\n if (\n (ifSellToken0 && base === \"buy\") ||\n (!ifSellToken0 && base === \"sell\")\n ) {\n newTickRange = tickToLimitOrderRange(\n getNewTick(\n tick,\n action === \"minus\" ? \"Decrement\" : \"Increment\",\n tickSpacing,\n pool\n ),\n pool.fee,\n rangeWidth\n );\n } else {\n newTickRange = tickToLimitOrderRange(\n getNewTick(\n tick,\n action === \"minus\" ? \"Increment\" : \"Decrement\",\n tickSpacing,\n pool\n ),\n pool.fee,\n rangeWidth\n );\n }\n if (\n (ifSellToken0 && newTickRange.tickLower > pool.tickCurrent) ||\n (!ifSellToken0 && newTickRange.tickUpper < pool.tickCurrent)\n ) {\n setTick(newTickRange.tickAvg);\n }\n }\n };\n const tickRange =\n tick && feeTier && tickToLimitOrderRange(tick, feeTier, rangeWidth);\n\n const handleUnknownAddress = async (tokenAddress: string) => {\n return await fetchUnknownToken(\n tokenAddress,\n networkId,\n publicClient,\n isConnected,\n walletAddress\n );\n };\n\n const handleSelectToken = async (token: IToken, isSell: boolean) => {\n if (isSell) {\n if (checkAddresses(token, buyToken)) setBuyToken(null);\n // if sell = null, buy selected with amount, auto fill sell amount\n if (\n !sellToken &&\n buyToken &&\n bigDecimal.compareTo(buyAmount, \"0\") !== 0\n ) {\n setSellAmount(\"0\");\n }\n setSellToken(token);\n } else {\n if (checkAddresses(token, sellToken)) setSellToken(null);\n // if buy = null, sell selected with amount, auto fill buy amount\n if (\n !buyToken &&\n sellToken &&\n bigDecimal.compareTo(sellAmount, \"0\") !== 0\n ) {\n setBuyAmount(\"0\");\n }\n setBuyToken(token);\n }\n toggleSelectTokenModal(false);\n };\n\n const toggleSelectTokenModal = (open: boolean) => {\n setModalState(E_ModalKey.TOKEN_SELECT_MODAL, open);\n };\n const toggleTokenWarningModal = (open: boolean) => {\n setModalState(E_ModalKey.TOKEN_WARNING_MODAL, open);\n };\n\n return (\n <>\n <ContentContainer>\n <SwapInputWrapper>\n <SwapInput\n title=\"Sell\"\n token={sellToken}\n price={sellToken?.price ?? \"\"}\n value={sellAmount}\n showMax={true}\n showBalance={isConnected}\n openTokenSelectModal={() => {\n setIsSell(true);\n toggleSelectTokenModal(true);\n }}\n onValueChange={(value) => {\n updatePriority(\"sell\");\n // update sell amount\n setSellAmount(value);\n // if buy token is selected\n if (buyToken && pool) {\n // price base on sell token\n const price = tickToPrice(\n ifSellToken0 ? pool.token0 : pool.token1,\n ifSellToken0 ? pool.token1 : pool.token0,\n tick\n );\n // if buy token selected but amount not entered\n if (\n !buyAmount ||\n priorityList[0] === \"buy\" ||\n Number(buyAmount) === 0 ||\n Number(value) === 0\n ) {\n const amount = trimNumber(\n bigDecimal.multiply(value, price.toFixed(18))\n );\n setBuyAmount(amount);\n } else {\n const humanReadableAmount =\n bigDecimal.compareTo(value, 0) === 0\n ? \"0\"\n : bigDecimal.divide(buyAmount, value, 18);\n const newPrice = parsePrice(\n ifSellToken0 ? pool.token0 : pool.token1,\n ifSellToken0 ? pool.token1 : pool.token0,\n humanReadableAmount\n );\n const newTickRange = tickToLimitOrderRange(\n priceToClosestTickSafe(newPrice),\n pool.fee,\n rangeWidth\n );\n if (\n newTickRange.tickAvg !== tick &&\n ((ifSellToken0 &&\n newTickRange.tickLower > pool.tickCurrent) ||\n (!ifSellToken0 &&\n newTickRange.tickUpper < pool.tickCurrent))\n ) {\n setTick(newTickRange.tickAvg);\n } else {\n const amount = trimNumber(\n bigDecimal.multiply(value, price.toFixed(18))\n );\n setBuyAmount(amount);\n }\n }\n }\n }}\n size=\"small\"\n decimalScale={sellToken?.decimals}\n />\n <GapSmall />\n <SwapButton onClick={handleSwap}>\n <SwapButtonIcon />\n </SwapButton>\n <SwapInput\n title=\"Buy\"\n token={buyToken}\n price={buyToken?.price ?? \"\"}\n value={buyAmount}\n showMax={false}\n showBalance={isConnected}\n openTokenSelectModal={() => {\n setIsSell(false);\n toggleSelectTokenModal(true);\n }}\n onValueChange={(value) => {\n updatePriority(\"buy\");\n // update buy amount\n setBuyAmount(value);\n // if sell token is selected\n if (sellToken && pool) {\n // price base on buy token\n const price = tickToPrice(\n !ifSellToken0 ? pool.token0 : pool.token1,\n !ifSellToken0 ? pool.token1 : pool.token0,\n tick\n );\n // if sell token selected but amount not entered\n if (\n !sellAmount ||\n priorityList[0] === \"sell\" ||\n Number(sellAmount) === 0 ||\n Number(value) === 0\n ) {\n const amount = trimNumber(\n bigDecimal.multiply(value, price.toFixed(18))\n );\n setSellAmount(amount);\n } else {\n const humanReadableAmount = bigDecimal.divide(\n value,\n sellAmount,\n 18\n );\n\n const newPrice = parsePrice(\n ifSellToken0 ? pool.token0 : pool.token1,\n ifSellToken0 ? pool.token1 : pool.token0,\n humanReadableAmount\n );\n const newTickRange = tickToLimitOrderRange(\n priceToClosestTickSafe(newPrice),\n pool.fee,\n rangeWidth\n );\n if (\n newTickRange.tickAvg !== tick &&\n ((ifSellToken0 &&\n newTickRange.tickLower > pool.tickCurrent) ||\n (!ifSellToken0 &&\n newTickRange.tickUpper < pool.tickCurrent))\n ) {\n setTick(newTickRange.tickAvg);\n } else {\n const amount = trimNumber(\n bigDecimal.multiply(value, price.toFixed(18))\n );\n setSellAmount(amount);\n }\n }\n }\n }}\n size=\"small\"\n decimalScale={buyToken?.decimals}\n />\n </SwapInputWrapper>\n <Gap />\n <TokenSwap\n onCloseToMarketClick={() => {\n if (pool) {\n updatePriority(\"price\");\n const newTick = tickToLimitOrderRange(\n getNewTick(\n null,\n ifSellToken0 ? \"Increment\" : \"Decrement\",\n tickSpacing,\n pool,\n rangeWidth\n ),\n pool.fee,\n rangeWidth\n ).tickAvg;\n setTick(newTick);\n }\n }}\n onMinusClick={() => onPlusMinusClick(\"minus\")}\n onPlusClick={() => onPlusMinusClick(\"plus\")}\n sellTicker={sellToken?.ticker ?? \"-\"}\n buyTicker={buyToken?.ticker ?? \"-\"}\n disabled={!sellToken || !buyToken || !pool}\n //@ts-ignore\n value={price}\n onChange={(value: string) => setPrice(value)}\n onBlur={(value: string) => {\n updatePriority(\"price\");\n const price = parsePrice(\n ifSellToken0 ? pool.token0 : pool.token1,\n ifSellToken0 ? pool.token1 : pool.token0,\n base === \"buy\" || bigDecimal.compareTo(value, 0) === 0\n ? value\n : bigDecimal.divide(\"1\", value, 18)\n );\n const newTickRange = tickToLimitOrderRange(\n priceToClosestTickSafe(price),\n feeTier,\n rangeWidth\n );\n // if valid tick\n if (\n newTickRange.tickAvg !== tick &&\n ((ifSellToken0 && newTickRange.tickLower > pool.tickCurrent) ||\n (!ifSellToken0 && newTickRange.tickUpper < pool.tickCurrent))\n ) {\n setTick(newTickRange.tickAvg);\n } else {\n // tick stay the same && bring price back to the valid price\n updatePriceByTick();\n }\n }}\n action={base}\n setAction={(base: \"sell\" | \"buy\") => {\n setBase(base);\n if (bigDecimal.compareTo(price, \"0\") !== 0)\n setPrice(bigDecimal.divide(\"1\", price, 18));\n }}\n marketPrice={getMarketPrice()}\n />\n <AdvancedSetting\n amm={ammEnum}\n sellToken={sellToken}\n sellAmount={sellAmount}\n feeTier={feeTier}\n defaultFeeTier={DEFAULT_FEE_TIER[ammEnum]}\n defaultRevenue={DEFAULT_REVENUE}\n supportedFeeTier={supportedFeeTier}\n onFeeTierChange={(value) => setFeeTier(value)}\n rangeWidth={rangeWidth}\n onRangeWidthChange={(value) => setRangeWidth(value)}\n gasCeilingAmount={bigDecimal.multiply(\n sellAmount ?? \"0\",\n sellToken?.price && sellToken?.price !== \"-\" ? sellToken.price : \"0\"\n )}\n gasCeilingPercentage={gasCeiling}\n onGasCeilingChange={(percentage) => setGasCeiling(percentage)}\n onGasCeilingError={\n !!sellToken\n ? (percentage) =>\n gasCeilingInputError(networkId, percentage, gasCeilingAmount)\n : undefined\n }\n expireDays={expireDays}\n maxExpireDays={AUTOMATION_EXPIRATION_IN_DAYS}\n expireDaysOnError={expireDaysOnError}\n onExpireInput={(value: string) => {\n if (Number(value) === 0) {\n setExpireDays(\"\");\n } else {\n setExpireDays(value + \" Days\");\n }\n if (Number(value) > AUTOMATION_EXPIRATION_IN_DAYS) {\n setExpireDaysOnError(true);\n } else {\n setExpireDaysOnError(false);\n }\n }}\n />\n {showNotification && (\n <Notification\n variant=\"error\"\n text=\"Token pair is not supported\"\n //@ts-ignore\n style={{ marginTop: \"8px\" }}\n />\n )}\n {poolError && sellToken && buyToken && !showNotification && (\n <Notification\n variant=\"error\"\n text={poolError}\n //@ts-ignore\n style={{ marginTop: \"8px\" }}\n />\n )}\n <ButtonWrapper>\n <ApproveTokenBtn\n token={sellToken}\n contractAddress={\n getChainInfo(networkId).amms[ammEnum]\n .nonfungiblePositionManager as Address\n }\n amount={sellAmount ?? \"0\"}\n approveOnChange={(approve: boolean) => setApproved(approve)}\n useNative={sellToken?.native}\n />\n <Button\n variant=\"contained\"\n color=\"secondary\"\n size=\"lg\"\n width=\"100%\"\n onClick={handleConfirm}\n disabled={\n expireDaysOnError ||\n !!error ||\n disabled ||\n !buyToken ||\n Number(buyAmount) <= 0 ||\n !sellToken ||\n Number(sellAmount) <= 0 ||\n !approved ||\n showNotification\n }\n >\n {error ? error : \"Place Limit Order\"}\n </Button>\n </ButtonWrapper>\n <br />\n {!isProdEnv() && (\n <>\n tick:{\" \"}\n {tickRange && (\n <>\n {tickRange.tickLower} {tickRange.tickAvg} {tickRange.tickUpper}\n </>\n )}{\" \"}\n <br />\n pool current tick: {pool?.tickCurrent} <br />\n if sell token 0: {String(ifSellToken0)} <br />\n priorityList: {String(priorityList)}\n </>\n )}\n </ContentContainer>\n <Modal\n isModalOpen={isOpen}\n onClose={() => toggleSelectTokenModal(false)}\n padding={20}\n >\n <TokenSelectModal\n {...{\n commonTokens: commonTokens,\n selectedToken: isSell ? sellToken : buyToken,\n selectToken: (token: IToken) => handleSelectToken(token, isSell),\n selectUnknownToken: (token: IToken) => {\n setTokenWarning({ token, isSell });\n toggleTokenWarningModal(true);\n },\n handleUnknownAddress,\n }}\n />\n </Modal>\n <Modal\n isModalOpen={isTokenWarningOpen}\n onClose={() => toggleTokenWarningModal(false)}\n closeIcon={false}\n >\n <TokenWarningContent\n {...{\n amm: ammEnum,\n token: tokenWarning?.token,\n exploreURL: getExplorerURL(networkId),\n confirmClick: (token: IToken) => {\n handleSelectToken(token, tokenWarning?.isSell);\n // Add new warning token with the useLocalStorageState in the web app\n mutateWarningTokens(\n networkId,\n new Token(\n networkId,\n token.address,\n token.decimals,\n token.ticker,\n token.name\n )\n );\n toggleTokenWarningModal(false);\n },\n cancelClick: () => toggleTokenWarningModal(false),\n }}\n />\n </Modal>\n </>\n );\n};\n\nexport default PlaceOrderContent;\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport {\n DEFAULT_FEE_TIER,\n DEFAULT_GAS_CEILING,\n DEFAULT_REVENUE,\n} from \"@/utils/helper\";\nimport { formatUSDAmount } from \"@/utils/numberFormat\";\nimport { IPlaceOrderForm } from \"@/views/LimitOrder/PlaceOrder/types\";\nimport { Headline } from \"@/views/style\";\nimport { NetworkIcons } from \"@aperture/assetkit\";\nimport { TokenCardProps } from \"@aperture/uikit\";\nimport { FeeAmount } from \"@aperture_finance/uniswap-v3-sdk\";\nimport bigDecimal from \"js-big-decimal\";\nimport { useState } from \"react\";\nimport { Address } from \"viem\";\nimport { LimitOrderPreview } from \"../LimitOrderPreview\";\nimport PlaceOrderContent from \"./PlaceOrderContent\";\nimport { HeaderTag, StyledChainAMMLabel } from \"./style\";\n\nconst PlaceOrder = () => {\n const { amm, ammEnum, network } = useNetwork();\n const [preview, setPreview] = useState<boolean>(false);\n const [form, setForm] = useState<IPlaceOrderForm | null>(null);\n const [sell, setSell] = useState<TokenCardProps>({\n Icon: <NetworkIcons.EthereumIcon width={28} height={28} />,\n ticker: \"ticker\",\n name: \"name\",\n amount: \"0\",\n subText: \"~$0\",\n address: \"0x\",\n native: true,\n });\n const [buy, setBuy] = useState<TokenCardProps>({\n Icon: <NetworkIcons.EthereumIcon width={28} height={28} />,\n ticker: \"ticker\",\n name: \"name\",\n amount: \"0\",\n subText: \"~$0\",\n address: \"0x\",\n native: false,\n });\n const [feeTier, setFeeTier] = useState<FeeAmount | undefined>(\n DEFAULT_FEE_TIER[ammEnum]\n );\n const [rangeWidth, setRangeWidth] = useState<number | undefined>(1);\n const [gasCeiling, setGasCeiling] = useState(DEFAULT_GAS_CEILING);\n const handlePlaceOrderConfirm = (form: IPlaceOrderForm) => {\n setSell({\n Icon: form.sell.token!.Icon,\n ticker: form.sell.token!.ticker,\n name: form.sell.token!.name ?? form.sell.token!.ticker,\n amount: form.sell.value,\n subText: formatUSDAmount(\n bigDecimal.multiply(form.sell.value, form.sell.token!.price ?? \"0\")\n ),\n address: form.sell.token!.address as Address,\n native: form.sell.token!.native,\n });\n setBuy({\n Icon: form.buy.token!.Icon,\n ticker: form.buy.token!.ticker,\n name: form.buy.token!.name ?? form.buy.token!.ticker,\n amount: form.buy.value,\n subText: formatUSDAmount(\n bigDecimal.multiply(form.buy.value, form.buy.token!.price ?? \"0\")\n ),\n address: form.buy.token!.address as Address,\n native: form.buy.token!.native,\n });\n setFeeTier(form.feeTier);\n setRangeWidth(form.rangeWidth);\n setGasCeiling(form.gasCeiling);\n setForm(form);\n setPreview(true);\n };\n\n return (\n <div>\n <HeaderTag>\n Revenue Earning <br /> Limit Order\n <StyledChainAMMLabel amm={amm} chainId={network} />\n </HeaderTag>\n <Headline>Place Orders</Headline>\n <div>\n {!preview ? (\n <PlaceOrderContent onConfirm={handlePlaceOrderConfirm} />\n ) : (\n <LimitOrderPreview\n form={form}\n sellToken={sell}\n buyToken={buy}\n feeTier={feeTier}\n rangeWidth={rangeWidth}\n feeRevenue={bigDecimal.multiply(sell.amount, DEFAULT_REVENUE)}\n gasCeiling={bigDecimal.multiply(gasCeiling, 100)}\n onTitleClick={() => setPreview(false)}\n />\n )}\n </div>\n </div>\n );\n};\n\nexport default PlaceOrder;\n","import { useNetwork } from \"@/components/NetworkContext/NetworkContext\";\nimport { DEFAULT_AMM, DEFAULT_NETWORK, isManta } from \"@/utils/networkHelper\";\nimport OpenOrder from \"@/views/LimitOrder/OpenOrder\";\nimport PlaceOrder from \"@/views/LimitOrder/PlaceOrder\";\nimport { EmptyBox, PageContainer } from \"@/views/style\";\nimport { Headline5 } from \"@aperture/uikit\";\nimport { useEffect } from \"react\";\nimport styled from \"styled-components\";\nimport { useAccount } from \"wagmi\";\n\nconst Body = styled.div`\n display: grid;\n grid-template-columns: 420px 40px 629px;\n`;\n\nexport default function LimitOrders() {\n const { network, setNetwork, ammEnum } = useNetwork();\n const { isConnected } = useAccount();\n const notSupported = isManta(network) || ammEnum === \"SLIPSTREAM\";\n\n useEffect(() => {\n if (!isConnected) {\n if (notSupported) setNetwork(DEFAULT_AMM, DEFAULT_NETWORK);\n }\n }, []);\n\n return (\n <PageContainer>\n {notSupported ? (\n <EmptyBox>\n <Headline5>Coming Soon!</Headline5>\n </EmptyBox>\n ) : (\n <Body>\n <PlaceOrder />\n <div />\n <OpenOrder />\n </Body>\n )}\n </PageContainer>\n );\n}\n","import { AccessoryIcons } from \"@aperture/assetkit\";\nimport { Headline5 } from \"@aperture/uikit\";\nimport styled from \"styled-components\";\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n box-sizing: border-box;\n gap: ${({ theme }) => theme.spacing[\"3xl\"]};\n`;\n\nexport const Subtitle = styled(Headline5)`\n color: ${({ theme }) => theme.colors.grey.darkGrey2};\n margin-bottom: 16px;\n span:first-child {\n margin-right: 4px;\n }\n`;\n\nexport const Header = styled.div`\n box-sizing: border-box;\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n`;\n\nexport const HeadlineWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: ${({ theme }) => theme.spacing.xl};\n`;\n\nexport const SwapContainer = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n border-radius: ${({ theme }) => theme.radii.md};\n gap: ${({ theme }) => theme.spacing[\"2xl\"]};\n position: relative;\n overflow: auto;\n`;\n\nexport const SwapInputWrapper = styled.div<{ gap?: number }>`\n display: flex;\n flex-direction: column;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n gap: ${({ gap }) => gap || 0}px;\n position: relative;\n`;\n\nexport const ExchangeWrapper = styled.div`\n width: 100%;\n`;\n\nexport const SwapButton = styled.button<{ disabled: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 48px;\n height: 48px;\n cursor: ${({ disabled }) => (disabled ? \"default\" : \"pointer\")};\n border-radius: ${({ theme }) => theme.radii.round};\n background: ${({ theme }) => theme.colors.global.primary};\n border: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateY(-50%) translateX(-50%);\n`;\n\nexport const SwapButtonIcon = styled(AccessoryIcons.ExchangeIcon2)<{\n disabled: boolean;\n}>`\n transform: rotate(0deg);\n transition: transform ${({ theme }) => theme.transitions.default} ease;\n fill: ${({ theme }) => theme.colors.global.textAlt.T1};\n`;\n\nexport const ButtonWrapper = styled.div`\n display: flex;\n width: 100%;\n\n > div {\n width: 100%;\n }\n`;\n\nexport const DivideDiv = styled.div`\n position: relative;\n height: 100%;\n width: 100%;\n padding: 2px 0;\n`;\n\nexport const DivideY = styled.div`\n border: 1px solid ${({ theme }) => theme.colors.global.line.Line1};\n`;\n","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { stringToHex, toHex, } from '../../utils/encoding/toHex.js';\n/**\n * Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signMessage\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign)\n * - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * With the calculated signature, you can:\n * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,\n * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.\n *\n * @param client - Client to use\n * @param parameters - {@link SignMessageParameters}\n * @returns The signed message. {@link SignMessageReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * message: 'hello world',\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, custom } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n * message: 'hello world',\n * })\n */\nexport async function signMessage(client, { account: account_ = client.account, message, }) {\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/signMessage',\n });\n const account = parseAccount(account_);\n if (account.type === 'local')\n return account.signMessage({ message });\n const message_ = (() => {\n if (typeof message === 'string')\n return stringToHex(message);\n if (message.raw instanceof Uint8Array)\n return toHex(message.raw);\n return message.raw;\n })();\n return client.request({\n method: 'personal_sign',\n params: [message_, account.address],\n }, { retryCount: 0 });\n}\n//# sourceMappingURL=signMessage.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError, } from '../../errors/account.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getTypesForEIP712Domain, validateTypedData, } from '../../utils/typedData.js';\n/**\n * Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712): `sign(keccak256(\"\\x19\\x01\" ‖ domainSeparator ‖ hashStruct(message)))`\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signTypedData\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4)\n * - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * @param client - Client to use\n * @param parameters - {@link SignTypedDataParameters}\n * @returns The signed data. {@link SignTypedDataReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signTypedData(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * domain: {\n * name: 'Ether Mail',\n * version: '1',\n * chainId: 1,\n * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n * },\n * types: {\n * Person: [\n * { name: 'name', type: 'string' },\n * { name: 'wallet', type: 'address' },\n * ],\n * Mail: [\n * { name: 'from', type: 'Person' },\n * { name: 'to', type: 'Person' },\n * { name: 'contents', type: 'string' },\n * ],\n * },\n * primaryType: 'Mail',\n * message: {\n * from: {\n * name: 'Cow',\n * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n * },\n * to: {\n * name: 'Bob',\n * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n * },\n * contents: 'Hello, Bob!',\n * },\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const signature = await signTypedData(client, {\n * domain: {\n * name: 'Ether Mail',\n * version: '1',\n * chainId: 1,\n * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n * },\n * types: {\n * Person: [\n * { name: 'name', type: 'string' },\n * { name: 'wallet', type: 'address' },\n * ],\n * Mail: [\n * { name: 'from', type: 'Person' },\n * { name: 'to', type: 'Person' },\n * { name: 'contents', type: 'string' },\n * ],\n * },\n * primaryType: 'Mail',\n * message: {\n * from: {\n * name: 'Cow',\n * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n * },\n * to: {\n * name: 'Bob',\n * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n * },\n * contents: 'Hello, Bob!',\n * },\n * })\n */\nexport async function signTypedData(client, parameters) {\n const { account: account_ = client.account, domain, message, primaryType, } = parameters;\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/signTypedData',\n });\n const account = parseAccount(account_);\n const types = {\n EIP712Domain: getTypesForEIP712Domain({ domain }),\n ...parameters.types,\n };\n // Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc\n // as we can't statically check this with TypeScript.\n validateTypedData({ domain, message, primaryType, types });\n if (account.type === 'local')\n return account.signTypedData({ domain, message, primaryType, types });\n const typedData = stringify({ domain: domain ?? {}, message, primaryType, types }, (_, value) => (isHex(value) ? value.toLowerCase() : value));\n return client.request({\n method: 'eth_signTypedData_v4',\n params: [account.address, typedData],\n }, { retryCount: 0 });\n}\n//# sourceMappingURL=signTypedData.js.map"],"names":["window","__NEXT_P","push","__webpack_require__","SpinnerWrapper","styled","StyledButton","Button","ApproveOnChainBtn","text","positionIdBN","color","tokenPair","disabled","onApproved","handleError","props","param","ammEnum","networkId","useNetwork","addSnackbar","useSnackbarV2","txnHash","setTxnHash","useState","undefined","approveRequest","useMemo","chainInfo","getChainInfo","to","amms","nonfungiblePositionManager","data","ICommonNonfungiblePositionManager__factory","encodeFunctionData","apertureAutoman","ready","txData","sendTransaction","error","txErrorMsg","isError","isTxError","isPending","isTxLoading","isSuccess","isTxSuccess","useSendTransactionWithGas","waitTxData","waitTxErrorMsg","isWaitTxError","isLoading","isWaitTxLoading","isWaitTxSuccess","useWaitForTransaction","hash","onError","useCallback","err","info","status","useEffect","concat","toString","message","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__","jsx","onClick","variant","size","invalid","width","Spinner","__webpack_exports__","SignPayloadBtn","payload","setSignedPayload","showStartIcon","noFeeNotification","Fragment","address","useAccount","payloadInString","stringify","isSignLoading","signMessage","useSignMessage","isLoadingStatus","jsxs","account","startIcon","AccessoryIcons","height","useFetchPositionTypedData","publicClient","walletAddress","isConnected","useSWR","shouldFetch","positionId","getPositionTypedData","amm","chainId","client","deadline","BigInt","getPositionDeadline","viem","signTypedData_signTypedData","config","parameters","connector","rest","type","getClient","getConnectorClient","e","action","getAction","s","signTypedData","x","SignPositionPermitBtn","setPermitInfo","disabledSign","signPositionPermit","useSignPositionPermit","successTips","useEventCallback","signTypedDataConfig","useSignTypedData","mutation","useConfig","Z","mutate","mutateAsync","result","useMutation","D","mutationFn","variables","mutationKey","signTypedDataAsync","onSuccess","signature","jsx_runtime","PureSignPositionPermitBtn","PureSignPositionPermitButtonComponent","children","React","Button_SignPositionPermitBtn","TokenSelectModal","commonTokens","selectedToken","selectToken","selectUnknownToken","handleUnknownAddress","customClose","onClose","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","TokenSelectContent","StyledSignPayloadBtn","theme","colors","global","background","BG2","primary","LimitOrderCard","order","useFetchAllChainUserTriggers","payloadSig","setPayloadSig","cancelPayload","ownerAddr","taskId","Number","orderId","router","useRouter","setPositionPage","usePage","deleteTrigger","then","tokenBuy","ticker","tokenSell","catch","OrderCard","from","Icon","getTokenIcon","dateTime","timestampFormat","timestamp","buyAmount","formatTokenAmount","sellAmount","limitPrice","formatPrice","buyRatio","feeTier","min","amountMinimum","max","amountMaximum","revenue","earnedFeeInputToken","feeRevenue","earnedFeeOutputToken","notification","Btn","navTo","pathname","query","CommonQueryKey","nftId","LoaderWrapper","T1","OrderListBox","spacing","md","BG1","EmptyBox","FlexColumn","radii","lg","line","Line1","T3","compose","layout","space","OpenOrderContent","showFulfilled","limitOrders","useTheme","filteredLimitOrders","filter","OrderStatus","LinearLoaderGroup","length","map","ApertureLogos","fill","Headline5","HeaderTag","FlexDiv","Flex","Text","OpenOrder","allChainsTriggerObj","show","setShow","isFiltering","setIsFiltering","setLimitOrders","mutateWarningTokens","useMutateWarningTokens","triggerToLimitOrder","triggers","div","Headline","StatusTab","noText","onStatus","onChange","ButtonWrapper","StepsModal","txdata","txHash","gasCeiling","deadlineInDays","createTrigger","onclose","ifAuthorized","useIfAuthorized","isWalletContract","useIsWalletContract","balanceMutate","useFetchUserTokensBalance","mutatePositionMap","useMutatePositionMap","currentTokenPrice","tokensPrice","useCurrentChainToken","txReceipt","step","setStep","setPositionId","positionForm","setPositionForm","outerLimitPrice","inputCurrencyAmount","setPayload","signedPayload","onChainApproved","setOnChainApproved","permitForm","setPermitForm","approved","isPayloadReady","trackLimitOrderOpen","tokenMap","getTokenMap","positionDetails","token0","get","token1","amount0","position","toExact","amount1","token0Price","price","token1Price","token0Value","bigDecimal","token1Value","logs","forEach","log","blockNumber","getAddress","getDeadline","String","StepsContent","approveOnChain","parseFloat","permitInfo","ButtonBox","primaryDisable","ConfirmLimitOrder","sellToken","buyToken","rangeWidth","goBack","state","setModalState","useModal","isOpen","STEPS_MODAL","tx","setTx","setData","setError","handleCreateTrigger","signatureInfo","openSnackBar","currentTheme","getCreateTriggerFailure","transaction","E_ModalKey","getTransactionForLimitOrder","estimateGas","gas","calculateGasMargin","getLogger","JSON","details","Modal","isModalOpen","disableBackgroundOnClose","closeIcon","Container","xl","TokenWrapper","TokenTitle","Body1","InfoCards","sm2","TabWrapper","Tab","SwitchMenuTab","CutLine","Line2","TimeZone","T2","LimitOrderPreview","form","onTitleClick","tab","setTab","ifBuy","timeZone","momentTimeZone","Date","getTime","useOnNetworkAccountChange","DrawerTitle","isDrawer","Headline4","fontWeight","gap","TokenCard","menu","defaultSelected","indexOf","onSelect","value","InfoCard","title","content","amount","marketPrice","buy","sell","minPrice","maxPrice","hint","DEFAULT_FEE_TIER","formatUSDAmount","gasInDollar","moment","format","diff","FeeInfoCard","styles","feeInfo","fee","DEFAULT_APERTURE_FEE","token","Headline1","ContentContainer","SwapButton","round","SwapButtonIcon","withConfig","textAlt","transitions","default","Gap","GapSmall","sm","Subtitle2","StyledChainAMMLabel","ChainAMMLabel","PlaceOrderContent","onConfirm","isChainSupported","isTokenMapLoading","useFetchTokenMap","isSell","setIsSell","isTokenWarningOpen","tokenWarning","setTokenWarning","setDisabled","setSellToken","setBuyToken","setSellAmount","setBuyAmount","setPrice","base","setBase","setApproved","setFeeTier","setRangeWidth","gasCeilingAmount","setGasCeiling","getGasCeiling","showNotification","setShowNotification","pool","setPool","tick","setTick","priorityList","setPriorityList","expireDays","setExpireDays","expireDaysOnError","setExpireDaysOnError","poolError","setPoolError","ifSellToken0","toLowerCase","marketPriceLoading","useFetchCurrentChainMarketPrice","supportedFeeTier","feeTierMatch","Set","SupportedFeeAmount","feeAmount","add","Object","values","sort","a","b","tickSpacing","TICK_SPACINGS","has","newTick","tickToLimitOrderRange","getNewTick","tickAvg","updatePriceByTick","newPrice","tickToPrice","trimNumber","toFixed","invert","handleSwap","buyIndex","findIndex","item","sellIndex","native","gasCeilingButtonError","handleConfirm","tickCurrent","tickRange","tickLower","tickUpper","replace","updatePriority","newPriorityList","index","priority","splice","onPlusMinusClick","newTickRange","tokenAddress","fetchUnknownToken","handleSelectToken","checkAddresses","toggleSelectTokenModal","open","toggleTokenWarningModal","SwapInputWrapper","SwapInput","showMax","showBalance","openTokenSelectModal","onValueChange","humanReadableAmount","parsePrice","priceToClosestTickSafe","decimalScale","decimals","TokenSwap","onCloseToMarketClick","onMinusClick","onPlusClick","sellTicker","buyTicker","onBlur","setAction","getMarketPrice","AdvancedSetting","defaultFeeTier","defaultRevenue","DEFAULT_REVENUE","onFeeTierChange","onRangeWidthChange","gasCeilingPercentage","onGasCeilingChange","percentage","onGasCeilingError","gasCeilingInputError","maxExpireDays","AUTOMATION_EXPIRATION_IN_DAYS","onExpireInput","Notification","style","marginTop","ApproveTokenBtn","contractAddress","approveOnChange","approve","useNative","br","isProdEnv","padding","TokenWarningContent","exploreURL","getExplorerURL","confirmClick","Token","name","cancelClick","PlaceOrder","network","preview","setPreview","setForm","setSell","NetworkIcons","subText","setBuy","DEFAULT_GAS_CEILING","handlePlaceOrderConfirm","Body","LimitOrders","setNetwork","notSupported","isManta","DEFAULT_AMM","DEFAULT_NETWORK","PageContainer","grey","darkGrey2","Header","SwapContainer","ExchangeWrapper","DivideDiv","DivideY","account_","_errors_account_js__WEBPACK_IMPORTED_MODULE_0__","o","docsPath","_accounts_utils_parseAccount_js__WEBPACK_IMPORTED_MODULE_1__","T","message_","_utils_encoding_toHex_js__WEBPACK_IMPORTED_MODULE_2__","$G","raw","Uint8Array","NC","request","method","params","retryCount","domain","primaryType","types","EIP712Domain","_utils_typedData_js__WEBPACK_IMPORTED_MODULE_2__","cj","iC","typedData","_utils_stringify_js__WEBPACK_IMPORTED_MODULE_3__","P","_","_utils_data_isHex_js__WEBPACK_IMPORTED_MODULE_4__","v"],"sourceRoot":""}