@metamask-previews/gas-fee-controller
Advanced tools
Comparing version 13.0.1-preview.c5f6cb4 to 13.0.2-preview.051e5742
@@ -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 |
@@ -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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
176428
1296
1441
12
+ Added@types/bn.js@^5.1.5
+ Addedbn.js@^5.2.1
- Removedethereumjs-util@^7.0.10
- Removed@types/pbkdf2@3.1.2(transitive)
- Removed@types/secp256k1@4.0.6(transitive)
- Removedbase-x@3.0.10(transitive)
- Removedblakejs@1.2.1(transitive)
- Removedbn.js@4.12.1(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowserify-aes@1.2.0(transitive)
- Removedbs58@4.0.1(transitive)
- Removedbs58check@2.1.2(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedcipher-base@1.0.6(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedcreate-hmac@1.1.7(transitive)
- Removedelliptic@6.6.1(transitive)
- Removedethereum-cryptography@0.1.3(transitive)
- Removedethereumjs-util@7.1.5(transitive)
- Removedevp_bytestokey@1.0.3(transitive)
- Removedhash-base@3.1.0(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedkeccak@3.0.4(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removednode-addon-api@2.0.25.1.0(transitive)
- Removednode-gyp-build@4.8.4(transitive)
- Removedpbkdf2@3.1.2(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedrlp@2.2.7(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedscrypt-js@3.0.1(transitive)
- Removedsecp256k1@4.0.4(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)