From 682126802e21201ca5aed8a4aff88f54ca05101c Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Tue, 24 Oct 2023 16:13:33 -0400 Subject: [PATCH] improve: use dummy address --- api/_utils.ts | 7 +++++-- api/limits.ts | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/_utils.ts b/api/_utils.ts index 8ab12cc8e..904f8364a 100644 --- a/api/_utils.ts +++ b/api/_utils.ts @@ -477,7 +477,10 @@ export const getTokenSymbol = (tokenAddress: string): string => { * @param amount The amount of funds that are requesting to be transferred * @param originChainId The origin chain that this token will be transferred from * @param destinationChainId The destination chain that this token will be transferred to + * @param recipientAddress The address that will receive the transferred funds * @param tokenPrice An optional overred price to prevent the SDK from creating its own call + * @param message An optional message to include in the transfer + * @param relayerAddress An optional relayer address to use for the transfer * @returns The a promise to the relayer fee for the given `amount` of transferring `l1Token` to `destinationChainId` */ export const getRelayerFeeDetails = async ( @@ -485,7 +488,7 @@ export const getRelayerFeeDetails = async ( amount: sdk.utils.BigNumberish, originChainId: number, destinationChainId: number, - recipientAddress: string, + recipientAddress = "0x893d0d70ad97717052e3aa8903d9615804167759", // A known dummy address tokenPrice?: number, message?: string, relayerAddress?: string @@ -505,7 +508,7 @@ export const getRelayerFeeDetails = async ( { amount: sdk.utils.toBN(amount), depositId: sdk.utils.bnUint32Max.toNumber(), - depositor: sdk.utils.randomAddress(), // Random depositor - shouldn't make too much of a difference. + depositor: recipientAddress, destinationChainId, originChainId, relayerFeePct: sdk.utils.bnZero, diff --git a/api/limits.ts b/api/limits.ts index 3fcced6c7..b856209ba 100644 --- a/api/limits.ts +++ b/api/limits.ts @@ -30,7 +30,6 @@ import { HUB_POOL_CHAIN_ID, ENABLED_ROUTES, } from "./_utils"; -import { utils } from "@across-protocol/sdk-v2"; const LimitsQueryParamsSchema = object({ token: validAddress(), @@ -150,7 +149,7 @@ const handler = async ( ethers.BigNumber.from("10").pow(18), computedOriginChainId, Number(destinationChainId), - utils.randomAddress(), + undefined, tokenPriceNative ), hubPool.callStatic.multicall(multicallInput, { blockTag: BLOCK_TAG_LAG }),