Repository navigation
feat(eth-rpc): enhance MetaMask & Web3.js compatibility with complete JSON-RPC and WebSocket support - #4099
Open
D-H-O-R-A wants to merge 1 commit into
Conversation
…SON-RPC/WSS support - Add standard MetaMask RPC methods: net_version, eth_protocolVersion, eth_getTransactionReceipt, eth_getCode, eth_syncing, eth_getLogs, personal_ecRecover - Add WebSocket support for JSON-RPC and subscription management - Add virtual ERC-20 and ERC-721 token metadata and interfaces for eth_call - Handle EthereumTransaction timestamp offset tolerance in CommonValidation - Add comprehensive unit tests in EthRpcRouteSpec
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This Pull Request addresses several compatibility issues encountered when connecting MetaMask, ethers.js, and web3.js directly to the Waves Node EVM JSON-RPC endpoint.
Problems Identified & Solved
Missing Essential JSON-RPC Methods for Web3 / MetaMask:
net_version: Expected by MetaMask to return the chain ID in decimal representation string.eth_protocolVersion: Returns standard protocol version (0x41).eth_syncing: Returns boolean false or synchronization state.eth_getTransactionReceipt: Returns full transaction status (0x1/0x0), cumulative gas, effective gas price, and block metadata expected by Web3 wallets.eth_getCode: Distinguishes between EOA and accounts with RIDE contracts/dApps.eth_getLogs: Standard event log filtering.eth_getStorageAt: Direct access to account data storage state.personal_ecRecover: Recovers Ethereum public keys/addresses from standard prefixed signed messages.eth_uncleCountByBlockHash,eth_uncleCountByBlockNumber,eth_getUncleBy...: Returns empty/null for PoS consensus.WebSocket Support for Subscriptions:
/eth/wsand/wsallowing wallets and frontends to subscribe tonewHeadsandlogs.Virtual ERC-20 & ERC-721 Metadata via
eth_call:name(),symbol(),decimals(),totalSupply(),balanceOf(address),tokenURI(uint256),ownerOf(uint256)) for native assets and NFTs so that MetaMask and Web3 explorers can render token names, icons, and balances seamlessly.EthereumTransaction Timestamp Validation Tolerance:
CommonValidation.scala, relaxed timestamp mistiming checks forEthereumTransactionwhen timestamps originate from standard EVM clients.Unit Tests:
EthRpcRouteSpec.scalacovering all added RPC methods and token metadata interactions.