Add all-in-one Solana RPC plugins#185
Conversation
🦋 Changeset detectedLatest commit: 05f04fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
trevor-cortex
left a comment
There was a problem hiding this comment.
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
solanaMainnetRpcfunction acceptsSolanaRpcConfig<string>and casts toSolanaRpcConfig<MainnetUrl>internally — worth verifying this gives the expected type-narrowing downstream. - The
DefaultRpcSubscriptionsChannelConfigimport is now unused in the new code section (it's still used by the deprecatedrpcfunction 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.
| pipe( | ||
| client, | ||
| solanaRpcConnection<TClusterUrl>(config.rpcUrl, config.rpcConfig), | ||
| solanaRpcSubscriptionsConnection<TClusterUrl>( |
There was a problem hiding this comment.
I didn't realise you could use pipe to compose plugins like this, that's really nice!
There was a problem hiding this comment.
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.
Merge activity
|
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.
c3a25da to
05f04fc
Compare

This PR adds
solanaRpc,solanaMainnetRpc,solanaDevnetRpc, andsolanaLocalRpc— 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.