aeternity / ae_mdw

Aeternity Middleware in Elixir
26 stars 10 forks source link

Add counting of transactions for specific account with scoping #1943

Open vatanasov opened 2 weeks ago

vatanasov commented 2 weeks ago

Aescan requires information about count of transactions for specific account with scoping by height. /transactions/count can't take two filters and /accounts/{id}/transactions/count doesn't support filtering by height. Probably making the second one work would be more appropriate.

janmichek commented 2 weeks ago

For the feature I build for aescan, I would ideally filter by time. I would use 24hours window, actually.

yaboiishere commented 1 week ago

Would something similar to the way stats endpoint be ok for this?

janmichek commented 1 week ago

Would something similar to the way stats endpoint be ok for this?

Yeah, is the 24h window also possible like this per account? That would be ideal

yaboiishere commented 1 week ago

I think so, but the database might become way bigger. I'll try to implement it and see how it performs

yaboiishere commented 6 days ago

I'm doing the logic that counts the transactions, right now it only counts the transaction for an account when the account is the one that initiated the tx i.e the origin account. Valentin raised a good point that it might be better to count the transaction for each participating account. Which would you prefer?