We're now supporting Polygon zkEVM!
Learn more here.

Contents

eth_getProof RPC Method

The API credit value for this method is 2 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. address - string - The address of the account for which the balance is to be checked
  2. storageKeys - array[strings] - An array of storage-keys that should be proofed and included
  3. blockNumber - string - (optional) The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chain

Returns:

  1. address - The address associated with the account
  2. accountProof - An array of rlp-serialized MerkleTree-Nodes which starts with the stateRoot-Node and follows the path of the SHA3 address as key
  3. balance - The current balance of the account in wei
  4. codeHash - A 32 byte hash of the code of the account
  5. nonce - The hash of the generated proof-of-work. Null if pending
  6. storageHash - A 32 byte SHA3 of the storageRoot. All storage will deliver a MerkleProof starting with this rootHash
  7. storageProof - An array of storage-entries as requested. Each entry is an object with the following fields:
  8. key - The requested storage key

    value - The storage value

    proof - An array of rlp-serialized MerkleTree-Nodes which starts with the stateRoot-Node and follows the path of the SHA3 address as key

Code Examples:

require 'eth'

client = Eth::Client.create 'http://sample-endpoint-name.network.quiknode.pro/token-goes-here/'
payload = {
    "jsonrpc": "2.0",
    "method": "eth_getProof",
    "params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842",["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"],"latest"],
    "id": "1"
}

response = client.send(payload.to_json)
puts response
Ready to get started? Create a free account