Skip to content

Commit

Permalink
Simplified RPC docs code example
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax authored Apr 29, 2024
1 parent 219d68a commit b87106b
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .vitepress/scripts/rpc-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,21 @@ export async function generateRpcDocs() {
::: code-group
\`\`\`JavaScript
const url = new URL('http://127.0.0.1:8648');
const res = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: {
"jsonrpc": "2.0",
"method": "{{ methodName }}",
"params": [{{ parametersValues }}],
"id": 1
const res = await fetch(
'http://127.0.0.1:8648',
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: {
"jsonrpc": "2.0",
"method": "{{ methodName }}",
"params": [{{ parametersValues }}],
"id": 1
}
}
});
);
const data = await res.json();
\`\`\`
Expand Down

0 comments on commit b87106b

Please sign in to comment.