Skip to content

Add an ?anchor= filter to GET /api/v1/liquidity/entries #92

Description

@Jagadeeshftw

📌 Description

GET /api/v1/liquidity/entries lists raw per-anchor entries with no filtering per the README, forcing clients to fetch and filter the entire list client-side even when they only care about one anchor's contributions (e.g. for an anchor detail page).

🧩 Requirements and context

  • Add an ?anchor= query param filtering entries to one anchor id.
  • Return an empty array (not 404) for a valid-format but unknown anchor id, consistent with other list endpoints.
  • Keep the unfiltered response shape identical when the param is absent.

🛠️ Suggested execution

  • Update routes/liquidity.ts and LiquidityService/LiquidityRepository to accept and apply the filter.
  • Add tests in routes/liquidity.test.ts for filtered vs. unfiltered results.
  • Update the README and src/openapi.ts.

✅ Acceptance criteria

  • ?anchor= returns only that anchor's entries.
  • Unfiltered behavior is unchanged.
  • Documented in OpenAPI and README.

🔒 Security notes

No new attack surface; read-only filter over already-public entry data.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueapiHTTP/WebSocket APIenhancementNew feature or improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions