We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94d966a commit 3632223Copy full SHA for 3632223
connect/src/routes/cctp/automatic.ts
@@ -13,6 +13,7 @@ import { TransferState } from "../../types.js";
13
import { Wormhole } from "../../wormhole.js";
14
import type { StaticRouteMethods } from "../route.js";
15
import { AutomaticRoute } from "../route.js";
16
+import { MinAmountError } from "../types.js";
17
import type {
18
Quote,
19
QuoteResult,
@@ -163,9 +164,7 @@ export class AutomaticCCTPRoute<N extends Network>
163
164
165
const minAmount = (fee * 105n) / 100n;
166
if (amount.units(amt) < minAmount) {
- throw new Error(
167
- `Minimum amount is ${amount.display(request.amountFromBaseUnits(minAmount))}`,
168
- );
+ throw new MinAmountError(amount.fromBaseUnits(minAmount, amt.decimals));
169
}
170
171
const redeemableAmount = amount.units(amt) - fee;
0 commit comments