Type Alias WatchBlocksParameters<TTransport, TChain, TIncludeTransactions, TBlockTag>

WatchBlocksParameters<TTransport, TChain, TIncludeTransactions, TBlockTag>: {
    onBlock: OnBlock<TChain, TIncludeTransactions, TBlockTag>;
    onError?: ((error: Error) => void);
} & ((GetTransportConfig<TTransport>["type"] extends "webSocket"
    ? {
        blockTag?: undefined;
        emitMissed?: undefined;
        emitOnBegin?: undefined;
        includeTransactions?: undefined;
        poll?: false;
        pollingInterval?: undefined;
    }
    : never) | {
    blockTag?: TBlockTag | BlockTag;
    emitMissed?: boolean;
    emitOnBegin?: boolean;
    includeTransactions?: TIncludeTransactions;
    poll?: true;
    pollingInterval?: number;
})

Type Parameters

Type declaration

  • onBlock: OnBlock<TChain, TIncludeTransactions, TBlockTag>

    The callback to call when a new block is received.

  • OptionalonError?: ((error: Error) => void)

    The callback to call when an error occurred when trying to get for a new block.

      • (error): void
      • Parameters

        Returns void