Phantom wallet 4900 disconnected or 4100 unauthorized? Connecting Solana wallets correctly
Phantom (and Solana wallet providers generally) return numbered errors that map to specific connection states. Get the sequence wrong and you'll see 4100 or 4900 — both fixable once you know which is which.
4100 Unauthorized: connect first
4100 unauthorized means the dApp isn't authorized yet — you tried to sign or send a transaction before the wallet approved the connection. The fix is sequencing:
Call connect() first, wait for the user to approve, then make the transaction request. Don't attempt signAndSendTransaction on a fresh page load before the connection handshake completes.
4900 Disconnected: it's the network, not permissions
4900 disconnected means Phantom couldn't connect to the network — the wallet is offline. This is not an authorization error (the common misread). Prompt the user to check their connection and reconnect, then retry once the wallet is back online.
The distinction matters: 4100 is a sequencing problem (connect before you transact), 4900 is a connectivity problem (wallet offline). Retrying a 4100 without connecting first just repeats it; retrying a 4900 works once the network is back.
-32603 deeplink
A -32603 on a deeplink flow is typically an environment issue (mainnet-only, a deprecated deeplink path). Prefer the current provider connection flow over deprecated deeplinks.
For agents using Solana wallets
diagnose_infra_error returns the phantom-solana family and tells the agent whether it's a connect-first sequencing issue or a genuine offline state — so it doesn't retry a 4100 without connecting or misread a 4900 as auth.
Machine-readable guide: https://snapback.sh/llms.txt · Tool discovery: https://snapback.sh/.well-known/mcp.json · MCP endpoint: https://api.snapback.sh/mcp. Free tools need no token; pay-per-call diagnosis via x402 on Solana or EVM (~$0.0032 USDC).