# Unichain eth_estimateGas

> Estimates gas required for a Unichain transaction.

# `eth_estimateGas`

<Description />

## Parameters

- `TRANSACTION CALL OBJECT` _\[required]_
  - `from`: _\[optional]_ 20 Bytes - The address the transaction is sent from.
  - `to`: 20 Bytes - The address the transaction is directed to.
  - `gas`: _\[optional]_ Hexadecimal value of the gas provided for the transaction execution. `eth_estimateGas` consumes
    zero gas, but this parameter may be needed by some executions.
  - `gasPrice`: _\[optional]_ Hexadecimal value of the gas price used for each paid gas.
  - `maxPriorityFeePerGas`: _\[optional]_ Maximum fee, in wei, the sender is willing to pay per gas
    above the base fee.
    See [EIP-1559 transactions](../../../concepts/transaction-types.md#eip-1559-transactions).
  - `maxFeePerGas`: _\[optional]_ Maximum total fee (base fee + priority fee), in wei, the sender is
    willing to pay per gas.
    See [EIP-1559 transactions](../../../concepts/transaction-types.md#eip-1559-transactions).
  - `value`: _\[optional]_ Hexadecimal value of the value sent with this transaction.
  - `data`: _\[optional]_ Hash of the method signature and encoded parameters. See the
    [Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
  - `blockParameter`: (string) [_required_] A hexadecimal block number, or one of the tags `latest`,
    `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).

    :::warning
    `safe` isn't supported. Use `finalized` instead.
    :::

If no gas limit is specified, geth uses the block gas limit from the pending block as an upper bound.
As a result the returned estimate might not be enough to executed the call/transaction when the amount
of gas is higher than the pending block gas limit.

## Returns

<Returns />

## Example

<Example />

### Request

<Tabs>
  <TabItem value="curl">

```bash
curl https://unichain-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a"}], "id": 1}'
```

  </TabItem>
</Tabs>

### Response

<Response />
