Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ of the [MetaMask developer page](https://metamask.io/developer/).

## May 2025

- Documented Infura's filter API method support for [Arbitrum](/services/reference/arbitrum/json-rpc-methods/filter-methods/),
[Avalanche](/services/reference/avalanche-c-chain/json-rpc-methods/filter-methods/), [Base](/services/reference/base/json-rpc-methods/filter-methods/),
[Celo](/services/reference/celo/json-rpc-methods/filter-methods/), [Linea](/services/reference/linea/json-rpc-methods/filter-methods/),
[Optimism](/services/reference/optimism/json-rpc-methods/filter-methods/), and
[Polygon POS](/services/reference/polygon-pos/json-rpc-methods/filter-methods/) networks. ([#1994](https://github.com/MetaMask/metamask-docs/pull/1994))
- Discontinue Infura support for the Ethereum Holesky testnet. ([#1996](https://github.com/MetaMask/metamask-docs/pull/1996))

## April 2025
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Polling method for a filter, which returns an array of logs which occurred since the last poll.
Filter must be created by calling either [`eth_newFilter`](../../ethereum/json-rpc-methods/filter-methods/eth_newfilter.mdx) or [`eth_newBlockFilter`](../../ethereum/json-rpc-methods/filter-methods/eth_newblockfilter.mdx).
Filter must be created by calling either [`eth_newFilter`](../eth_newfilter) or [`eth_newBlockFilter`](../eth_newblockfilter).
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- `log object array`: (array) An array of log objects, or an empty array if nothing has changed since the last poll.
- For filters created with [`eth_newBlockFilter`](../../ethereum/json-rpc-methods/filter-methods/eth_newblockfilter.mdx) the return values are block hashes (32 bytes), for example, `["0x3454645634534..."]`.
- For filters created with [`eth_newFilter`](../../ethereum/json-rpc-methods/filter-methods/eth_newfilter.mdx) the logs are objects with the following params:
- For filters created with [`eth_newBlockFilter`](../eth_newblockfilter) the return values are block hashes (32 bytes), for example, `["0x3454645634534..."]`.
- For filters created with [`eth_newFilter`](../eth_newfilter) the logs are objects with the following params:
- `address`: 20 bytes. Address from which this log originated.
- `blockHash`: 32 bytes. The hash of the block where this log was in. `Null` when it is a pending log.
- `blockNumber`: The block number where this log was in. `Null` when it is a pending log.
- `blockHash`: 32 bytes. The hash of the block where this log was in. `null` when it is a pending log.
- `blockNumber`: The block number where this log was in. `null` when it is a pending log.
- `data`: DATA. Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `Null` when it is a pending log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it is a valid log.
- `topics`: Array of DATA. An array of 0 to 4 32-bytes DATA of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes. A hash of the transactions from which this log was created. `Null` when it is a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `Null` when it is a pending log.
- `transactionHash`: 32 bytes. A hash of the transactions from which this log was created. `null` when it is a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it is a pending log.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
- `log object array`: (array) An array of log objects that match the filter. For an array of logs that occurred since the last poll, use [eth_getFilterChanges](../../ethereum/json-rpc-methods/filter-methods/eth_getfilterchanges.mdx). Log objects contain the following keys and their values:
- `address`: 20 bytes. Address from which this log originated.
- `blockHash`: 32 bytes. The hash of the block where this log was in. `Null` when it is a pending log.
- `blockNumber`: The block number where this log was in. `Null` when it is a pending log.
- `blockHash`: 32 bytes. The hash of the block where this log was in. `null` when it's a pending log.
- `blockNumber`: The block number where this log was in. `null` when it's a pending log.
- `data`: DATA. Contains the non-indexed arguments of the log.
- `logIndex`: A hexadecimal of the log index position in the block. `Null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it is a valid log.
- `logIndex`: A hexadecimal of the log index position in the block. `null` when it is a pending log.
- `removed`: `true` when the log was removed, due to a chain reorganization. `false` if it's a valid log.
- `topics`: Array of DATA. An array of 0 to 4 32-bytes DATA of indexed log arguments. In Solidity the first `topic` is the hash of the signature of the event (for example, `Deposit(address,bytes32,uint256)`), except when you declared the event with the anonymous specifier.
- `transactionHash`: 32 bytes. A hash of the transactions from which this log was created. `Null` when it is a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `Null` when it is a pending log.
- `transactionHash`: 32 bytes. A hash of the transactions from which this log was created. `null` when it's a pending log.
- `transactionIndex`: A hexadecimal of the transactions index position from which this log was created. `null` when it's a pending log.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call [`eth_getFilterChanges`](../../ethereum/json-rpc-methods/filter-methods/eth_getfilterchanges.mdx).
Creates a filter in the node, to notify when a new block arrives. To check if the state has
changed, call [`eth_getFilterChanges`](../eth_getfilterchanges).

:::tip Valid for fifteen minutes
Filter IDs will be valid for up to fifteen minutes, and can be polled by any connection using the same `<YOUR-API-KEY>`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using [`eth_getFilterChanges`](../eth_getfilterchanges) automatically
expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Creates a filter object based on the given filter options, to notify when the state changes (logs). To check if the state has changed, call [`eth_getFilterChanges`](../../ethereum/json-rpc-methods/filter-methods/eth_getfilterchanges.mdx).
Creates a filter object based on the given filter options, to notify when the state changes (logs). To check if the state has changed, call [`eth_getFilterChanges`](../eth_getfilterchanges).

:::tip Valid for fifteen minutes
Filter IDs will be valid for up to fifteen minutes, and can be polled by any connection using the same `<YOUR-API-KEY>`.
:::warning Expires after 15 minutes of inactivity
Filters that are not polled using [`eth_getFilterChanges`](../eth_getfilterchanges) automatically
expires after 15 minutes of inactivity.
Filter IDs can be polled by any connection using the same API key.
:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

<Tabs>
<TabItem value="curl">

```bash
curl https://arbitrum-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```

</TabItem>
<TabItem value="WSS">

```bash
wscat -c wss://arbitrum-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

<Tabs>
<TabItem value="curl">

```bash
curl https://arbitrum-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```

</TabItem>
<TabItem value="WSS">

```bash
wscat -c wss://arbitrum-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "eth_getFilterLogs", "params": ["0x10ff0bfbedb01f0dbd4106d14eb719ec38b6eb5b821c"], "id": 1}'
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

<Tabs>
<TabItem value="curl">

```bash
curl https://arbitrum-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```

</TabItem>
<TabItem value="WSS">

```bash
wscat -c wss://arbitrum-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1}'
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

<Tabs>
<TabItem value="curl">

```bash
curl https://arbitrum-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```

</TabItem>
<TabItem value="WSS">

```bash
wscat -c wss://arbitrum-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "eth_newFilter", "params": [{"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}], "id": 1}'
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

<Tabs>
<TabItem value="curl">

```bash
curl https://arbitrum-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```

</TabItem>
<TabItem value="WSS">

```bash
wscat -c wss://arbitrum-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "eth_uninstallFilter", "params": ["0x10ff0bfba9472c87932c56632eef8f5cc70910e8e71d"], "id": 1}'
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "eth_getFilterChanges"
---

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

import Description from "/services/reference/_partials/filter-methods/_eth_getfilterchanges-description.mdx"

<Description />

## Parameters

import Params from "/services/reference/_partials/filter-methods/_eth_getfilterchanges-parameters.mdx"

<Params />

## Returns

import Returns from "/services/reference/_partials/filter-methods/_eth_getfilterchanges-returns.mdx"

<Returns />

## Example

import Example from "/services/reference/_partials/filter-methods/_eth_getfilterchanges-example.mdx"

<Example />

### Request

import Request from "./_eth_getfilterchanges-request.mdx"

<Request />

### Response

import Response from "/services/reference/_partials/filter-methods/_eth_getfilterchanges-response.mdx"

<Response />
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "eth_getFilterLogs"
---

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

import Description from "/services/reference/_partials/filter-methods/_eth_getfilterlogs-description.mdx"

<Description />

## Parameters

import Params from "/services/reference/_partials/filter-methods/_eth_getfilterlogs-parameters.mdx"

<Params />

## Returns

import Returns from "/services/reference/_partials/filter-methods/_eth_getfilterlogs-returns.mdx"

<Returns />

## Example

import Example from "/services/reference/_partials/filter-methods/_eth_getfilterlogs-example.mdx"

<Example />

### Request

import Request from "./_eth_getfilterlogs-request.mdx"

<Request />

### Response

import Response from "/services/reference/_partials/filter-methods/_eth_getfilterlogs-response.mdx"

<Response />
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "eth_newBlockFilter"
---

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

import Description from "/services/reference/_partials/filter-methods/_eth_newblockfilter-description.mdx"

<Description />

## Parameters

import Params from "/services/reference/_partials/filter-methods/_eth_newblockfilter-parameters.mdx"

<Params />

## Returns

import Returns from "/services/reference/_partials/filter-methods/_eth_newblockfilter-returns.mdx"

<Returns />

## Example

import Example from "/services/reference/_partials/filter-methods/_eth_newblockfilter-example.mdx"

<Example />

### Request

import Request from "./_eth_newblockfilter-request.mdx"

<Request />

### Response

import Response from "/services/reference/_partials/filter-methods/_eth_newblockfilter-response.mdx"

<Response />
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "eth_newFilter"
---

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

import Description from "/services/reference/_partials/filter-methods/_eth_newfilter-description.mdx"

<Description />

## Parameters

import Params from "/services/reference/_partials/filter-methods/_eth_newfilter-parameters.mdx"

<Params />

## Returns

import Returns from "/services/reference/_partials/filter-methods/_eth_newfilter-returns.mdx"

<Returns />

## Example

import Example from "/services/reference/_partials/filter-methods/_eth_newfilter-example.mdx"

<Example />

### Request

import Request from "./_eth_newfilter-request.mdx"

<Request />

### Response

import Response from "/services/reference/_partials/filter-methods/_eth_newfilter-response.mdx"

<Response />
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "eth_newPendingTransactionFilter"
---

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

import Description from "/services/reference/_partials/filter-methods/_eth_newpendingtransactionfilter-description.mdx"

<Description />
Loading
Loading