core icon indicating copy to clipboard operation
core copied to clipboard

fix: use hardcoded Infura gas API urls

Open OGPoyraz opened this issue 1 year ago • 0 comments

Explanation

legacyAPIEndpoint and EIP1559APIEndpoint options are the gas API urls used in GasFeeController. This PR aims to remove those and put the new Infura URL as hardcoded.

New Infura API also expects an auth header on requests, hence this PR is adding new options infuraAPIKey and infuraAPIKeySecret to constructor.

References

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2254

Changelog

@metamask/gas-fee-controller

  • BREAKING: Removed the constructor options legacyAPIEndpoint and EIP1559APIEndpoint. These URLs are now hardcoded within the controller.
  • BREAKING: The controller's constructor now requires infuraAPIKey and infuraAPIKeySecret parameters. These are used to construct and send the Authorization header for Infura gas API requests.

Checklist

  • [X] I've updated the test suite for new or updated code as appropriate
  • [X] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • [X] I've highlighted breaking changes using the "BREAKING" category above as appropriate

OGPoyraz avatar Mar 18 '24 11:03 OGPoyraz