File tree 2 files changed +15
-2
lines changed
internal/builtin-plugins/network-manager/edr
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { LoggerConfig } from "./types/logger.js";
3
3
import type { TracingConfig } from "./types/node-types.js" ;
4
4
import type { EdrNetworkConfig } from "../../../../types/config.js" ;
5
5
import type {
6
+ EthSubscription ,
6
7
JsonRpcResponse ,
7
8
RequestArguments ,
8
9
SuccessfulJsonRpcResponse ,
@@ -332,13 +333,14 @@ export class EdrProvider extends BaseProvider {
332
333
}
333
334
334
335
#emitEip1193SubscriptionEvent( subscription : string , result : unknown ) {
335
- this . emit ( " message" , {
336
+ const message : EthSubscription = {
336
337
type : "eth_subscription" ,
337
338
data : {
338
339
subscription,
339
340
result,
340
341
} ,
341
- } ) ;
342
+ } ;
343
+ this . emit ( "message" , message ) ;
342
344
}
343
345
}
344
346
Original file line number Diff line number Diff line change @@ -88,6 +88,17 @@ export interface EthereumProvider extends EIP1193Provider {
88
88
) : void ;
89
89
}
90
90
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
+
91
102
/**
92
103
* A JSON-RPC 2.0 request object.
93
104
*
You can’t perform that action at this time.
0 commit comments