|
8 | 8 | import type { Wormhole } from "../wormhole.js";
|
9 | 9 | import type { RouteTransferRequest } from "./request.js";
|
10 | 10 | import type { Route, RouteConstructor } from "./route.js";
|
11 |
| -import { isAutomatic } from "./route.js"; |
12 | 11 | import { uniqueTokens } from "./token.js";
|
13 |
| -import type { Options, Receipt, ValidatedTransferParams } from "./types.js"; |
14 | 12 |
|
15 | 13 | export class RouteResolver<N extends Network> {
|
16 | 14 | wh: Wormhole<N>;
|
@@ -102,25 +100,6 @@ export class RouteResolver<N extends Network> {
|
102 | 100 | this.routeConstructors.filter((_, index) => routesSupported[index]),
|
103 | 101 | );
|
104 | 102 |
|
105 |
| - // Next, we make sure all supported routes are available. For relayed routes, this will ping |
106 |
| - // the relayer to make sure it's online. |
107 |
| - return await Promise.all( |
108 |
| - supportedRoutes.map( |
109 |
| - async ( |
110 |
| - rc, |
111 |
| - ): Promise<[Route<N, Options, ValidatedTransferParams<Options>, Receipt>, boolean]> => { |
112 |
| - const route = new rc(this.wh); |
113 |
| - try { |
114 |
| - const available = isAutomatic(route) ? await route.isAvailable(request) : true; |
115 |
| - return [route, available]; |
116 |
| - } catch (e) { |
117 |
| - console.error(`failed to check if route is available for ${rc.meta.name}: `, e); |
118 |
| - return [route, false]; |
119 |
| - } |
120 |
| - }, |
121 |
| - ), |
122 |
| - ) |
123 |
| - .then((availableRoutes) => availableRoutes.filter(([_, available]) => available)) |
124 |
| - .then((availableRoutes) => availableRoutes.map(([route, _]) => route!)); |
| 103 | + return supportedRoutes.map((rc) => new rc(this.wh)); |
125 | 104 | }
|
126 | 105 | }
|
0 commit comments