Skip to content

Fix: Universal Bridge Analytics Parsing and Team Analytics Loading State #7288

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

Closed
wants to merge 16 commits into from

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Jun 5, 2025


PR-Codex overview

This PR introduces several enhancements and new features across various components in the thirdweb package, including type definitions, UI adjustments, and error handling improvements.

Detailed summary

  • Added Action type in BridgeAction.ts.
  • Updated modalMaxWidthCompact in constants.ts.
  • Enhanced getQueryOptions in useChainQuery.ts.
  • Introduced WindowAdapter interface for platform-specific functionality.
  • Improved error handling in mapBridgeError.ts.
  • Implemented useBridgeRoutes and useBridgeError hooks.
  • Added FiatProviderSelection component for selecting payment providers.
  • Enhanced UI components like TokenBalanceRow, ErrorBanner, and SuccessScreen.
  • Updated wallet information display in WalletRow.
  • Added tests for new hooks and error mapping functionalities.

The following files were skipped due to too many changes: packages/thirdweb/src/react/core/utils/persist.ts, packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx, packages/thirdweb/src/react/core/hooks/useBridgePrepare.ts, packages/thirdweb/src/react/web/ui/PayEmbed.tsx, packages/thirdweb/src/react/web/ui/Bridge/common/TokenAndChain.tsx, packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx, packages/thirdweb/src/stories/Bridge/StepRunner.stories.tsx, packages/thirdweb/src/stories/Bridge/PaymentSelection.stories.tsx, packages/thirdweb/src/react/core/hooks/useBridgeError.test.ts, packages/thirdweb/src/react/core/hooks/useBridgePrepare.test.ts, packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx, packages/thirdweb/src/react/web/ui/Bridge/QuoteLoader.tsx, packages/thirdweb/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx, packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts, packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx, packages/thirdweb/src/react/core/machines/paymentMachine.ts, packages/thirdweb/src/stories/Bridge/BridgeOrchestrator.stories.tsx, packages/thirdweb/src/react/components.md, packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx, packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx, packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx, packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx, packages/thirdweb/src/react/core/hooks/usePaymentMethods.test.ts, packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx, packages/thirdweb/src/react/web/ui/Bridge/payment-success/PaymentReceipt.tsx, packages/thirdweb/src/stories/Bridge/PaymentDetails.stories.tsx, packages/thirdweb/src/react/PRODUCT.md, packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx, apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/analytics/page.tsx, packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx, packages/thirdweb/src/react/core/machines/paymentMachine.test.ts, packages/thirdweb/src/react/core/hooks/useStepExecutor.ts, packages/thirdweb/src/stories/Bridge/fixtures.ts, packages/thirdweb/src/react/TECH_SPEC.md, packages/thirdweb/src/react/core/hooks/useStepExecutor.test.ts, packages/thirdweb/src/react/TASK_LIST.md, pnpm-lock.yaml

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

Summary by CodeRabbit

  • New Features

    • Introduced BridgeEmbed 2.0 with a modular, cross-platform payment and asset-bridging widget supporting multi-hop bridging, token swaps, and fiat on-ramping.
    • Added comprehensive UI components for payment flows, including funding wallets, direct payments, transaction execution, payment selection, and detailed receipts.
    • Implemented advanced React hooks for payment methods, bridge quoting, preparation, step execution, and error handling.
    • Added robust state management using a payment state machine with resumability and retry capabilities.
    • Provided Storybook stories for all new UI components to aid in visual testing and documentation.
  • Bug Fixes

    • Improved date comparison logic for analytics and statistics to ensure accurate data aggregation.
    • Refined error handling to prevent display of infinite trend values and enhance user-facing error messages.
  • Documentation

    • Added detailed product specifications, technical specs, engineering task lists, and UI component catalogs for BridgeEmbed 2.0.
    • Updated developer documentation for formatting, linting, and testing strategies.
  • Style

    • Enhanced UI styling, theming, and responsiveness across all new components.
    • Adjusted button and icon styles for improved consistency and accessibility.
  • Tests

    • Introduced comprehensive unit and integration tests for new hooks, state machines, error mapping, and UI components.
  • Chores

    • Added placeholder files to maintain directory structure for future development and type organization.

joaquim-verges and others added 16 commits June 5, 2025 00:52
• Refactor analytics page into smaller async components with proper loading states
• Add Promise.allSettled for better error handling in analytics data fetching
• Fix date comparison logic using ISO string comparison for Universal Bridge metrics
• Add infinity check for trend values to prevent display issues
• Replace generic loading page with specific chart loading skeleton states

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gregfromstl gregfromstl requested review from jnsdls, joaquim-verges and a team as code owners June 5, 2025 17:05
Copy link

changeset-bot bot commented Jun 5, 2025

⚠️ No Changeset found

Latest commit: e07b37b

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

vercel bot commented Jun 5, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 5, 2025 5:05pm
login 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 5, 2025 5:05pm
thirdweb_playground 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 5, 2025 5:05pm
thirdweb-www 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 5, 2025 5:05pm
wallet-ui 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 5, 2025 5:05pm

Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

Warning

Rate limit exceeded

@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab79dc and e07b37b.

⛔ Files ignored due to path filters (2)
  • packages/thirdweb/src/wallets/__generated__/wallet-infos.ts is excluded by !**/__generated__/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (84)
  • AGENTS.md (2 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/analytics/page.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/team/components/Analytics/Stat.tsx (1 hunks)
  • packages/thirdweb/scripts/wallets/generate.ts (1 hunks)
  • packages/thirdweb/src/bridge/Routes.ts (3 hunks)
  • packages/thirdweb/src/bridge/types/BridgeAction.ts (1 hunks)
  • packages/thirdweb/src/bridge/types/Errors.ts (2 hunks)
  • packages/thirdweb/src/pay/convert/cryptoToFiat.ts (2 hunks)
  • packages/thirdweb/src/pay/convert/fiatToCrypto.ts (2 hunks)
  • packages/thirdweb/src/pay/convert/get-token.ts (2 hunks)
  • packages/thirdweb/src/react/PRODUCT.md (1 hunks)
  • packages/thirdweb/src/react/TASK_LIST.md (1 hunks)
  • packages/thirdweb/src/react/TECH_SPEC.md (1 hunks)
  • packages/thirdweb/src/react/components.md (1 hunks)
  • packages/thirdweb/src/react/core/adapters/.keep (1 hunks)
  • packages/thirdweb/src/react/core/adapters/WindowAdapter.ts (1 hunks)
  • packages/thirdweb/src/react/core/errors/.keep (1 hunks)
  • packages/thirdweb/src/react/core/errors/mapBridgeError.test.ts (1 hunks)
  • packages/thirdweb/src/react/core/errors/mapBridgeError.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useBridgeError.test.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useBridgeError.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useBridgePrepare.test.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useBridgePrepare.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useBridgeQuote.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useBridgeRoutes.test.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useBridgeRoutes.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.test.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useStepExecutor.test.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/useStepExecutor.ts (1 hunks)
  • packages/thirdweb/src/react/core/machines/.keep (1 hunks)
  • packages/thirdweb/src/react/core/machines/paymentMachine.test.ts (1 hunks)
  • packages/thirdweb/src/react/core/machines/paymentMachine.ts (1 hunks)
  • packages/thirdweb/src/react/core/types/.keep (1 hunks)
  • packages/thirdweb/src/react/core/utils/persist.ts (1 hunks)
  • packages/thirdweb/src/react/core/utils/wallet.test.ts (1 hunks)
  • packages/thirdweb/src/react/native/adapters/WindowAdapter.ts (1 hunks)
  • packages/thirdweb/src/react/native/flows/.keep (1 hunks)
  • packages/thirdweb/src/react/web/adapters/WindowAdapter.ts (1 hunks)
  • packages/thirdweb/src/react/web/adapters/adapters.test.ts (1 hunks)
  • packages/thirdweb/src/react/web/flows/.keep (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/ErrorBanner.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/QuoteLoader.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/common/TokenAndChain.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/common/TokenBalanceRow.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-success/PaymentReceipt.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/constants.ts (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts (2 hunks)
  • packages/thirdweb/src/react/web/ui/PayEmbed.tsx (3 hunks)
  • packages/thirdweb/src/react/web/ui/components/ChainName.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/components/TokenIcon.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/BridgeOrchestrator.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/ErrorBanner.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/PaymentDetails.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/PaymentSelection.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/StepRunner.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/Bridge/fixtures.ts (1 hunks)
  • packages/thirdweb/src/stories/TokenBalanceRow.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/WalletRow.stories.tsx (1 hunks)
  • packages/thirdweb/src/stories/utils.tsx (2 hunks)

Walkthrough

This update introduces BridgeEmbed 2.0, a comprehensive cross-platform payment and bridge widget for React and React Native. It adds a modular state machine-driven UI, hooks, adapters, error handling, and Storybook stories for multi-step blockchain payment flows. The PR also refactors dashboard analytics, updates bridge/pay conversion logic, and enhances documentation and testing.

Changes

File(s) / Group Change Summary
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/analytics/page.tsx
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
Refactored analytics page to split monolithic data fetching into smaller async components, improved error handling, and updated date comparison logic.
apps/dashboard/src/app/(app)/team/components/Analytics/Stat.tsx Updated trend badge rendering to exclude infinite values.
packages/thirdweb/scripts/wallets/generate.ts Changed TypeScript type assertion syntax for wallet info generation.
packages/thirdweb/src/bridge/Routes.ts
packages/thirdweb/src/bridge/types/BridgeAction.ts
packages/thirdweb/src/bridge/types/Errors.ts
Added includePrices option to routes, extended Action type with "fee", and enhanced ApiError with a toString() method.
packages/thirdweb/src/pay/convert/cryptoToFiat.ts
packages/thirdweb/src/pay/convert/fiatToCrypto.ts
packages/thirdweb/src/pay/convert/get-token.ts
Refactored token price fetching to return complete token objects, updated conversion logic, and improved error handling.
packages/thirdweb/src/react/PRODUCT.md
packages/thirdweb/src/react/TECH_SPEC.md
packages/thirdweb/src/react/TASK_LIST.md
packages/thirdweb/src/react/components.md
Added product, technical spec, task list, and components documentation for BridgeEmbed 2.0.
packages/thirdweb/src/react/core/adapters/WindowAdapter.ts
packages/thirdweb/src/react/core/adapters/.keep
packages/thirdweb/src/react/native/adapters/WindowAdapter.ts
packages/thirdweb/src/react/web/adapters/WindowAdapter.ts
Introduced platform-specific WindowAdapter interface and implementations for dependency inversion.
packages/thirdweb/src/react/core/errors/mapBridgeError.ts
packages/thirdweb/src/react/core/errors/mapBridgeError.test.ts
packages/thirdweb/src/react/core/errors/.keep
Added error mapping and retry logic utilities for bridge errors with tests.
packages/thirdweb/src/react/core/hooks/useBridgeError.ts
packages/thirdweb/src/react/core/hooks/useBridgeError.test.ts
packages/thirdweb/src/react/core/hooks/useBridgePrepare.ts
packages/thirdweb/src/react/core/hooks/useBridgePrepare.test.ts
packages/thirdweb/src/react/core/hooks/useBridgeQuote.ts
packages/thirdweb/src/react/core/hooks/useBridgeRoutes.ts
packages/thirdweb/src/react/core/hooks/useBridgeRoutes.test.ts
packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
packages/thirdweb/src/react/core/hooks/usePaymentMethods.test.ts
packages/thirdweb/src/react/core/hooks/useStepExecutor.ts
packages/thirdweb/src/react/core/hooks/useStepExecutor.test.ts
Introduced new hooks for bridge payment flows: error normalization, transaction preparation, quoting, route fetching, payment methods, and step execution, with corresponding tests.
packages/thirdweb/src/react/core/machines/paymentMachine.ts
packages/thirdweb/src/react/core/machines/paymentMachine.test.ts
packages/thirdweb/src/react/core/machines/.keep
Added a state machine hook for managing payment flow states and transitions, with tests.
packages/thirdweb/src/react/core/utils/persist.ts Introduced persistence utilities for saving and restoring payment state machine snapshots.
packages/thirdweb/src/react/core/types/.keep Added placeholder for shared type definitions.
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
packages/thirdweb/src/react/web/ui/Bridge/ErrorBanner.tsx
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
packages/thirdweb/src/react/web/ui/Bridge/QuoteLoader.tsx
packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx
packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx
packages/thirdweb/src/react/web/ui/Bridge/common/TokenAndChain.tsx
packages/thirdweb/src/react/web/ui/Bridge/common/TokenBalanceRow.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-success/PaymentReceipt.tsx
packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx
Added new modular UI components for BridgeEmbed 2.0, covering orchestrator, payment steps, error, success, and selection flows.
packages/thirdweb/src/react/web/ui/PayEmbed.tsx Re-implemented PayEmbed to use new BridgeEmbed orchestrator and logic; renamed legacy implementation.
packages/thirdweb/src/react/web/ui/components/ChainName.tsx
packages/thirdweb/src/react/web/ui/components/TokenIcon.tsx
packages/thirdweb/src/react/web/ui/components/buttons.tsx
Enhanced UI components with new props, improved logic, and removed hover scaling effects.
packages/thirdweb/src/react/web/ui/ConnectWallet/constants.ts
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.tsx
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts
packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
Minor UI and utility improvements, including new currency formatting and icon helpers, adjusted modal width, and icon size changes.
packages/thirdweb/src/stories/Bridge/BridgeOrchestrator.stories.tsx
packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx
packages/thirdweb/src/stories/Bridge/ErrorBanner.stories.tsx
packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
packages/thirdweb/src/stories/Bridge/PaymentDetails.stories.tsx
packages/thirdweb/src/stories/Bridge/PaymentSelection.stories.tsx
packages/thirdweb/src/stories/Bridge/StepRunner.stories.tsx
packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx
packages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsx
packages/thirdweb/src/stories/Bridge/fixtures.ts
packages/thirdweb/src/stories/TokenBalanceRow.stories.tsx
packages/thirdweb/src/stories/WalletRow.stories.tsx
packages/thirdweb/src/stories/utils.tsx
Added comprehensive Storybook stories and fixtures for all new BridgeEmbed UI components and utilities.
AGENTS.md Updated formatting/linting and test runner instructions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BridgeEmbed
    participant StateMachine
    participant Hooks
    participant Adapters
    participant SDK
    participant Wallet

    User->>BridgeEmbed: Initiate payment/bridge flow
    BridgeEmbed->>StateMachine: Initialize with mode and adapters
    StateMachine->>Hooks: Fetch payment methods, routes, quotes
    Hooks->>SDK: Request bridge/payment data
    SDK-->>Hooks: Return data (routes, quotes, tokens)
    Hooks-->>StateMachine: Provide payment methods/quotes
    StateMachine->>BridgeEmbed: Update UI state (selection, preview, execution)
    User->>BridgeEmbed: Select payment method, confirm details
    BridgeEmbed->>StateMachine: Dispatch events (selection, confirm, execute)
    StateMachine->>Hooks: Prepare and execute steps
    Hooks->>Wallet: Send transactions, sign, switch chain
    Wallet-->>Hooks: Return transaction status/receipts
    Hooks-->>StateMachine: Report execution progress/completion/errors
    StateMachine->>BridgeEmbed: Update UI (progress, success, error)
    User->>BridgeEmbed: Retry/cancel as needed
Loading

Possibly related PRs

  • thirdweb-dev/js#7241: The main PR and the retrieved PR both involve changes related to smart wallet detection and handling, specifically replacing the old hasSmartAccount function with a refined isSmartWallet function and updating related imports and usage across the codebase; thus, they are directly related at the code level concerning smart wallet detection logic.

  • thirdweb-dev/js#7228: The main PR focuses on adding and using a ThirdwebClient instance explicitly across various React components and hooks in the dashboard app, replacing implicit or hook-based client acquisition, while the retrieved PR primarily removes the useThirdwebClient hook and refactors components to accept a client prop of type ThirdwebClient for better client integration; thus, both PRs share a direct and strong connection at the code level regarding the handling and propagation of the ThirdwebClient instance in dashboard components.

  • thirdweb-dev/js#7202: The main PR introduces a comprehensive new BridgeEmbed 2.0 React integration with a modular payment flow, UI components, hooks, and state machine, including a BridgeOrchestrator component that accepts purchaseData as a prop; the retrieved PR fixes a bug by ensuring purchaseData is properly forwarded in the Transfer.prepare call during transfer quote preparation, directly relating to the handling of purchase data in the transfer flow used by the main PR’s components.

Suggested reviewers

  • gregfromstl
  • jnsdls
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.

@gregfromstl gregfromstl closed this Jun 5, 2025
@github-actions github-actions bot added Dashboard Involves changes to the Dashboard. packages SDK Involves changes to the thirdweb SDK labels Jun 5, 2025
Copy link
Contributor

graphite-app bot commented Jun 5, 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.

Copy link
Contributor

github-actions bot commented Jun 5, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 62.6 KB (+0.05% 🔺) 1.3 s (+0.05% 🔺) 179 ms (+134.22% 🔺) 1.5 s
thirdweb (cjs) 345.87 KB (+0.1% 🔺) 7 s (+0.1% 🔺) 654 ms (+9.54% 🔺) 7.6 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 59 ms (+901.26% 🔺) 173 ms
thirdweb/chains (tree-shaking) 531 B (0%) 11 ms (0%) 13 ms (+544.11% 🔺) 24 ms
thirdweb/react (minimal + tree-shaking) 19.56 KB (0%) 392 ms (0%) 56 ms (+376.76% 🔺) 447 ms

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. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants