add parameters example for eth rpc

pull/2363/head
Ayrat Badykov 5 years ago
parent 50d57ee839
commit e03de6f659
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 6
      apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/eth_controller.ex
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/api_docs/eth_rpc.html.eex

@ -12,12 +12,18 @@ defmodule BlockScoutWeb.API.RPC.EthController do
notes: """
the `earliest` parameter will not work as expected currently, because genesis block balances
are not currently imported
""",
example: """
{"id": 0, "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x0000000000000000000000000000000000000007", "2"]}
"""
},
"eth_getLogs" => %{
action: :eth_get_logs,
notes: """
Will never return more than 1000 log entries.
""",
example: """
{"id": 0, "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x0000000000000000000000000000000000000026","topics": ["0x01"]}]}
"""
}
}

@ -22,11 +22,13 @@
<tr>
<th>Supported Method</th>
<th>Notes</th>
<th>Parameters example</th>
</tr>
<%= for {method, info} <- Map.to_list(@documentation) do %>
<tr>
<td> <a href="https://github.com/ethereum/wiki/wiki/JSON-RPC#<%= method %>"> <%= method %> </a> </td>
<td> <%= Map.get(info, :notes, "N/A") %> </td>
<td> <%= Map.get(info, :example, "N/A") %> </td>
</tr>
<% end %>
</table>

Loading…
Cancel
Save