Skip to content

Feat/mirror node query api#145

Open
Aamir377300 wants to merge 2 commits into
hiero-ledger:mainfrom
Aamir377300:feat/mirror-node-query-api
Open

Feat/mirror node query api#145
Aamir377300 wants to merge 2 commits into
hiero-ledger:mainfrom
Aamir377300:feat/mirror-node-query-api

Conversation

@Aamir377300

Copy link
Copy Markdown
Contributor

This issue solve #140

Description

I worked on introducing a query-object-based API for the Mirror Node repositories to help avoid the growing number of repository method combinations as more filters get added over time.

Main Changes

For transactions, I added a TransactionQuery model that supports combinations of: Account, Transaction Type, Result, Limit, Order and Timestamp filters

I also added:

findAll(TransactionQuery query)

to TransactionRepository.


Additional Improvements(not mention in issue #140)

While implementing the transaction query flow, I noticed a few related areas where the same pattern would likely be needed for consistency across the Mirror Node client, so I extended the approach a bit further.

This includes:

  • adding AccountQuery and NftQuery
  • adding findAll(query) support for AccountRepository and NftRepository
  • introducing a shared Order enum for consistent sorting across repositories

I also updated the REST infrastructure to support dynamic and multi-value query parameters. This was especially useful for timestamp range filtering where multiple parameters such as gt and lt may need to be sent together.

Additionally, I expanded the JSON converter layer with toAccountInfos to support the new account query flow.


Verification

The project is compiling successfully across modules with:

./mvnw clean compile

Overall, I felt these additional changes helped make the query API more consistent and reusable across the Mirror Node client instead of solving it only for transactions.

I’d appreciate any feedback or suggestions on the approach and implementation. Thanks for reviewing!

Signed-off-by: Aamir377300 <belalaamirkhan@gmail.com>
Signed-off-by: Aamir377300 <belalaamirkhan@gmail.com>
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 this pull request may close these issues.

1 participant