Skip to content

Conversation

@iamramtin
Copy link

This PR addresses the SolanaJSONRPCError: failed to get transaction: Method not found error by replacing the deprecated getConfirmedTransaction method with the getTransaction method.

Key changes:

  1. Replaced getConfirmedTransaction with getTransaction, including the commitment and maxSupportedTransactionVersion parameters to ensure compatibility with the latest Solana JSON RPC.
  2. Added error handling with a try/catch block for better stability and clearer logs.
  3. Cleaned up code with improved variable names and output formatting.

These updates should resolve the issue and improve the overall reliability of the client script.

Add cleanup and error handling

Signed-off-by: Ramtin Mesgari <26694963+iamramtin@users.noreply.github.com>
@iamramtin iamramtin force-pushed the fix-jsonrpc-method-not-found-error branch from c6f09e5 to aac2239 Compare April 20, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant