From 5441dc6e37999b35256b213d481c1f2ec3f1bde0 Mon Sep 17 00:00:00 2001 From: nicholaspai Date: Sun, 12 Jan 2025 08:17:02 -0700 Subject: [PATCH] Increase ttl of native gas cost, add gasFeeDetails to response --- api/_utils.ts | 2 +- api/limits.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/_utils.ts b/api/_utils.ts index e32b46097..ab17bf097 100644 --- a/api/_utils.ts +++ b/api/_utils.ts @@ -1979,7 +1979,7 @@ export function getCachedNativeGasCost( // We can use a long TTL since we are fetching only the native gas cost which should rarely change. // Set this longer than the secondsPerUpdate value in the cron cache gas prices job. const ttlPerChain = { - default: 60, + default: 120, }; const cacheKey = buildInternalCacheKey( "nativeGasCost", diff --git a/api/limits.ts b/api/limits.ts index fc9b8e318..4781b939f 100644 --- a/api/limits.ts +++ b/api/limits.ts @@ -417,6 +417,14 @@ const handler = async ( capitalFeeTotal: relayerFeeDetails.capitalFeeTotal, capitalFeePercent: relayerFeeDetails.capitalFeePercent, }, + gasFeeDetails: tokenGasCost + ? { + nativeGasCost: nativeGasCost!.toString(), // Should exist if tokenGasCost exists + opStackL1GasCost: opStackL1GasCost?.toString(), + gasPrice: gasPrice.toString(), + tokenGasCost: tokenGasCost.toString(), + } + : undefined, }; logger.debug({ at: "Limits",