Modules: eth

eth_accounts

Accounts returns the collection of accounts this node manages.

Params (0)

None

Result

commonAddress []common.Address

  • Required: ✓ Yes

=== "Schema"

``` Schema

- items: 

		- description: `Hex representation of a Keccak 256 hash POINTER`
		- pattern: `^0x[a-fA-F\d]{64}$`
		- title: `keccak`
		- type: string


- type: array


```

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_blockNumber

BlockNumber returns the block number of the chain head.

Params (0)

None

Result

hexutil.Uint64

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_chainId

ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config.

Note, this method does not conform to EIP-695 because the configured chain ID is always returned, regardless of the current head block. We used to return an error when the chain wasn't synced up to a block where EIP-155 is enabled, but this behavior caused issues in CL clients.

Params (0)

None

Result

*hexutil.Big

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_createAccessList

CreateAccessList creates an EIP-2930 type AccessList for the given transaction. Reexec and BlockNrOrHash can be specified to create the accessList on top of a certain state.

Params (2)

Parameters must be given by position.

1: args TransactionArgs

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: blockNrOrHash *rpc.BlockNumberOrHash

  • Required: ✓ Yes

Result

*accessListResult

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_etherbase

Etherbase is the address that mining rewards will be sent to.

Params (0)

None

Result

common.Address

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_fillTransaction

FillTransaction fills the defaults (nonce, gas, gasPrice or 1559 fields) on a given unsigned transaction, and returns it to the caller for further processing (signing + broadcast).

Params (1)

Parameters must be given by position.

1: args TransactionArgs

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*SignTransactionResult

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getBalance

GetBalance returns the amount of wei for the given address in the state of the given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed.

Params (2)

Parameters must be given by position.

1: address common.Address

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: blockNrOrHash rpc.BlockNumberOrHash

  • Required: ✓ Yes

Result

*hexutil.Big

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getBlockByNumber

GetBlockByNumber returns the requested canonical block.

  • When blockNr is -1 the chain pending block is returned.

  • When blockNr is -2 the chain latest block is returned.

  • When blockNr is -3 the chain finalized block is returned.

  • When blockNr is -4 the chain safe block is returned.

  • When fullTx is true all transactions in the block are returned, otherwise only the transaction hash is returned.

Params (2)

Parameters must be given by position.

1: number rpc.BlockNumber

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: fullTx bool

  • Required: ✓ Yes

Result

*RPCMarshalBlockT

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getBlockTransactionCountByNumber

GetBlockTransactionCountByNumber returns the number of transactions in the block with the given block number.

Params (1)

Parameters must be given by position.

1: blockNr rpc.BlockNumber

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*hexutil.Uint

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getFilterChanges

GetFilterChanges returns the logs for the filter with the given id since last time it was called. This can be used for polling.

For pending transaction and block filters the result is []common.Hash. (pending)Log filters return []Log.

Params (1)

Parameters must be given by position.

1: id rpc.ID

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

interface interface{}

  • Required: ✓ Yes

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getFilterLogs

GetFilterLogs returns the logs for the filter with the given id. If the filter could not be found an empty array of logs is returned.

Params (1)

Parameters must be given by position.

1: id rpc.ID

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

typesLog []*types.Log

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getHashrate

GetHashrate returns the current hashrate for local CPU miner and remote miner.

Params (0)

None

Result

uint64

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getHeaderByNumber

GetHeaderByNumber returns the requested canonical block header.

  • When blockNr is -1 the chain pending header is returned.

  • When blockNr is -2 the chain latest header is returned.

  • When blockNr is -3 the chain finalized header is returned.

  • When blockNr is -4 the chain safe header is returned.

Params (1)

Parameters must be given by position.

1: number rpc.BlockNumber

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*RPCMarshalHeaderT

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getProof

GetProof returns the Merkle-proof for a given account and optionally some storage keys.

Params (3)

Parameters must be given by position.

1: address common.Address

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: storageKeys []string

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

3: blockNrOrHash rpc.BlockNumberOrHash

  • Required: ✓ Yes

Result

*AccountResult

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getRawTransactionByBlockHashAndIndex

GetRawTransactionByBlockHashAndIndex returns the bytes of the transaction for the given block hash and index.

Params (2)

Parameters must be given by position.

1: blockHash common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: index hexutil.Uint

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

hexutil.Bytes

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getRawTransactionByHash

GetRawTransactionByHash returns the bytes of the transaction for the given hash.

Params (1)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

hexutil.Bytes

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"

chevron-rightSource codehashtag

```go func (s *TransactionAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) { tx, _, _, _, err := s.b.GetTransaction(ctx, hash) if err != nil { return nil, err } if tx == nil { if tx = s.b.GetPoolTransaction(hash); tx == nil { return nil, nil } } return tx.MarshalBinary() }// GetRawTransactionByHash returns the bytes of the transaction for the given hash.

View on GitHub →arrow-up-right


eth_getTransactionByBlockHashAndIndex

GetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.

Params (2)

Parameters must be given by position.

1: blockHash common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: index hexutil.Uint

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*RPCTransaction

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getTransactionByHash

GetTransactionByHash returns the transaction for the given hash

Params (1)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*RPCTransaction

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getTransactionReceipt

GetTransactionReceipt returns the transaction receipt for the given transaction hash.

Params (1)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

mapstringinterface map[string]interface{}

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getUncleByBlockHashAndIndex

GetUncleByBlockHashAndIndex returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.

Params (2)

Parameters must be given by position.

1: blockHash common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: index hexutil.Uint

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*RPCMarshalBlockT

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getUncleCountByBlockHash

GetUncleCountByBlockHash returns number of uncles in the block for the given block hash

Params (1)

Parameters must be given by position.

1: blockHash common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*hexutil.Uint

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_getWork

GetWork returns a work package for external miner.

The work package consists of 3 strings:

Params (0)

None

Result

num4string [4]string

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_logs

Logs creates a subscription that fires for all new log that match the given filter criteria.

Params (1)

Parameters must be given by position.

1: crit FilterCriteria

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

*rpc.Subscription

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_maxPriorityFeePerGas

MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions.

Params (0)

None

Result

*hexutil.Big

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_newBlockFilter

NewBlockFilter creates a filter that fetches blocks that are imported into the chain. It is part of the filter package since polling goes with eth_getFilterChanges.

Params (0)

None

Result

rpc.ID

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_newFilter

NewFilter creates a new filter and returns the filter id. It can be used to retrieve logs when the state changes. This method cannot be used to fetch logs that are already stored in the state.

Default criteria for the from and to block are "latest". Using "latest" as block number will return logs for mined blocks. Using "pending" as block number returns logs for not yet mined (pending) blocks. In case logs are removed (chain reorg) previously returned logs are returned again but with the removed property set to true.

In case "fromBlock" > "toBlock" an error is returned.

Params (1)

Parameters must be given by position.

1: crit FilterCriteria

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

rpc.ID

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_newHeads

NewHeads send a notification each time a new (header) block is appended to the chain.

Params (0)

None

Result

*rpc.Subscription

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_newPendingTransactions

NewPendingTransactions creates a subscription that is triggered each time a transaction enters the transaction pool. If fullTx is true the full tx is sent to the client, otherwise the hash is sent.

Params (1)

Parameters must be given by position.

1: fullTx *bool

  • Required: ✓ Yes

Result

*rpc.Subscription

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_newSideBlockFilter

NewSideBlockFilter creates a filter that fetches blocks that are imported into the chain with a non-canonical status. It is part of the filter package since polling goes with eth_getFilterChanges.

Params (0)

None

Result

rpc.ID

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_newSideHeads

NewSideHeads send a notification each time a new non-canonical (header) block is written to the database.

Params (0)

None

Result

*rpc.Subscription

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_resend

Resend accepts an existing transaction and a new gas price and limit. It will remove the given transaction from the pool and reinsert it with the new gas price and limit.

Params (3)

Parameters must be given by position.

1: sendArgs TransactionArgs

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: gasPrice *hexutil.Big

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

3: gasLimit *hexutil.Uint64

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_sendRawTransaction

SendRawTransaction will add the signed transaction to the transaction pool. The sender is responsible for signing the transaction and using the correct nonce.

Params (1)

Parameters must be given by position.

1: input hexutil.Bytes

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_sign

Sign calculates an ECDSA signature for: keccak256("\x19Ethereum Signed Message:\n" + len(message) + message).

Note, the produced signature conforms to the secp256k1 curve R, S and V values, where the V value will be 27 or 28 for legacy reasons.

The account associated with addr must be unlocked.

https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign

Params (2)

Parameters must be given by position.

1: addr common.Address

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: data hexutil.Bytes

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

hexutil.Bytes

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_submitHashrate

SubmitHashrate can be used for remote miners to submit their hash rate. This enables the node to report the combined hash rate of all miners which submit work through this node.

It accepts the miner hash rate and an identifier which must be unique between nodes.

Params (2)

Parameters must be given by position.

1: rate hexutil.Uint64

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: id common.Hash

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_subscribe

Subscribe creates a subscription to an event channel. Subscriptions are not available over HTTP; they are only available over WS, IPC, and Process connections.

Params (2)

Parameters must be given by position.

1: subscriptionName RPCEthSubscriptionParamsName

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

2: subscriptionOptions interface{}

  • Required: No

Result

subscriptionID rpc.ID

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Client Method Invocation Examples

=== "Shell WebSocket"


eth_syncing

Syncing returns false in case the node is currently not syncing with the network. It can be up-to-date or has not yet received the latest block headers from its pears. In case it is synchronizing:

  • startingBlock: block number this node started to synchronize from

  • currentBlock: block number this node is currently importing

  • highestBlock: block number of the highest block header this node has received from peers

  • pulledStates: number of state entries processed until now

  • knownStates: number of known state entries that still need to be pulled

Params (0)

None

Result

interface interface{}

  • Required: ✓ Yes

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"


eth_uninstallFilter

UninstallFilter removes the filter with the given filter id.

Params (1)

Parameters must be given by position.

1: id rpc.ID

  • Required: ✓ Yes

=== "Schema"

=== "Raw"

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

=== "Shell HTTP"

=== "Shell WebSocket"

=== "Javascript Console"

Last updated