Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Endpoint does not work (at least for cluster devnet) #157

Open
IsaacGluck opened this issue Jan 3, 2025 · 4 comments
Open

API Endpoint does not work (at least for cluster devnet) #157

IsaacGluck opened this issue Jan 3, 2025 · 4 comments

Comments

@IsaacGluck
Copy link

The Helius api endpoint (at least for cluster devnet) https://api-devnet.helius-rpc.com (as defined in helius-labs/helius-sdk/blob/main/src/utils/get-helius-endpoints.ts) does not seem to work.

The endpoint https://api.helius.xyz as specified in the docs (e.g. here) works.

@peperuney
Copy link

bump this

@peperuney
Copy link

my cluster registration for devnet is having issues for webhooks

@0xIchigo
Copy link
Contributor

gm @IsaacGluck! I apologize for the inconvenience. Are you still running into this issue? What calls are you making on devnet?

@IsaacGluck
Copy link
Author

gm @IsaacGluck! I apologize for the inconvenience. Are you still running into this issue? What calls are you making on devnet?

Hey @0xIchigo thanks for getting back to me. I wasn't able to make any calls to the api via the sdk successfully.

It looks like under the hood the sdk is using the URL https://api-devnet.helius-rpc.com which doesn't work. When I send requests directly to https://api.helius.xyz/v0 (which I got from the Helius docs), however, it works.

For example:

const helius = new Helius(process.env.HELIUS_API_KEY, 'devnet');
await helius.getAllWebhooks();

>>> Request failed with status code 404

VS

const HELIUS_BASE_URL = 'https://api.helius.xyz/v0';

const heliusGet = <QueryParams, ReponseBody>(
  route: string,
  params?: QueryParams
): Promise<AxiosResponse<ReponseBody>> => axios.get<ReponseBody>(HELIUS_BASE_URL + route, {
    headers: HELIUS_HEADERS,
    params: {
      'api-key': process.env.HELIUS_API_KEY,
      ...params
    },
  });

await heliusGet<void, Webhook[]>(`/webhooks`).then((res) => res.data);

>>> Success [...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants