-
Notifications
You must be signed in to change notification settings - Fork 620
[Dashboard] Feature: Adds paired address for expedited token route finding #7892
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
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds an optional pairedTokenAddress to the createTokenOnUniversalBridge API and updates its caller to pass NATIVE_TOKEN_ADDRESS on successful token launch. The POST body now forwards pairedTokenAddress when provided. No other logic, control flow, or error handling changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as CreateTokenAssetPage
participant API as createTokenOnUniversalBridge
participant Bridge as Universal Bridge API
User->>UI: Launch token (success path)
UI->>API: createTokenOnUniversalBridge({ chainId, tokenAddress, client, pairedTokenAddress: NATIVE_TOKEN_ADDRESS })
API->>Bridge: POST /tokens { chainId, tokenAddress, pairedTokenAddress? }
Bridge-->>API: Response
API-->>UI: Response
UI-->>User: Continue workflow
note over API,Bridge: pairedTokenAddress is forwarded when provided
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7892 +/- ##
=======================================
Coverage 56.54% 56.54%
=======================================
Files 904 904
Lines 58592 58592
Branches 4140 4140
=======================================
Hits 33131 33131
Misses 25355 25355
Partials 106 106
🚀 New features to boost your workflow:
|
size-limit report 📦
|
There was a problem hiding this 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
🧹 Nitpick comments (3)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts (2)
4-9: Add explicit return type and tighten address typing.The function lacks an explicit return type, and addresses are plain strings. Add a Promise return type and use a template-literal address type to prevent accidental non-hex values.
-export async function createTokenOnUniversalBridge(params: { - chainId: number; - tokenAddress: string; - pairedTokenAddress?: string; - client: ThirdwebClient; -}) { +export async function createTokenOnUniversalBridge(params: { + chainId: number; + tokenAddress: `0x${string}`; + pairedTokenAddress?: `0x${string}`; + client: ThirdwebClient; +}): Promise<Response> {
12-16: Send pairedTokenAddress only when defined (readability/clarity).JSON.stringify drops undefined, but making the intent explicit improves readability and avoids accidental falsey values sneaking in.
- body: JSON.stringify({ - chainId: params.chainId.toString(), - tokenAddress: params.tokenAddress, - pairedTokenAddress: params.pairedTokenAddress, - }), + body: JSON.stringify({ + chainId: params.chainId.toString(), + tokenAddress: params.tokenAddress, + ...(params.pairedTokenAddress && { + pairedTokenAddress: params.pairedTokenAddress, + }), + }),apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx (1)
444-451: Avoid unhandled promise from createTokenOnUniversalBridge.This call is not awaited; a network failure will surface as an unhandled rejection in the client. Fire-and-forget is fine here—just make it explicit and catch errors.
- createTokenOnUniversalBridge({ + void createTokenOnUniversalBridge({ chainId: params.chainId, client: props.client, tokenAddress: params.contractAddress, // TODO: UPDATE THIS WHEN WE ALLOW CUSTOM CURRENCY PAIRING pairedTokenAddress: NATIVE_TOKEN_ADDRESS, - }); + }).catch((err) => { + console.error("Failed to register token on Universal Bridge", err); + });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts(1 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsxapps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsxapps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from@/components/ui/*(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLinkfor internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()from@/lib/utilsfor conditional class logic
Use design system tokens (e.g.,bg-card,border-border,text-muted-foreground)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()to retrieve JWT from cookies on server side
UseAuthorization: Bearerheader – never embed tokens in URLs
Return typed results (e.g.,Project[],User[]) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stablequeryKeysfor React Query cache hits
ConfigurestaleTime/cacheTimein React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-jsin server components
Files:
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsxapps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx (1)
448-450: Action Required: Confirm bridge API accepts NATIVE_TOKEN_ADDRESS (0xeeee…ee) as the native‐asset sentinelI attempted the placeholder curl test but received a 401 Unauthorized (authentication required), so I couldn’t validate whether the bridge truly treats
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeas its native‐asset sentinel. Please:
- Rerun the POST to
https://bridge.thirdweb-dev.com/v1/tokenswith valid values for:
chainIdtokenAddressx-client-id- Verify that the response succeeds when
pairedTokenAddressis set toNATIVE_TOKEN_ADDRESS(0xeeee…ee).- If the bridge instead expects a different sentinel (e.g.
null,"", or another keyword), update this code block accordingly:- // TODO: UPDATE THIS WHEN WE ALLOW CUSTOM CURRENCY PAIRING - pairedTokenAddress: NATIVE_TOKEN_ADDRESS, + pairedTokenAddress: /* confirmed sentinel or replacement */,Once confirmed, we can ensure the implementation aligns with the bridge contract’s requirements.
PR-Codex overview
This PR focuses on enhancing the token creation functionality by introducing support for a paired token address in the token creation process, allowing for future customization of currency pairing.
Detailed summary
pairedTokenAddressproperty in thecreate-token-page-impl.tsxfile with a TODO comment for future updates.createTokenOnUniversalBridgefunction increate-token-on-bridge.tsto include an optionalpairedTokenAddressparameter in its parameters and the request body.Summary by CodeRabbit