1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.EthersProviderWrapper = void 0;
|
4 | const ethers_1 = require("ethers");
|
5 | class 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 |
|
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 | }
|
30 | exports.EthersProviderWrapper = EthersProviderWrapper;
|
31 |
|
\ | No newline at end of file |