Solana ‘Account not found’ when sending API request
This may seem like a simple issue but I am unsure how to fix ‘Account not found’ when I send a request to API to fetch user’s Solana balance. Any advice would be very helpful!
Error getting account info: Error: failed to get info about account ####(my Wallet): Error: 403 : {“jsonrpc”:”2.0″,”error”:{“code”: 403, “message”:”Access forbidden”}
Here’s more info on my current set up, I can connect my wallet, but when sending request to API about my wallet, it fails:
Wallet Connection Setup:
- Using @solana/wallet-adapter-react for wallet integration
- Currently configured for Mainnet (WalletAdapterNetwork.Mainnet)
- Using PhantomWalletAdapter with autoConnect enabled
- Connection settings: commitment ‘confirmed’, preflightCommitment
‘processed’
Balance Checking Process:
- Using getAccountInfo with ‘confirmed’ commitment
- Implementing retry logic (3 attempts with 1-second delays)
- Using getBalance with ‘confirmed’ commitment after account
verification - Refreshing balance every 2 seconds
Transaction Flow:
- Creating transaction with latest blockhash
- Using confirmed commitment for transaction operations
- Transaction timeout set to 60 seconds
- Implementing exponential backoff for status checks (10 retries)
Current Issue:
- Wallet connects successfully but getAccountInfo returns null
- Error suggests account not found despite wallet being connected
- This happens consistently even with retry logic
- All operations are configured for Mainnet to match user’s wallet
network
Key Environment Details:
Network: Solana Mainnet
RPC Endpoint: Using clusterApiUrl(network) from @solana/web3.js
WebSocket endpoint configured automatically from RPC URL
Using standard Solana Web3.js v1.x library