Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2db842e

Browse files
committedDec 3, 2024·
move check to quote method
1 parent 6931aee commit 2db842e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed
 

‎sdk/route/src/automatic.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,6 @@ 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-
125117
const options = params.options ?? this.getDefaultOptions();
126118

127119
const gasDropoff = amount.parse(
@@ -168,6 +160,13 @@ export class NttAutomaticRoute<N extends Network>
168160
ntt: params.normalizedParams.sourceContracts,
169161
});
170162

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+
171170
const deliveryPrice = await ntt.quoteDeliveryPrice(
172171
toChain.chain,
173172
params.normalizedParams.options

0 commit comments

Comments
 (0)
Please sign in to comment.