Skip to content

Commit

Permalink
feat(api): add spoke pool addresses to available-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Sep 10, 2024
1 parent 4f196f0 commit b394180
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/available-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
handleErrorCondition,
DISABLED_CHAINS_FOR_AVAILABLE_ROUTES,
DISABLED_TOKENS_FOR_AVAILABLE_ROUTES,
getSpokePoolAddress,
} from "./_utils";
import { TypedVercelRequest } from "./_types";

Expand Down Expand Up @@ -49,6 +50,7 @@ const handler = async (
destinationToken: string;
fromTokenSymbol: string;
toTokenSymbol: string;
isNative: boolean;
}) =>
![route.originChainId, route.destinationChainId].some((chainId) =>
DISABLED_CHAINS_FOR_AVAILABLE_ROUTES.includes(String(chainId))
Expand All @@ -72,6 +74,9 @@ const handler = async (
fromTokenSymbol: route.fromTokenSymbol,
toTokenSymbol: route.toTokenSymbol,
destinationToken: route.toTokenAddress,
isNative: route.isNative,
originSpokePool: getSpokePoolAddress(route.fromChain),
destinationSpokePool: getSpokePoolAddress(route.toChain),
})
).map((route) => ({
originChainId: route.originChainId,
Expand All @@ -80,6 +85,9 @@ const handler = async (
destinationToken: route.destinationToken,
originTokenSymbol: route.fromTokenSymbol,
destinationTokenSymbol: route.toTokenSymbol,
isNative: route.isNative,
originSpokePool: route.originSpokePool,
destinationSpokePool: route.destinationSpokePool,
}));

// Two different explanations for how `stale-while-revalidate` works:
Expand Down

0 comments on commit b394180

Please sign in to comment.