Search code examples
blockchainsolana

get solana transaction-history for a given address - based on date range


I want to use Rust or Python to retrieve historical Solana transactions for a given wallet - in a specific date range.

There is the get_confirmed_signature_for_address2() which returns signatures for a given address, with an option to get signatures before a given signature.

But how can I find historical transactions using a specific timestamp?


Solution

  • getBlockTime will give you the estimated time for a given block

    getBlock will give the list of signatures in a specific block

    getSignatures will get you the signatures for an address 1000 at a time, before or after a given signature.

    Combine them with a binary search algorithm to find nearby timestamp