Feature / Add 'get_blocks_in_range' API method #3677
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds the new API method
get_blocks_in_range
to theblock_api
andcondenser_api
to enable requesting a specified range of blocks at once. The default query limit is set to 250 blocks, but it can be changed to a higher limit in the config.ini (for example, we can set it to 1000 withquery-limit-get-blocks-in-range = 1000
).Result
If all blocks in the requested range exist, the request result is an array of blocks and the first element of the returned array contains the first block of the range, the second the next one and so on.
In case an invalid range was requested or a block inside the range does not exist, a corresponding error message will be returned.
Examples
block_api
condenser_api