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

@rarible/estimate-middleware

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rarible/estimate-middleware - npm Package Compare versions

Comparing version 0.9.10 to 0.9.13

2

build/middleware.d.ts

@@ -8,2 +8,2 @@ import type { JsonRpcEngine, JsonRpcMiddleware } from "json-rpc-engine";

*/
export declare function createEstimateGasMiddleware(engine: JsonRpcEngine, force?: boolean, threshold?: number): JsonRpcMiddleware<string[], Block>;
export declare function createEstimateGasMiddleware(engine: JsonRpcEngine, force?: boolean, threshold?: number, multiplier?: number): JsonRpcMiddleware<string[], Block>;

@@ -13,6 +13,7 @@ "use strict";

*/
function createEstimateGasMiddleware(engine, force, threshold) {
function createEstimateGasMiddleware(engine, force, threshold, multiplier) {
var _this = this;
if (force === void 0) { force = false; }
if (threshold === void 0) { threshold = 1.03; }
if (multiplier === void 0) { multiplier = 2; }
return (0, json_rpc_engine_1.createAsyncMiddleware)(function (req, res, next) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {

@@ -64,7 +65,10 @@ var params, gasLimitResponse, limitRaw, limitHex, multiplied, maxPriorityFeePerGasResponse, maxPriorityFeePerGasResponseRaw, blockResponse, baseFeeRaw, baseFee, maxPriorityFeePerGas, maxFeePerGasHex, error_1;

blockResponse = _a.sent();
baseFeeRaw = extractbaseFeePerGas(blockResponse);
baseFeeRaw = extractBaseFeePerGas(blockResponse);
if (maxPriorityFeePerGasResponseRaw && baseFeeRaw) {
baseFee = (0, bn_1.toBn)(extractHex(baseFeeRaw), 16).toFixed(0);
if (params.gasPrice !== undefined) {
delete params.gasPrice;
}
baseFee = (0, bn_1.toBn)(extractHex(baseFeeRaw), 16).multipliedBy(multiplier).toFixed(0);
maxPriorityFeePerGas = extractHex(maxPriorityFeePerGasResponseRaw);
maxFeePerGasHex = (0, bn_1.toBn)(maxPriorityFeePerGas, 16).plus(baseFee).minus(1).toString(16);
maxFeePerGasHex = (0, bn_1.toBn)(maxPriorityFeePerGas, 16).plus(baseFee).toString(16);
params["maxPriorityFeePerGas"] = maxPriorityFeePerGasResponseRaw;

@@ -102,3 +106,3 @@ params["maxFeePerGas"] = withPrefix(maxFeePerGasHex);

}
function extractbaseFeePerGas(response) {
function extractBaseFeePerGas(response) {
if (isJSONRpcResponse(response)) {

@@ -105,0 +109,0 @@ if (response.error) {

{
"name": "@rarible/estimate-middleware",
"version": "0.9.10",
"version": "0.9.13",
"keywords": [

@@ -39,3 +39,3 @@ "rarible",

},
"gitHead": "d942b0e14cc928ff246d0baad5d578441175e719"
"gitHead": "c418090181be16aca5a6d6227214a037a660e849"
}

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