Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@metamask-previews/gas-fee-controller

Package Overview
Dependencies
Maintainers
2
Versions
386
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask-previews/gas-fee-controller - npm Package Compare versions

Comparing version 13.0.1-preview.c5f6cb4 to 13.0.2-preview.051e5742

14

CHANGELOG.md

@@ -10,2 +10,12 @@ # Changelog

## [13.0.2]
### Changed
- Replace `ethereumjs-util` with `bn.js` ([#3943](https://github.com/MetaMask/core/pull/3943))
- Bump `@metamask/controller-utils` to `^8.0.4` ([#4007](https://github.com/MetaMask/core/pull/4007))
- Bump `@metamask/ethjs-unit` to `^0.3.0` ([#3897](https://github.com/MetaMask/core/pull/3897))
- Bump `@metamask/network-controller` to `^17.2.1` ([#4007](https://github.com/MetaMask/core/pull/4007))
- Bump `@metamask/polling-controller` to `^5.0.1` ([#4007](https://github.com/MetaMask/core/pull/4007))
## [13.0.1]

@@ -15,3 +25,2 @@

- Bump `@metamask/ethjs-unit` to `^0.3.0` ([#3897](https://github.com/MetaMask/core/pull/3897))
- Bump `@metamask/controller-utils` to `^8.0.3` ([#3915](https://github.com/MetaMask/core/pull/3915))

@@ -213,3 +222,4 @@

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@13.0.1...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@13.0.2...HEAD
[13.0.2]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@13.0.1...@metamask/gas-fee-controller@13.0.2
[13.0.1]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@13.0.0...@metamask/gas-fee-controller@13.0.1

@@ -216,0 +226,0 @@ [13.0.0]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@12.0.0...@metamask/gas-fee-controller@13.0.0

3

dist/fetchBlockFeeHistory.d.ts

@@ -1,3 +0,2 @@

/// <reference types="bn.js" />
import { BN } from 'ethereumjs-util';
import BN from 'bn.js';
declare type EthQuery = any;

@@ -4,0 +3,0 @@ /**

@@ -11,5 +11,8 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const controller_utils_1 = require("@metamask/controller-utils");
const ethereumjs_util_1 = require("ethereumjs-util");
const bn_js_1 = __importDefault(require("bn.js"));
const MAX_NUMBER_OF_BLOCKS_PER_ETH_FEE_HISTORY_CALL = 1024;

@@ -189,3 +192,3 @@ /**

function determineRequestChunkSpecifiers(endBlockNumber, totalNumberOfBlocks) {
if (endBlockNumber.lt(new ethereumjs_util_1.BN(totalNumberOfBlocks))) {
if (endBlockNumber.lt(new bn_js_1.default(totalNumberOfBlocks))) {
totalNumberOfBlocks = endBlockNumber.toNumber();

@@ -192,0 +195,0 @@ }

@@ -8,3 +8,3 @@ "use strict";

const ethjs_unit_1 = require("@metamask/ethjs-unit");
const ethereumjs_util_1 = require("ethereumjs-util");
const bn_js_1 = __importDefault(require("bn.js"));
const medianOf_1 = __importDefault(require("./medianOf"));

@@ -16,5 +16,5 @@ const PRIORITY_LEVELS = ['low', 'medium', 'high'];

percentile: 10,
baseFeePercentageMultiplier: new ethereumjs_util_1.BN(110),
priorityFeePercentageMultiplier: new ethereumjs_util_1.BN(94),
minSuggestedMaxPriorityFeePerGas: new ethereumjs_util_1.BN(1000000000),
baseFeePercentageMultiplier: new bn_js_1.default(110),
priorityFeePercentageMultiplier: new bn_js_1.default(94),
minSuggestedMaxPriorityFeePerGas: new bn_js_1.default(1000000000),
estimatedWaitTimes: {

@@ -27,5 +27,5 @@ minWaitTimeEstimate: 15000,

percentile: 20,
baseFeePercentageMultiplier: new ethereumjs_util_1.BN(120),
priorityFeePercentageMultiplier: new ethereumjs_util_1.BN(97),
minSuggestedMaxPriorityFeePerGas: new ethereumjs_util_1.BN(1500000000),
baseFeePercentageMultiplier: new bn_js_1.default(120),
priorityFeePercentageMultiplier: new bn_js_1.default(97),
minSuggestedMaxPriorityFeePerGas: new bn_js_1.default(1500000000),
estimatedWaitTimes: {

@@ -38,5 +38,5 @@ minWaitTimeEstimate: 15000,

percentile: 30,
baseFeePercentageMultiplier: new ethereumjs_util_1.BN(125),
priorityFeePercentageMultiplier: new ethereumjs_util_1.BN(98),
minSuggestedMaxPriorityFeePerGas: new ethereumjs_util_1.BN(2000000000),
baseFeePercentageMultiplier: new bn_js_1.default(125),
priorityFeePercentageMultiplier: new bn_js_1.default(98),
minSuggestedMaxPriorityFeePerGas: new bn_js_1.default(2000000000),
estimatedWaitTimes: {

@@ -69,3 +69,3 @@ minWaitTimeEstimate: 15000,

})
.filter(ethereumjs_util_1.BN.isBN);
.filter(bn_js_1.default.isBN);
const medianPriorityFee = (0, medianOf_1.default)(priorityFees);

@@ -75,3 +75,3 @@ const adjustedPriorityFee = medianPriorityFee

.divn(100);
const suggestedMaxPriorityFeePerGas = ethereumjs_util_1.BN.max(adjustedPriorityFee, settings.minSuggestedMaxPriorityFeePerGas);
const suggestedMaxPriorityFeePerGas = bn_js_1.default.max(adjustedPriorityFee, settings.minSuggestedMaxPriorityFeePerGas);
const suggestedMaxFeePerGas = adjustedBaseFee.add(suggestedMaxPriorityFeePerGas);

@@ -78,0 +78,0 @@ return Object.assign(Object.assign({}, settings.estimatedWaitTimes), { suggestedMaxPriorityFeePerGas: (0, ethjs_unit_1.fromWei)(suggestedMaxPriorityFeePerGas, controller_utils_1.GWEI), suggestedMaxFeePerGas: (0, ethjs_unit_1.fromWei)(suggestedMaxFeePerGas, controller_utils_1.GWEI) });

@@ -1,3 +0,2 @@

/// <reference types="bn.js" />
import type { BN } from 'ethereumjs-util';
import type * as BN from 'bn.js';
/**

@@ -4,0 +3,0 @@ * Finds the median among a list of numbers. Note that this is different from the implementation

@@ -1,3 +0,2 @@

/// <reference types="bn.js" />
import type { BN } from 'ethereumjs-util';
import type * as BN from 'bn.js';
export declare type EthBlock = {

@@ -4,0 +3,0 @@ number: BN;

@@ -11,6 +11,9 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateTimeEstimate = exports.fetchEthGasPriceEstimate = exports.fetchLegacyGasPriceEstimates = exports.fetchGasEstimates = exports.normalizeGWEIDecimalNumbers = void 0;
const controller_utils_1 = require("@metamask/controller-utils");
const ethereumjs_util_1 = require("ethereumjs-util");
const bn_js_1 = __importDefault(require("bn.js"));
const makeClientIdHeader = (clientId) => ({ 'X-Client-Id': clientId });

@@ -107,3 +110,3 @@ /**

const estimatedBaseFeeInWEI = (0, controller_utils_1.gweiDecToWEIBN)(estimatedBaseFee);
const effectiveMaxPriorityFee = ethereumjs_util_1.BN.min(maxPriorityFeePerGasInWEI, maxFeePerGasInWEI.sub(estimatedBaseFeeInWEI));
const effectiveMaxPriorityFee = bn_js_1.default.min(maxPriorityFeePerGasInWEI, maxFeePerGasInWEI.sub(estimatedBaseFeeInWEI));
const lowMaxPriorityFeeInWEI = (0, controller_utils_1.gweiDecToWEIBN)(low.suggestedMaxPriorityFeePerGas);

@@ -110,0 +113,0 @@ const mediumMaxPriorityFeeInWEI = (0, controller_utils_1.gweiDecToWEIBN)(medium.suggestedMaxPriorityFeePerGas);

{
"name": "@metamask-previews/gas-fee-controller",
"version": "13.0.1-preview.c5f6cb4",
"version": "13.0.2-preview.051e5742",
"description": "Periodically calculates gas fee estimates based on various gas limits as well as other data displayed on transaction confirm screens",

@@ -35,10 +35,11 @@ "keywords": [

"@metamask/base-controller": "^4.1.1",
"@metamask/controller-utils": "^8.0.3",
"@metamask/controller-utils": "^8.0.4",
"@metamask/eth-query": "^4.0.0",
"@metamask/ethjs-unit": "^0.3.0",
"@metamask/network-controller": "^17.2.0",
"@metamask/polling-controller": "^5.0.0",
"@metamask/network-controller": "^17.2.1",
"@metamask/polling-controller": "^5.0.1",
"@metamask/utils": "^8.3.0",
"@types/bn.js": "^5.1.5",
"@types/uuid": "^8.3.0",
"ethereumjs-util": "^7.0.10",
"bn.js": "^5.2.1",
"uuid": "^8.3.2"

@@ -45,0 +46,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc