Skip to content

Add QuickNode add-on helpers, exports, tests, and cluster feature wiring#20

Open
RachitSrivastava12 wants to merge 5 commits into
solanakite:mainfrom
RachitSrivastava12:main
Open

Add QuickNode add-on helpers, exports, tests, and cluster feature wiring#20
RachitSrivastava12 wants to merge 5 commits into
solanakite:mainfrom
RachitSrivastava12:main

Conversation

@RachitSrivastava12

Copy link
Copy Markdown

Summary

This PR adds QuickNode add-on support to Kite as an additive extension, without changing the existing core helper APIs.

The main work is:

  • adding a dedicated QuickNode helper module
  • exporting the new QuickNode factories from the package entrypoint
  • adding/updating tests for the QuickNode helper surface
  • fixing cluster feature-flag wiring so createKitePlugin actually respects cluster config instead of hardcoding the transaction feature flags

What was added

QuickNode helper support was added in:

  • src/lib/quicknode.ts

Exports were added in:

  • src/index.ts

Tests were added/updated in:

  • src/tests/quicknode.test.ts

Cluster/config cleanup was done in:

  • src/lib/clusters.ts
  • src/lib/connect.ts

QuickNode functionality covered

Free add-ons:

  • Solana Priority Fee API
  • Metaplex DAS API
  • OpenOcean V4 Swap API
  • Pump.fun swap support through Metis
  • Solana MEV Protection / Resilience send path handling

Paid add-on helper surface:

  • Stablecoin balances
  • Metis Jupiter swap helpers
  • Jito helpers
  • Iris
  • GoldRush
  • Titan
  • Scorechain

Yellowstone was intentionally not included.

Important fixes made

1. Real endpoint/path corrections

Several helper paths and payload assumptions were updated to match real QuickNode behavior:

  • Metis/Jupiter helpers were aligned to the current /quote and /swap routes
  • Pump.fun swap was aligned to the Metis-style /pump-fun/swap route
  • OpenOcean was updated to use the actual QuickNode add-on path:
    • /addon/807/v4/solana/...
  • OpenOcean amount handling was updated to support conversion into amountDecimals
  • OpenOcean response parsing was updated to match the real wrapped response shape

2. MEV send path correction

The Merkle/Blink helpers were changed to use the real exposed sendTransaction path instead of unsupported custom RPC method assumptions.

3. Cluster feature wiring

createKitePlugin was previously hardcoding transaction feature flags to false.
This PR updates that wiring so known cluster config features are actually respected.

4. Export surface cleanup

Unsupported Pump.fun market-data helper exports were removed from the public package surface so the PR does not claim undocumented functionality.

Validation performed

Build verification

  • npm run build passes

Live verification performed

Live checks were performed against a real QuickNode endpoint for the free add-ons / free-access paths:

  • Priority Fee
  • DAS
  • wallet token accounts
  • OpenOcean quote
  • Metis quote
  • Pump.fun swap endpoint reachability
  • MEV protected send path reachability

What was not fully live-tested

Paid add-ons were not fully live-tested end-to-end because no paid-enabled endpoint was available in this validation pass.

Also not fully proven end-to-end:

  • funded signed transaction execution through MEV routes
  • full swap execution with a funded burner wallet

Notes

This PR is additive and is intended to extend Kite’s QuickNode support without changing unrelated existing functionality.

- getQuickNodePriorityFeesFactory: fetches live fee estimates from
  QuickNode's qn_estimatePriorityFees API with 5 levels (low/medium/
  recommended/high/extreme) plus network congestion score
- getAssetsByOwnerFactory: queries NFTs, cNFTs and tokens via
  QuickNode's Metaplex DAS API
- getAssetFactory: fetches full details for a single digital asset

Both add-ons are FREE on QuickNode endpoints.
Enable at: https://dashboard.quicknode.com

@mikemaccana mikemaccana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work Rachit! I really appreciate how comprehensive this is. I have a few changes suggested but once they're done we should be able to get this in soon!

Comment thread src/lib/clusters.ts Outdated
isNameKnownToSolanaExplorer: false,
// TODO: add support for QuickNode priority fee API
// QuickNode exposes a separate qn_estimatePriorityFees helper API, but
// the core smart-transaction path still uses standard recent fee fallback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding support here! We actually think it's awesome - anyone with a Quicknode RPC should use it by default! Please add:

supportsQNEstimatePriorityFees: true

And update the PR so Quicknode users use it!

Comment thread src/lib/connect.ts Outdated
const {
webSocketURL: derivedWsUrl,
features,
} = getClusterDetailsFromClusterConfig(clusterName, clusterDetails);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a formatting change - please use the existing formatting settings, otherwise the PR has a bunch of noise in it.

Comment thread src/lib/connect.ts Outdated

let supportsGetPriorityFeeEstimate = false;
let needsPriorityFees = false;
let enableClientSideRetries = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are you moving these?

Comment thread src/lib/quicknode.ts Outdated
@@ -0,0 +1,1966 @@
/**
* QuickNode-specific helpers for Kite

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lowercase 'n' (yes we changed it) - just 'Quicknode' now!

Please fix this everywhere!

Comment thread src/lib/quicknode.ts Outdated
* Get a free endpoint at: https://dashboard.quicknode.com
*
* Add-ons used:
* - Solana Priority Fee API (FREE) → getQuickNodePriorityFeesFactory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The FREE/PAID will change over time - best to keep it in one place - remove it from here and just let the dashboard determine what's free and paid.

Comment thread src/lib/quicknode.ts Outdated
outAmount: string;
minOutAmount: string;
price_impact?: string;
priceImpact?: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This API is stupid. You should explicitly call it out for having price_impact and priceImpact, tell me if one or the other is deprecated, add a URL to the github issue where you have raised this as a bug.

Comment thread src/lib/quicknode.ts Outdated
inAmount: quote.inAmount,
outAmount: quote.outAmount,
minOutAmount: quote.minOutAmount,
priceImpact: quote.price_impact ?? quote.priceImpact ?? "0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is good. Postel's law.

Just add a comment saying // This API sucks, see comment above or similar.

Comment thread src/lib/quicknode.ts Outdated
name: quote.inToken.name,
symbol: quote.inToken.symbol,
decimals: quote.inToken.decimals,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you not do inToken = quote.inToken and outToken = quote = quote.outToken?

Comment thread src/lib/quicknode.ts Outdated
groupKey: "collection",
groupValue: options.collectionMint,
limit: options.limit ?? 100,
page: options.page ?? 1,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't line up code like this. Just use prettier. Have your editor format on save.

Comment thread src/lib/quicknode.ts Outdated
return isQuickNodeRpcUrl(normalized) ? "https://public.jupiterapi.com" : normalized;
};

const resolveOpenOceanBase = (endpointUrl: string) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK this file is getting too large - I want you to chaneg the PR so:

lib/quicknode/addons/openocean.ts
lib/quicknode/addons/openocean.test.ts

Claude will do this for you easily!

@RachitSrivastava12

Copy link
Copy Markdown
Author

Hey @mikemaccana i’ve updated the PR and applied the changes:

  1. added supportsQNEstimatePriorityFees to the cluster config and wired Quicknode clusters to use qn_estimatePriorityFees by default in the priority-fee path, with fallback to recent prioritization fees

  2. cleaned up the connect.ts changes to reduce formatting noise and keep the flag wiring local

  3. updated descriptive QuickNode prose/comments to Quicknode without renaming the public API surface

  4. removed FREE / PAID labels from code comments so tiering stays defined by the dashboard

  5. renamed the JSON-RPC helper argument from method to rpcMethod and deduplicated shared JSON response parsing between the RPC and REST helpers

  6. replaced the old base helper with stripTrailingSlash, switched it to URL-based handling, added the regex comment/examples, renamed whole / fraction to major / minor, and added clearer normalization comments

  7. documented the OpenOcean price_impact / priceImpact inconsistency, linked the upstream issue, kept the compatibility fallback, and reduced repetition in the mapper by destructuring inToken / outToken

  8. removed hand-aligned spacing in quicknode.ts and normalized those blocks to the repo’s existing formatting style

  9. split the OpenOcean add-on into src/lib/quicknode/addons/openocean.ts and src/lib/quicknode/addons/openocean.test.ts, while keeping the public exports unchanged through src/lib/quicknode.ts

  10. added src/tests/openocean.test.ts so the moved OpenOcean tests still run under the repo’s existing test script, and npm run build passes locally

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.

2 participants