import { SubscribeBlockTracker } from 'eth-block-tracker' ; import ProviderEngine from 'web3-provider-engine' ; import { WebsocketProviderOptions } from 'web3-core-helpers' ; export default class PatchedSubscribeBlockTracker extends SubscribeBlockTracker { _handleSubData ( response ) { super . _handleSubData ( null , response ) ; } get provider ( ) { return this . _provider ; } } type Constructor = new ( ... args ) => { } ; function ExtendProviderEngine < TBase extends Constructor > ( Base ) { return class ExtendingProviderEngine extends Base { get blockTracker ( ) : PatchedSubscribeBlockTracker { return ( this as any ) . _blockTracker ; } } ; } export const ExtendedProviderEngine = ExtendProviderEngine ( ProviderEngine ) ; import { WebsocketProvider as TypedWebsocketProvider , default as UntypedWebsocketProvider , } from 'web3-providers-ws' ; export declare class TypedWebsocketProviderWithConstructor extends TypedWebsocketProvider { constructor ( host , options ? ) ; } export const WebsocketProvider = UntypedWebsocketProvider as unknown as TypedWebsocketProviderWithConstructor ;