mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
added eth_client func.
This commit is contained in:
parent
d3963c816b
commit
80cd2d3871
2 changed files with 10 additions and 0 deletions
|
|
@ -64,6 +64,11 @@ func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64 {
|
||||||
return hexutil.Uint64(api.e.Miner().HashRate())
|
return hexutil.Uint64(api.e.Miner().HashRate())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
|
||||||
|
func (api *PublicEthereumAPI) ChainId() *big.Int {
|
||||||
|
return api.e.chainConfig.ChainId
|
||||||
|
}
|
||||||
|
|
||||||
// PublicMinerAPI provides an API to control the miner.
|
// PublicMinerAPI provides an API to control the miner.
|
||||||
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
|
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
|
||||||
type PublicMinerAPI struct {
|
type PublicMinerAPI struct {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,11 @@ const Chequebook_JS = `
|
||||||
web3._extend({
|
web3._extend({
|
||||||
property: 'chequebook',
|
property: 'chequebook',
|
||||||
methods: [
|
methods: [
|
||||||
|
new web3._extend.Method({
|
||||||
|
name: 'chainId',
|
||||||
|
call: 'eth_chainId',
|
||||||
|
params: 0
|
||||||
|
}),
|
||||||
new web3._extend.Method({
|
new web3._extend.Method({
|
||||||
name: 'deposit',
|
name: 'deposit',
|
||||||
call: 'chequebook_deposit',
|
call: 'chequebook_deposit',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue