UNPKG

958 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.EthersProviderWrapper = void 0;
4const ethers_1 = require("ethers");
5class EthersProviderWrapper extends ethers_1.ethers.providers.JsonRpcProvider {
6 constructor(hardhatProvider) {
7 super();
8 this._hardhatProvider = hardhatProvider;
9 }
10 async send(method, params) {
11 const result = await this._hardhatProvider.send(method, params);
12 // We replicate ethers' behavior.
13 this.emit("debug", {
14 action: "send",
15 request: {
16 id: 42,
17 jsonrpc: "2.0",
18 method,
19 params,
20 },
21 response: result,
22 provider: this,
23 });
24 return result;
25 }
26 toJSON() {
27 return "<WrappedHardhatProvider>";
28 }
29}
30exports.EthersProviderWrapper = EthersProviderWrapper;
31//# sourceMappingURL=ethers-provider-wrapper.js.map
\No newline at end of file