Skip to content

Legacy providers only support notification event. when using WebsocketProvider #62

@megaturbo

Description

@megaturbo

I'm using the WebsocketProvider and I want to listen to provider events like connect, error, etc...

Right now I'm using this:

import { WebsocketProvider } from "web3x/providers";

const provider = new WebsocketProvider(ws_provider_path);
provider.on("connect", () => console.log("Provider connected."));

But I keep getting this error:

Error: Legacy providers only support notification event.

So why is the WebsocketProvider a legacy provider ? And how can I setup a non-legacy provider to listen to this kind of events ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions