Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/eth/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,16 @@
result:
name: Block number
value: '0x2377'
- name: net_version
summary: Returns the current network ID. This is usually equivalent to the chainID, but may differ from it for some legacy networks or special testnets.
params: []
result:
name: Network ID
schema:
$ref: '#/components/schemas/uintDecimal'
examples:
- name: net_version example
params: []
result:
name: Network ID
value: '1'
4 changes: 4 additions & 0 deletions src/schemas/base-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ uint256:
title: hex encoded 256 bit unsigned integer
type: string
pattern: ^0x(0|[1-9a-f][0-9a-f]{0,63})$
uintDecimal:
title: decimal unsigned integer string
type: string
pattern: ^[1-9][0-9]*$
hash32:
title: 32 byte hex value
type: string
Expand Down
3 changes: 3 additions & 0 deletions tests/net_version/get-network-id.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Calls net_version to retrieve the network ID, which is expected to be equal to the chainID of the test chain.
>> {"jsonrpc":"2.0","id":1,"method":"net_version"}
<< {"jsonrpc":"2.0","id":1,"result":"3503995874084926"}
Loading