Is it possible to fetch transactions from any account within an anchor on-chain program (rust)? I have tried installing solana-client to use the RPC with anchor-lang = "0.25.0" but breaks the build. Is there an alternative? are we not supposed to read transactions at all within an Anchor program?

If that's the case feels like a huge blind spot for validating stuff :(

  • Are you trying to get the transcation using anchor on chain or off chain (js,ts,py)? Commented Sep 20, 2022 at 17:39
  • on-chain, I know js/ts and py can.
    – Ander
    Commented Sep 20, 2022 at 18:23

1 Answer 1


No. Solana is a state machine. An on-chain program cannot fetch transactions, but it can fetch the actual account data (state).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.