Skip to content

chore: read bridge gas fee estimates from gasFeeEstimatesByChainId#7826

Open
micaelae wants to merge 8 commits intomainfrom
swaps3122-gas-fees-by-chain
Open

chore: read bridge gas fee estimates from gasFeeEstimatesByChainId#7826
micaelae wants to merge 8 commits intomainfrom
swaps3122-gas-fees-by-chain

Conversation

@micaelae
Copy link
Member

@micaelae micaelae commented Feb 3, 2026

Explanation

Changes the gasFeeEstimates source used in quote metadata calculations to the chain-agnostic gasFeeEstimatesByChainId state. Resulting values will be the same as before but this sets up the clients for removing global selected network references

See CHANGELOG for required client changes

Draft extension PR: MetaMask/metamask-extension#37593

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Touches quote fee/metadata computation and introduces a breaking state shape change for selector consumers; behavior should be equivalent but missing/incorrect chain-scoped gas estimates could change displayed network fees.

Overview
selectBridgeQuotes now derives EVM gas fee inputs from gasFeeEstimatesByChainId keyed by the quote’s srcChainId, removing reliance on a global selected-network gas estimate (breaking for consumers that pass gasFeeEstimates into BridgeAppState).

Quote metadata calculation is hardened to handle missing gas estimates (defaults fees to zero), and tests were updated/added to cover the new state shape and the “no gas estimates available” case. Minor follow-ups include using toHex for chain-id formatting, switching a few || fallbacks to ??, and adjusting some TypeScript generic naming in BridgeController metrics tracking.

Written by Cursor Bugbot for commit 82d089c. This will update automatically on new commits. Configure here.

@micaelae micaelae changed the title chore: use gasFeesByChainId to remove selectedNetworkClientId reference chore: read bridge gas fee estimates from gasFeeEstimatesByChainId Feb 5, 2026
@micaelae micaelae marked this pull request as ready for review February 5, 2026 00:55
@micaelae micaelae requested review from a team as code owners February 5, 2026 00:55
@micaelae micaelae enabled auto-merge February 5, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant