op-energy-foundation / op-energy-blockspan-service

0 stars 0 forks source link

Add new Links to filter strikes based on range queries #13

Closed Natsvora closed 3 months ago

Natsvora commented 3 months ago

Description:

hashstrikes/strikes-range?startblock=xxxxx&endblock=xxxxxx hashstrikes/strikes-range?startTime=xxxxx&endTime=xxxxxx hashstrikes/strikes-range?startblock=xxxxx&endTime=xxxxxx hashstrikes/strikes-range?startTime=xxxxx&endblock=xxxxxx

Link names: Strikes List with start and end block Strikes List with start block and endtime

General Idea:

In terms of filtering the strikes, I can see any combination of these 4 parameters

?strikeStartBlock=#block# ?strikeEndBlock=#block# ?strikeStartTime=#time# ?strikeEndTime=#time#

if both start time and start block are provided, the earlier should be used, and if both end time and end block are provided, the latest should be used. (though sounds a bit complicated to code I admit — that's an argument for providing it from the API, I think it'll be easier in haskell)

if start but not end is provided, end should be the latest possible strike, and if end but not start is provided, start should be 0.

dambaev commented 3 months ago

wrong repo