From 9aca473ba184a1352cdaf841a4c96f7d2043b80c Mon Sep 17 00:00:00 2001 From: Qvkare Date: Mon, 6 Jan 2025 19:08:21 +0300 Subject: [PATCH] add request methods linea-estimategas.mdx (#915) * add request methods linea-estimategas.mdx * Fix link --------- Co-authored-by: Joel Willmore <95916148+jlwllmr@users.noreply.github.com> --- docs/api/reference/linea-estimategas.mdx | 33 +++++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/api/reference/linea-estimategas.mdx b/docs/api/reference/linea-estimategas.mdx index 74b98c7dd..542ad2775 100644 --- a/docs/api/reference/linea-estimategas.mdx +++ b/docs/api/reference/linea-estimategas.mdx @@ -57,12 +57,13 @@ fee per gas. :::tip -You can also call the API using [Infura's supported Linea endpoints](https://docs.infura.io/api/networks/linea/choose-a-network). +You can also call the API using [Infura's supported Linea endpoints](https://docs.metamask.io/services/reference/linea/json-rpc-methods/). + ::: ### Request - + ```bash @@ -73,7 +74,7 @@ You can also call the API using [Infura's supported Linea endpoints](https://doc ``` - {/* + ```javascript type LineaEstimateGasResponse = { baseFeePerGas: string; @@ -93,7 +94,7 @@ You can also call the API using [Infura's supported Linea endpoints](https://doc const fees: LineaEstimateGasResponse = await provider.send("linea_estimateGas", [params]); console.log(fees); ``` - */} + ```javascript import { createPublicClient, http, parseEther } from 'viem' @@ -125,6 +126,9 @@ You can also call the API using [Infura's supported Linea endpoints](https://doc ### Response + + + ```JSON { "jsonrpc": "2.0", @@ -137,6 +141,27 @@ You can also call the API using [Infura's supported Linea endpoints](https://doc } ``` + + + ```javascript + { + baseFeePerGas: "0x7", + gasLimit: "0xcf08", + priorityFeePerGas: "0x43a82a4" + } + ``` + + + ```javascript + { + baseFeePerGas: 7n, + gasLimit: 53000n, + priorityFeePerGas: 4444716n + } + ``` + + + Where: - `baseFeePerGas` - Uses the Linea base fee which is set at 7 wei. - `gasLimit` - Uses the standard `eth_estimateGas` API calculation.