Skip to content

Add utils ledger-date endpoint with validation and tests#237

Merged
Sulex45 merged 1 commit into
stellarkit-lab-devtools:mainfrom
Mayorlay:commiti
Jun 2, 2026
Merged

Add utils ledger-date endpoint with validation and tests#237
Sulex45 merged 1 commit into
stellarkit-lab-devtools:mainfrom
Mayorlay:commiti

Conversation

@Mayorlay
Copy link
Copy Markdown

@Mayorlay Mayorlay commented Jun 2, 2026

Description

Added a new utility API endpoint:

  • GET /utils/ledger-date?sequence=12345

It returns:

  • sequence
  • estimatedDate
  • note

The estimate is based on the latest ledger close time and an approximate average Stellar ledger close interval of ~5 seconds.

Also added validation:

  • rejects non-positive integers
  • rejects invalid sequence formats

Tests were added in api.test.js for valid and invalid requests.

@Sulex45 Sulex45 merged commit a6a140f into stellarkit-lab-devtools:main Jun 2, 2026
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.

2 participants