From 3f1b6ddd5fd786b3849b2a1c9e66bae76226cb58 Mon Sep 17 00:00:00 2001 From: nigiri <168690269+0xnigir1@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:47:32 -0300 Subject: [PATCH] feat: add ethPrice to gasInfo --- apps/api/src/metrics/dto/response/l1Metrics.dto.ts | 8 ++++++++ apps/api/src/metrics/metrics.controller.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/apps/api/src/metrics/dto/response/l1Metrics.dto.ts b/apps/api/src/metrics/dto/response/l1Metrics.dto.ts index 361397e..8d30b56 100644 --- a/apps/api/src/metrics/dto/response/l1Metrics.dto.ts +++ b/apps/api/src/metrics/dto/response/l1Metrics.dto.ts @@ -66,10 +66,18 @@ export class EthGasInfo { */ erc20Transfer: string; + /** + * The price of ETH in USD + * @type {string} + * @memberof EthGasInfo + */ + ethPrice?: string; + constructor(data: EthGasInfo) { this.gasPrice = data.gasPrice; this.ethTransfer = data.ethTransfer; this.erc20Transfer = data.erc20Transfer; + this.ethPrice = data.ethPrice; } } diff --git a/apps/api/src/metrics/metrics.controller.ts b/apps/api/src/metrics/metrics.controller.ts index 7bff9e1..0e48e0a 100644 --- a/apps/api/src/metrics/metrics.controller.ts +++ b/apps/api/src/metrics/metrics.controller.ts @@ -64,6 +64,7 @@ export class MetricsController { gasPrice: gasInfo.gasPrice.toString(), erc20Transfer: gasInfo.erc20Transfer.toString(), ethTransfer: gasInfo.ethTransfer.toString(), + ethPrice: gasInfo.ethPrice?.toString() || undefined, }, zkChains, });