Skip to content

Feature: add status/token filtering to GET /streams and GET /streams/analytics #6

Description

@ijeoma270

GET /streams only filters by address right now. The analytics endpoint has the same problem, it always aggregates across every status and every token, and totalRatePerSecond actually sums rates across all active streams regardless of token, which mixes units together if a wallet has both XLM and USDC streams going at once. There's no way to just ask for someone's active streams, or just their USDC ones, without pulling everything back and filtering it yourself on the client.

Add status and token as query params on both the list endpoint and the analytics endpoint, and let them combine with the existing address filter. On analytics specifically, when a token is passed in, the rate total should only cover that token instead of mixing them.

Relevant file is streams.controller.ts.

Before submitting your PR, make sure all checks pass locally and the build succeeds. Each issue will be thoroughly reviewed and only merged if it fully meets the requirements. In your PR, specify the issue number and title, and include tests for each filter on its own and combined. On the issue, comment tagging the author to let them know you're working on it. On the PR, tag the maintainer to notify that review is ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions