Skip to content

Commit b675b23

Browse files
committed
fix: revert removal of EthSubscription type
1 parent 232c4f5 commit b675b23

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

v-next/hardhat/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { LoggerConfig } from "./types/logger.js";
33
import type { TracingConfig } from "./types/node-types.js";
44
import type { EdrNetworkConfig } from "../../../../types/config.js";
55
import type {
6+
EthSubscription,
67
JsonRpcResponse,
78
RequestArguments,
89
SuccessfulJsonRpcResponse,
@@ -332,13 +333,14 @@ export class EdrProvider extends BaseProvider {
332333
}
333334

334335
#emitEip1193SubscriptionEvent(subscription: string, result: unknown) {
335-
this.emit("message", {
336+
const message: EthSubscription = {
336337
type: "eth_subscription",
337338
data: {
338339
subscription,
339340
result,
340341
},
341-
});
342+
};
343+
this.emit("message", message);
342344
}
343345
}
344346

v-next/hardhat/src/types/providers.ts

+11
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ export interface EthereumProvider extends EIP1193Provider {
8888
): void;
8989
}
9090

91+
/**
92+
* A message emitted by the provider as a result of an eth_subscription.
93+
*/
94+
export interface EthSubscription {
95+
readonly type: "eth_subscription";
96+
readonly data: {
97+
readonly subscription: string;
98+
readonly result: unknown;
99+
};
100+
}
101+
91102
/**
92103
* A JSON-RPC 2.0 request object.
93104
*

0 commit comments

Comments
 (0)