symbol / catapult-rest

Catapult REST combines HTTP and WebSockets to perform read and write actions on the blockchain
https://docs.symbolplatform.com/api.html
43 stars 32 forks source link

Allow Integer filtering by block height #625

Open orisdorch opened 3 years ago

orisdorch commented 3 years ago

Height is presently only filterable as a string. The ability to filter height as an integer would be more functional.

Sample use cases:

This would be particularly useful for blockchain monitoring when CLI installation isn't an option or adds unnecessary complexity - i.e. when attempting to integrate with SAAS or cloud based workflow automation platforms (like Microsoft Power Automate).

rg911 commented 3 years ago

Height on-chain is uint64, (long in java), the consideration is when the height reaches the max int32 we then have the problem. In rest, it is using nodejs's native Long type, basic arithmetic can be done, but agree that there are limitations for the current rest gateway.

orisdorch commented 3 years ago

Looks like this issue was worked around by adding fromHeight and toHeight to some calls (i.e. http://localhost:3000/statements/transaction - https://docs.symbolplatform.com/symbol-openapi/v1.0.0/#operation/searchReceipts), but not others (i.e. http://localhost:3000/statements/resolutions/address- https://docs.symbolplatform.com/symbol-openapi/v1.0.0/#operation/searchAddressResolutionStatements).

If this is the chosen solution, perhaps we can extend it to all requests that permit the height parameter?