TLDR:Documentation Index
Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
Use this file to discover all available pages before exploring further.
@solana/web3.jsv1 derives the WSS URL from the HTTP URL via its internalmakeWebsocketUrlhelper. The derived URL does not match a Chainstack WSS endpoint, and any subscription call fails withUnexpected server response: 404or503.- Fix v1 by passing
wsEndpointexplicitly toConnection. - v1 is now legacy.
@solana/kitis the recommended SDK — it has no derivation bug because it takes RPC and subscription transports as separate inputs.
The WSS-derivation bug
When you callnew Connection(httpEndpoint) without a wsEndpoint, v1 routes the URL through makeWebsocketUrl — a helper that rewrites the scheme (https:// → wss://) and reshapes the host. The result does not match a Chainstack node’s WSS endpoint, so the first subscription call fails:
503 if the rewritten host resolves but the request hits a different upstream that returns 503 for the unknown path.
This bites only the v1 line, which is now on the maintenance branch — security fixes only, no new features. The same project, renamed and restructured, ships today as @solana/kit.
Fix: pass wsEndpoint explicitly
Find the HTTPS and WSS endpoints in your node access details (Manage your node) and pass both to Connection:
Better: migrate to @solana/kit
Per the official Solana docs, @solana/kit is now the recommended TypeScript SDK and @solana/web3.js is the legacy line. Kit takes RPC and subscription transports as separate inputs, so the derivation step that breaks v1 is gone:
@solana/web3-compat bridge lets you swap your @solana/web3.js import for @solana/web3-compat and migrate file by file onto Kit primitives. It is a Phase 0 release — supported surface is currently Connection methods, Keypair, Transaction/VersionedTransaction, and sendAndConfirmTransaction; anything else falls back to legacy v1. Keep the v1 dependency in your package.json until your usage fits inside the supported surface.
See also
- Solana tooling — modern Solana stack (Kit, Anchor 1.0, Codama, LiteSVM, Surfpool)
- Solana blockSubscribe 1009 error on WebSocket — fix
1009(MESSAGE_TOO_BIG) on large block pushes - Handle real-time data using WebSockets with JavaScript and Python