Amine
Amine

Reputation: 31

How do i get all transactions in an account without going through all the blocks?

How do i fetch all the transactions in a specific NEAR accounts without going through all the blocks like the example here : https://docs.near.org/docs/api/naj-cookbook#recent-transaction-details

I'm trying to show the transactions in react and fetching all the blocks takes too much time

Upvotes: 2

Views: 1342

Answers (1)

khorolets
khorolets

Reputation: 726

It's impossible to do through the API. It is possible to get with SQL query from public PostgreSQL database of the Indexer for Explorer

https://github.com/near/near-indexer-for-explorer#shared-public-access

However, the access is shared across everyone and has a very limited number of connections. So it's not the most reliable solution if you're building some project and need to do such queries regularly.

So if you need to get all transactions for the account regularly you will need to write and run your own indexer that stores data you need in some database so you can access it on regular basis.

Useful links:

Upvotes: 2

Related Questions