Skip to content

Commit

Permalink
sdk: automatic route is available fix
Browse files Browse the repository at this point in the history
Need to check if the route is actually available on the contract.
  • Loading branch information
kev1n-peters authored and nik-suri committed Dec 4, 2024
1 parent 5f2845c commit 40a4f92
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sdk/route/src/automatic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ export class NttAutomaticRoute<N extends Network>
request: routes.RouteTransferRequest<N>,
params: Tp
): Promise<Vr> {
if (!(await this.isAvailable(request))) {
return {
valid: false,
params,
error: new Error("Relaying is not available"),
};
}

const options = params.options ?? this.getDefaultOptions();

const gasDropoff = amount.parse(
Expand Down

0 comments on commit 40a4f92

Please sign in to comment.