Skip to content

Commit 6931aee

Browse files
committed
sdk: automatic route is available fix
Need to check if the route is actually available on the contract.
1 parent 738c67b commit 6931aee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sdk/route/src/automatic.ts

+8
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ export class NttAutomaticRoute<N extends Network>
114114
request: routes.RouteTransferRequest<N>,
115115
params: Tp
116116
): Promise<Vr> {
117+
if (!(await this.isAvailable(request))) {
118+
return {
119+
valid: false,
120+
params,
121+
error: new Error("Relaying is not available"),
122+
};
123+
}
124+
117125
const options = params.options ?? this.getDefaultOptions();
118126

119127
const gasDropoff = amount.parse(

0 commit comments

Comments
 (0)