Skip to content

Commit

Permalink
sdk: automatic route is available fix (#569)
Browse files Browse the repository at this point in the history
* sdk: automatic route is available fix

Need to check if the route is actually available on the contract.

* move check to quote method
  • Loading branch information
kev1n-peters authored Dec 4, 2024
1 parent 5f2845c commit 55016ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sdk/route/src/automatic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ export class NttAutomaticRoute<N extends Network>
ntt: params.normalizedParams.sourceContracts,
});

if (!(await ntt.isRelayingAvailable(toChain.chain))) {
return {
success: false,
error: new Error(`Relaying to chain ${toChain.chain} is not available`),
};
}

const deliveryPrice = await ntt.quoteDeliveryPrice(
toChain.chain,
params.normalizedParams.options
Expand Down

0 comments on commit 55016ae

Please sign in to comment.