rpcpool / yellowstone-grpc

solana geyser grpc service
GNU Affero General Public License v3.0
205 stars 92 forks source link

Typescript client has TypeError: Client is not a constructor #428

Open samuel-kinetic opened 6 days ago

samuel-kinetic commented 6 days ago

When I trying with the steps on https://docs.triton.one/project-yellowstone/dragons-mouth-grpc-subscriptions#nodejs-typescript, and save the following content in get-version.ts:

import Client from "@triton-one/yellowstone-grpc";

const main = async () => {
    const client = new Client(
        "http://some-grpc.host.com",
        "some-key", {
            "grpc.max_receive_message_length": 64 * 1024 * 1024 // 64 MB
        });

    // now you can call the client methods, e.g.:

    const version = await client.getVersion(); // gets the version information
    console.log(version);
}

main();

And I got the following error when running npx esrun get-version.ts:

  const client = new Client(
                 ^

TypeError: Client is not a constructor

Am I missing anything from the doc and how could we solve?

Pleidak commented 5 days ago

I am having the same problem, I asked solana.stackexchange but no help. Did you get a fix and what version are you using?

samuel-kinetic commented 4 days ago

Not fixed yet, still have the problem from my side.