Skip to content

Commit

Permalink
improve(suggested-fees): Filter underlying simulation reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Oct 26, 2023
1 parent 1672213 commit db98094
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions api/suggested-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,22 @@ const handler = async (
currentUt,
nextUt
);
const relayerFeeDetails = await getRelayerFeeDetails(
l1Token,
amount,
computedOriginChainId,
destinationChainId,
recipientAddress,
tokenPrice,
message,
relayerAddress
);

let relayerFeeDetails: sdk.relayFeeCalculator.RelayerFeeDetails;
try {
relayerFeeDetails = await getRelayerFeeDetails(
l1Token,
amount,
computedOriginChainId,
destinationChainId,
recipientAddress,
tokenPrice,
message,
relayerAddress
);
} catch {
throw new InputError("Failed to estimate relayer fees");
}

const skipAmountLimitEnabled = skipAmountLimit === "true";

Expand Down

0 comments on commit db98094

Please sign in to comment.