File tree Expand file tree Collapse file tree 3 files changed +4
-19
lines changed
packages/gas-fee-controller/src Expand file tree Collapse file tree 3 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,13 @@ describe('GasFeeController', () => {
228228 * @param options.interval - The polling interval.
229229 * @param options.state - The initial GasFeeController state
230230 * @param options.infuraAPIKey - The Infura API key.
231- * @param options.infuraAPIKeySecret - The Infura API key secret.
232231 */
233232 async function setupGasFeeController ( {
234233 getIsEIP1559Compatible = jest . fn ( ) . mockResolvedValue ( true ) ,
235234 getCurrentNetworkLegacyGasAPICompatibility = jest
236235 . fn ( )
237236 . mockReturnValue ( false ) ,
238237 infuraAPIKey = 'INFURA_API_KEY' ,
239- infuraAPIKeySecret = 'INFURA_API_KEY_SECRET' ,
240238 clientId,
241239 getChainId,
242240 networkControllerState = { } ,
@@ -251,7 +249,6 @@ describe('GasFeeController', () => {
251249 state ?: GasFeeState ;
252250 interval ?: number ;
253251 infuraAPIKey ?: string ;
254- infuraAPIKeySecret ?: string ;
255252 } = { } ) {
256253 const controllerMessenger = getControllerMessenger ( ) ;
257254 networkController = await setupNetworkController ( {
@@ -270,7 +267,6 @@ describe('GasFeeController', () => {
270267 clientId,
271268 interval,
272269 infuraAPIKey,
273- infuraAPIKeySecret,
274270 } ) ;
275271 }
276272
Original file line number Diff line number Diff line change @@ -305,7 +305,6 @@ export class GasFeeController extends StaticIntervalPollingController<
305305 * @param options.clientId - The client ID used to identify to the gas estimation API who is
306306 * asking for estimates.
307307 * @param options.infuraAPIKey - The Infura API key used for infura API requests.
308- * @param options.infuraAPIKeySecret - The Infura API key secret used for infura API requests.
309308 */
310309 constructor ( {
311310 interval = 15000 ,
@@ -319,7 +318,6 @@ export class GasFeeController extends StaticIntervalPollingController<
319318 onNetworkDidChange,
320319 clientId,
321320 infuraAPIKey,
322- infuraAPIKeySecret,
323321 } : {
324322 interval ?: number ;
325323 messenger : GasFeeMessenger ;
@@ -332,7 +330,6 @@ export class GasFeeController extends StaticIntervalPollingController<
332330 onNetworkDidChange ?: ( listener : ( state : NetworkState ) => void ) => void ;
333331 clientId ?: string ;
334332 infuraAPIKey : string ;
335- infuraAPIKeySecret : string ;
336333 } ) {
337334 super ( {
338335 name,
@@ -353,10 +350,7 @@ export class GasFeeController extends StaticIntervalPollingController<
353350 this . EIP1559APIEndpoint = `${ GAS_API_BASE_URL } /networks/<chain_id>/suggestedGasFees` ;
354351 this . legacyAPIEndpoint = `${ GAS_API_BASE_URL } /networks/<chain_id>/gasPrices` ;
355352 this . clientId = clientId ;
356- this . infuraAuthToken = buildInfuraAuthToken (
357- infuraAPIKey ,
358- infuraAPIKeySecret ,
359- ) ;
353+ this . infuraAuthToken = buildInfuraAuthToken ( infuraAPIKey ) ;
360354
361355 this . ethQuery = new EthQuery ( this . #getProvider( ) ) ;
362356
Original file line number Diff line number Diff line change @@ -196,16 +196,11 @@ export function calculateTimeEstimate(
196196 * Build an infura auth token from the given API key and secret.
197197 *
198198 * @param infuraAPIKey - The Infura API key.
199- * @param infuraAPIKeySecret - The Infura API key secret.
200199 * @returns The base64 encoded auth token.
201200 */
202- export function buildInfuraAuthToken (
203- infuraAPIKey : string ,
204- infuraAPIKeySecret : string ,
205- ) {
206- return Buffer . from ( `${ infuraAPIKey } :${ infuraAPIKeySecret } ` ) . toString (
207- 'base64' ,
208- ) ;
201+ export function buildInfuraAuthToken ( infuraAPIKey : string ) {
202+ // We intentionally leave the password empty, as Infura does not require one
203+ return Buffer . from ( `${ infuraAPIKey } :` ) . toString ( 'base64' ) ;
209204}
210205
211206/**
You can’t perform that action at this time.
0 commit comments