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

Improved Filtering options #131

Merged
merged 8 commits into from
Sep 18, 2023
Merged

Improved Filtering options #131

merged 8 commits into from
Sep 18, 2023

Conversation

alexsporn
Copy link
Member

  • Added unlockableByAddress filter to /outputs/basic, /outputs/alias and outputs/nft routes which checks for the different address unlocks with an OR condition
  • Added new /outputs route that combines Basic, Alias and NFT outputs in the result. It supports some of the common filtering options including the above unlockableByAddress one.

pkg/server/routes.go Outdated Show resolved Hide resolved
@muXxer muXxer enabled auto-merge (squash) September 15, 2023 10:48
@alexsporn
Copy link
Member Author

2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/basic?address=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/basic?address=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (1.14ms)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/basic?expirationReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/basic?expirationReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (444.95µs)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/basic?storageDepositReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/basic?storageDepositReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (384µs)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/nft?address=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/nft?address=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (4.74ms)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/nft?address=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy&cursor=64bba6c3c268262aa92fea1cc830361b67d42939d39038621a18d66168812e462edc5f8c2800.1000
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/nft?address=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy&cursor=64bba6c3c268262aa92fea1cc830361b67d42939d39038621a18d66168812e462edc5f8c2800.1000 (1.78ms)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/nft?expirationReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/nft?expirationReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (437.91µs)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/nft?storageDepositReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/nft?storageDepositReturnAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (353.04µs)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/alias?governor=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/alias?governor=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (985.37µs)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs/alias?stateController=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs/alias?stateController=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (704.41µs)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs?unlockableByAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs?unlockableByAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (5.1ms)
2023/09/18 09:09:08 --> GET http://localhost:14265/api/indexer/v1/outputs?cursor=64bba5eaea219a40b17b1f8cae71b65ec9079081744a1bcda9961916a432cb5a7c4999872300.1000&unlockableByAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy
2023/09/18 09:09:08 <-- 200 http://localhost:14265/api/indexer/v1/outputs?cursor=64bba5eaea219a40b17b1f8cae71b65ec9079081744a1bcda9961916a432cb5a7c4999872300.1000&unlockableByAddress=rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy (2.56ms)
Sum: 1317
Combined: 1317
Equal: true

The sum of all requests equals the combined results, so it is looking good

@muXxer muXxer merged commit 03320ba into develop Sep 18, 2023
4 checks passed
@muXxer muXxer deleted the feat/improved-filtering branch September 18, 2023 07:17
muXxer pushed a commit that referenced this pull request Sep 18, 2023
* Improved Filtering options (#131)

* Added unlockableByAddress filter to basic, alias and nft routes which checks for the different address unlocks with an OR condition

* Added new outputs route that combines basic, alias and nft outputs in the result

* Bump version

* Fixed review comments

* used []bytes instead of types

* Finished cleaning up types

* Add possible fix for Postgres

* Fixed linter warnings

---------

Co-authored-by: shufps <[email protected]>

* Using hive.go/runtime/options (#132)

* Adapted inx-indexer to iota-core and 2.0

* Adapted to latest inx-app changes

* Renamed alias.go to account.go

* Fixed nil pointer crash

* Updated go.mod and Dockerfile

* Adding delegation output support

* Fixed some old mentions of aliases

* Added delegation routes to rest server

* Updated deps

* Re-enabled pruning index check

* Fixed after rebase

* Reduced the amount of diffs

* Reverted some changes due to merge

* Reverted rename to make diff smaller

* Fixed foundry account query filter

* linter fixes and change reverts

* Reverted some changes

---------

Co-authored-by: shufps <[email protected]>
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.

Improve Indexer API for wallet usecases
3 participants