Skip to content

Add all-in-one Solana RPC plugins#185

Merged
lorisleiva merged 1 commit into
mainfrom
04-12-add_all-in-one_solana_rpc_plugins
Apr 14, 2026
Merged

Add all-in-one Solana RPC plugins#185
lorisleiva merged 1 commit into
mainfrom
04-12-add_all-in-one_solana_rpc_plugins

Conversation

@lorisleiva
Copy link
Copy Markdown
Member

This PR adds solanaRpc, solanaMainnetRpc, solanaDevnetRpc, and solanaLocalRpc — all-in-one plugins that set up a full Solana RPC client with RPC connection, subscriptions, minimum balance computation, transaction planning, and transaction execution in a single call. Cluster-specific presets provide sensible defaults and the devnet/local variants include airdrop support.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 12, 2026

🦋 Changeset detected

Latest commit: 05f04fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@solana/kit-plugin-rpc Minor
@solana/kit-client-rpc Minor
@solana/kit-plugins Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lorisleiva
Copy link
Copy Markdown
Member Author

@trevor-cortex

Copy link
Copy Markdown

@trevor-cortex trevor-cortex left a comment

Choose a reason for hiding this comment

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

Summary

This PR adds four all-in-one plugins (solanaRpc, solanaMainnetRpc, solanaDevnetRpc, solanaLocalRpc) that compose existing lower-level plugins into a single .use() call, giving users a complete Solana RPC client with connection, subscriptions, minimum balance, transaction planning, and execution. Cluster-specific presets provide sensible defaults, and devnet/local variants include airdrop support.

Notes

Clean implementation — the composition via pipe reusing existing plugins is well-structured. The new @solana/kit-plugin-instruction-plan workspace dependency makes sense for planAndSendTransactions.

Looks good to me — a couple of minor observations below, but nothing blocking.

For subsequent reviewers

  • The solanaMainnetRpc function accepts SolanaRpcConfig<string> and casts to SolanaRpcConfig<MainnetUrl> internally — worth verifying this gives the expected type-narrowing downstream.
  • The DefaultRpcSubscriptionsChannelConfig import is now unused in the new code section (it's still used by the deprecated rpc function below, so it's fine for now).
  • Tests are structural only (checking properties exist) — no integration tests hitting real RPCs, which is reasonable for this layer.

Comment thread packages/kit-plugin-rpc/src/solana-rpc.ts
Comment thread packages/kit-plugin-rpc/src/solana-rpc.ts
Copy link
Copy Markdown
Member

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

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

Nice!

Comment on lines +91 to +94
pipe(
client,
solanaRpcConnection<TClusterUrl>(config.rpcUrl, config.rpcConfig),
solanaRpcSubscriptionsConnection<TClusterUrl>(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I didn't realise you could use pipe to compose plugins like this, that's really nice!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah createClient is just a fancy pipe. In fact I tried using createClient first here but it made the types way more complicated than they need to be (because of the async conditionals) so I thought it'd make more sense to stick to pipes for internal plugin compositions.

Copy link
Copy Markdown
Member Author

lorisleiva commented Apr 14, 2026

Merge activity

  • Apr 14, 5:32 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 14, 5:35 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 14, 5:36 PM UTC: @lorisleiva merged this pull request with Graphite.

@lorisleiva lorisleiva changed the base branch from 04-12-add_granular_rpc_connection_plugins_and_deprecate_rpc___localhostrpc_ to graphite-base/185 April 14, 2026 17:33
@lorisleiva lorisleiva changed the base branch from graphite-base/185 to main April 14, 2026 17:34
This PR adds `solanaRpc`, `solanaMainnetRpc`, `solanaDevnetRpc`, and `solanaLocalRpc` — all-in-one plugins that set up a full Solana RPC client with RPC connection, subscriptions, minimum balance computation, transaction planning, and transaction execution in a single call. Cluster-specific presets provide sensible defaults and the devnet/local variants include airdrop support.
@lorisleiva lorisleiva force-pushed the 04-12-add_all-in-one_solana_rpc_plugins branch from c3a25da to 05f04fc Compare April 14, 2026 17:35
@lorisleiva lorisleiva merged commit 5954d7b into main Apr 14, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 14, 2026
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