Skip to content

Commit 1041022

Browse files
Merge pull request 0xPolygon#369 from 0xPolygon/zkevm/json-rpc
Update API doc with instructions
2 parents 7ee8ed4 + 4f69dfb commit 1041022

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/zkEVM/api/json-rpc.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,36 @@ hide:
33
- toc
44
---
55

6+
Endpoint details are listed in the [playground](#playground) doc below.
7+
8+
## Terminal
9+
10+
Use the Cardona testnet https://rpc.cardona.zkevm-rpc.com to test the [endpoint methods](#playground) in a terminal. For example:
11+
12+
### `zkevm_estimateGasPrice`
13+
14+
```sh
15+
curl -X POST \
16+
-H "Content-Type: application/json" \
17+
--data '{"jsonrpc":"2.0","method":"zkevm_estimateGasPrice","params":[{"from":"0x0000000000000000000000000000000000000001","to":"0x0000000000000000000000000000000000000002","value":"0x1"}],"id":1}' \
18+
https://rpc.cardona.zkevm-rpc.com
19+
```
20+
21+
#### Result
22+
23+
```sh
24+
{"jsonrpc":"2.0","id":1,"result":"0xe2ea2f0"}
25+
```
26+
27+
## Playground
28+
29+
The available methods are detailed in the playground description below.
30+
31+
Each method description provides:
32+
33+
- Method name and explanation.
34+
- Parameters required if any and their details.
35+
- Expected return.
36+
- Examples.
37+
638
<embed type="text/html" src="https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/0xPolygon/polygon-docs/3eb44779e7380e91e5c92f160424159a3da1bdba/docs/zkEVM/api/zkevm.openrpc.json&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:splitView]=false" width="100%" height="1000px">

0 commit comments

Comments
 (0)