Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linea method. #1590

Merged
merged 9 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ of the [MetaMask developer page](https://metamask.io/developer/).

## September 2024

- Documented [`linea_getTransactionExclusionStatusV1`](/services/reference/linea/json-rpc-methods/linea_gettransactionexclusionstatusv1).
([#1590](https://github.com/MetaMask/metamask-docs/pull/1590))
- Updated [credit cost](/services/get-started/pricing/credit-cost/#ethereum) for `eth_sendRawTransaction`.
([#1581](https://github.com/MetaMask/metamask-docs/pull/1581))
- Documented WebSocket support for [Base](/services/reference/base),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
title: "linea_getTransactionExclusionStatusV1"
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

:::info Only available on request

This API method is only available on request. [Contact support](https://support.infura.io/)
to obtain access to the method.

:::

Checks if a transaction was rejected for exceeding data line limits, preventing the prover from generating
a proof to be included in a block.

:::warning

You can only check for rejected transactions within seven days of the transaction attempt.

:::

The API call provides the rejection reason if the transaction fails.
It returns `null` if the transaction succeeds.

## Parameters

`transaction hash`: _\[Required]_ A string representing the hash (32 bytes) of a transaction.

## Returns

- `txHash`: The hash of the transaction.
- `from`: The address of the sender.
- `nonce`: Number of transactions made by the sender.
- `txRejectionStage`: The point at which the transaction was rejected. One of:
- `SEQUENCER`: Rejected by the sequencer.
- `RPC`: Rejected by an RPC node.
- `P2P`: Rejected by a P2P-connected node.
- `reasonMessage`: The reason the transaction was rejected.
- `blockNumber`: The block that the transaction was rejected from, in hexadecimal format.
Only returned for transactions rejected by the sequencer.
- `timestamp`: Time of rejection, in ISO 8601 format.

## Example

Replace `<YOUR-API-KEY>` with an API key from your [Infura dashboard](https://infura.io/dashboard).

### Request

<Tabs>
<TabItem value="cURL">

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

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

</TabItem>
</Tabs>

### Response

<Tabs>
<TabItem value="JSON">
```json
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"txHash": "0x526e56101cf39c1e717cef9cedf6fdddb42684711abda35bae51136dbb350ad7",
"from": "0x4d144d7b9c96b26361d6ac74dd1d8267edca4fc2",
"nonce": "0x64",
"txRejectionStage": "SEQUENCER",
"reasonMessage": "Transaction line count for module ADD=402 is above the limit 70",
"blockNumber": "0x3039",
"timestamp": "2024-08-22T09:18:51Z"
}
}
```
</TabItem>
</Tabs>

The API returns a `null` result if the transaction does not exceed line limits or is older than seven days.
In these cases, the database does not contain the transaction. For example:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}
```
Loading