Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Support polling for network congestion level
When a user is about to send a transaction or is looking at a swap quote, we would like to inform them if the network is busy so that we can push them to use a lower fee setting. The GasFeeController already provides a way to poll for fee estimates, which we employ on transaction preview screens. This commit updates the polling mechanism so that we can also gauge the network congestion level. This is done by hitting the `eth_feeHistory` endpoint, which was added in EIP-1559. This endpoint allows us to see the base and priority fees that were used in the last N blocks, where N is a number we can choose. We use this data to determine whether there has been a recent spike in fees.
- Loading branch information