From 4b3a9734b2643ebb36825bc5ec9c457992bb6399 Mon Sep 17 00:00:00 2001 From: Alexandra Tran Date: Mon, 17 Mar 2025 11:10:47 -0700 Subject: [PATCH] Fix code base lint error --- services/concepts/curl.md | 2 +- src/components/GasApiNetworks.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/concepts/curl.md b/services/concepts/curl.md index 5b4e34db70b..7f9cdfa0b7c 100644 --- a/services/concepts/curl.md +++ b/services/concepts/curl.md @@ -74,7 +74,7 @@ The example specifies the `Content-Type` to be `application/json` which means th The `-d` or `--data` flag specifies more information sent along with the curl request. -In the example, the data object is a list of key value pairs in JSON format. This follows the [JSON RPC 2.0 specification ](https://www.jsonrpc.org/specification)which requires the four specific keys seen here. +In the example, the data object is a list of key value pairs in JSON format. This follows the [JSON RPC 2.0 specification](https://www.jsonrpc.org/specification) which requires the four specific keys seen here. The `method`, `params`, and `id` values are modifiable. diff --git a/src/components/GasApiNetworks.tsx b/src/components/GasApiNetworks.tsx index 3d9e5146921..9967782e152 100644 --- a/src/components/GasApiNetworks.tsx +++ b/src/components/GasApiNetworks.tsx @@ -1,13 +1,17 @@ import React, { useEffect, useState } from 'react'; +interface NetworkData { + [chainId: string]: string; +} + const GasApiNetworks = () => { - const [networks, setNetworks] = useState({}); + const [networks, setNetworks] = useState({}); useEffect(() => { const fetchData = async () => { try { const response = await fetch('https://gas.api.cx.metamask.io/v1/supportedChainNames'); - const data = await response.json(); + const data: NetworkData = await response.json(); setNetworks(data); } catch (error) { console.error('Error fetching data:', error);