Skip to content

Commit

Permalink
try moving CL tRPC router to edge
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator committed Jun 4, 2024
1 parent 9be0e9f commit edd9e07
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/web/components/cards/my-position/expanded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ const Chart: FunctionComponent<{

const SuperfluidPositionInfo: FunctionComponent<
NonNullable<
RouterOutputs["local"]["concentratedLiquidity"]["getPositionDetails"]["superfluidData"]
RouterOutputs["edge"]["concentratedLiquidity"]["getPositionDetails"]["superfluidData"]
>
> = (props) => {
const {
Expand Down
4 changes: 2 additions & 2 deletions packages/web/components/cards/my-position/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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 ?? "",
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/complex/my-positions-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/complex/portfolio-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "",
},
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/pool-detail/concentrated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions packages/web/server/api/edge-router.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
assetsRouter,
concentratedLiquidityRouter,
createTRPCRouter,
earnRouter,
poolsRouter,
Expand All @@ -14,4 +15,5 @@ export const edgeRouter = createTRPCRouter({
staking: stakingRouter,
earn: earnRouter,
transactions: transactionsRouter,
concentratedLiquidity: concentratedLiquidityRouter,
});
2 changes: 0 additions & 2 deletions packages/web/server/api/root-router.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
cmsRouter,
concentratedLiquidityRouter,
createTRPCRouter,
oneClickTradingRouter,
swapRouter,
Expand All @@ -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,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/web/stores/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function invalidateQueryData(apiUtils: ReturnType<typeof api.useUtils>) {
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";
Expand Down

0 comments on commit edd9e07

Please sign in to comment.