Skip to content

Fix blockhash retrieval error by upgrading @solana/web3.js to ^1.98.0 #26

Description

@iamramtin

Problem:

When using older versions of @solana/web3.js (such as 1.33.0), the following error occurs:

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

This error is caused by the removal of the getRecentBlockhash method in Solana RPC, which older versions of @solana/web3.js attempt to call.

Solution:

Upgrade @solana/web3.js to version ^1.98.0, which resolves the error by using the updated getLatestBlockhash method in the Solana RPC.

Steps to Reproduce:

  1. Use an older version of @solana/web3.js (e.g., 1.33.0).
  2. Attempt to send a transaction using sendAndConfirmTransaction.
  3. Receive the error: failed to get recent blockhash: Method not found.

https://www.quicknode.com/docs/solana/getRecentBlockhash

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions