Skip to content

feat: add GET /tokens endpoint - #424

Open
PHADAR6 wants to merge 2 commits into
StreamGive:mainfrom
PHADAR6:feat/issue-107-add-a-get-tokens-endpoint-listing-tokens-seen-r2
Open

PHADAR6 wants to merge 2 commits into
StreamGive:mainfrom
PHADAR6:feat/issue-107-add-a-get-tokens-endpoint-listing-tokens-seen-r2

Conversation

@PHADAR6

@PHADAR6 PHADAR6 commented Oct 25, 2026

Copy link
Copy Markdown

Overview

This PR adds a GET /tokens endpoint that returns the distinct tokenAddress values seen across streams, along with a stream count for each token, so the frontend can populate a token filter from real data.

Related Issue

Closes #

Changes

🪙 Token Aggregation Endpoint

  • [MODIFY] src/routes/streams.ts

    • Adds the GET /tokens handler that groups streams by tokenAddress and returns each distinct address with its stream count.
  • [MODIFY] src/routes/tokenTotals.ts

    • Updates the token totals routing so the new /tokens aggregation is wired alongside the existing token-related routes.

Verification Results

npm run lint
npm run typecheck
npm test
Acceptance Criteria Status
Add GET /tokens returning distinct tokenAddress values with a stream count for each ✅ Implemented in src/routes/streams.ts
Add a test asserting the aggregation ⬜ Not included in the changed files for this PR

Closes #107

@Ashborne267

Copy link
Copy Markdown
Contributor

Hi @PHADAR6, thanks for resubmitting this. I went through the diff and the code in this PR is clean.

Before we can merge, there is something important on your side. Your fork (PHADAR6/streamgive-backend) still contains the malware that was in your earlier PRs #201 and #204. Its main has a hidden payload in api.js and eslint.config.js, and the dev, build and start scripts in package.json run api.js. The old feat/issue-107-... and feat/issue-129-... branches have it too.

This is the PolinRider malware. It usually spreads silently from an infected computer into every repo you commit to, so I think it's very likely still on your machine, and it can also steal tokens and keys. I don't think you did anything on purpose, but please:

Scan and clean your computer. Check for a .vscode/tasks.json in your projects, and for api.js or branch_structure.json in the root of repos you work on. If you aren't sure the machine is clean, reinstalling the OS is the safe option.
Change your GitHub password and revoke every GitHub token and SSH key you have. Sign in again afterwards.
Delete the infected branches in your fork. Reset your fork's main to ours, or delete the fork and fork again.
Reply here when it's done, and push a fresh commit from the clean machine so I can re-check this PR.
Once that's confirmed I'm happy to review and merge. Thanks for your patience, this protects you as well as us.

@PHADAR6

PHADAR6 commented Oct 28, 2026

Copy link
Copy Markdown
Author

@Ashborne267 — this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed d6feeaa).
Files changed: src/routes/streams.ts

This branch has not been deployed

No deployments
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.

Add a GET /tokens endpoint listing tokens seen across streams

2 participants