From edd9e07d316bb3da29271ffc5d7e3d1697deede9 Mon Sep 17 00:00:00 2001 From: Jon Ator Date: Tue, 4 Jun 2024 15:04:51 -0500 Subject: [PATCH] try moving CL tRPC router to edge --- packages/web/components/cards/my-position/expanded.tsx | 2 +- packages/web/components/cards/my-position/index.tsx | 4 ++-- packages/web/components/complex/my-positions-section.tsx | 2 +- packages/web/components/complex/portfolio-page.tsx | 2 +- packages/web/components/pool-detail/concentrated.tsx | 2 +- packages/web/server/api/edge-router.ts | 2 ++ packages/web/server/api/root-router.ts | 2 -- packages/web/stores/index.tsx | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/web/components/cards/my-position/expanded.tsx b/packages/web/components/cards/my-position/expanded.tsx index 2ea673fda8..cf6858b080 100644 --- a/packages/web/components/cards/my-position/expanded.tsx +++ b/packages/web/components/cards/my-position/expanded.tsx @@ -567,7 +567,7 @@ const Chart: FunctionComponent<{ const SuperfluidPositionInfo: FunctionComponent< NonNullable< - RouterOutputs["local"]["concentratedLiquidity"]["getPositionDetails"]["superfluidData"] + RouterOutputs["edge"]["concentratedLiquidity"]["getPositionDetails"]["superfluidData"] > > = (props) => { const { diff --git a/packages/web/components/cards/my-position/index.tsx b/packages/web/components/cards/my-position/index.tsx index cf309a3251..8a7c42d127 100644 --- a/packages/web/components/cards/my-position/index.tsx +++ b/packages/web/components/cards/my-position/index.tsx @@ -36,7 +36,7 @@ export const MyPositionCard: FunctionComponent<{ const featureFlags = useFeatureFlags(); const { data: positionPerformance } = - api.local.concentratedLiquidity.getPositionHistoricalPerformance.useQuery( + api.edge.concentratedLiquidity.getPositionHistoricalPerformance.useQuery( { position: position.position, }, @@ -50,7 +50,7 @@ export const MyPositionCard: FunctionComponent<{ ); const { data: positionDetails, isLoading: isLoadingPositionDetails } = - api.local.concentratedLiquidity.getPositionDetails.useQuery( + api.edge.concentratedLiquidity.getPositionDetails.useQuery( { position: position.position, userOsmoAddress: account?.address ?? "", diff --git a/packages/web/components/complex/my-positions-section.tsx b/packages/web/components/complex/my-positions-section.tsx index 3c99a0151f..1fada11f66 100644 --- a/packages/web/components/complex/my-positions-section.tsx +++ b/packages/web/components/complex/my-positions-section.tsx @@ -20,7 +20,7 @@ export const MyPositionsSection: FunctionComponent<{ forPoolId?: string }> = const [viewMore, setViewMore] = useState(false); const { data: positions, isLoading } = - api.local.concentratedLiquidity.getUserPositions.useQuery( + api.edge.concentratedLiquidity.getUserPositions.useQuery( { userOsmoAddress: account?.address ?? "", forPoolId, diff --git a/packages/web/components/complex/portfolio-page.tsx b/packages/web/components/complex/portfolio-page.tsx index 2f0440a8bb..c96c4e611c 100644 --- a/packages/web/components/complex/portfolio-page.tsx +++ b/packages/web/components/complex/portfolio-page.tsx @@ -357,7 +357,7 @@ const WalletDisconnectedSplash: FunctionComponent = () => ( function useUserPositionsData(address: string | undefined) { const { data: positions, isLoading: isLoadingUserPositions } = - api.local.concentratedLiquidity.getUserPositions.useQuery( + api.edge.concentratedLiquidity.getUserPositions.useQuery( { userOsmoAddress: address ?? "", }, diff --git a/packages/web/components/pool-detail/concentrated.tsx b/packages/web/components/pool-detail/concentrated.tsx index 28c625a8d0..0c771d239e 100644 --- a/packages/web/components/pool-detail/concentrated.tsx +++ b/packages/web/components/pool-detail/concentrated.tsx @@ -63,7 +63,7 @@ export const ConcentratedLiquidityPool: FunctionComponent<{ poolId: string }> = api.edge.pools.getSuperfluidPoolIds.useQuery(); const { data: userPositions, isFetched: isUserPositionsFetched } = - api.local.concentratedLiquidity.getUserPositions.useQuery( + api.edge.concentratedLiquidity.getUserPositions.useQuery( { userOsmoAddress: account?.address ?? "", forPoolId: poolId, diff --git a/packages/web/server/api/edge-router.ts b/packages/web/server/api/edge-router.ts index 23edd55646..cf608d2460 100644 --- a/packages/web/server/api/edge-router.ts +++ b/packages/web/server/api/edge-router.ts @@ -1,5 +1,6 @@ import { assetsRouter, + concentratedLiquidityRouter, createTRPCRouter, earnRouter, poolsRouter, @@ -14,4 +15,5 @@ export const edgeRouter = createTRPCRouter({ staking: stakingRouter, earn: earnRouter, transactions: transactionsRouter, + concentratedLiquidity: concentratedLiquidityRouter, }); diff --git a/packages/web/server/api/root-router.ts b/packages/web/server/api/root-router.ts index 4ae868ffd2..1047db5cf9 100644 --- a/packages/web/server/api/root-router.ts +++ b/packages/web/server/api/root-router.ts @@ -1,6 +1,5 @@ import { cmsRouter, - concentratedLiquidityRouter, createTRPCRouter, oneClickTradingRouter, swapRouter, @@ -14,7 +13,6 @@ import { bridgeTransferRouter } from "~/server/api/routers/bridge-transfer"; * Caution: Ensure no sensitive data is exposed through these functions. */ export const localRouter = createTRPCRouter({ quoteRouter: swapRouter, - concentratedLiquidity: concentratedLiquidityRouter, oneClickTrading: oneClickTradingRouter, cms: cmsRouter, }); diff --git a/packages/web/stores/index.tsx b/packages/web/stores/index.tsx index 1578441aaf..58e9f32bc0 100644 --- a/packages/web/stores/index.tsx +++ b/packages/web/stores/index.tsx @@ -18,8 +18,8 @@ function invalidateQueryData(apiUtils: ReturnType) { apiUtils.edge.assets.getUserMarketAsset.invalidate(); apiUtils.edge.assets.getUserAssetsTotal.invalidate(); apiUtils.edge.assets.getUserBridgeAssets.invalidate(); - apiUtils.local.concentratedLiquidity.getUserPositions.invalidate(); - apiUtils.local.concentratedLiquidity.getPositionDetails.invalidate(); + apiUtils.edge.concentratedLiquidity.getUserPositions.invalidate(); + apiUtils.edge.concentratedLiquidity.getPositionDetails.invalidate(); } const EXCEEDS_1CT_NETWORK_FEE_LIMIT_TOAST_ID = "exceeds-1ct-network-fee-limit";