diff --git a/connect/src/routes/cctp/automatic.ts b/connect/src/routes/cctp/automatic.ts index 2dff9da65..5f600fafc 100644 --- a/connect/src/routes/cctp/automatic.ts +++ b/connect/src/routes/cctp/automatic.ts @@ -13,6 +13,7 @@ import { TransferState } from "../../types.js"; import { Wormhole } from "../../wormhole.js"; import type { StaticRouteMethods } from "../route.js"; import { AutomaticRoute } from "../route.js"; +import { MinAmountError } from "../types.js"; import type { Quote, QuoteResult, @@ -163,9 +164,7 @@ export class AutomaticCCTPRoute const minAmount = (fee * 105n) / 100n; if (amount.units(amt) < minAmount) { - throw new Error( - `Minimum amount is ${amount.display(request.amountFromBaseUnits(minAmount))}`, - ); + throw new MinAmountError(amount.fromBaseUnits(minAmount, amt.decimals)); } const redeemableAmount = amount.units(amt) - fee;