Skip to content

Add a batch key metadata endpoint to fetch details for multiple key IDs in a single request #813

Description

@Chucks1093

Summary

The batch buy feature on the client requires metadata for multiple keys simultaneously. Fetching them one by one causes a waterfall of requests. A POST /keys/batch endpoint accepting an array of key IDs and returning their metadata in a single response would eliminate this.

Scope

  • Add POST /keys/batch endpoint accepting { ids: string[] } in the request body
  • Validate that the array contains between 1 and 20 key IDs
  • Return an array of key metadata objects in the same order as the input IDs
  • For IDs that do not exist return null in the corresponding position
  • Cache individual key metadata in Redis for 60 seconds and serve from cache when available

Acceptance Criteria

  • Returns metadata for all valid IDs in input order
  • Unknown IDs return null in the corresponding position
  • More than 20 IDs returns 400
  • Empty array returns 400
  • Cached metadata served without a database query

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions