EIP-1898 Support #3165
-
Hi! Do you have plans to have support for EIP-1898 (https://eips.ethereum.org/EIPS/eip-1898)? I'd like to create a PR for that. Although this EIP is marked as stagnant, it is widely supported by most clients and actively used in production to retrieve deterministic state from Ethereum RPCs. It enables clients to unambiguously specify the block they want to query for certain RPC methods. RPC methods affected by EIP-1898:
ExamplesBefore EIP-1898: {
"method": "eth_getBalance",
"params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "0xf65631529d476553ca5b0056d6480c3970dd5ac884fee51d5b30ca7fceab8894"],
"id": "42",
"jsonrpc": "2.0"
} {
"method": "eth_getBalance",
"params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "0x1482fbb"],
"id": "42",
"jsonrpc": "2.0"
} After EIP-1898: {
"method": "eth_getBalance",
"params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", {
"blockHash": "0xf65631529d476553ca5b0056d6480c3970dd5ac884fee51d5b30ca7fceab8894"
}],
"id": "42",
"jsonrpc": "2.0"
} {
"method": "eth_getBalance",
"params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", {
"blockNumber": "0x1482fbb"
}],
"id": "42",
"jsonrpc": "2.0"
} Usageconst url = '...';
const transport = http(url);
const client = createPublicClient({
chain: mainnet,
transport: transport,
});
const balance = await client.getBalance({
address: '0x8D97689C9818892B700e27F316cc3E41e17fBeb9',
blockTag: { blockHash: '0xf65631529d476553ca5b0056d6480c3970dd5ac884fee51d5b30ca7fceab8894' }
}), ExtraClients and services that support EIP-1898:
Other links: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Is this not supported? |
Beta Was this translation helpful? Give feedback.
-
PR welcome. |
Beta Was this translation helpful? Give feedback.
PR welcome.