@rarible/estimate-middleware
Advanced tools
Comparing version 0.5.0 to 0.5.5
import { JsonRpcEngine } from "json-rpc-engine"; | ||
import type { SafeEventEmitterProvider } from "eth-json-rpc-middleware/dist/utils/cache"; | ||
export declare function estimate(provider: any, estimate: JsonRpcEngine | string): SafeEventEmitterProvider; | ||
export declare function estimate(provider: any, estimate?: JsonRpcEngine | string): SafeEventEmitterProvider; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var engine = new json_rpc_engine_1.JsonRpcEngine(); | ||
engine.push((0, middleware_1.estimateGasMiddliware)(getEstimateEngine(estimate))); | ||
engine.push((0, middleware_1.estimateGasMiddliware)(getEstimateEngine(provider, estimate))); | ||
engine.push((0, eth_json_rpc_middleware_1.providerAsMiddleware)(provider)); | ||
@@ -15,4 +15,9 @@ return (0, eth_json_rpc_middleware_1.providerFromEngine)(engine); | ||
exports.estimate = estimate; | ||
function getEstimateEngine(estimate) { | ||
if (typeof estimate === "string") { | ||
function getEstimateEngine(provider, estimate) { | ||
if (estimate === undefined) { | ||
var estimateEngine = new json_rpc_engine_1.JsonRpcEngine(); | ||
estimateEngine.push((0, eth_json_rpc_middleware_1.providerAsMiddleware)(provider)); | ||
return estimateEngine; | ||
} | ||
else if (typeof estimate === "string") { | ||
var engine = new json_rpc_engine_1.JsonRpcEngine(); | ||
@@ -19,0 +24,0 @@ engine.push((0, eth_json_rpc_middleware_1.createFetchMiddleware)({ rpcUrl: estimate })); |
{ | ||
"name": "@rarible/estimate-middleware", | ||
"version": "0.5.0", | ||
"version": "0.5.5", | ||
"keywords": [ | ||
@@ -37,3 +37,3 @@ "rarible", | ||
}, | ||
"gitHead": "371aa2124f5ac7b3c10ba4266230bc3f556edf68" | ||
"gitHead": "00fb8a5a10ad9d345e45fbb47d0eb5e576a3ab1d" | ||
} |
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
27674
94