Skip to content

Conversation

@mikejhale
Copy link
Contributor

@mikejhale mikejhale commented Dec 22, 2025

  • Update Jupiter Price API to v3
  • Add NEXT_PUBLIC_JUPITER_API_KEY to .env.example
  • Rebrand to Quicknode
  • Update Next (patched)
  • Update README.md

Note

Introduces a server-side price proxy and rebrands UI copy/assets.

  • Add GET /api/price that proxies Jupiter Price API v3 with x-api-key from JUPITER_API_KEY; returns {[address]: {usdPrice,...}}
  • Update utils/solana/price.ts to v3 schema; UI (StakingForm) now polls /api/price and reads usdPrice for SOL→USD
  • Add JUPITER_API_KEY to .env.example; refine .gitignore to ignore .env.* but keep .env.example
  • Rebrand “QuickNode” → “Quicknode” across UI copy and alt text; replace public/quicknode.svg
  • Minor UI/infra tweaks: title/description casing, suppressHydrationWarning in layout, README instructions; patch dependency updates (Next, ESLint, Tailwind)

Written by Cursor Bugbot for commit 0be11d7. This will update automatically on new commits. Configure here.

const response = await fetch(url);
const apiKey = process.env.NEXT_PUBLIC_JUPITER_API_KEY;
if (!apiKey) {
throw new Error("JUPITER_API_KEY is not set in environment variables");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message references wrong environment variable name

The error message thrown when the API key is missing says "JUPITER_API_KEY is not set in environment variables" but the actual environment variable being checked is NEXT_PUBLIC_JUPITER_API_KEY. This misleading message would cause developers to set the wrong variable name when troubleshooting.

Fix in Cursor Fix in Web

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems likeNEXT_PUBLIC prefix a way for Next to warn us it's going to expose the variable - we wouldn't want to do that, see https://nextjs.org/docs/app/guides/environment-variables

Can we just use process.env.JUPITER_API_KEY and make this server-only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this change after this commit already. It is server-only and I moved the Price API call to api:

const apiKey = process.env.JUPITER_API_KEY;
    if (!apiKey) {
      return NextResponse.json(
        { error: "JUPITER_API_KEY is not set in environment variables" },
        { status: 500 }
      );
    }

Copy link

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a security issue with the API key (see the comment) but looks good once that's resolved. 👍

const url = new URL(JUPITER_PRICE_ENDPOINT);
url.searchParams.set("ids", WRAPPED_SOL_ADDRESS);

const apiKey = process.env.JUPITER_API_KEY;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we throw earlier (ie, as soon as the server starts) if the environment variable isn't set, rather than waiting for an incoming GET?

const response = await fetch(url);
const apiKey = process.env.NEXT_PUBLIC_JUPITER_API_KEY;
if (!apiKey) {
throw new Error("JUPITER_API_KEY is not set in environment variables");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems likeNEXT_PUBLIC prefix a way for Next to warn us it's going to expose the variable - we wouldn't want to do that, see https://nextjs.org/docs/app/guides/environment-variables

Can we just use process.env.JUPITER_API_KEY and make this server-only?

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

Successfully merging this pull request may close these issues.

3 participants