A Connection is the object you use to talk to a Solana node over JSON-RPC.
You point it at an RPC endpoint (devnet/testnet/mainnet or a custom URL) and then use it to read chain state and send/simulate transactions.
We provide a helper method to allow you to create a Solana Connection given some network data.
Usage
Derive the connection from useGetActiveNetworkData, which automatically re-fetches when the wallet account changes or the user switches networks:
Last modified on September 21, 2026