From 3c58e9c028df6ebc5e67404ebf072788577100b2 Mon Sep 17 00:00:00 2001 From: nigiri <168690269+0xnigir1@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:59:08 -0300 Subject: [PATCH] fix: swagger config & rpc availability --- apps/api/src/api-docs/swagger.yaml | 4 ++-- apps/api/src/metrics/controllers/index.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/api/src/api-docs/swagger.yaml b/apps/api/src/api-docs/swagger.yaml index 1adb6c8..7d1ac75 100644 --- a/apps/api/src/api-docs/swagger.yaml +++ b/apps/api/src/api-docs/swagger.yaml @@ -4,8 +4,8 @@ info: description: Documentation for ZKchainHub API version: 1.0 servers: - - url: http://localhost:3000 - description: Local server + - url: / + description: Server tags: - name: Metrics diff --git a/apps/api/src/metrics/controllers/index.ts b/apps/api/src/metrics/controllers/index.ts index b500a05..469d113 100644 --- a/apps/api/src/metrics/controllers/index.ts +++ b/apps/api/src/metrics/controllers/index.ts @@ -32,13 +32,14 @@ export class MetricsController { }, new BigNumber(0)) .toString(); const chainIdStr = chainId.toString(); + const hasRpc = this.l2MetricsMap.has(chainId); if (!metadata) { return { chainId: chainIdStr, chainType: await this.l1MetricsService.chainType(chainId), baseToken: (await this.l1MetricsService.getBaseTokens([chainId]))[0], tvl, - rpc: false, + rpc: hasRpc, }; } return { @@ -47,7 +48,7 @@ export class MetricsController { baseToken: metadata.baseToken, tvl, metadata: new ZkChainMetadata(metadata), - rpc: false, + rpc: hasRpc, }; }), );