Skip to content

Commit 55016ae

Browse files
authored
sdk: automatic route is available fix (#569)
* sdk: automatic route is available fix Need to check if the route is actually available on the contract. * move check to quote method
1 parent 5f2845c commit 55016ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sdk/route/src/automatic.ts

+7
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ export class NttAutomaticRoute<N extends Network>
160160
ntt: params.normalizedParams.sourceContracts,
161161
});
162162

163+
if (!(await ntt.isRelayingAvailable(toChain.chain))) {
164+
return {
165+
success: false,
166+
error: new Error(`Relaying to chain ${toChain.chain} is not available`),
167+
};
168+
}
169+
163170
const deliveryPrice = await ntt.quoteDeliveryPrice(
164171
toChain.chain,
165172
params.normalizedParams.options

0 commit comments

Comments
 (0)