Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.
Merged
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
3 changes: 3 additions & 0 deletions sdk-estimate-gas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ We can't use the `{a: b(), c: d()}` syntax because the `L2Provider` functions co

[Estimate the total cost (L1+L2) of running the transaction](https://sdk.optimism.io/modules.html#estimateTotalGasCost).

> :warning: This function calls `eth_estimateGas`, which runs the transaction in the node (without changing the blockchain state).
> This means that the account in `l2Provider` has to have enough ETH to pay for the gas cost of the transaction.

```js
retVal.l1Cost = await provider.estimateL1GasCost(tx)
retVal.l2Cost = await provider.estimateL2GasCost(tx)
Expand Down