From cfc5fb5177ed102e7f49c46558db85774554e65a Mon Sep 17 00:00:00 2001 From: aednikanov Date: Wed, 18 Sep 2024 19:50:57 +0300 Subject: [PATCH] feat(docs): added small improvement --- src/components/ParserOpenRPC/RequestBox/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ParserOpenRPC/RequestBox/index.tsx b/src/components/ParserOpenRPC/RequestBox/index.tsx index ba44e3dcbe0..908aea55591 100644 --- a/src/components/ParserOpenRPC/RequestBox/index.tsx +++ b/src/components/ParserOpenRPC/RequestBox/index.tsx @@ -42,10 +42,11 @@ export default function RequestBox({ const preparedShellParams = JSON.stringify(paramsData); const NETWORK_URL = "https://linea-mainnet.infura.io"; const API_KEY = ""; + const lineaAPIKey = customAPIKey ? customAPIKey : API_KEY; if (isMetamaskNetwork) { return `await window.ethereum.request({\n "method": "${method}",\n "params": ${preparedParams.replace(/"([^"]+)":/g, '$1:')},\n});`; } - return `curl ${NETWORK_URL}/v3/${isLineaReferencePage ? customAPIKey : API_KEY} \\\n -X POST \\\n -H "Content-Type: application/json" \\\n -d '{\n "jsonrpc": "2.0",\n "method": "${method}",\n "params": ${preparedShellParams},\n "id": 1\n }'`; + return `curl ${NETWORK_URL}/v3/${isLineaReferencePage ? lineaAPIKey : API_KEY} \\\n -X POST \\\n -H "Content-Type: application/json" \\\n -d '{\n "jsonrpc": "2.0",\n "method": "${method}",\n "params": ${preparedShellParams},\n "id": 1\n }'`; }, [customAPIKey, method, paramsData]); const exampleResponse = useMemo(() => {