curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x20c0000000000000000000000000000000000000",
[
"0x0"
],
"latest"
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x20c0000000000000000000000000000000000000",
[
"0x0"
],
"latest"
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}address — the address to get the proof forstorageKeys — array of storage positions to prove (hex strings)blockParameter — the block number (hex) or tag (latest, earliest, pending)result — the proof object:
address — the account addressaccountProof — array of RLP-encoded Merkle Patricia trie nodes from state root to accountbalance — the account balancecodeHash — the hash of the account codenonce — the account noncestorageHash — the hash of the storage trie rootstorageProof — array of storage proofs, one per requested key:
key — the storage keyvalue — the storage valueproof — array of RLP-encoded trie nodes from storage root to valueeth_getProof code examplesconst ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
// pathUSD token address
const PATHUSD = "0x20c0000000000000000000000000000000000000";
const getProof = async () => {
// Get proof for storage slot 0 (often totalSupply)
const proof = await provider.send("eth_getProof", [
PATHUSD,
["0x0", "0x1"],
"latest"
]);
console.log(`Account: ${proof.address}`);
console.log(`Balance: ${proof.balance}`);
console.log(`Nonce: ${parseInt(proof.nonce, 16)}`);
console.log(`Code Hash: ${proof.codeHash}`);
console.log(`Storage Hash: ${proof.storageHash}`);
console.log(`\nAccount Proof nodes: ${proof.accountProof.length}`);
for (const sp of proof.storageProof) {
console.log(`\nStorage Key: ${sp.key}`);
console.log(` Value: ${sp.value}`);
console.log(` Proof nodes: ${sp.proof.length}`);
}
};
getProof();
Was this page helpful?