app/util/custom-gas.js
/**
 * Fetches gas estimated from gas station
 *
 * @returns {Object} - Object containing basic estimates
 */
Fetches gas estimated from gas station
@returns {Object} - Object containing basic estimates
Fetches gas estimated from gas station @returns { Object } - Object containing basic estimates
async function fetchBasicGasEstimates() {
	return await fetch(`https://api.metaswap.codefi.network/gasPrices`, {
		headers: {},
		referrerPolicy: 'no-referrer-when-downgrade',
		body: null,
		method: 'GET',
		mode: 'cors'
	})
		.then(r => r.json())
		.then(({ SafeGasPrice, ProposeGasPrice, FastGasPrice }) => {
			const basicEstimates = {
				average: ProposeGasPrice,
				safeLow: SafeGasPrice,
				fast: FastGasPrice
			};
			return basicEstimates;
		});
}
async function fetchBasicGasEstimates ( ) { return await fetch ( ` ` , { headers : { } , referrerPolicy : 'no-referrer-when-downgrade' , body : null , method : 'GET' , mode : 'cors' } ) . then ( r => r . json ( ) ) . then ( ( { SafeGasPrice , ProposeGasPrice , FastGasPrice } ) => { const basicEstimates = { average : ProposeGasPrice , safeLow : SafeGasPrice , fast : FastGasPrice } ; return basicEstimates ; } ) ; }
Fetches gas estimated from gas station
 @returns {Object} - Object containing basic estimates
Fetches gas estimated from gas station @returns { Object } - Object containing basic estimates