Skip to content

Conversation

@brad-decker
Copy link
Contributor

Breaking changes

  1. must supply new method 'getIsMainnet' that will be called when polling to determine if, in the absence of EIP-1559 compatibility, the metaswaps API should be hit for gas estimates.
  2. the old fetchLegacyGasPriceEstimate has been renamed to fetchEthGasPriceEstimate because eth_gasPrice is not legacy, it is just a fall back.
  3. a new fetchLegacyGasPriceEstimates (note plurality Estimates) is the method that will return metaswaps API estimates.

Non Breaking Changes

  1. gasEstimateType will be returned in state as well, and can be any of 'none' | 'legacy' | 'fee-market' or 'eth_gasPrice'. A constant is exported to prevent issues with string typos.
  2. when receiving a gasPrice from eth_gasPrice the result will be returned in dec gwei instead of hex wei.

@brad-decker brad-decker requested a review from a team as a code owner July 1, 2021 18:57
@brad-decker brad-decker marked this pull request as draft July 1, 2021 18:57
Comment on lines 308 to 312
} catch (error) {
try {
estimates = await this.fetchLegacyGasPriceEstimate(this.ethQuery);
estimates = await this.fetchEthGasPriceEstimate(this.ethQuery);
gasEstimateType = GAS_ESTIMATE_TYPES.ETH_GASPRICE;
} catch (error2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are not tracking error from fetchGasEstimates or fetchLegacyGasPriceEstimates we can just } catch { and rename error2 to error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Base automatically changed from superior-unit-conversions to draft-gasfee-controller July 1, 2021 19:33
@brad-decker brad-decker marked this pull request as ready for review July 1, 2021 19:38
@brad-decker brad-decker force-pushed the add-metaswaps-api-to-gas-fee-controller branch from 8383700 to f39df36 Compare July 1, 2021 19:38
@brad-decker
Copy link
Contributor Author

@wachunei rebased to remove the superfulous commit

@brad-decker brad-decker requested a review from wachunei July 1, 2021 19:47
Copy link
Member

@wachunei wachunei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brad-decker brad-decker merged commit 465d3b8 into draft-gasfee-controller Jul 1, 2021
@brad-decker brad-decker deleted the add-metaswaps-api-to-gas-fee-controller branch July 1, 2021 19:54
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.

3 participants