Skip to content

Conversation

@kalabukdima
Copy link
Contributor

Add `/resolve-timestap` to portal API
@mo4islona
Copy link

Path is not very canonical

GET /datasets/<dataset>/resolve-timestamp/<timestamp>

I would suggest something like

GET /datasets/<dataset>/timestamps/<timestamp>/block

Meaning: “Give me the block that corresponds to this timestamp.”

@belopash
Copy link

belopash commented Dec 7, 2025

Nut sure if it should be 404, sometimes it's inconvinient to work with error codes. Maybe should be something like

{ "blockNumber": null }

also probably we should return hash + number instead of just number

@belopash belopash self-requested a review December 7, 2025 08:47
@kalabukdima
Copy link
Contributor Author

Nut sure if it should be 404, sometimes it's inconvinient to work with error codes. Maybe should be something like

{ "blockNumber": null }

How about just null in the response so that it's always an optional number? We already have top-level null returned from /head in case of missing data. I understand that JSON object would be more extensible, but I don't see why this endpoint may ever get more complicated than that.

also probably we should return hash + number instead of just number

Why do we need a hash?

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.

5 participants