Skip to content

[TOOL-4899] Dashboard: fetch token icon from bridge api as fallback in coin asset page #7460

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

Conversation

MananTank
Copy link
Member

@MananTank MananTank commented Jun 27, 2025


PR-Codex overview

This PR introduces a new utility function, fetchTokenInfoFromBridge, to retrieve token information from a bridge API. It also integrates this function into the ERC20PublicPage component to fetch and display token metadata.

Detailed summary

  • Added fetchTokenInfoFromBridge function in fetch-coin-info.ts to fetch token details from a bridge API.
  • Integrated fetchTokenInfoFromBridge in ERC20PublicPage to obtain token info.
  • Updated contractMetadata.image with tokenInfo.iconUri if no image is present.

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

Summary by CodeRabbit

  • New Features
    • Enhanced ERC20 public pages to automatically display token icons when available, enriching token metadata with external information.

Copy link

linear bot commented Jun 27, 2025

Copy link

vercel bot commented Jun 27, 2025

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

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

Copy link

changeset-bot bot commented Jun 27, 2025

⚠️ No Changeset found

Latest commit: 26b8c32

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

@vercel vercel bot temporarily deployed to Preview – nebula June 27, 2025 15:26 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 27, 2025 15:26 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 27, 2025 15:26 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 27, 2025 15:27 Inactive
@MananTank MananTank marked this pull request as ready for review June 27, 2025 15:27
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

"""

Walkthrough

A new utility function was added to fetch token information from a bridge API. The ERC20 public page now uses this function to retrieve token metadata, specifically updating the contract's image if it is not already set, by integrating the image URI from the bridge API response.

Changes

File(s) Change Summary
.../erc20/_utils/fetch-coin-info.ts Added fetchTokenInfoFromBridge function to fetch token info (including icon URI) from bridge API.
.../erc20/erc20.tsx Updated ERC20PublicPage to call fetchTokenInfoFromBridge and use its image URI if contract metadata image is missing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ERC20PublicPage
    participant fetchTokenInfoFromBridge
    participant BridgeAPI

    User->>ERC20PublicPage: Load page
    ERC20PublicPage->>fetchTokenInfoFromBridge: Fetch token info (chainId, tokenAddress, clientId)
    fetchTokenInfoFromBridge->>BridgeAPI: GET /v1/tokens?chainId&tokenAddress&clientId
    BridgeAPI-->>fetchTokenInfoFromBridge: Return token data (iconUri, etc.)
    fetchTokenInfoFromBridge-->>ERC20PublicPage: Return token info
    ERC20PublicPage->>ERC20PublicPage: If contractMetadata.image is missing, set from tokenInfo.iconUri
Loading

Assessment against linked issues

Objective Addressed Explanation
Load token image from bridge API if no image got from contractUri (TOOL-4899)

Suggested reviewers

  • jnsdls
    """

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: 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 462f19f and 26b8c32.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • 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.

@MananTank MananTank requested review from a team as code owners June 27, 2025 15:27
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Jun 27, 2025
Copy link
Member Author

MananTank commented Jun 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.

@MananTank MananTank changed the base branch from 06-27-_tool-4898_dashboard_replace_payembed_with_buywidget_in_asset_page_add_tracking to graphite-base/7460 June 27, 2025 15:29
@MananTank MananTank force-pushed the 06-27-_tool-4899_dashboard_fetch_token_icon_from_bridge_api_as_fallback_in_coin_asset_page branch from bf98ec0 to 522ad90 Compare June 27, 2025 15:29
@MananTank MananTank force-pushed the graphite-base/7460 branch from 8b1048e to 9d6739e Compare June 27, 2025 15:29
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 27, 2025 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 27, 2025 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula June 27, 2025 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 27, 2025 15:29 Inactive
@MananTank MananTank changed the base branch from graphite-base/7460 to main June 27, 2025 15:29
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.92%. Comparing base (c7f7f48) to head (26b8c32).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7460   +/-   ##
=======================================
  Coverage   51.92%   51.92%           
=======================================
  Files         947      947           
  Lines       63932    63932           
  Branches     4216     4216           
=======================================
  Hits        33194    33194           
  Misses      30632    30632           
  Partials      106      106           
Flag Coverage Δ
packages 51.92% <ø> (ø)
🚀 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

@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: 1

🧹 Nitpick comments (1)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts (1)

3-7: Consider adding JSDoc documentation.

Adding JSDoc comments would improve the function's documentation and help with IDE support:

+/**
+ * Fetches token information from the bridge API.
+ * @param params - The parameters for fetching token info
+ * @param params.chainId - The chain ID of the token
+ * @param params.tokenAddress - The contract address of the token
+ * @param params.clientId - The client ID for the API request
+ * @returns Promise that resolves to token info object or null if failed
+ */
 export async function fetchTokenInfoFromBridge(params: {
   chainId: number;
   tokenAddress: string;
   clientId: string;
 }) {
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5640d48 and 522ad90.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.@(ts|tsx)`: Accept a typed 'props' object and export a named function (e.g...

**/*.@(ts|tsx): Accept a typed 'props' object and export a named function (e.g., export function MyComponent()).
Combine class names via 'cn', expose 'className' prop if useful.
Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Local state or effects live inside; data fetching happens in hooks.
Merge class names with 'cn' from '@/lib/utils' to keep conditional logic readable.
Stick to design-tokens: background ('bg-card'), borders ('border-border'), muted text ('text-muted-foreground') etc.
Use the 'container' class with a 'max-w-7xl' cap for page width consistency.
Spacing utilities ('px-', 'py-', 'gap-*') are preferred over custom margins.
Responsive helpers follow mobile-first ('max-sm', 'md', 'lg', 'xl').
Never hard-code colors – always go through Tailwind variables.
Tailwind CSS is the styling system – avoid inline styles or CSS modules.
Prefix files with 'import "server-only";' so they never end up in the client bundle (for server-only code).

📄 Source: CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc)

List of files the instruction was applied to:

  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: MananTank
PR: thirdweb-dev/js#7307
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:324-346
Timestamp: 2025-06-09T15:15:02.350Z
Learning: In the move-funds functionality, MananTank prefers having both individual toast.promise notifications for each token transfer AND batch summary toasts, even though this creates multiple notifications. This dual notification approach is acceptable for the move-funds user experience.
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/shared-settings-page.tsx:29-39
Timestamp: 2025-05-27T20:10:47.245Z
Learning: MananTank prefers adding error handling (try-catch) directly inside utility functions like `shouldRenderNewPublicPage` rather than requiring callers to wrap the function calls in try-catch blocks. This centralizes error handling and benefits all callers automatically.
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts (2)
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (`useTokenPriceData.ts`), direct array access on `json.data[0]` without optional chaining is intentionally correct and should not be changed to use safety checks.
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx (11)
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (`useTokenPriceData.ts`), direct array access on `json.data[0]` without optional chaining is intentionally correct and should not be changed to use safety checks.
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractTokensPage` component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Learnt from: MananTank
PR: thirdweb-dev/js#7434
File: apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
Learnt from: MananTank
PR: thirdweb-dev/js#7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (`useTrack`) calls across the dashboard, the team intentionally keeps `contractType` generic as `"NFTCollection"` even for ERC-721 drops; contract differentiation is handled via the `ercType` field instead.
Learnt from: MananTank
PR: thirdweb-dev/js#7081
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/create-token-page-impl.tsx:110-118
Timestamp: 2025-05-20T18:54:15.781Z
Learning: In the thirdweb dashboard's token asset creation flow, the `transferBatch` function from `thirdweb/extensions/erc20` accepts the raw quantity values from the form without requiring explicit conversion to wei using `toUnits()`. The function appears to handle this conversion internally or is designed to work with the values in the format they're already provided.
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/shared-direct-listings-page.tsx:47-52
Timestamp: 2025-05-26T16:29:54.317Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractDirectListingsPage` component in the direct listings shared page, following the same pattern as other server components in the codebase where `projectMeta` is only needed for client components.
Learnt from: jnsdls
PR: thirdweb-dev/js#6929
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx:14-19
Timestamp: 2025-05-21T05:17:31.283Z
Learning: In Next.js server components, the `params` object can sometimes be a Promise that needs to be awaited, despite type annotations suggesting otherwise. In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx, it's necessary to await the params object before accessing its properties.
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/nfts/page.tsx:20-20
Timestamp: 2025-05-26T16:26:58.068Z
Learning: In team/project contract pages under routes like `/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/*`, users are always logged in by design. The hardcoded `isLoggedIn={true}` prop in these pages is intentional and correct, not a bug to be fixed.
Learnt from: MananTank
PR: thirdweb-dev/js#7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:255-277
Timestamp: 2025-06-06T23:47:55.122Z
Learning: The `transfer` function from `thirdweb/extensions/erc20` accepts human-readable amounts via the `amount` property and automatically handles conversion to base units (wei) by fetching the token decimals internally. Manual conversion using `toWei()` is not required when using the `amount` property.
Learnt from: MananTank
PR: thirdweb-dev/js#7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/form.ts:25-42
Timestamp: 2025-06-10T00:46:00.514Z
Learning: In NFT creation functions, the setClaimConditions function signatures are intentionally different between ERC721 and ERC1155. ERC721 setClaimConditions accepts the full CreateNFTFormValues, while ERC1155 setClaimConditions accepts a custom object with nftCollectionInfo and nftBatch parameters because it processes batches differently than the entire form data.
🧬 Code Graph Analysis (1)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts (1)
apps/dashboard/src/@/constants/env-utils.ts (1)
  • isProd (1-3)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (4)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts (1)

16-28: Wrap JSON parsing in error handling.

The res.json() call could throw if the response is not valid JSON. Apply this additional error handling:

-  const data = (await res.json()) as {
-    data: Array<{
-      iconUri: string;
-      address: string;
-      decimals: number;
-      name: string;
-      symbol: string;
-      priceUsd: number;
-    }>;
-  };
-
-  return data.data[0];
+  try {
+    const data = (await res.json()) as {
+      data: Array<{
+        iconUri: string;
+        address: string;
+        decimals: number;
+        name: string;
+        symbol: string;
+        priceUsd: number;
+      }>;
+    };
+
+    return data.data[0];
+  } catch {
+    return null;
+  }
⛔ Skipped due to learnings
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (`useTokenPriceData.ts`), direct array access on `json.data[0]` without optional chaining is intentionally correct and should not be changed to use safety checks.
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Learnt from: MananTank
PR: thirdweb-dev/js#7273
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/create-token-page-impl.tsx:246-255
Timestamp: 2025-06-04T19:48:46.972Z
Learning: The `pollWithTimeout` utility function already throws an error when it times out, so additional try-catch blocks around it for timeout handling are redundant.
Learnt from: MananTank
PR: thirdweb-dev/js#7273
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/create-token-page-impl.tsx:246-255
Timestamp: 2025-06-04T19:48:46.972Z
Learning: The `pollWithTimeout` utility function already throws an error when it times out, so additional try-catch blocks around it for timeout handling are redundant. Other parts of the codebase use `tryCatch` wrapper when they want to handle pollWithTimeout errors gracefully rather than letting them bubble up.
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx (3)

12-12: LGTM!

The import statement is properly added and follows the established pattern in the file.


20-34: LGTM!

The integration of fetchTokenInfoFromBridge into the Promise.all array is well-implemented. The function is called with the appropriate parameters and maintains the concurrent data fetching pattern.


36-39: LGTM!

The conditional logic for updating the contract metadata image is well-implemented. It properly checks for the absence of an existing image and the presence of token info before applying the fallback icon URI.

@MananTank MananTank force-pushed the 06-27-_tool-4899_dashboard_fetch_token_icon_from_bridge_api_as_fallback_in_coin_asset_page branch from 522ad90 to 6d50001 Compare June 27, 2025 15:47
@vercel vercel bot temporarily deployed to Preview – nebula June 27, 2025 15:47 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 27, 2025 15:47 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 27, 2025 15:47 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 27, 2025 15:47 Inactive
Copy link
Contributor

github-actions bot commented Jun 27, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.11 KB (0%) 1.3 s (0%) 137 ms (+71.82% 🔺) 1.4 s
thirdweb (cjs) 352.61 KB (0%) 7.1 s (0%) 600 ms (-1.24% 🔽) 7.7 s
thirdweb (minimal + tree-shaking) 5.72 KB (0%) 115 ms (0%) 59 ms (+922.46% 🔺) 173 ms
thirdweb/chains (tree-shaking) 530 B (0%) 11 ms (0%) 26 ms (+1416.67% 🔺) 36 ms
thirdweb/react (minimal + tree-shaking) 19.59 KB (0%) 392 ms (0%) 104 ms (+771.03% 🔺) 496 ms

Copy link
Contributor

graphite-app bot commented Jun 27, 2025

Merge activity

@MananTank MananTank force-pushed the 06-27-_tool-4899_dashboard_fetch_token_icon_from_bridge_api_as_fallback_in_coin_asset_page branch from 6d50001 to 462f19f Compare June 27, 2025 19:36
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 27, 2025 19:36 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 27, 2025 19:36 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula June 27, 2025 19:36 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 27, 2025 19:36 Inactive
…n coin asset page (#7460)

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a new utility function to fetch token information from a bridge and integrates it into the `ERC20PublicPage` component to enhance contract metadata with token icons.

### Detailed summary
- Added `fetchTokenInfoFromBridge` function in `fetch-coin-info.ts` to fetch token details from a bridge API.
- Integrated `fetchTokenInfoFromBridge` in the `ERC20PublicPage` component.
- Updated contract metadata to include the token icon if not already present.

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

<!-- end pr-codex -->

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

* **New Features**
  * Enhanced ERC20 public pages to automatically display token icons when available, enriching token metadata with external information.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 06-27-_tool-4899_dashboard_fetch_token_icon_from_bridge_api_as_fallback_in_coin_asset_page branch from 462f19f to 26b8c32 Compare June 27, 2025 19:46
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 27, 2025 19:46 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 27, 2025 19:46 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula June 27, 2025 19:46 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 27, 2025 19:46 Inactive
@graphite-app graphite-app bot merged commit 26b8c32 into main Jun 27, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 06-27-_tool-4899_dashboard_fetch_token_icon_from_bridge_api_as_fallback_in_coin_asset_page branch June 27, 2025 19:56
@vercel vercel bot temporarily deployed to Production – nebula June 27, 2025 19:56 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 June 27, 2025 19:56 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground June 27, 2025 19:56 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui June 27, 2025 19:56 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants