跳转到内容

EVM JSON-RPC 方法

方法RU 成本说明
eth_chainId0返回链 ID
net_version0返回网络 ID
web3_clientVersion0返回客户端版本
web3_sha30返回 Keccak-256 哈希
net_listening0返回监听状态
net_peerCount0返回 peer 数量
方法RU 成本说明
eth_blockNumber5返回最新区块号
eth_getBlockByNumber10按区块号查询区块
eth_getBlockByHash10按区块哈希查询区块
eth_getBlockTransactionCountByNumber5返回区块内交易数
eth_getBlockTransactionCountByHash5返回区块内交易数
方法RU 成本说明
eth_getTransactionByHash10按哈希查询交易
eth_getTransactionByBlockNumberAndIndex10按区块号与索引查询交易
eth_getTransactionByBlockHashAndIndex10按区块哈希与索引查询交易
eth_getTransactionReceipt10返回交易回执
eth_getTransactionCount10返回地址 nonce
eth_sendRawTransaction20广播已签名交易
方法RU 成本说明
eth_getBalance10返回 ETH 余额
eth_getCode10返回合约字节码
eth_getStorageAt10返回指定存储槽数据
eth_call20无状态执行调用
eth_estimateGas20估算交易 gas
eth_gasPrice5返回当前 gas price
eth_feeHistory10返回费用历史
eth_maxPriorityFeePerGas5返回优先费建议
方法RU 成本说明
eth_getLogs50按过滤条件查询日志
eth_newFilter10创建新过滤器
eth_newBlockFilter10创建新区块过滤器
eth_newPendingTransactionFilter10创建待打包交易过滤器
eth_getFilterChanges10返回过滤器变更
eth_getFilterLogs50返回过滤器全部日志
eth_uninstallFilter5卸载过滤器
方法RU 成本说明
eth_subscribe10订阅事件
eth_unsubscribe5取消订阅
方法RU 成本说明
debug_traceTransaction200交易执行追踪
debug_traceBlockByNumber500区块内交易追踪
trace_block200返回区块 trace
trace_transaction200返回交易 trace

说明:RU 成本为近似值。复杂调用(例如大范围 eth_getLogs)会因响应体积增加 RU 消耗。