Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Add eth_chainId to js's web3 interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sorpaas committed Aug 18, 2017
1 parent 6995f05 commit 7f8f215
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/src/api/rpc/eth/eth.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export default class Eth {
this._transport = transport;
}

chainId () {
return this._transport
.execute('eth_chainId');
}

accounts () {
return this._transport
.execute('eth_accounts')
Expand Down
8 changes: 8 additions & 0 deletions js/src/views/RpcCalls/data/rpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
"inputFormatters": [],
"outputFormatter": null
},
{
"name": "eth_chainId",
"desc": "Returns the current chain ID used for tranaction signing.",
"params": [],
"returns": "`String` - The current blockchain chain ID",
"inputFormatters": [],
"outputFormatter": null
},
{
"name": "eth_syncing",
"desc": "Returns an object with data about the sync status or `false`.",
Expand Down

0 comments on commit 7f8f215

Please sign in to comment.