Skip to content

new tokens route #7170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged

new tokens route #7170

merged 1 commit into from
May 27, 2025

Conversation

iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented May 27, 2025

[Dashboard] Feature: Add new tokens endpoint and deprecate ERC-20 balances endpoint

Notes for the reviewer

This PR adds a new endpoint for getting tokens at /v1/tokens and marks the existing ERC-20 balances endpoint (/v1/tokens/erc20/{ownerAddress}) as deprecated.

How to test

Verify that the new endpoint is accessible and that the deprecated flag is correctly set for both endpoints in the insight blueprints.

Summary by CodeRabbit

  • New Features

    • Introduced a new "Get tokens" endpoint for accessing token data.
  • Bug Fixes

    • Marked the older ERC-20 balances endpoint as deprecated to guide users toward the updated endpoint.

PR-Codex overview

This PR introduces a new endpoint for retrieving tokens and marks an existing endpoint as deprecated in the insightBlueprints.ts file.

Detailed summary

  • Added a new endpoint with:
    • name: "Get tokens"
    • path: "/v1/tokens"
    • deprecated: false
  • Marked the existing endpoint "Get ERC-20 balances by address" as deprecated with deprecated: true.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented May 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2025 5:03pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) May 27, 2025 5:03pm
login ⬜️ Skipped (Inspect) May 27, 2025 5:03pm
thirdweb-www ⬜️ Skipped (Inspect) May 27, 2025 5:03pm
wallet-ui ⬜️ Skipped (Inspect) May 27, 2025 5:03pm

@vercel vercel bot temporarily deployed to Preview – login May 27, 2025 09:41 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www May 27, 2025 09:41 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 May 27, 2025 09:41 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 27, 2025 09:41 Inactive
Copy link

changeset-bot bot commented May 27, 2025

⚠️ No Changeset found

Latest commit: f115b4d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented May 27, 2025

Walkthrough

The "Get ERC-20 balances by address" endpoint was marked as deprecated, and a new non-deprecated "Get tokens" endpoint was added to the tokens blueprint paths in the playground-web app. No other changes to exported or public entities were made.

Changes

File Change Summary
apps/playground-web/src/app/insight/insightBlueprints.ts Deprecated old ERC-20 tokens endpoint; added new "Get tokens" endpoint

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PlaygroundWeb
    participant TokensAPI

    User ->> PlaygroundWeb: Request tokens data
    PlaygroundWeb ->> TokensAPI: Call /v1/tokens (new endpoint)
    TokensAPI -->> PlaygroundWeb: Return tokens data
    PlaygroundWeb -->> User: Display tokens information
Loading

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • ERC-20: Entity not found: Issue - Could not find referenced Issue.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 45a00fe and f115b4d.

📒 Files selected for processing (1)
  • apps/playground-web/src/app/insight/insightBlueprints.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/playground-web/src/app/insight/insightBlueprints.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Playground Changes involving the Playground codebase. label May 27, 2025
Copy link
Contributor Author

iuwqyir commented May 27, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.67%. Comparing base (0e4390b) to head (f115b4d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7170   +/-   ##
=======================================
  Coverage   55.67%   55.67%           
=======================================
  Files         904      904           
  Lines       58391    58391           
  Branches     4119     4119           
=======================================
  Hits        32510    32510           
  Misses      25775    25775           
  Partials      106      106           
Flag Coverage Δ
packages 55.67% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented May 27, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 61.75 KB (+0.06% 🔺) 1.3 s (+0.06% 🔺) 237 ms (+85.69% 🔺) 1.5 s
thirdweb (cjs) 344.4 KB (0%) 6.9 s (0%) 937 ms (+3.94% 🔺) 7.9 s
thirdweb (minimal + tree-shaking) 5.69 KB (0%) 114 ms (0%) 82 ms (+1161.87% 🔺) 196 ms
thirdweb/chains (tree-shaking) 531 B (0%) 11 ms (0%) 8 ms (+204.22% 🔺) 18 ms
thirdweb/react (minimal + tree-shaking) 19.54 KB (0%) 391 ms (0%) 160 ms (+930.33% 🔺) 551 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (1)
apps/playground-web/src/app/insight/insightBlueprints.ts (1)

1-1: 💡 Verification agent

🧩 Analysis chain

Verify manual changes to auto-generated file.

The file header indicates this is auto-generated by the update-insight-blueprints script, but manual changes are being made in this PR. Ensure this is intentional and won't be overwritten by the next script execution.


🏁 Script executed:

#!/bin/bash
# Description: Check if there are any scripts or processes that auto-generate this file
# Expected: Find references to update-insight-blueprints script and understand the generation process

# Search for the update script mentioned in the comment
fd -t f -e js -e ts -e json | xargs rg -l "update-insight-blueprints"

# Look for any build or generation scripts
fd -t f -e js -e ts -e json -e sh | xargs rg -l "insightBlueprints"

# Check for any package.json scripts that might regenerate this file
cat package.json | jq '.scripts' 2>/dev/null || echo "No package.json found"

Length of output: 2501


I’d like to inspect the generator to confirm exactly how insightBlueprints.ts is produced. Please run:


🏁 Script executed:

#!/bin/bash
# Show the updateInsightBlueprints generator to verify overwrite behavior
sed -n '1,200p' apps/playground-web/scripts/updateInsightBlueprints.ts

Length of output: 672


Manual edits to auto-generated file will be overwritten
The insightBlueprints.ts in apps/playground-web/src/app/insight/ is completely re-written each time you run apps/playground-web/scripts/updateInsightBlueprints.ts. Any direct changes here (deprecating ERC-20 or adding a new tokens endpoint) will be lost on the next generation.

Please:

  • Revert your manual changes in insightBlueprints.ts.
  • Update the source of truth used by fetchAllBlueprints()—for example, modify the upstream blueprint definitions or adjust the logic in apps/playground-web/scripts/utils.ts.
  • Rerun pnpm playground:build (or directly node apps/playground-web/scripts/updateInsightBlueprints.ts), then commit the regenerated insightBlueprints.ts.
🧹 Nitpick comments (1)
apps/playground-web/src/app/insight/insightBlueprints.ts (1)

82-86: LGTM: New tokens endpoint added correctly.

The new general tokens endpoint follows the established structure and is correctly marked as non-deprecated.

Consider moving the general /v1/tokens endpoint to appear before the more specific token endpoints for better logical organization:

  paths: [
+   {
+     name: "Get tokens",
+     path: "/v1/tokens", 
+     deprecated: false,
+   },
    {
      name: "Get token transfers by transaction",
      path: "/v1/tokens/transfers/transaction/{transaction_hash}",
      deprecated: false,
    },
    // ... other endpoints
-   {
-     name: "Get tokens",
-     path: "/v1/tokens",
-     deprecated: false,
-   },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e4390b and 45a00fe.

📒 Files selected for processing (1)
  • apps/playground-web/src/app/insight/insightBlueprints.ts (1 hunks)
🔇 Additional comments (2)
apps/playground-web/src/app/insight/insightBlueprints.ts (2)

80-80: LGTM: ERC-20 endpoint correctly deprecated.

The existing ERC-20 balances endpoint has been properly marked as deprecated, which aligns with the PR objectives.


78-86:

✅ Verification successful

Verify endpoint accessibility and deprecation flags.

As requested in the PR objectives, please verify that:

  1. The new /v1/tokens endpoint is accessible
  2. The deprecated flag is correctly set for both endpoints

🏁 Script executed:

#!/bin/bash
# Description: Verify the endpoints are properly configured by checking for any related route definitions
# Expected: Find route handlers or API definitions that correspond to these endpoints

# Search for route definitions or handlers for the new tokens endpoint
rg -A 5 -B 5 "\/v1\/tokens\"" --type ts --type js

# Look for any API documentation or OpenAPI specs that might reference these endpoints  
rg -A 3 -B 3 "v1/tokens" --type json --type yaml --type yml

# Check for any test files that might test these endpoints
fd -t f -e test.ts -e test.js -e spec.ts -e spec.js | xargs rg -l "v1/tokens"

Length of output: 296


🏁 Script executed:

#!/bin/bash
# Description: Re-run verification for /v1/tokens endpoint definitions

# Search for route definitions or handlers for the new tokens endpoint in .ts and .js files
rg -A5 -B5 "/v1/tokens" --type ts --type js

# Look for any API documentation or OpenAPI specs referencing these endpoints in JSON or YAML files
rg -A3 -B3 "v1/tokens" --type json --type yaml

# Check for any test/spec files that might test these endpoints
fd -e test.ts -e test.js -e spec.ts -e spec.js | xargs -r rg -l "v1/tokens"

Length of output: 18780


No changes needed—endpoints and deprecation flags are correct

  • The new /v1/tokens endpoint is present in the generated client (types.gen.ts and sdk.gen.ts) and is already consumed (e.g. in apps/dashboard/src/@/api/universal-bridge/tokens.ts).
  • In apps/playground-web/src/app/insight/insightBlueprints.ts, /v1/tokens/erc20/{ownerAddress} remains deprecated: true and /v1/tokens is deprecated: false as intended.

@iuwqyir iuwqyir added the merge-queue Adds the pull request to Graphite's merge queue. label May 27, 2025 — with Graphite App
Copy link
Contributor Author

iuwqyir commented May 27, 2025

Merge activity

## [Dashboard] Feature: Add new tokens endpoint and deprecate ERC-20 balances endpoint

## Notes for the reviewer

This PR adds a new endpoint for getting tokens at `/v1/tokens` and marks the existing ERC-20 balances endpoint (`/v1/tokens/erc20/{ownerAddress}`) as deprecated.

## How to test

Verify that the new endpoint is accessible and that the deprecated flag is correctly set for both endpoints in the insight blueprints.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced a new "Get tokens" endpoint for accessing token data.

- **Bug Fixes**
  - Marked the older ERC-20 balances endpoint as deprecated to guide users toward the updated endpoint.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 05-27-new_tokens_route branch from 45a00fe to f115b4d Compare May 27, 2025 17:02
@vercel vercel bot temporarily deployed to Preview – docs-v2 May 27, 2025 17:02 Inactive
@vercel vercel bot temporarily deployed to Preview – login May 27, 2025 17:02 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 27, 2025 17:02 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www May 27, 2025 17:02 Inactive
@graphite-app graphite-app bot merged commit f115b4d into main May 27, 2025
23 checks passed
@graphite-app graphite-app bot removed the merge-queue Adds the pull request to Graphite's merge queue. label May 27, 2025
@graphite-app graphite-app bot deleted the 05-27-new_tokens_route branch May 27, 2025 17:06
@vercel vercel bot temporarily deployed to Production – docs-v2 May 27, 2025 17:06 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui May 27, 2025 17:06 Inactive
@vercel vercel bot temporarily deployed to Production – login May 27, 2025 17:06 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb-www May 27, 2025 17:06 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Playground Changes involving the Playground codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants