Skip to content

Commit

Permalink
chore: api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris committed Oct 27, 2023
1 parent 95f85a6 commit ffa5191
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions api/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,15 @@ export const getRelayerFeeDetails = async (

const relayFeeCalculator = getRelayerFeeCalculator(destinationChainId);
try {
const oneBp = ethers.utils.parseEther("0.0001");
return await relayFeeCalculator.relayerFeeDetails(
{
amount: sdk.utils.toBN(amount),
depositId: sdk.utils.bnUint32Max.toNumber(),
depositor: recipientAddress,
destinationChainId,
originChainId,
relayerFeePct: oneBp,
realizedLpFeePct: oneBp,
relayerFeePct: sdk.utils.bnZero,
realizedLpFeePct: sdk.utils.bnZero,
recipient: recipientAddress,
message: message ?? sdk.constants.EMPTY_MESSAGE,
quoteTimestamp: sdk.utils.getCurrentTime(),
Expand Down
8 changes: 6 additions & 2 deletions api/suggested-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { BlockFinder } from "@uma/sdk";
import { VercelResponse } from "@vercel/node";
import { ethers } from "ethers";
import { type, assert, Infer, optional, string } from "superstruct";
import { disabledL1Tokens, DEFAULT_QUOTE_TIMESTAMP_BUFFER } from "./_constants";
import {
disabledL1Tokens,
DEFAULT_QUOTE_TIMESTAMP_BUFFER,
DEFAULT_SIMULATED_RECIPIENT_ADDRESS,
} from "./_constants";
import { TypedVercelRequest } from "./_types";
import {
getLogger,
Expand Down Expand Up @@ -79,7 +83,7 @@ const handler = async (
const destinationChainId = Number(_destinationChainId);

relayerAddress ??= sdk.constants.DEFAULT_SIMULATED_RELAYER_ADDRESS;
recipientAddress ??= sdk.constants.DEFAULT_SIMULATED_RELAYER_ADDRESS;
recipientAddress ??= DEFAULT_SIMULATED_RECIPIENT_ADDRESS;
token = ethers.utils.getAddress(token);

const [latestBlock, tokenDetails] = await Promise.all([
Expand Down

0 comments on commit ffa5191

Please sign in to comment.