File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
packages/eth-json-rpc-provider/src Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -145,9 +145,11 @@ export class InternalProvider<
145145 readonly #handle = async < Result extends Json > (
146146 jsonRpcRequest : JsonRpcRequest ,
147147 ) : Promise < JsonRpcResponse < Result > > => {
148- // @ts -expect-error - The signatures are incompatible between the legacy engine
149- // and server, but this works at runtime.
150- return await this . #server. handle ( jsonRpcRequest ) ;
148+ // This typecast is technicaly unsafe, but we need it to preserve the provider's
149+ // public interface, which allows you to typecast results.
150+ return ( await this . #server. handle (
151+ jsonRpcRequest ,
152+ ) ) as JsonRpcResponse < Result > ;
151153 } ;
152154
153155 readonly #handleWithCallback = (
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { InternalProvider } from './internal-provider';
1111 *
1212 * @param middleware - The middleware to construct a provider from.
1313 * @returns An Ethereum provider.
14- * @deprecated Use {@link providerFromMiddlewareV2} instead.
14+ * @deprecated Use `JsonRpcEngineV2` middleware and {@link providerFromMiddlewareV2} instead.
1515 */
1616export function providerFromMiddleware <
1717 Params extends JsonRpcParams ,
You can’t perform that action at this time.
0 commit comments