diff --git a/packages/gas-fee-controller/CHANGELOG.md b/packages/gas-fee-controller/CHANGELOG.md index ed926f534a..e23e98f1fb 100644 --- a/packages/gas-fee-controller/CHANGELOG.md +++ b/packages/gas-fee-controller/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Expose missing public `GasFeeController` methods through its messenger ([#8699](https://github.com/MetaMask/core/pull/8699)) + - The following actions are now available: + - `GasFeeController:enableNonRPCGasFeeApis` + - `GasFeeController:disableNonRPCGasFeeApis` + - Corresponding action types are available as well. - Bump `@metamask/messenger` from `^1.1.0` to `^1.2.0` ([#8373](https://github.com/MetaMask/core/pull/8373), [#8632](https://github.com/MetaMask/core/pull/8632)) - Add missing `@metamask/messenger` dependency ([#8318](https://github.com/MetaMask/core/pull/8318), [#8364](https://github.com/MetaMask/core/pull/8364)) - Bump `@metamask/controller-utils` from `^11.19.0` to `^11.20.0` ([#8344](https://github.com/MetaMask/core/pull/8344)) diff --git a/packages/gas-fee-controller/src/GasFeeController-method-action-types.ts b/packages/gas-fee-controller/src/GasFeeController-method-action-types.ts index 8420235bfe..000c9b6a77 100644 --- a/packages/gas-fee-controller/src/GasFeeController-method-action-types.ts +++ b/packages/gas-fee-controller/src/GasFeeController-method-action-types.ts @@ -68,6 +68,16 @@ export type GasFeeControllerGetTimeEstimateAction = { handler: GasFeeController['getTimeEstimate']; }; +export type GasFeeControllerEnableNonRPCGasFeeApisAction = { + type: `GasFeeController:enableNonRPCGasFeeApis`; + handler: GasFeeController['enableNonRPCGasFeeApis']; +}; + +export type GasFeeControllerDisableNonRPCGasFeeApisAction = { + type: `GasFeeController:disableNonRPCGasFeeApis`; + handler: GasFeeController['disableNonRPCGasFeeApis']; +}; + /** * Union of all GasFeeController action types. */ @@ -77,4 +87,6 @@ export type GasFeeControllerMethodActions = | GasFeeControllerGetGasFeeEstimatesAndStartPollingAction | GasFeeControllerDisconnectPollerAction | GasFeeControllerStopPollingAction - | GasFeeControllerGetTimeEstimateAction; + | GasFeeControllerGetTimeEstimateAction + | GasFeeControllerEnableNonRPCGasFeeApisAction + | GasFeeControllerDisableNonRPCGasFeeApisAction; diff --git a/packages/gas-fee-controller/src/GasFeeController.ts b/packages/gas-fee-controller/src/GasFeeController.ts index ce0a232baa..bacebdd786 100644 --- a/packages/gas-fee-controller/src/GasFeeController.ts +++ b/packages/gas-fee-controller/src/GasFeeController.ts @@ -252,7 +252,9 @@ export type GasFeeState = GasFeeEstimatesByChainId & const name = 'GasFeeController'; const MESSENGER_EXPOSED_METHODS = [ + 'disableNonRPCGasFeeApis', 'disconnectPoller', + 'enableNonRPCGasFeeApis', 'fetchGasFeeEstimates', 'getGasFeeEstimatesAndStartPolling', 'getTimeEstimate', diff --git a/packages/gas-fee-controller/src/index.ts b/packages/gas-fee-controller/src/index.ts index ced487688f..073a4b4b74 100644 --- a/packages/gas-fee-controller/src/index.ts +++ b/packages/gas-fee-controller/src/index.ts @@ -6,4 +6,6 @@ export type { GasFeeControllerDisconnectPollerAction, GasFeeControllerStopPollingAction, GasFeeControllerGetTimeEstimateAction, + GasFeeControllerEnableNonRPCGasFeeApisAction, + GasFeeControllerDisableNonRPCGasFeeApisAction, } from './GasFeeController-method-action-types';