Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable transactions count multiple filters #2054

Closed
janmichek opened this issue Dec 27, 2024 · 6 comments · Fixed by #2074
Closed

Enable transactions count multiple filters #2054

janmichek opened this issue Dec 27, 2024 · 6 comments · Fixed by #2074
Assignees

Comments

@janmichek
Copy link

https://mainnet.aeternity.io/mdw/v3/transactions/count?scope=time:1734600720-1734687120&type=spend

error "invalid query: can't query by multiple filters and/or invalid filters"

But that's exactly what I want .] please enable filtering by multiple filters / combined parameters

@yaboiishere
Copy link
Contributor

I've looked into this and sadly it won't be as easy as removing the restriction. This is due to a limitation in the current implementation, where in order to have the API respond within reasonable time we count differently depending on the filters. If it's a filter by time/gen we can derive the count, but it it's by type/type_group we have to check in a table that keeps track of the count of all transaction types

@janmichek
Copy link
Author

janmichek commented Jan 21, 2025

Aha, thanks for input.
This is the use case I am trying to achieve
https://pr-993-aescan-testnet.stg.service.aepps.com/transactions try to filter both by date and type
Maybe it will spark some idea for you

for now you wont see the counter as its temporarily hidden for combined params

@yaboiishere
Copy link
Contributor

While figuring out how to implement this I stumbled upon this endpoint https://mainnet.aeternity.io/mdw/swagger/#/default/GetTransactionsStats which is more or less what I was implementing. Would that endpoint work for you? It allows you to filter by type and date.

@janmichek
Copy link
Author

I have checked that. Its not going to work as the data are grouped by interval

@yaboiishere
Copy link
Contributor

I've added a modified stats endpoint for the transactions. It works like the normal one, except it returns the summed up count of all the intervals. Once it's deployed it will be available at /v3/stats/transactions/total

@janmichek
Copy link
Author

That should probably work good enough, thanks. Waiting for the deployment then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants