Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to get recent blockhash #242

Open
jude98 opened this issue Sep 4, 2024 · 2 comments · May be fixed by #243
Open

Error: Failed to get recent blockhash #242

jude98 opened this issue Sep 4, 2024 · 2 comments · May be fixed by #243

Comments

@jude98
Copy link

jude98 commented Sep 4, 2024

I’ve integrated Solana Pay into my application, and it has been working smoothly until recently. However, I’ve started encountering the following error:

Error: failed to get recent blockhash: SolanaJSONRPCError: failed to get recent blockhash: Method not found
    at Connection.getRecentBlockhash

This issue arises when calling the createTransfer method:

const transaction = await createTransfer(
 connection,
 provider.publicKey,
 {
   recipient,
   amount,
   splToken,
   reference,
 },
 { commitment: "confirmed" }
);

Environment

  • Network: Devnet
  • RPC Provider: Helius RPC
  • Commitment Level: confirmed
  • Library: Solana Pay ("@solana/pay": "^0.2.5")

It appears that getRecentBlockhash has been deprecated, and this method is still being used internally when creating a transfer transaction. This may be leading to compatibility issues, particularly with newer RPC providers like Helius.

@Majidrazaee
Copy link

Majidrazaee commented Sep 4, 2024 via email

@0x2539
Copy link

0x2539 commented Sep 16, 2024

Hey @jude98 I've added a PR that fixes this issue, if you need this urgently, change the version in your package.json to: "@solana/pay": "https://gitpkg.vercel.app/0x2539/solana-pay/core?fix/latest-blockhash-build"

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 a pull request may close this issue.

3 participants