Skip to content

Commit

Permalink
improve: rearrange amount too low
Browse files Browse the repository at this point in the history
Signed-off-by: james-a-morris <[email protected]>
  • Loading branch information
james-a-morris committed Sep 6, 2024
1 parent 276e8b4 commit eba53ca
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions api/suggested-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ const handler = async (
gasPrice
);

const skipAmountLimitEnabled = skipAmountLimit === "true";
const isAmountTooLow =
relayerFeeDetails.isAmountTooLow ||
BigNumber.from(amountInput).lt(limits.minDeposit);

if (!skipAmountLimitEnabled && relayerFeeDetails.isAmountTooLow) {
const skipAmountLimitEnabled = skipAmountLimit === "true";
if (!skipAmountLimitEnabled && isAmountTooLow) {
throw new InputError("Sent amount is too low relative to fees");
}

Expand All @@ -288,10 +291,6 @@ const handler = async (
amountInUsd
);

const isAmountTooLow =
relayerFeeDetails.isAmountTooLow ||
BigNumber.from(amountInput).lt(limits.minDeposit);

const { exclusiveRelayer, exclusivityPeriod } =
await selectExclusiveRelayer(
computedOriginChainId,
Expand Down

0 comments on commit eba53ca

Please sign in to comment.