blitz_api icon indicating copy to clipboard operation
blitz_api copied to clipboard

Add endpoint to give me a list of recent transactions

Open cstenglein opened this issue 4 years ago • 3 comments
trafficstars

E.g. like in the mock-backend

cstenglein avatar Oct 16 '21 14:10 cstenglein

I've pushed the first version of this endpoint to the repo. As discussed, it currently is super inefficient. It fetches all invoices, payments and transactions each time the endpoint is hit. Need to find a better way to cache this. Possibly it is a good idea to build this list once on startup and keep it updated when new transactions roll in. All the functionality is there.

We'll keep this issue open until I've implemented the improvements.

fusion44 avatar Nov 02 '21 18:11 fusion44

@rootzoll important issue

Transactions show up but new transactions need to be provided over SSE as well.

cstenglein avatar Nov 22 '21 13:11 cstenglein

As discussed today this is not an easy task to implement, as it won't work when multiple clients are connected to the SSE endpoint. To make that work we'd have to track a state for each connected client and handle the data accordingly.

Workaround: Client side receives new onchain tx and payments from the SSE endpoint in their native formats, which then must be manually parsed to the unified transaction format.

fusion44 avatar Nov 22 '21 21:11 fusion44