|
|
@ -489,9 +489,7 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
|
|
|
|
|
|
|
|
getGasPrice () { |
|
|
|
getGasPrice () { |
|
|
|
const { recentBlocksController } = this |
|
|
|
const { recentBlocksController } = this |
|
|
|
console.dir(recentBlocksController) |
|
|
|
|
|
|
|
const { recentBlocks } = recentBlocksController.store.getState() |
|
|
|
const { recentBlocks } = recentBlocksController.store.getState() |
|
|
|
console.dir(recentBlocks) |
|
|
|
|
|
|
|
const lowestPrices = recentBlocks.map((block) => { |
|
|
|
const lowestPrices = recentBlocks.map((block) => { |
|
|
|
return block.transactions |
|
|
|
return block.transactions |
|
|
|
.sort((a, b) => { |
|
|
|
.sort((a, b) => { |
|
|
@ -499,7 +497,6 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
})[0] |
|
|
|
})[0] |
|
|
|
}) |
|
|
|
}) |
|
|
|
.map(number => number.div(GWEI_BN).toNumber()) |
|
|
|
.map(number => number.div(GWEI_BN).toNumber()) |
|
|
|
console.dir({ lowestPrices }) |
|
|
|
|
|
|
|
return percentile(50, lowestPrices) |
|
|
|
return percentile(50, lowestPrices) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|