Near Api to fetch all the transactions of an address till date or at any particular blockheight

Viewed 389

I found a api "view_account" method using which i can fetch the balance of an address at a particular blockheight. Is there any Api or a way where i pass an address and it provides all the supporting transactions for the balance.

1 Answers

NEAR Protocol nodes do not store the data in that way, and it would be unrealistic to do so for all the use-cases out there, so the solution is to index the network block by block. There is an official Indexer Framework based on the official NEAR node implementation (nearcore), or you can use JSON RPC and build it yourself. There is an official Indexer for Explorer, which stores the data in PostgreSQL database (see the schema in the README), and we have a public shared read-only replica available for everyone out there to play with.

Flux implemented an indexer for their needs (also based on Indexer Framework): flux-capacitor

Related