Skip to content

Commit

Permalink
feat(docs): added small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
aednikanov committed Sep 18, 2024
1 parent 1f74dd0 commit cfc5fb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/ParserOpenRPC/RequestBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ export default function RequestBox({
const preparedShellParams = JSON.stringify(paramsData);
const NETWORK_URL = "https://linea-mainnet.infura.io";
const API_KEY = "<YOUR-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(() => {
Expand Down

0 comments on commit cfc5fb5

Please sign in to comment.