Arbitrum One
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Arbitrum One
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_unsubscribe cancels an active WebSocket subscription on Arbitrum One (chain ID 42161) by the ID that eth_subscribe returned, stopping the node from pushing any further notifications for that stream. Arbitrum One is the Optimistic Rollup that settles to Ethereum and pays gas in ETH, and its sequencer streams blocks sub-second, so an unused newHeads or logs subscription keeps delivering a steady flow of messages until you tear it down. Send eth_unsubscribe over the same WebSocket connection you opened against wss://arbitrum.therpc.io/YOUR_API_KEY (the WebSocket form of https://arbitrum.therpc.io/YOUR_API_KEY); the node returns true when it finds and removes the subscription, or false when no such subscription exists.
newHeads subscription when a user navigates away from a live Arbitrum One view, so your app stops processing block notifications it no longer displays.logs stream before opening a new one with updated address/topics filters — for example when switching from monitoring a Camelot pool to an Aave market — so you never run two overlapping streams at once.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | subscriptionId | string | 是 | The hex subscription ID returned by eth_subscribe. |
| 类型 | 描述 |
|---|---|
| boolean | `true` if the subscription was found and cancelled. `false` if it did not exist. |
Try it live in the Arbitrum One playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | invalid subscription id | The subscription ID is malformed or belongs to a different connection. |
-32000 | subscription not found | The subscription was already cancelled or never existed. |
参数
The hex subscription ID returned by eth_subscribe.