eth_unsubscribe

网络: Ethereum Sepolia · 测试网 · Chain ID 11155111(0xaa36a7)

计为 1 个 Request。 计费规则见 Request Counting。

协议:仅支持 WebSocket(WSS)

描述

取消此前创建的订阅。

参数

参数类型必填说明
subscriptionIdhex是订阅 ID

请求

{ "jsonrpc": "2.0", "method": "eth_unsubscribe", "params": ["0x1"], "id": 1 }

代码示例

const ws = new WebSocket("wss://ethereum-sepolia-rpc.blockreq.com/v1/rpc/public"); ws.onopen = () => { ws.send(JSON.stringify({ "jsonrpc": "2.0", "method": "eth_unsubscribe", "params": [ "0x1" ], "id": 1 })); }; ws.onmessage = (event) => { console.log(JSON.parse(event.data)); };

在线试用