useBridgeRoutes

Hook that fetches available bridge routes with caching and retry logic

Example

const {
data: routes,
isLoading,
error,
} = useBridgeRoutes({
client: thirdwebClient,
originChainId: 1,
destinationChainId: 137,
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
});
function useBridgeRoutes(
): UseQueryResult<Result, Error>;

Parameters

Parameters for fetching routes including client and filter options

Type

let params: RoutesTypes.Options & { enabled?: boolean };

Returns

let returnType: UseQueryResult<Result, Error>;

React Query result with routes data, loading state, and error handling