Compare commits

..
Author SHA1 Message Date
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
8af6143d53 Version Packages (#7304)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-16 17:56:01 -07:00
ed81006741 Feature: New UB Components (#7354)
Co-authored-by: Joaquim Verges <[email protected]>
2025-06-16 17:07:28 -07:00
MananTank 3f74760113 [TOOL-4819] Dashboard: Load all engine backend wallets, add pagination in table (#7347)
<!--

## 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 enhances the `useEngine` hook and the `BackendWalletsSection` component by adding pagination functionality for backend wallets retrieval, allowing users to navigate through pages of wallet data.

### Detailed summary
- Added optional `limit` and `page` parameters to the `useEngine` hook.
- Updated the fetch URL in the hook to accommodate pagination.
- Introduced pagination controls in `BackendWalletsSection` using `Button` components.
- Managed pagination state with `useState` for current page tracking.

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

<!-- end pr-codex -->
2025-06-16 20:59:30 +00:00
MananTank 9253c54cf9 [TOOL-4821] Improve Team members search (#7346)
<!--

## 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 search feature for members in the `ManageMembersSection` component by integrating the `Fuse.js` library for fuzzy searching. This enhancement allows users to filter members based on their names and emails more effectively.

### Detailed summary
- Added `Fuse` from `fuse.js` to enable fuzzy searching.
- Created a `membersIndex` using `useMemo` to index `props.members`.
- Updated the filtering logic to use `membersIndex.search(searchTerm)` for searching members.
- Included `membersIndex` in the dependency array of the `membersToShow` memoization.

> ✨ 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**
  - Improved member search functionality with fuzzy matching, allowing for more flexible and accurate search results based on names and emails.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-16 20:47:28 +00:00
MananTank 913ea98d23 [TOOL-4802] NFT Asset Page (#7332)
<!--

## 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 focuses on enhancing the handling of NFTs and contract components within the application, including updates to types, UI components, and functionality related to NFT collections and claims.

### Detailed summary
- Updated `NFTMetadata` type to include `slug`.
- Added `slug` property in various components.
- Introduced `supplyFormatter` for better NFT supply formatting.
- Changed contract type handling to `NFTCollection`.
- Enhanced `MinimalProject` type to include `slug`.
- Updated UI components for better user interaction.
- Improved pagination and NFT display logic.
- Added new utilities for NFT claim conditions and total counts.
- Refactored claim token UI to utilize new components and structures.
- Implemented responsive layouts for better mobile support.

> The following files were skipped due to too many changes: `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nfts-grid.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/buy-nft-drop/buy-nft-drop-ui.client.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/token-viewer/token-viewer.tsx`

> ✨ 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**
  - Introduced public NFT pages for ERC-721 and ERC-1155 contracts with responsive layouts, NFT grids, token viewer dialogs, and buy functionality.
  - Added components for token price display, supply claimed progress, and enhanced pagination controls.
  - Enabled NFT purchases from drops with dedicated UI and transaction handling for ERC-721 and ERC-1155 standards.
  - Added tabbed navigation for public NFT pages and improved media rendering with loading placeholders.
  - Introduced a responsive layout component for device-specific rendering and customizable wallet address focus behavior.
  - Added new components for buying NFTs and editions with form validation, pricing display, and transaction feedback.
  - Added a token price component with loading skeleton and strikethrough styling.
  - Added a supply claimed progress bar with detailed percentage display.
  - Introduced a token viewer dialog with dynamic data fetching and rich metadata display.
  - Added a paginated NFT grid with detailed claim condition info for ERC-1155 tokens.
  - Added buy NFT drop card components with server and client rendering support.
  - Added a custom media renderer component with loading state management.

- **Enhancements**
  - Improved contract and page header components with customizable styling options.
  - Expanded project and team data structures to include project slugs for better navigation.
  - Updated wallet address and pagination components with additional props for accessibility and styling.
  - Refined tracking of click and keyboard events for asset cards.
  - Simplified purchase UI code by delegating price and supply display to shared components.
  - Enhanced pagination to handle two-page scenarios with simplified controls.
  - Updated public page rendering logic to support multiple ERC standards with unified detection.
  - Improved purchase flows with analytics tracking and toast notifications.
  - Added support for special user pricing and dynamic claim condition fetching.

- **Bug Fixes**
  - Fixed conditional rendering and redirection logic for public NFT pages based on contract type and metadata presence.

- **Documentation**
  - Added Storybook stories for new UI components including supply claimed progress and NFT drop purchase flows.

- **Refactor**
  - Delegated price and supply display logic to shared components for consistency.
  - Updated types and props to support new features and improve maintainability.

- **Chores**
  - Broadened NFT metadata field types for improved compatibility with diverse data formats.
  - Added fallback for React experimental API to prevent errors in unsupported environments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-16 17:56:26 +00:00
gregandGitHub 5ce8a5618f Revert "brige embed (#7222)" (#7345) 2025-06-16 10:39:31 -07:00
35a909a897 WIP brige embed (#7222)
Co-authored-by: gregfromstl <[email protected]>
2025-06-15 18:36:11 -07:00
gregandGitHub 9f6c1a4820 Feature: clarify webhook disclaimer (#7339) 2025-06-15 16:21:26 -07:00
Phillip HoandGitHub e43afa1b4e chore: update team/account docs for team management (#7341) 2025-06-14 14:04:32 +08:00
Jonas DanielsandGitHub 94e2cbc468 [Dashboard] Add Google Tag Manager and PostHog to CSP script sources (#7338) 2025-06-13 15:08:47 -07:00
kumaryash90 64ee04c25d Update implementations (#7335)
<!--

## 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 focuses on updating the `MarketplaceV3` addresses in the `ZKSYNC_IMPLEMENTATIONS` and `ZKSYNC_WETH` records, reflecting new contract addresses for the marketplace.

### Detailed summary
- Updated `MarketplaceV3` address for `[324]` from `0x88e7F2bEf0a23073b7Cc2c79D307Dbd9138Fa79c` to `0xFD5663B3Ed316aEB79c9b5c4A242172273cA3395`.
- Updated `MarketplaceV3` address for `[2741]` from `0x4b14569c7B79DBe686Ac3Ba5996131E7EDaB7a93` to `0x9Fdf34f552cdA8E2B0cD64e2EddcB732a5Ff8455`.
- Added new `MarketplaceV3` address for `[531050104]`: `0x292c324920d4120F928dA6f04548442fa10B8B0f`.
- Added new `MarketplaceV3` address for `[50104]`: `0x292c324920d4120F928dA6f04548442fa10B8B0f`.
- Added new `WETH` address for `[531050104]`: `0x9B7EA63EF5062661570afe548e3AD691D5652527`.
- Added new `WETH` address for `[50104]`: `0x2b1A859dE6A55c553520D7780Bc5805712B128F9`.

> ✨ 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**
  - Added support for MarketplaceV3 contract on two additional networks.
  - Updated MarketplaceV3 contract addresses on existing networks for improved compatibility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-13 13:50:20 +00:00
Jonas DanielsandGitHub 680b8cdb16 [Dashboard] Rename getMemberById to getMemberByAccountId and add onboarding banner (#7334) 2025-06-12 16:40:00 -07:00
saminacodes 787db9308d [Docs] UB (#7333)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the documentation for the `Universal Bridge` by adding troubleshooting information and FAQs regarding payment issues and token support.

### Detailed summary
- Added a section for handling "Error 500: Internal Server Error" with upgrade instructions for the SDK.
- Included a new FAQ on supporting tokens on the `Universal Bridge` with criteria and request instructions.

> ✨ 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

- **Documentation**
  - Added a new FAQ explaining how to request support for a token on Universal Bridge, including submission steps and expected processing time.
  - Introduced troubleshooting guidance for resolving "Error 500" or "Something went wrong" messages in Universal Bridge, with instructions to update the SDK and contact support if needed.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-12 23:32:30 +00:00
kilavvyandGitHub c152db3e2f Fix Typographical Errors in Documentation and Comments (#7331)
Signed-off-by: kilavvy <[email protected]>
2025-06-12 14:01:03 -07:00
Corey RiceandGitHub 5f57300cf9 docs: fix typos in doc string (#7301) 2025-06-11 23:44:15 -07:00
Jonas DanielsandGitHub db20bd17b1 update deps 2 (#7328) 2025-06-11 23:41:12 -07:00
Jonas DanielsandGitHub 0a85205e4a update storybook (#7327) 2025-06-11 23:24:45 -07:00
Jonas DanielsandGitHub cda390eefe update dependencies (#7326) 2025-06-11 21:23:36 -07:00
leopardracerandGitHub 305f738ff1 Fix typos in comments and test descriptions (#7323)
Signed-off-by: leopardracer <[email protected]>
2025-06-11 21:08:07 -07:00
Jonas DanielsandGitHub a1c875c596 [Dashboard] Add self-service dedicated engine deployment option (#7325) 2025-06-11 19:32:08 -07:00
Jonas DanielsandGitHub 38f1821eb9 [Dashboard] Add plan selection step to team onboarding flow (#7324) 2025-06-11 17:56:00 -07:00
jnsdls 848984481f [Dashboard] Add 7-day free trial for Growth plan (#7322)
# Add 7-day free trial for Growth plan and include Starter plan in team onboarding

This PR adds a 7-day free trial indicator for teams that have just signed up but haven't subscribed yet when selecting the Growth plan. It also updates the team onboarding flow to properly handle the Starter plan.

Changes include:
- Added logic to detect if a team qualifies for the 7-day trial (new signup with no payment on Growth plan)
- Added a "7 day free trial" text display for qualifying teams
- Updated the polling logic to consider both "free" and "starter" plans as non-paid plans
- Modified the onboarding description text to remove reference to "free Starter plan"

## Summary by CodeRabbit

- **New Features**
  - Added a clear "7 day free trial" indicator for eligible Growth plan users.

- **Enhancements**
  - Updated onboarding modal text to remove "free" from the Starter plan description.
  - Modified billing plan polling logic to exclude both "free" and "starter" plans before proceeding.

---

## PR-Codex overview
This PR focuses on updating the logic for determining billing plans and enhancing the user experience regarding trial periods in the `InviteTeamMembers` and `PricingCard` components.

### Detailed summary
- In `InviteTeamMembers.tsx`, updated the condition for `isNonFreePlan` to exclude both "free" and "starter" plans.
- Modified the text in `InviteModalContent` to clarify the Starter plan.
- In `pricing-card.tsx`, added a condition for a 7-day trial for teams with a "growth" billing plan and "noPayment" status.
- Changed the rendering logic for remaining trial days to include a message for the 7-day trial.

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

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the pricing logic and UI in the dashboard. It modifies how pricing is handled, specifically for trial periods, and updates the display of pricing information to better reflect the available options and trials.

### Detailed summary
- Changed `price` type from `string | number` to `number`.
- Updated `isNonFreePlan` logic to exclude "starter" plans.
- Revised promotional text for the Growth plan.
- Added logic for a 7-day free trial for new teams on the Growth plan.
- Updated UI to display a "7 Day Free Trial" badge and adjusted pricing display accordingly.
- Modified call-to-action button text based on trial eligibility.

> ✨ 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**
  - Added a "7 Day Free Trial" badge and updated price display for eligible users on the Growth plan.
  - Call-to-action button now shows "Start 7 Day Free Trial" when applicable.

- **Bug Fixes**
  - Improved onboarding flow by updating plan detection logic to better handle "Starter" and "Free" plans.

- **Style**
  - Revised onboarding text to emphasize upgrading to the Growth plan and removed mention of the Starter plan.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-11 19:59:56 +00:00
Jonas DanielsandGitHub 950bbaee1c [Dashboard] Update URL rewrites for grants and superchain pages (#7320) 2025-06-10 18:09:35 -07:00
MananTank 99d6b3b151 Dashboard: Add NFT creation wizard in Asset page (#7315)
<!--

## 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 focuses on improving the handling of file inputs and media uploads within the application. It introduces new functionalities for managing blob URLs, refines error handling, and enhances the user interface for uploading assets.

### Detailed summary
- Added `fileToBlobUrl` function to convert files to blob URLs.
- Enhanced `FileInput` components to accept a `client` prop for better integration.
- Updated error handling in several components to provide more detailed feedback.
- Refined layouts and styles for asset creation pages.
- Introduced new schemas for validating NFT and social URL data.
- Improved tracking functionality for NFT creation steps.
- Added support for handling multiple file types in uploads.
- Enhanced the user interface for attributes and social URLs input fields.

> The following files were skipped due to too many changes: `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/upload-nfts/upload-nfts.tsx`, `apps/dashboard/src/core-ui/batch-upload/batch-table.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/page.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/sales/sales-settings.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/collection-info/nft-collection-info-fieldset.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_components/claim-conditions/snapshot-upload.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/token-info-fieldset.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/components/airdrop-upload.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/nft/NFTMediaFormGroup.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/create-nft-page-ui.tsx`, `apps/dashboard/src/components/shared/FileInput.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/shared-metadata-form.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/distribution/token-airdrop.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/lazy-mint-form.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/upload-nfts/batch-upload/process-files.ts`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/mint-form.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/upload-nfts/single-upload/single-upload-nft.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/update-metadata-form.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/upload-nfts/batch-upload/batch-upload-instructions.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/launch/launch-token.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/create-nft-page.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/upload-nfts/batch-upload/batch-upload-nfts.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch/launch-nft.tsx`

> ✨ 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**
  - Added logic to always display the selected token in token selectors.
  - Introduced a styled drag-and-drop file upload area with error handling and reset options.
  - Added reusable components: file preview for files and URLs, step cards with navigation and tracking, social URLs fieldset, downloadable file button, batch upload instructions, and NFT attribute management.
  - Launched a multi-step NFT creation workflow covering collection info, asset upload (single and batch), sales settings, and launch steps.
  - Added schema validation for NFT metadata including pricing, social URLs, and blockchain addresses.
  - Enabled batch uploading and inline editing of NFTs with price, currency, and supply management.
  - Added advanced sales and royalty settings with real-time validation and analytics tracking.

- **Enhancements**
  - Improved error reporting in toast notifications with detailed parsed messages.
  - Centralized and streamlined media file handling by removing redundant hooks and consolidating upload logic.
  - Enhanced navigation and event tracking across multi-step asset creation flows.
  - Updated UI components to accept client context for consistent file handling.
  - Refined form validation by reusing common schemas.

- **Bug Fixes**
  - Corrected NFT supply column label to "Circulating Supply".
  - Improved loading placeholder text in token selectors.

- **Refactor**
  - Consolidated CSV upload logic and replaced custom drag-and-drop UIs with a unified DropZone component.
  - Replaced multiple media preview components with a single FilePreview component.
  - Updated prop types and component interfaces for better consistency and maintainability.
  - Removed deprecated hooks and unused imports to reduce technical debt.
  - Reorganized and standardized import paths across modules.
  - Simplified step execution logic in launch flows and enhanced retry capabilities.

- **Documentation**
  - Added Storybook stories for DropZone, multi-step status, and NFT upload components to support visual testing and documentation.

- **Chores**
  - Exported utility functions and constants for broader use.
  - Improved styling flexibility by enhancing component className handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-10 21:50:05 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
81c66f4e7b chore(deps): bump github/codeql-action from 3.28.18 to 3.28.19 (#7308)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 12:22:11 -07:00
catalyst17 639356071c docs: add webhooks section to agents and LLMs documentation (#7317)
# [Portal] Feature: Add Webhooks Documentation for AI Agents + Example with multiple ABIs for decoding

## Notes for the reviewer

Example with multiple ABIs for decoding ([related PR](https://app.graphite.dev/github/pr/thirdweb-dev/insight-service/268/fix-improve-ABI-validation-to-support-array-format))

1. Added examples on creating events filters with multiple ABI options

Also, this PR adds comprehensive documentation about using webhooks with AI agents in the Insight platform. The documentation covers:

1. Use cases for webhooks with AI agents
2. How to create and manage webhooks
3. Filtering capabilities, including support for multiple ABIs
4. Information about webhook payloads

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

## Summary by CodeRabbit

- **Documentation**
  - Added a new "Webhooks" section describing how to use webhooks with the Insight API for real-time blockchain event notifications and event-driven AI agents.
  - Provided use cases, filter examples, and links to detailed webhook and payload documentation.
  - Enhanced webhook filter documentation to clarify support for multiple ABIs, including examples for handling ERC-20 and ERC-721 Transfer events.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-10 18:53:39 +00:00
saminacodes 62af256575 [Docs] Update Broken Link (#7319)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the content in the `page.mdx` file related to fees and support for the `Universal Bridge` feature.

### Detailed summary
- Updated the explanation of fees for "Buy With Crypto" to specify fee settings in the project page.
- Revised the link for supported cryptocurrencies to direct to a new URL with a specific service.

> ✨ 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

- **Documentation**
  - Clarified FAQ entry about setting additional fees for swap transactions and provided step-by-step instructions for configuring these fees.
  - Updated the "supported chains" link in the FAQ to use an absolute URL.
  - Removed an unnecessary blank line for improved readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-10 18:46:55 +00:00
jnsdls eb1c705654 [Dashboard] Improve error handling in billing checkout process (#7318)
# Add "Go back" button to Stripe redirect error page and improve error handling

This PR enhances the Stripe redirect error page by adding a "Go back" button, allowing users to navigate away from error states. It also improves error handling in the billing checkout flow by:

1. Converting `getBillingCheckoutUrl()` to return structured responses with proper error messages
2. Adding specific error messages for different HTTP status codes (402 for outstanding invoices, 429 for rate limiting)
3. Displaying these more descriptive error messages to users when checkout fails

These changes provide a better user experience when errors occur during the checkout process.

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

## Summary by CodeRabbit

- **New Features**
  - Added a "Go back" button to the Stripe redirect error page, allowing users to easily return to the previous screen.

- **Bug Fixes**
  - Improved error handling during the checkout process, providing clearer error messages for issues such as authentication, outstanding invoices, rate limiting, and unknown errors. Error messages are now displayed directly on the error page when checkout fails.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-10 18:30:16 +00:00
arcoraven 9643b8d2c5 feat: create/delete teams (#7293)
# [Dashboard] Feature: Add Team Creation and Deletion

## Notes for the reviewer

This PR adds the ability for users to create and delete teams from the dashboard. It includes:

1. Server actions for creating and deleting teams
2. UI integration in the account header, team selector, and account teams page
3. Team deletion functionality in the team settings page

## How to test

- Try creating a new team from the account header dropdown
- Try creating a new team from the account teams page
- Try deleting a team from the team settings page (only available for team owners)

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

- **New Features**
  - Enabled team creation directly from the account and team selection interfaces, allowing users to create a new team and be redirected to its page immediately.
  - Activated the "Create Team" button in relevant menus and headers, making team creation accessible across both desktop and mobile views.

- **Bug Fixes**
  - Improved error handling and user feedback with toast notifications when team creation fails.

- **Refactor**
  - Updated team deletion to use real permission checks and improved the user interface for deleting teams.
  - Added comprehensive handling of authorization and error messages for team creation and deletion operations.
  - Redirected users to the account page when no teams are available.

- **Documentation**
  - Marked the default team retrieval function as deprecated in the documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR primarily focuses on enhancing team management functionalities within the application. It introduces the ability to create and delete teams, updates various UI components to accommodate these changes, and ensures proper redirection and error handling during team operations.

### Detailed summary
- Added `createTeam` function in `createTeam.ts` for team creation.
- Introduced `deleteTeam` function in `deleteTeam.ts` for team deletion.
- Updated UI components to include `createTeam` functionality.
- Modified `TeamHeaderLoggedIn`, `AccountHeader`, and other components to handle team creation and deletion.
- Implemented redirection upon successful team creation and deletion.
- Updated `DeleteTeamCard` and `TeamGeneralSettingsPageUI` to manage permissions for team deletion.
- Enhanced error handling and user feedback with toast notifications during team operations.

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

<!-- end pr-codex -->
2025-06-10 01:44:58 +00:00
jnsdls 56d27d4c63 [Dashboard] Sort usage categories by total amount in descending order (#7314)
# Sort usage categories by total amount

This PR sorts the usage categories displayed on the team usage page by their total amount in descending order. Categories with higher total costs will now appear at the top of the list, making it easier for users to identify their most significant expenses at a glance.

The implementation:
- Creates a `sortedCategories` array by sorting the usage preview data
- Sorts based on the sum of `amountUsdCents` for each category's line items
- Uses the sorted array in the render function instead of the original data

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

## Summary by CodeRabbit

- **Enhancements**
  - Usage categories are now displayed in descending order based on their subtotal amounts, making it easier to identify the highest usage categories at a glance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-09 20:52:46 +00:00
jnsdls e742929b2c [Dashboard] Add notifications system with unread tracking (#7302)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced a new notifications system with a bell icon button displaying unread indicators.
  - Added a notifications panel with Inbox and Archive tabs supporting infinite scrolling and marking notifications as read.
  - Implemented a centralized notification state manager with optimized fetching, caching, and mutation handling.
  - Added a UI drawer component for mobile notification display with smooth open/close interactions.

- **Refactor**
  - Replaced legacy notification button and fetching logic with the new unified Notifications button using only account ID.
  - Removed legacy notification callbacks and components from header and navigation for simplified notification handling.

- **Chores**
  - Removed deprecated notification files and Storybook stories.
  - Updated dependencies by replacing "idb-keyval" with "vaul" for UI drawer functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on removing the `NotificationButton` component and its related files, replacing it with a new `NotificationsButton` component that integrates notifications more effectively within the application.

### Detailed summary
- Deleted `NotificationButton.tsx`, `fetch-notifications.ts`, and `NotificationButton.stories.tsx`.
- Added `NotificationsButton` component with enhanced functionality for displaying notifications.
- Updated various components (`AccountHeaderUI`, `SecondaryNav`, `TeamHeaderUI`) to use `NotificationsButton`.
- Removed references to `getInboxNotifications` and `markNotificationAsRead` from multiple components.
- Introduced new notification management logic and UI components in `notification-list.tsx` and `notification-entry.tsx`.
- Updated dependencies in `package.json` to include the new `vaul` library for UI elements.

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

<!-- end pr-codex -->
2025-06-09 20:09:05 +00:00
MananTank dacfd94af5 Nebula: Improved toasts in move funds page (#7307)
<!--

## 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 focuses on improving error handling and user feedback in the `SendFunds` function by utilizing `toast.promise` for asynchronous operations, enhancing the user experience during token transfers.

### Detailed summary
- Replaced `toast.loading`, `toast.success`, and `toast.error` with `toast.promise` for batch and single token transfers.
- Improved error handling by catching errors without logging them.
- Simplified success and error messages in the toast notifications.
- Removed duration settings for toast notifications.

> ✨ 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

- **Refactor**
  - Toast notifications for sending funds are now streamlined using unified loading, success, and error messages, providing clearer and more consistent feedback during transactions. Error messages are also improved for better clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-09 15:24:28 +00:00
catalyst17 2d15cd6a47 docs: update webhook parameter filtering types and add example (#7295)
# [Portal] Fix: Update webhook parameter filtering documentation

## Notes for the reviewer

This PR updates the webhook filtering documentation to:
1. Correct the type definition for `params` in both events and transactions filters
2. Add a practical example showing how to filter for `Transfer` events with specific parameters

## How to test

Review the updated documentation to ensure the type definitions are correct and the new example is clear and helpful.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `params` property in the webhooks filtering configuration to allow for stricter type definitions, changing it from `Record<string, any>` to `Record<string, string | number>`. It also provides an example of how to filter `Transfer` events.

### Detailed summary
- Changed `params` type in the `webhooks` filtering from `Record<string, any>` to `Record<string, string | number>`.
- Updated `params` type in the `signatures` object from `string[]` to `Record<string, string | number>`.
- Added an example for filtering `Transfer` events with a specific `from` address.

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

<!-- end pr-codex -->
2025-06-09 12:00:22 +00:00
catalyst17 62a3cd8348 fix: make contract and to addresses optional in webhook form (#7294)
<!--

## 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 focuses on improving the handling of contract addresses in the `CreateWebhookModal` and `FilterDetailsStep` components, as well as refining validation logic for addresses in `webhookTypes.ts`. It enhances user experience by clarifying requirements and allowing optional inputs.

### Detailed summary
- In `CreateWebhookModal.tsx`, the `addresses` property now defaults to an empty string if not provided.
- In `FilterDetailsStep.tsx`, the `FormLabel` for "Contract Addresses" and "To Address" no longer includes a required indicator.
- Validation in `webhookTypes.ts` for `addresses`, `fromAddresses`, and `toAddresses` is updated to allow empty inputs and provide clearer error messages.

> ✨ 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

- **Bug Fixes**
	- Removed the required field indicator from "Contract Addresses" and "To Address" labels in the form UI.

- **New Features**
	- Updated form validation to allow "Contract Addresses", "From Address", and "To Address" fields to be optional and accept empty values, with improved error messages for clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-09 12:00:22 +00:00
Phillip HoandGitHub 2a4195b4ad chore: pass authToken to analytics query (#7306) 2025-06-09 17:51:38 +08:00
Phillip HoandGitHub 6378f371c5 chore: pass allowImpersonation flag to /v2/keys/use (#7303) 2025-06-08 17:59:00 +08:00
Jonas DanielsandGitHub b3e42f7407 [Dashboard] Add audit log feature for Scale plan teams (#7300) 2025-06-07 00:37:21 -07:00
MananTank 044f897763 Nebula: Add Move funds page (#7298)
<!--

## 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 focuses on enhancing the user experience in the `Nebula` application by adding new features, improving existing components, and ensuring better handling of user authentication and fund transfers.

### Detailed summary
- Updated redirect logic in `middleware.ts` to preserve search params and prevent redirect from certain paths.
- Added `placeholder` prop to `DecimalInput` in `decimal-input.tsx`.
- Integrated `TWAutoConnect` component in `ChatPageLayout.tsx`.
- Enhanced `TransactionButton` in `TransactionButton.tsx` to manage a new `disableNoFundsPopup` prop.
- Refactored `NebulaProviders` to remove redundant `TWAutoConnect` usage.
- Created a new `RecoverPage` component in `move-funds/page.tsx` for fund recovery.
- Introduced `MoveFundsConnectButton` for connecting wallets in `connect-button.tsx`.
- Implemented a new `MoveFundsPage` for managing fund transfers.
- Updated `MismatchButton` to handle the new `disableNoFundsPopup` prop.
- Enhanced token management and user feedback within the `MoveFundsPage`.
- Added new components and functions for improved token selection and balance rendering.

> ✨ 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**
	- Introduced a Move Funds page for transferring cryptocurrency between wallets, featuring wallet connection, chain and token selection, and transaction handling.
	- Added a customizable connect button supporting multiple authentication methods and theme adaptation.
	- Added the ability to display placeholder text in decimal input fields.
	- Enhanced button components with an option to disable the "Not Enough Funds" popup.
	- Added a dedicated page layout combining header, theme toggle, support link, and Move Funds functionality.
	- Integrated automatic wallet connection within the chat page layout for seamless user experience.

- **Bug Fixes**
	- Updated middleware to allow unauthenticated access to the Move Funds page without redirecting to the login page.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-07 00:45:33 +00:00
jnsdls 7fa5be5317 [Dashboard] Add staff mode for viewing teams without membership (#7299)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added a "STAFF MODE" warning banner for users viewing a team they do not belong to, with a button to leave staff mode.
- **User Interface**
  - Adjusted the team header layout for improved accessibility, ensuring the team badge is no longer nested inside the team link.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR primarily focuses on updating the `TeamHeaderUI` component and enhancing the `TeamLayout` and `ProjectLayout` components to incorporate a "Staff Mode" feature, which restricts user actions based on team membership.

### Detailed summary
- Modified the structure of the `TeamHeaderUI` component to wrap the `Link` inside a `span`.
- Added a "Staff Mode" warning message in `TeamLayout` if the user is not part of the team.
- Implemented the same "Staff Mode" warning in `ProjectLayout`.
- Updated API calls to include `getTeamBySlug` and `getProject`.

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

<!-- end pr-codex -->
2025-06-06 21:42:16 +00:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2510c4f0c1 Version Packages (#7297)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-06 12:43:05 -05:00
gregandGitHub 69bf925c01 [SDK] Feature: preferred chan id pay embed (#7296) 2025-06-06 11:54:06 -05:00
Yash094 d4aed43b18 feat: add SIWA feedback functionality to dashboard chat (#7272)
<!--

## 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 focuses on refactoring the `CustomChatContent` and `CustomChats` components to improve type safety and functionality in handling user messages and feedback. It introduces new types and methods for managing chat messages and feedback submission.

### Detailed summary
- Replaced `NebulaUserMessage` with `UserMessage` and `CustomChatMessage`.
- Added `handleFeedback` function for submitting feedback on messages.
- Updated `CustomChats` component to handle new message types and feedback.
- Modified `sendMessage` logic in `ChatBar` to use the new message structure.
- Introduced `RenderMessage` and `StyledMarkdownRenderer` for rendering chat messages.
- Added feedback buttons for assistant messages in `RenderMessage`.

> ✨ 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**
  - Introduced a new chat interface supporting multiple message types with distinct visual styles.
  - Enabled users to submit feedback (thumbs up/down) on assistant messages.
  - Enhanced chat experience with auto-scrolling that respects user interactions.

- **Bug Fixes**
  - Prevented duplicate feedback submissions on assistant messages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-06 16:24:33 +00:00
Jonas DanielsandGitHub f89c15c517 [Dashboard] Add detailed usage breakdown and billing preview (#7290) 2025-06-06 00:11:11 -07:00
MananTank c95c0dc5bd Nebula: Fix AutoConnect not using nebula client in root layout (#7291)
<!--

## 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 focuses on updating the `TWAutoConnect` component to accept a `client` prop, allowing for better integration with different third-party clients in the application.

### Detailed summary
- Updated `TWAutoConnect` in `layout.tsx` to accept a `client` prop.
- Introduced `thirdwebClient` in `providers.tsx` to provide the client to `TWAutoConnect`.
- Modified `TWAutoConnect` component to require a `client` prop.
- Updated usage of `TWAutoConnect` in `nebula-app/providers.tsx` to pass in `nebulaAppThirdwebClient`.

> ✨ 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**
  - Improved integration of client context within the auto-connect wallet feature, enhancing authentication and connectivity for users.

- **Refactor**
  - Updated internal handling of client instances for wallet auto-connect components to streamline authentication processes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-06 00:45:26 +00:00
GiselleNessi c77b4d8f85 updated old support links to portal (#7286)
<!--

## 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 focuses on updating the `SupportPage` component in the `page.tsx` file by adding new features, modifying existing sections, and improving the overall structure and content of the help products.

### Detailed summary
- Added new icons: `HomeIcon`, `WalletIcon`, `EngineIcon`, `InsightIcon`, `PayIcon`, and `NebulaIcon`.
- Introduced a new help product: "Playground".
- Replaced "Connect" product icon and updated its description.
- Changed "Contracts" to "Universal Bridge" with a new icon and description.
- Updated "Engine" product with a new icon and description.
- Replaced "Account" with "Insight" and updated its details.
- Replaced "Misc" with "Nebula" and updated its details.
- Changed section title from "Knowledge base" to "Learning Resources".
- Modified product icon rendering from image to component usage.
- Updated button text from "View All" to "View".

> ✨ 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**
  - Introduced new products "Playground" and "Nebula" to the support page.
- **Improvements**
  - Updated product categories, icons, and descriptions for a clearer overview.
  - Replaced static images with modern icon components for improved visual consistency.
  - Changed page heading to "Learning Resources."
  - Simplified layout by replacing help article lists with concise product descriptions.
  - Shortened the "View All" button text to "View."
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-05 21:13:38 +00:00
PaoloRollo 5c4c49b90a [Dashboard] Fix: Handle ping event (#7287)
<!--

## 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.

-->

This PR adds a simple `ping` case in the `promptNebula` function to avoid `console.warn` logs in the browser console.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR adds support for a new event type, `"ping"`, in the `ChatStreamedEvent` type definition and handles the `"ping"` event case in the event processing logic.

### Detailed summary
- Added a new case for `"ping"` in the event handling switch statement.
- Introduced a new type definition for the `"ping"` event in the `ChatStreamedEvent` type, including a `data` field of type `string`.

> ✨ 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**
  - Improved chat event handling with support for a new "ping" event type, enhancing the stability of real-time chat updates.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-05 18:55:15 +00:00
MananTank a5cd66439c [TOOL-4687] Dashboard: Show Special Price UI in claim tokens card (#7284)
<!--

## 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 focuses on improving the `RecentTransfers` and `ClaimTokenCardUI` components in a React application by refining state management, simplifying logic, and enhancing UI elements.

### Detailed summary
- Removed `hasFetchedOnce` state in `RecentTransfers`.
- Changed condition for disabling the button in `RecentTransfersUI`.
- Simplified logic for claim parameters in `ClaimTokenCardUI`.
- Introduced `TokenPrice` component to handle price display.
- Added tooltip for special pricing indication.
- Adjusted UI elements for better clarity and organization.

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

<!-- end pr-codex -->
2025-06-05 18:44:04 +00:00
MananTank 05f65ec150 [TOOL-4686] Dashboard: Add supply remaining progress in asset page claim tokens card (#7283)
<!--

## 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 enhances the `ClaimTokenCardUI` component by adding a new `SupplyRemaining` feature, which displays the supply of tokens claimed and remaining. It also improves the UI with a progress bar and formatting adjustments.

### Detailed summary
- Added `Progress` component for visual representation of supply sold.
- Introduced `SupplyRemaining` function to show claimed and remaining supply.
- Formatted supply numbers using `compactNumberFormatter`.
- Updated headings and styling for better UI consistency.

> ✨ 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**
  - Added a visual display showing claimed versus total claimable token supply, including a progress bar and percentage sold.
- **Style**
  - Improved typography and spacing for headings and token symbol labels for better visual consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-05 18:44:04 +00:00
gregandGitHub 6610633799 [Dashboard] Fix: Async team analytics rendering (#7289) 2025-06-05 12:19:36 -05:00
MananTank 7ab79dc3bb Dashboard: Fix contract deploy page missing last used teamId in client object (#7285)
<!--

## 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 focuses on updating the authentication mechanism by replacing the usage of `getAuthToken` with `getUserThirdwebClient` in the `page.tsx` and `uri-based-deploy.tsx` files, enhancing the handling of third-party client connections.

### Detailed summary
- Removed `getAuthToken` and its associated logic in `page.tsx`.
- Introduced `getUserThirdwebClient` to fetch the client in `page.tsx`.
- Updated the `isLoggedIn` prop in `PublishedContract` to use `!!account`.
- Adjusted the logic in `uri-based-deploy.tsx` to fetch client and teams without `authToken`.
- Changed the `isLoggedIn` prop to always be `true` in `uri-based-deploy.tsx`.

> ✨ 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

- **Refactor**
  - Streamlined the process for obtaining the user client, simplifying authentication and client initialization for published contract and deploy flows.
  - Improved logic for login checks and client handling, reducing redundant token fetching and making the login state determination more straightforward.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-05 14:07:42 +00:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2b39669e46 Version Packages (#7277)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-05 05:30:01 -07:00
ArseniiandGitHub e3e3142f7e fix: handle short storage values in beacon proxy pattern (#7282) 2025-06-05 05:21:22 -07:00
ArseniiandGitHub 7c0b80d132 fix: handle short proxyStorage in getBeaconFromStorageSlot (#7281) 2025-06-05 04:45:21 -07:00
Joaquim VergesandGitHub 5c1db8bf27 [Dashboard] Add Sophon testnet to custom claim amounts (#7280) 2025-06-05 04:26:01 -07:00
Phillip HoandGitHub a87446a9e6 fix: invalid handling of ISO time in RPC graphs (#7279) 2025-06-05 17:01:04 +08:00
saminacodes 9493fda7bf [Docs] webhook and ub docs (#7278)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the user experience for webhooks in the thirdweb platform by updating sidebar navigation, adding troubleshooting information, and improving documentation on configuring webhooks.

### Detailed summary
- Updated sidebar in `insight` to rename "Getting Started" to "Get Started".
- Added "Troubleshoot" section with `WrenchIcon` in `pay` sidebar.
- Introduced troubleshooting content in `troubleshoot/page.mdx`.
- Enhanced `webhooks/page.mdx` with new structure and images for configuration steps.
- Revised descriptions and added a "Get started" section in `webhooks/page.mdx`.

> ✨ 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**
  - Added a "Troubleshoot" section in the sidebar for Universal Bridge, providing guidance for resolving payment card issues.
  - Introduced a troubleshooting article explaining card support errors and suggesting alternative payment methods.

- **Documentation**
  - Enhanced the Insight Webhooks documentation with step-by-step setup instructions, visual aids, and improved metadata description.
  - Added a new "Get started" section to guide users through webhook creation and testing.

- **Style**
  - Renamed the "Getting Started" sidebar link under Webhooks to "Get Started" for consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-04 23:39:32 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
59dbae0c21 chore(deps): bump biomejs/setup-biome from 2.5.0 to 2.5.1 (#7250)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-04 16:00:50 -07:00
Jonas DanielsandGitHub 42236d43a8 [service-utils] Remove starter_legacy plan type (#7276) 2025-06-04 16:00:32 -07:00
jnsdls a920d1ee07 [Dashboard] Restrict billing actions to team owners only (#7274)
# Improve Billing UI for Non-Owner Team Members

This PR enhances the billing UI to properly handle permissions for team members who aren't owners. It:

- Restricts billing actions to team owners only
- Adds tooltips explaining why certain actions are disabled
- Properly disables buttons for non-owner team members
- Improves the Button component to handle disabled state for non-button elements

## Key Changes:

- Added `isOwnerAccount` flag to billing components to conditionally render or disable actions
- Enhanced Button component to properly handle disabled state for non-button elements (like anchor tags)
- Added tooltips to explain why actions are disabled for non-owners
- Restricted the following actions to team owners only:
  - Selecting/changing plans
  - Managing billing
  - Topping up credits
  - Paying invoices

These changes ensure a better UX for team members who don't have billing permissions while maintaining full functionality for team owners.

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

- **New Features**
	- Added owner-only restrictions for billing and payment actions. Only team owners can change plans, manage billing, top up credits, or pay invoices. Non-owner users now see disabled buttons with tooltips explaining these restrictions.
- **Accessibility**
	- Improved accessibility for disabled buttons by adding appropriate ARIA attributes and visual indicators.
- **User Interface**
	- Updated tooltips and button states to clearly communicate permission-based access to billing features.
	- Enhanced button behavior to consistently reflect disabled states across different elements and contexts.
- **Bug Fixes**
	- Standardized disabled state handling for buttons and interactive elements, ensuring consistent visual and functional behavior.
- **Chores**
	- Replaced internal navigation links with standard anchor elements for external billing-related links, improving security with added link attributes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR primarily focuses on enhancing user experience by adding an `isOwnerAccount` boolean prop to various components. This prop controls the visibility and functionality of certain actions, ensuring that only team owners can perform specific tasks.

### Detailed summary
- Changed `<Link>` to `<a>` in `billing.tsx` for proper link behavior.
- Added `isOwnerAccount` prop to multiple components and updated their functionality based on ownership status.
- Introduced `ToolTipLabel` to provide contextual information for actions restricted to team owners.
- Updated button states to reflect whether actions are enabled or disabled based on `isOwnerAccount`.

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

<!-- end pr-codex -->
2025-06-04 14:02:54 -07:00
MananTank 2329a22bf1 Dashboard: Poll for active claim condition before continuing with minting in coin launch (#7273)
<!--

## 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 polling mechanism to ensure that claim conditions are set before proceeding with token minting in the `CreateTokenAssetPage` component.

### Detailed summary
- Added import for `pollWithTimeout` utility.
- Implemented polling logic to check for active claim conditions before minting.
- Set a timeout of 30 seconds for the polling process.

> ✨ 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**
  - Improved the token creation process by ensuring minting only begins after claim conditions are confirmed, providing a more reliable experience for users.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-04 20:14:51 +00:00
Jonas DanielsandGitHub b25d2afa8b [Dashboard] Fix peak rate date formatting with error handling (#7271) 2025-06-04 02:19:36 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
8910f55ca2 Version Packages (#7245)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-04 00:31:34 -07:00
Joaquim VergesandGitHub b237318b7d [SDK] Support EIP7702 execution for ecosystem wallets (#7268) 2025-06-04 00:09:00 -07:00
Jonas DanielsandGitHub 082d9630f4 [Dashboard] Add crypto payment option for invoices (#7270) 2025-06-04 00:03:15 -07:00
Jonas DanielsandGitHub d4bc8e199d [Dashboard] Fix Stripe balance calculation in getStripeBalance function (#7269) 2025-06-03 22:45:25 -07:00
Jonas DanielsandGitHub 4edf1ebe95 [Dashboard] Add crypto top-up functionality for account credits (#7239) 2025-06-03 22:07:33 -07:00
MananTank b12725b231 [TOOL-4673] Dashboard: Enable posthog session recording for nebula app (#7267)
<!--

## 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 focuses on enhancing the `PHProvider` component by introducing a `disable_session_recording` prop, allowing for more control over session recording. Additionally, it renames the `Providers` component to `PayProviders` and `BridgeProviders` in their respective files for clarity.

### Detailed summary
- Added `disable_session_recording` prop to `<PHProvider>` in multiple files.
- Renamed `Providers` to `PayProviders` in `Providers.client.tsx` and `pay/layout.tsx`.
- Renamed `Providers` to `BridgeProviders` in `Providers.client.tsx` and `bridge/layout.tsx`.
- Updated the `PHProvider` function signature to accept `disable_session_recording` as a prop.

> ✨ 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**
	- Added explicit controls to enable or disable session recording across different sections of the dashboard.
- **Refactor**
	- Renamed provider components for improved clarity in the Bridge and Pay sections.
	- Updated component usage to reflect new provider names.
- **Style**
	- No visual changes introduced.
- **Bug Fixes**
	- None.
- **Documentation**
	- None.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-04 04:13:00 +00:00
MananTank 3d1c321bd6 [TOOL-4642] Fix useTxNotifications errors not shown in project contract pages (#7259)
<!--

## 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 focuses on adding an `ErrorProvider` wrapper around the layout of the `ContractLayout` component to handle errors more effectively.

### Detailed summary
- Added import for `ErrorProvider`.
- Wrapped the main layout in an `ErrorProvider`.
- Removed the previous layout structure while integrating the `ErrorProvider`.
- Maintained the structure of `TeamHeaderLoggedIn`, `SharedContractLayout`, `SaveLastUsedProject`, and `AppFooter` within the new error handling context.

> ✨ 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**
  - Improved error handling on the contract page with the addition of enhanced error context support.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-03 22:50:54 +00:00
MananTank 810ec6efa7 [TOOL-4651] Dashboard: Show error on invalid token distribution in ERC20 asset creation form (#7260)
<!--

## 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 focuses on enhancing the `TokenDistributionFieldset` component by adding error handling for token distribution and improving the UI by displaying error messages. It also updates the `StepCard` and `DistributionBarChart` components to accommodate new features.

### Detailed summary
- Added `disabled` prop to `StepCard`.
- Integrated error handling in `TokenDistributionFieldset` for distribution validation.
- Displayed error messages when distribution exceeds supply.
- Improved `DistributionBarChart` to conditionally style text based on segment percentages.
- Introduced `getDistributionError` and `SafeNumber` utility functions for validation logic.

> ✨ 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**
  - Added validation to ensure token distribution does not exceed total supply, with error messages displayed when limits are surpassed.
  - The "Next" submit button in the token creation flow can now be disabled based on validation errors.

- **Bug Fixes**
  - Owner percentage in the distribution chart is now prevented from displaying negative values.

- **Style**
  - Segment labels in the distribution chart legend are visually highlighted if their percentage is outside the 0–100% range.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-03 22:41:55 +00:00
MananTank 1c6ed9bd0d [TOOL-4667] Dashboard: Various improvements in ERC20 asset creation flow (#7264)
<!--

## 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 focuses on renaming references from "Token" to "Coin" throughout the codebase, along with some improvements in error handling and component structure.

### Detailed summary
- Renamed "Token" to "Coin" in various components and UI elements.
- Updated the `parseError` function to be exported.
- Introduced `ContractTypeCellUI` for better contract type rendering.
- Modified multi-step status handling to include more structured error messages.

> ✨ 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 multi-step status tracking with structured error messages and improved error display in step-based processes.

- **Improvements**
	- Updated all user-facing terminology from "Token" to "Coin" across creation, distribution, and sale interfaces.
	- Distribution and allocation charts now reflect "Coin" terminology and dynamically display the coin symbol when available.
	- Improved contract table to show "Coin" for relevant contract types.
	- Refined event tracking to trigger only when relevant actions occur.

- **Bug Fixes**
	- Error messages in step-based processes are now displayed more clearly with detailed information.

- **Refactor**
	- Streamlined contract type badge rendering for consistency and maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-03 22:33:11 +00:00
MananTank 82035fd0b7 [TOOL-4670] Dashboard: Update Managed Engine CTA, UI tweaks (#7266)
<!--

## 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 `bottomLineClassName` prop to the `TabLinks` and `TabPathLinks` components, enhancing customization options for styling. It also simplifies the UI in the `EmptyEngineState` component and updates the layout for better structure and readability.

### Detailed summary
- Added `bottomLineClassName` prop to `TabLinks` and `TabPathLinks`.
- Updated `TabLinks` to use `bottomLineClassName` for styling.
- Simplified `EmptyEngineState` content and button structure.
- Refactored layout in `Layout` component for improved organization.
- Adjusted `EngineLegacyBannerUI` for better spacing and button layout.

> ✨ 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

- **Refactor**
  - Updated navigation layout for the engine section with new tabbed navigation and improved header structure.
  - Adjusted container layouts for more consistent spacing and alignment.

- **Style**
  - Restyled the legacy banner, including button order, alignment, and icon adjustments for a clearer appearance.
  - Enhanced tab navigation with customizable bottom line styling for better visual integration.

- **Bug Fixes**
  - Unified the messaging and actions for adding a managed engine instance, removing plan-based differences for a more consistent user experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-03 22:21:32 +00:00
gregandGitHub 8b324597fb Feature: Update UB Docs for latest SDK and Guides (#7265) 2025-06-03 15:53:14 -05:00
FirekeeperandGitHub 5ebb7549ca [SDK] Force legacy for Plume 98866 (#7263) 2025-06-03 12:14:33 -07:00
MananTank dfe4cf0928 [TOOL-4645] Dashboard: Improve Project overview page loading performance (#7261)
<!--

## 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 focuses on improving the loading state of various chart components in the dashboard by enhancing the `LoadingChartState` component with additional styling and refactoring the code to utilize asynchronous components for better performance and user experience.

### Detailed summary
- Updated `LoadingChartState` to accept a `className` prop for custom styling.
- Modified `Suspense` components in `Transactions`, `RpcMethodBarChartCard`, and `EngineCloudChartCard` to use improved `LoadingChartState`.
- Introduced new async components: `AsyncTotalSponsoredCard`, `AsyncAuthMethodDistributionCard`, and `AsyncAppHighlightsCard`.
- Refactored fetching logic for analytics data to use async/await pattern, improving readability and maintainability.

> ✨ 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

- **Refactor**
  - Improved loading placeholders across analytics cards by simplifying their appearance and updating styling for a more consistent look.
  - Modularized data fetching for analytics cards, allowing each card to load and handle errors independently for a smoother user experience.

- **New Features**
  - Loading states for analytics cards now display updated visual styles with borders and adjusted heights.

- **Style**
  - Unified and customizable loading chart styles for better visual consistency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-03 16:31:36 +00:00
Joaquim VergesandGitHub 6cce31d828 [Dashboard] Add support for Sophon mainnet (#7258) 2025-06-03 01:59:10 -07:00
Joaquim VergesandGitHub aaad876a6f [Docs] Add Bundler API reference documentation (#7257) 2025-06-03 01:31:16 -07:00
gregandGitHub de297e4c97 [SDK] Feature: Track insufficient funds error across SDK (#7256) 2025-06-02 17:16:29 -05:00
pinkhoodie 2114e5f91f Add text input option to airdrop setup (#7238)
- Add manual text input alternative to CSV upload for airdrop addresses

- Support multiple input formats: space, comma, equals, and tab separated

- Parse text input and convert to CSV format for existing validation system

- Reuse all existing functionality: ENS resolution, address validation, duplicate removal

- Maintain same validation flow and error handling as CSV upload

- Change button text from 'Upload CSV' to 'Set up Airdrop' for clarity

![image](https://github.com/user-attachments/assets/e43afdd8-eed8-491a-ac93-9f02eb6ee703)
![image](https://github.com/user-attachments/assets/42522fa1-3886-4d68-a113-079d58b3da96)

<!--

## 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 enhances the CSV upload functionality in the `TokenAirdropSection` component. It introduces a new method for processing CSV data, allows manual entry of addresses and amounts, and updates UI labels to reflect the new functionality.

### Detailed summary
- Added `processData` function in `useCsvUpload` for processing parsed CSV data.
- Updated `TokenAirdropSection` UI labels from "CSV File Uploaded" to "Airdrop List Set".
- Changed button text from "View CSV" to "View List".
- Introduced `parseTextInput` function for manual input parsing.
- Added text input for entering addresses and amounts.
- Implemented handling for text input submission.
- Updated the layout to separate CSV upload and manual entry sections.

> ✨ 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**
  - Added the ability to manually enter airdrop addresses and amounts using a text area, supporting multiple input formats.
  - Users can now choose between uploading a CSV file or entering addresses and amounts directly.

- **UI Updates**
  - Updated labels and button texts to reflect support for both CSV and manual list input.
  - Improved layout with a visual divider and clear instructions for manual entry.
  - Enhanced reset and validation behaviors for both input methods.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-02 20:57:20 +00:00
Phillip HoandGitHub ca0841745a fix: docs formatting for verified domains page (#7248) 2025-06-02 17:08:03 +08:00
Phillip HoandGitHub d150ea1c91 docs: Add page on domain verification (#7247) 2025-06-02 16:33:17 +08:00
saminacodes f1479b85f0 [Docs] Improvements to acct, ec, and vault docs (#7246)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating various documentation and component links within the `thirdweb` portal, as well as enhancing the content of FAQs and guides to provide clearer information on account management, migration to the TypeScript SDK v5, and Engine Cloud features.

### Detailed summary
- Added `Account` link to `supportLinks` in `Header.tsx`.
- Included warning about deprecation of TypeScript SDK v4 in `page.mdx`.
- Added troubleshooting details for transactions in `Engine Troubleshoot Guide`.
- Updated FAQ on customized plans in `faq/page.mdx`.
- Introduced ownership transfer steps in `manage-team/page.mdx`.
- Removed outdated Nebula access details in `faqs/page.mdx`.
- Added details about server wallet keys and admin key usage in `vault/faqs/page.mdx`.
- Updated pricing explanation and added a new chains support detail in `Engine Cloud` FAQ.
- Introduced a new section on `Smart Server Wallets`, detailing benefits and security in `server-wallets/page.mdx`.

> ✨ 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**
  - Introduced a new documentation page for Smart Server Wallets, outlining features, security, and pricing.
  - Added new FAQ entries to the Vault documentation regarding key requirements for server wallets and admin key handling.
  - Added a new FAQ entry detailing supported chains for Engine Cloud.

- **Improvements**
  - Updated navigation links in the header, moving "Account" to support links and adding a "Status" link.
  - Enhanced troubleshooting guidance for Engine Cloud transactions.
  - Updated Engine Cloud pricing FAQ to reference the pricing page.
  - Added a warning callout about TypeScript SDK v4 deprecation to the migration guide.
  - Expanded billing documentation with a new section on transferring team ownership.
  - Clarified the FAQ about signing up for customized or enterprise plans.

- **Removals**
  - Removed outdated Nebula FAQ entries related to access approval and pricing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-02 02:24:09 +00:00
Joaquim VergesandGitHub 283dc289fc [SDK] Include native tokens in Insight.getOwnedTokens (#7243) 2025-06-01 01:31:23 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
8abf3cc777 Version Packages (#7231)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-31 03:55:10 -07:00
Joaquim VergesandGitHub f10fbc8383 [SDK] Optimize fiat conversion query (#7242) 2025-05-31 03:14:45 -07:00
Joaquim VergesandGitHub 38627d352b [SDK] Handle smart account detection for inApp and ecosystem wallets (#7241) 2025-05-31 02:39:26 -07:00
Joaquim VergesandGitHub ad8cc9a1d2 [SDK] Add Bridge.tokens() function to retrieve supported tokens (#7240) 2025-05-31 02:29:12 -07:00
Manan TankandGitHub 4e935392fa SDK: Fallback to insight response if RPC request fails in getNFTs extensions (#7234) 2025-05-30 23:54:24 -07:00
MananTank f44d6ba282 [TOOL-4648] Dashboard: Fix timestamp in sponsored transactions table (#7236)
<!--

## 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 focuses on refactoring the rendering logic of the `SponsoredTransactionsTableUI` component to improve clarity and functionality, particularly around handling timestamps and the rendering of table rows.

### Detailed summary
- Changed the way `transaction.timestamp` is handled to ensure it always ends with "Z".
- Simplified the mapping of `props.sponsoredTransactions` to use a block body for clarity.
- Added `client` prop to `ProjectCell`.
- Enhanced readability of the table structure by removing unnecessary code.

> ✨ 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

- **Bug Fixes**
	- Improved accuracy of transaction timestamps by ensuring all are treated as UTC.
	- Enhanced consistency in date and time display for sponsored transactions.

- **New Features**
	- Added support for passing client information to project, chain, and wallet address displays in the transactions table.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 23:41:53 +00:00
MananTank 3678054931 Dashboard: Fix TS errors (#7235)
<!--

## 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 focuses on updating the `clientId` prop being passed to the `PayEmbedFTUX` component in the `PayAnalytics.tsx` file.

### Detailed summary
- Changed the `clientId` prop from `props.clientId` to `props.projectClientId` in the return statement of the `PayEmbedFTUX` component when both `hasVolume` and `hasWallet` are false.

> ✨ 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

- **Bug Fixes**
  - Corrected an issue where the wrong client ID was passed to the PayEmbedFTUX component, ensuring accurate display and functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 21:25:13 +00:00
gregandGitHub 196cb54ae9 [Dashboard] Feature: Adds PostHog tracking to bridge page (#7232) 2025-05-30 13:23:12 -07:00
gregandGitHub ed2d64197d [Dashboard] add empty state for Pay analytics (#7206) 2025-05-30 13:08:28 -07:00
Manan TankandGitHub e141e11ff3 Dashboard import paths cleanup (#7229) 2025-05-30 13:07:39 -07:00
MananTank 6ae54ddd98 Dashboard: Remove useThirdwebClient hook (#7228)
<!--

## 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 focuses on integrating the `ThirdwebClient` into various components and functions across the application, enhancing the client functionality for better interaction with smart contracts and improving the overall architecture.

### Detailed summary
- Added `client` prop to multiple components for better contract interactions.
- Updated functions to utilize the `contract.client` instead of a generic client.
- Removed redundant imports of `useThirdwebClient`.
- Enhanced several UI components to accept and use the `client` prop.
- Modified API calls to pass the `client` where necessary for fetching data.
- Improved handling of ENS queries by passing the `client` directly.

> The following files were skipped due to too many changes: `apps/dashboard/src/components/contract-components/hooks.ts`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/connect/account-abstraction/factories/page.tsx`, `apps/dashboard/src/components/embedded-wallets/Configure/index.tsx`, `apps/dashboard/src/components/contract-components/contract-publish-form/index.tsx`, `apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx`

> ✨ 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**
  - Many components now accept a client instance as a prop, enabling more explicit and flexible client management throughout the dashboard.
- **Refactor**
  - Shifted from internal client initialization to explicit client prop injection across the app, affecting forms, tables, media components, contract publishing, and wallet settings.
  - Updated hooks and utility functions to require a client parameter instead of relying on internal context.
- **Chores**
  - Removed unused files and internal hooks related to client management.
- **Bug Fixes**
  - Improved consistency and reliability when handling authentication and client context in user flows.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 18:51:17 +00:00
gregandGitHub 8245c06b3e [SDK] Fix: Token price cache to use proper address (#7230) 2025-05-30 11:48:33 -07:00
MananTank 1c11f84481 Dashboard: Reduce useThirdwebClient hook usage #4 (#7227)
<!--

## 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 focuses on enhancing the `TransactionButton` component across various files by adding a `client` prop and other relevant properties to improve transaction handling and user interactions.

### Detailed summary
- Added `client` prop to `TransactionButton` in multiple components for transaction management.
- Included `isLoggedIn`, `txChainID`, and `transactionCount` props where applicable.
- Enhanced user experience by managing loading states and enabling/disabling buttons based on conditions.

> ✨ 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**
  - All transaction-related buttons and components now require and receive an explicit client instance, improving reliability and consistency across the dashboard.
- **Refactor**
  - Updated component interfaces to accept a client prop instead of relying on internal hooks.
  - Standardized the way client instances are passed through component hierarchies, including in forms, modals, and tables.
  - Renamed certain props for clarity (e.g., `clientId` to `projectClientId`).
- **Style**
  - No user-facing visual changes.
- **Chores**
  - Improved code maintainability by removing internal hook usage for client access.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 18:35:01 +00:00
MananTank b84db126d7 Dashboard: Reduce useThirdwebClient hook usage #3 (#7226)
<!--

## 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 primarily focuses on updating the usage of the `client` prop throughout various components in the application, replacing instances of `useThirdwebClient` with a more consistent approach using `getClientThirdwebClient`.

### Detailed summary
- Added `client` prop to multiple components including `AccountPage`, `DeployedContractsPage`, and `FaucetButton`.
- Replaced `useThirdwebClient` with `getClientThirdwebClient` in various files.
- Ensured consistency in passing the `client` prop across components.
- Updated the `ProfileHeader`, `PayModalButton`, and `SendTestTransaction` to accept `client` as a prop.
- Modified forms and sections to utilize the `client` prop for better integration with Thirdweb services.

> ✨ 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

- **Refactor**
  - Updated various components to receive a client instance as a prop instead of obtaining it internally, improving consistency and making client usage more explicit throughout the app.
  - Enhanced component interfaces to require a client prop where necessary, ensuring proper client context is passed across the dashboard.
  - Adjusted authentication and layout flows to support explicit client instantiation and propagation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 18:35:01 +00:00
MananTank a4406214c6 Dashboard: Reduce useThirdwebClient hook usage #2 (#7224)
<!--

## 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 focuses on enhancing the functionality of various components by integrating a `client` prop of type `ThirdwebClient` into multiple files. This change improves the interaction with the Thirdweb SDK across the application.

### Detailed summary
- Added `client` prop to components like `IconUpload`, `SolidityInput`, and `CustomConnectWallet`.
- Updated hooks and functions to accept `client` for better SDK integration.
- Modified forms to utilize the `client` for storage uploads and contract deployments.
- Enhanced `AddChainToWallet` and `EcosystemHeader` to support `client`.
- Updated various fieldsets to include `client`, improving data handling and validation.

> ✨ 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**
  - Components and forms now consistently accept and require a `client` prop, providing improved client context across wallet connection, contract deployment, network configuration, and NFT interactions.

- **Refactor**
  - Updated numerous components and hooks to require explicit passing of the `client` instance, replacing previous internal retrieval methods.
  - Prop types and interfaces were extended to include the new `client` property, ensuring consistent usage throughout the app.

- **Bug Fixes**
  - Addressed missing `client` props in several components to prevent potential issues with client-dependent functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 18:35:01 +00:00
MananTank 02627631b6 Dashboard: Reduce useThirdwebClient hook usage (#7223)
<!--

## 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 primarily focuses on adding a `client` prop to various components across the dashboard application, enhancing their functionality and ensuring consistent access to the `ThirdwebClient`.

### Detailed summary
- Added `client` prop to `BatchMetadata`, `Royalty`, `Mintable`, `Transferable`, `Claimable`, and other components.
- Updated `WalletAddress` component to accept `client` prop in multiple instances.
- Enhanced various tables and UI components to utilize the `client` prop for improved data handling.
- Refactored existing components to ensure compatibility with the new `client` prop, ensuring consistent client access throughout the application.

> ✨ 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 all WalletAddress displays across the dashboard to accept and utilize a new client context for improved integration and consistency.
- **Refactor**
  - Updated multiple components and their props to require and pass a client instance, ensuring unified client handling throughout tables, modals, and analytics views.
  - Replaced static table column definitions with dynamic, memoized columns that respond to client changes.
  - Standardized prop names related to client identification for clarity and maintainability.
- **Bug Fixes**
  - Ensured client context is consistently propagated to all relevant child components, preventing potential rendering or data issues.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 18:35:00 +00:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
913b243147 Version Packages (#7217)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-30 10:16:10 -07:00
gregGitHubcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
3edbe2898c [Dashboard] Fix: Purchase Data (#7225)
Signed-off-by: greg <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-05-30 09:45:34 -07:00
pinkhoodie 926dad4556 Update ChatBar.tsx to allow for copy/paste and drag/drop file uploads (#7153)
<!--

## 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 enhances the `ChatBar` component by adding image upload validation, drag-and-drop functionality, and user feedback through toast notifications. It improves user experience by ensuring only valid images are uploaded and prompts users to sign in if they attempt to upload without permission.

### Detailed summary
- Added `showSigninToUploadImagesToast` function for user notifications.
- Introduced `isDragOver` state for drag-and-drop feedback.
- Updated `handleImageUpload` to validate file types and sizes.
- Implemented drag-and-drop event handlers for image uploads.
- Added clipboard paste support for image uploads.
- Modified `ImageUploadButton` to use validated files directly.

> ✨ 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**
  - Added support for image uploads via drag-and-drop and clipboard paste in the chat bar.
  - Enhanced visual feedback during drag-and-drop image uploads.
  - Added prompts for users to sign in when attempting image uploads without authorization.

- **Bug Fixes**
  - Improved validation for image uploads, including file size and total image count limits.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 13:46:07 +00:00
Yash094 0639d0d9ea siwa updates and new article (#7197)
<!--

## 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 focuses on enhancing the chat functionality within the application by adding a feedback system, updating icons, and improving the knowledge base content related to ERC20 token transfers.

### Detailed summary
- Added a new knowledge base entry for "Transfer Amount Exceeds Allowance".
- Updated `Header` and `Hero` components to replace `BotIcon` with `MessageCircleIcon`.
- Introduced `sendFeedback` function to handle user feedback on chat messages.
- Modified `Chat` component to include feedback buttons (thumbs up/down) for messages.

> ✨ 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**
	- Introduced feedback buttons (thumbs up/down) for assistant messages in the AI chat, allowing users to rate responses.
	- Added a new "Ask AI" button on the main page, providing quick access to the chat assistant.
	- Added a new knowledge base article explaining the "ERC20: transfer amount exceeds allowance" error and its resolution.
- **Improvements**
	- Enhanced chat message payloads with source identifiers for better context.
	- Updated sidebar navigation with a new troubleshooting entry for ERC20 transfer allowance issues.
	- Updated chat and header icons to use a consistent message circle icon for AI-related features.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 07:58:58 +00:00
Joaquim VergesandGitHub 4fed9f4593 [SDK] Update token price APIs to query from insight directly (#7220) 2025-05-29 22:48:48 -07:00
arcoraven f2e8b9ecab feat: add Engine Cloud analytics to project overview (#7195)
# [Dashboard] Feature: Add Engine Cloud Analytics Charts

Example screenshot:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/vKjRiOG6EUjD7XH4cppU/73d7e2b9-23bd-46b5-8cae-5564a3630770.png)

## Notes for the reviewer
This PR adds Engine Cloud analytics to the dashboard, displaying request data in a bar chart visualization. The implementation includes:

1. A new API endpoint to fetch Engine Cloud method usage data
2. New UI components for displaying Engine Cloud analytics:
   - `EngineCloudBarChartCardUI` - Shows Engine Cloud requests by pathname
   - `EngineCloudChartCardUI` - Shows Engine Cloud methods usage with percentage breakdown
3. Integration of the new chart into the project analytics page

## How to test
- View the Storybook component at "Analytics/EngineCloudBarChartCard"
- Navigate to a project dashboard to see the Engine Cloud analytics chart
- Verify data is properly fetched and displayed in the chart

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a new feature to track and visualize `EngineCloud` statistics in the dashboard, enhancing analytics capabilities with new components and API integrations.

### Detailed summary
- Added `EngineCloudStats` interface in `analytics.ts`.
- Implemented `getEngineCloudMethodUsage` API function.
- Created `EngineCloudChartCard` component for displaying cloud stats.
- Developed `EngineCloudBarChartCardUI` for rendering bar charts.
- Added storybook entries for `EngineCloudBarChartCardUI`.
- Enhanced existing analytics with new data visualizations.

> ✨ 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**
  - Introduced a stacked bar chart visualization for engine cloud request statistics in the analytics dashboard.
  - Added a chart card displaying engine cloud method usage data with loading state support.
  - Enhanced analytics with time series data for multiple API pathnames.
  - Included engine cloud method usage data in the project analytics view.

- **Chores**
  - Updated `.gitignore` to exclude the `.pnpm-store/` directory from version control.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 01:34:51 +00:00
AmineAfia 523412437b Replace Select with Popover in webhook signature selection UI (#7219)
## [Dashboard] Feature: Replace Select with Popover for Event and Function Signature Selection

## Notes for the reviewer
This PR replaces the Select component with a Popover component for both event and function signature selection in the webhook filter details step. The change improves the user experience by providing a more customizable dropdown interface.

Key changes:
- Replaced Select/SelectContent/SelectItem with Popover/PopoverContent/PopoverTrigger
- Added state hooks to manage popover open states
- Improved styling and layout of signature selection options
- Maintained existing functionality for selecting signatures and updating form values

## How to test
Test the webhook creation flow, specifically when selecting event or function signatures. Verify that:
1. The popover opens and closes correctly
2. Selecting a signature properly updates the form
3. The selected signature displays correctly in the trigger button
4. The signature details (name, hash/selector) are properly displayed

<!-- start pr-codex -->

---

## PR-Codex overview
This PR refactors the `FilterDetailsStep` component to replace the `Select` dropdowns with a new `SignatureDropdown` component, enhancing the UI interaction by using a `Popover` for selecting event and function signatures.

### Detailed summary
- Removed `Select` dropdowns for event and function signatures.
- Introduced `SignatureDropdown` component for better UI/UX.
- Integrated `Popover` for displaying signature options.
- Updated state management for selected signatures and ABIs.
- Added new props for `SignatureDropdown` to handle selection and display.

> ✨ 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**
  - Introduced a new dropdown for selecting event and function signatures, offering a clearer and more interactive selection experience.

- **Style**
  - Updated the signature selection interface to use a popover-based dropdown for improved usability and consistency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 01:19:05 +00:00
arcoraven ac4ade6262 chore: remove Team from confirmEmail response (#7200)
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on removing references to `Team` in various components related to email verification and onboarding, simplifying the data structure passed around.

### Detailed summary
- Removed `teamStub` import and related references in `VerifyEmail.stories.tsx`.
- Eliminated `Team` type imports in `useApi.ts`, `VerifyEmail.tsx`, and `account-onboarding-ui.tsx`.
- Updated `onEmailConfirmed` and `verifyEmail` props to only handle `account` in `VerifyEmail.tsx` and `account-onboarding-ui.tsx`.
- Adjusted the `onComplete` prop in `AccountOnboardingProps` to reflect the removal of `team`.

> ✨ 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

- **Refactor**
  - Simplified onboarding and email verification flows by removing the requirement for team-related data. All relevant callbacks and functions now operate solely with account information.
- **Type Updates**
  - Updated type signatures for onboarding and verification handlers to exclude the team property, streamlining integration for end-users and developers.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 01:03:44 +00:00
Jonas DanielsandGitHub 819ce86c61 [thirdweb] Update dev script to use nodenext module format (#7218) 2025-05-29 18:02:25 -07:00
Jonas DanielsandGitHub 86fd445276 [service-utils] Add platform, SMS, and pay capabilities to TeamCapabilities type (#7210) 2025-05-29 18:01:54 -07:00
joaquim-verges 55fba51dab [Dashboard] Unhide Engine Cloud service (#7215)
<!--

## 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 focuses on updating service descriptions and modifying hidden services in the codebase.

### Detailed summary
- Updated the description of the `insight` service to "Indexed data for any EVM chain."
- Changed the title of the `engineCloud` service from "Server wallets" to "Engine Cloud."
- Updated the description of the `engineCloud` service to "Transaction API and Server wallets with high transaction throughput and low latency."
- Removed `engineCloud` from the `HIDDEN_SERVICES` array.

> ✨ 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

- **Chores**
  - Updated service descriptions for improved clarity.
  - Refined metadata for select services.
- **Refactor**
  - Adjusted visibility of certain services in API key settings.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 00:33:15 +00:00
jnsdls 7c95211b98 [Dashboard] update pricing plans and UI components (#7208)
# Update Pricing Plans and UI

This PR updates our pricing plans and UI to better align with our new pricing strategy:

- Replaced "Accelerate" plan with "Pro" plan
- Updated pricing: Starter ($5), Growth ($99), Scale ($499), Pro ($1499)
- Added "Starting at" label for Pro plan
- Updated feature lists across all plans
- Changed pricing card UI to use `DollarSignIcon` instead of `CircleDollarSignIcon`
- Added locale formatting for price display
- Updated team onboarding flow to show Growth, Scale and Pro plans
- Removed Cloud Hosted Engine section from Engine Footer Card
- Removed standalone Pro Card from pricing page

These changes ensure our pricing structure is more intuitive and better reflects the value of each tier.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating billing plans and their associated features in the application. It introduces a new `pro` plan, modifies existing plans, and adjusts the UI components to reflect these changes.

### Detailed summary
- Added `"plan:pro"` to billing plans.
- Updated comments from "accelerate" to "growth" for clarity.
- Replaced `CheckIcon` with `DollarSignIcon` in pricing components.
- Adjusted pricing for `starter` (from $9 to $5) and `growth` (from $79 to $99).
- Renamed `accelerate` plan to `scale` with a new price of $499.
- Introduced `pro` plan priced at $1499 with specific features.
- Adjusted invite permissions to restrict `starter` plan.
- Updated billing plan checks throughout components to include new plan logic.
- Removed deprecated `CloudHostedEngineSection` component.

> ✨ 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**
  - Introduced a new "pro" billing plan with updated pricing, features, and dedicated account executive support.
  - Added "scale" plan as a replacement for the previous "accelerate" plan, featuring expanded infrastructure and support options.

- **Enhancements**
  - Improved pricing display formatting for better readability.
  - Updated plan descriptions and feature lists for clarity and consistency across all plans.
  - Refined plan selection and upgrade prompts to reflect the new plan structure.

- **Bug Fixes**
  - Corrected plan requirement messaging for editing SMS countries to accurately reference the "growth" plan.

- **Removals**
  - Removed the "accelerate" and "starter" plans from UI and plan selection.
  - Eliminated the ProCard component and legacy usage credit mentions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-30 00:16:27 +00:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
3bb1fe0e1f Version Packages (#7214)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-29 17:02:32 -07:00
MananTank a1aba2989e Dashboard: Various Asset page updates (#7212)
<!--

## 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 focuses on enhancing tracking functionality and improving the UI components for better user feedback during token operations in the dashboard application.

### Detailed summary
- Updated `ProjectSidebarLayout.tsx` to simplify the `label` for the Engine section.
- Refactored date formatting in `RecentTransfers.tsx` for improved readability.
- Enhanced error handling and tracking in `launch-token.tsx`, `create-token-page-impl.tsx`, and `tracking.ts`.
- Improved tracking data structure by consolidating parameters in functions.
- Added success and error tracking in `ClaimTokenCardUI` for better user feedback during transactions.

> ✨ 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**
  - Added a success screen after purchasing tokens, displaying confirmation details and options to view the transaction or buy more.
  - Enhanced analytics tracking for token purchase and deployment flows, capturing more detailed error information and contextual metadata.

- **Bug Fixes**
  - Improved timestamp handling for recent transfers to ensure consistent display of relative times.

- **Style**
  - Updated the sidebar to remove the "New" badge from the "Engine" link.

- **Refactor**
  - Streamlined analytics tracking functions to use structured parameter objects and improved error message handling.

- **Chores**
  - Minor cleanup, including removal of unnecessary console logs.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-29 23:43:42 +00:00
AmineAfia deeca886a4 Add support for chain filtering in webhook creation (#7209)
## [Dashboard] Feature: Add Chain Filtering for Webhooks

## Notes for the reviewer
This PR adds support for filtering available chains in the webhook creation flow. It fetches supported chains from the Insight API and restricts the chain selection in the UI to only those chains that are supported for webhooks.

## How to test
1. Navigate to the webhooks page for a project
2. Verify that the chain selector in the webhook creation modal only shows supported chains
3. Confirm that the API call to fetch supported chains works correctly

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

- **New Features**
  - Added support for dynamically fetching and displaying supported blockchain networks when creating or managing webhooks.
  - The network selector now only shows networks that are currently supported for webhooks.
  - Users are notified if no supported blockchain networks are available for webhooks.

- **Bug Fixes**
  - Improved error handling and messaging when no supported blockchain networks are available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the `NetworkSelectors` and webhook components by adding support for multiple chain IDs, improving the data handling for webhooks, and integrating the fetching of supported chains from an API.

### Detailed summary
- Added `chainIds` prop to `NetworkSelectors` and filtered `allChains` based on it.
- Updated `CreateWebhookModal` to accept `supportedChainIds`.
- Modified `WebhooksTable` to include `supportedChainIds`.
- Introduced `getSupportedWebhookChains` API call to fetch supported chains.
- Updated `FilterDetailsStep` to utilize `supportedChainIds`.
- Adjusted `WebhooksPage` to manage `supportedChainIds` and handle API responses.

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

<!-- end pr-codex -->
2025-05-29 23:32:31 +00:00
Joaquim VergesandGitHub 31c4bb22fc [SDK] Add account deletion support when unlinking profiles (#7211) 2025-05-29 16:31:53 -07:00
MananTank 3b1e16c8b7 [TOOL-4621] New ERC20 public contract page (#7177)
<!--

## 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 primarily focuses on enhancing the dashboard's functionality and user interface by updating environment variable usage, improving component layouts, and refining analytics features. It also introduces new components and modifies existing ones for better data handling and presentation.

### Detailed summary
- Added `NEXT_PUBLIC_DASHBOARD_CLIENT_ID` to `public-envs.ts`.
- Updated `CreateTokenAssetPage` to pass `teamSlug` and `projectSlug`.
- Changed `projectSlug` to use `project.slug` in `marketplace` page.
- Enhanced `EmptyChartState` to accept a `type` prop.
- Updated `getTokenStepTrackingData` to include "deploy" action.
- Introduced `LoadingDots` component for loading states.
- Refactored multiple layout components to include `TeamHeader`.
- Added new public page handling logic in various components.
- Updated analytics functions to utilize the new client ID.
- Improved error handling and response management in analytics API calls.
- Added `DecimalInput` component to replace standard input in `token-sale.tsx`.

> The following files were skipped due to too many changes: `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/shared-layout.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components/Analytics.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/RecentTransfers.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/PriceChart.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/claim-tokens/claim-tokens-ui.tsx`

> ✨ 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**
  - Added new layout components with team headers for various dashboard sections.
  - Introduced `LoadingDots` component for animated loading indicators.
  - Added `PublicPageConnectButton` and `PageHeader` components for public pages.
  - Implemented public ERC-20 token page with price charts, token stats, recent transfers, and buy token embed.
  - Added token claim card UI with transaction step feedback for purchasing tokens.
  - Added hooks for fetching token price data and token transfers.
  - Added utility to fetch currency metadata for tokens.
  - Added comprehensive contract analytics overview component.
  - Introduced `DecimalInput` component for validated decimal input handling.
  - Added new social media brand icons for Discord and Telegram.

- **Improvements**
  - Enhanced area and bar charts with customizable styles, tooltip formatting, and explicit empty state types.
  - Improved empty chart state visuals with new area chart gradients and replaced spinner with animated dots.
  - Unified environment variable usage for client IDs across API calls and client initializations.
  - Updated contract overview to display call-to-action banner linking to public asset pages for ERC-20 tokens.
  - Enhanced contract table to conditionally show contract address or asset page links based on context.
  - Improved primary dashboard button to link to asset pages when applicable.
  - Added redirects to public landing pages for unsupported contract views lacking project metadata.
  - Wrapped existing layouts with conditional team headers for consistent UI in public/private views.
  - Added pagination and detailed tables for recent token transfers.
  - Updated project slug usage in marketplace listings for accuracy.
  - Introduced dynamic time precision handling in analytics charts and tooltips.
  - Added optional balance check control to transaction and mismatch buttons.
  - Replaced local decimal input component with shared validated decimal input component.
  - Added optional target attribute for call-to-action links in upsell banners.
  - Refined accessibility and sizing of icon components.

- **Bug Fixes**
  - Fixed environment variable naming for client IDs to ensure consistent API integration.

- **Refactor**
  - Standardized header and layout components for a unified dashboard experience.
  - Replaced spinner with animated dots in loading states for smoother UX.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-29 23:03:08 +00:00
jnsdls 1f42ad2a2d [Dashboard] migrate SelectOption to shadcn (#7194)
Migrated the `SelectOption` component in the dashboard batch upload flow to use shadcn/ui primitives and Tailwind classes.

- Replaced Chakra `Tooltip`, `Flex`, and `Radio` usage with `ToolTipLabel` and Tailwind markup
- Switched to shadcn/ui `Card`
- Removed dependency on Chakra typography components
- Updated component props to extend HTML attributes

Fixes migration step towards removing Chakra.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `SelectOption` component to improve its structure and styling. It replaces the `Tooltip` from `@chakra-ui/react` with a custom `ToolTipLabel`, modifies the layout and styling, and enhances the handling of props.

### Detailed summary
- Changed `SelectOptionProps` to extend `React.HTMLAttributes<HTMLDivElement>`.
- Replaced `Tooltip` with `ToolTipLabel`.
- Updated the card styling and structure.
- Modified the layout for `Radio` to a custom implementation.
- Adjusted class names for better styling consistency.
- Changed the rendering of `name` and `description` to use HTML elements directly.

> ✨ 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

- **Refactor**
  - Updated the selection option component with custom UI elements and Tailwind CSS styling, removing dependencies on Chakra UI and previous component libraries.
  - Improved accessibility and styling for tooltips, cards, and selection indicators.
  - Maintained original functionality and interactions with a refreshed look and feel.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-29 21:25:21 +00:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
0299034fc1 Version Packages (#7207)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-29 13:30:44 -07:00
Joaquim VergesandGitHub 861e623a1b [SDK] Engine search transactions and batch transaction support (#7190) 2025-05-29 13:19:26 -07:00
MananTank 6a335bfa77 Fix requests to thirdwebstorage-dev.com not set with secret-key (#7205)
<!--

## 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 focuses on updating the `fetch.ts` file in the `thirdweb` package to include a new URL for the thirdweb storage service.

### Detailed summary
- Added `".thirdwebstorage-dev.com"` to the list of URLs.

> ✨ 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

- **Chores**
  - Updated the list of recognized thirdweb service domains to include ".thirdwebstorage-dev.com".

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-29 20:09:50 +00:00
AmineAfia cb994dcb8f Re-enable webhooks sidebar link in project dashboard (#7196)
## [Dashboard] Feature: Add Webhooks to Project Sidebar

## Notes for the reviewer

This PR adds the Webhooks option to the project sidebar navigation. The option was previously commented out due to a scrolling issue, which has now been resolved.

## How to test

Navigate to a project page and verify that the Webhooks option appears in the sidebar with a "New" badge.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR primarily focuses on refining the handling of webhook payloads and enhancing the `ProjectSidebarLayout` component by reintroducing the webhooks link. It also updates the API fetch calls to ensure they consistently use HTTPS.

### Detailed summary
- Changed `params` type in `webhookPayloadUtils.ts` from `Record<string, unknown> | unknown[]` to `Record<string, unknown>`.
- Updated `params` in the `buildTransactionWebhookPayload` function to use an empty object instead of an empty array.
- Reintroduced the webhooks link in `ProjectSidebarLayout.tsx` with appropriate properties.
- Updated fetch calls in `webhooks.ts` to use HTTPS for the API domain in multiple functions (`getWebhooks`, `deleteWebhook`, `testWebhook`).

> ✨ 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**
  - Re-enabled the "Webhooks" link in the project sidebar, now visible with a "New" badge.

- **Bug Fixes**
  - Improved API reliability by ensuring all webhook-related network requests use the correct HTTPS scheme.

- **Refactor**
  - Updated internal data structures for webhook payloads to improve consistency and type safety.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-29 19:30:57 +00:00
Joaquim VergesandGitHub 4d38a7e8fe Update page.mdx (#7204)
Signed-off-by: Joaquim Verges <[email protected]>
2025-05-29 11:32:36 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
89e6af6baf Version Packages (#7164)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-29 11:10:34 -07:00
catalyst17 b345cc115e docs: add docs on aggregates (#7201)
# [Portal] Feature: Add Aggregation Examples and Documentation to Insight

## Notes for the reviewer

This PR adds comprehensive documentation for the Insight aggregation functionality across multiple pages:

- Added an "Aggregation Examples" section to the LLMs page with code samples
- Added detailed aggregation documentation to the Agents and LLMs page
- Added aggregation examples to the Blueprints page for Events, Transactions, Wallet Transactions, and Blocks
- Added FAQs about aggregation queries
- Added "Using Aggregation Presets" section to the Get Started page
- Enhanced Use Cases page with example aggregations for relevant scenarios

## How to test

Review the documentation for clarity and accuracy. The examples should be consistent with the actual API functionality.

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

- **Documentation**
  - Added comprehensive examples and explanations for using aggregation functions in Insight API queries across multiple documentation sections, including blueprints, use cases, FAQs, and getting started guides.
  - Introduced new sections detailing aggregation presets, usage patterns, and code snippets for blockchain data analysis.
  - Enhanced clarity on performing statistical and summary queries, with guidance on leveraging the Insight Playground for interactive exploration.
  - Updated the Insight landing page with a new feature card highlighting powerful aggregation capabilities and improved layout for feature cards.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR enhances the documentation for the `Insight` tool by adding new aggregation features, examples, and updating existing content to clarify how to utilize these functionalities effectively.

### Detailed summary
- Added `FunctionSquareIcon` to the import statement in `page.mdx`.
- Updated grid layout class from `lg:grid-cols-2` to `lg:grid-cols-3` in `page.mdx`.
- Introduced a new `FeatureCard` titled "Powerful Aggregations" in `page.mdx`.
- Added sections on aggregation queries and examples in `faqs/page.mdx`, `get-started/page.mdx`, and `agents-and-llms/page.mdx`.
- Provided aggregation examples in `use-cases/page.mdx` and `blueprints/page.mdx`.
- Enhanced documentation for wallet transactions and blocks, including aggregation examples in `agents-and-llms/page.mdx`.

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

<!-- end pr-codex -->
2025-05-29 17:37:27 +00:00
gregandGitHub 3d3c6f3d45 Fix: Transfer purchase data (#7202) 2025-05-29 10:30:15 -07:00
Robby UitbeijerseandGitHub ff3a79c884 chore: annotate getBuyWithFiatQuote as deprecated (#7198) 2025-05-29 09:00:53 -07:00
kumaryash90 16482cfa6a Stylus ERC20 template for CLI (#7192)
<!--

## 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 enhances the `create.ts` and `builder.ts` files for the Stylus project by adding project type selection and improving contract name handling during ABI processing. It introduces prompts for user input and refines how contract names are extracted and utilized.

### Detailed summary
- In `create.ts`, added prompts for selecting project type (Default or ERC20).
- Updated project creation logic based on the selected type.
- In `builder.ts`, improved contract name extraction to handle multiple contracts.
- Added prompts for selecting the entrypoint if multiple contracts are found.
- Refined usage of selected contract names throughout the build process.

> ✨ 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**
  - Added support for handling multiple contract ABIs, allowing users to select a contract entrypoint when more than one is present.
  - Introduced a prompt to select a project template type ("default" or "erc20") during project creation.

- **Improvements**
  - Enhanced error handling and user guidance when no contract is selected or found.
  - Updated success messages and console output for improved clarity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-29 12:12:00 +00:00
jnsdls e8a25d70b9 [Dashboard] replace chakra stats in accounts (#7188)
## Summary
- swap chakra `SimpleGrid`, `Stat`, `Skeleton` for shadcn `StatCard`
- use Tailwind grid utility classes

## Checklist
- [x] `pnpm biome check --apply`
- [x] `pnpm test` *(fails: spawn anvil ENOENT)*

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on refactoring the `AccountsCount` component to replace the `Card` and `SimpleGrid` components from `@chakra-ui/react` with a new layout using `StatCard` from a different module, enhancing the presentation of the total accounts data.

### Detailed summary
- Removed imports for `SimpleGrid`, `Skeleton`, `Stat`, `StatLabel`, and `StatNumber`.
- Added import for `StatCard` from `../../overview/components/stat-card`.
- Changed the layout from `SimpleGrid` and `Card` to a `div` with a grid layout.
- Updated the rendering to use `StatCard` for displaying the total accounts.

> ✨ 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

- **Refactor**
  - Updated the accounts count display to use a new StatCard component with improved layout and styling for a more consistent and responsive user interface.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-29 00:55:53 +00:00
gregandGitHub 44a7460c83 [SDK] Feature: Remove Switch Network button (#7191) 2025-05-28 17:45:07 -07:00
gregandGitHub 0731831169 Fix: Webhook docs tags (#7189) 2025-05-28 17:11:21 -07:00
AmineAfia 91750eddc6 Temporarily remove webhooks sidebar link until scrolling issue is fixed (#7187)
## [Dashboard] Fix: Temporarily remove Webhooks from sidebar

## Notes for the reviewer

Commented out the Webhooks section in the project sidebar until we resolve a scrolling issue. Also removed the unused BellIcon import.

## How to test

Verify that the Webhooks option no longer appears in the project sidebar navigation.

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

## Summary by CodeRabbit

- **Bug Fixes**
  - Temporarily removed the "Webhooks" link from the project sidebar to address a scrolling issue. The link and its badge are no longer visible.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 23:45:59 +00:00
iuwqyir 2fc083f1f2 token owners endpoint in insight playground (#7184)
## [Dashboard] Feature: Update Token and NFT API Endpoints

## Notes for the reviewer

This PR adds a new token endpoint and updates the name of an existing NFT endpoint:

1. Added a new endpoint for getting token owners by contract: `/v1/tokens/owners`
2. Renamed the "Get NFTs by owner" endpoint to simply "Get NFTs" to better reflect its functionality

## How to test

Verify the updated endpoint names appear correctly in the Insight section of the playground.

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

## Summary by CodeRabbit

- **New Features**
  - Added a new API endpoint for retrieving token owners by contract.

- **Refactor**
  - Renamed the "Get NFTs by owner" endpoint to "Get NFTs" for improved clarity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 23:26:30 +00:00
AmineAfia 75ae536e61 Add scrollable overflow to webhook filter select dropdowns (#7186)
## [Dashboard] Fix: Add scrolling to webhook event and function signature dropdowns

## Notes for the reviewer

This PR adds scrolling functionality to the webhook event and function signature dropdown menus by adding `max-h-60 overflow-y-auto` classes. This ensures that when there are many options, users can still navigate through them effectively.

## How to test

1. Navigate to the webhooks section in a project
2. Open the event signature dropdown and verify it scrolls properly when there are many options
3. Similarly, test the function signature dropdown to ensure it maintains its max width while allowing vertical scrolling

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

## Summary by CodeRabbit

- **Style**
  - Improved dropdown menus for event and transaction signature selection by limiting their maximum height and enabling vertical scrolling, enhancing usability when many options are available.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the `FilterDetailsStep` component by improving the usability of the dropdown content with better scrolling behavior.

### Detailed summary
- Updated the `className` of the first `<SelectContent>` from default to `max-h-60 overflow-y-auto` for better vertical scrolling.
- Updated the second `<SelectContent>` to include `overflow-y-auto` while retaining `max-w-[600px]`.

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

<!-- end pr-codex -->
2025-05-28 23:11:30 +00:00
gregandGitHub 41e59a9c20 [SDK] Feature: Adds explicit country param to onramps (#7185) 2025-05-28 16:11:09 -07:00
Joey BrightandGitHub fd97406fa2 chore: fix typos (#7180) 2025-05-28 16:10:17 -07:00
AmineAfia c336de3bfb Add webhook creation UI to dashboard (#7174)
<!--

## 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 focuses on enhancing the `CreateWebhookModal` component and related functionalities in the webhook management system, including form handling, validation, and API integration for creating webhooks.

### Detailed summary
- Changed `createWebhook` function to `export async function createWebhook`.
- Updated `CreateWebhookModal` to accept `clientId` prop.
- Integrated form steps for creating a webhook with validation.
- Added utility functions for parsing addresses and building webhook payloads.
- Improved error handling and user feedback during webhook testing.
- Enhanced UI components for better user experience in the webhook creation process.

> ✨ 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**
  - Introduced a multi-step modal form for creating webhooks, including form validation, ABI integration, and live endpoint testing.
  - Added components for basic info entry, filter configuration, and review before submission.
  - Enabled dynamic ABI fetching and signature extraction for blockchain event and transaction filters.
  - Improved error handling and user feedback throughout the webhook creation flow.

- **Bug Fixes**
  - Enhanced validation and error messages for webhook URLs and date handling in tables.

- **Chores**
  - Added comprehensive utility modules for ABI processing and webhook payload construction.
  - Implemented robust type definitions and validation schemas for webhook forms.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 22:02:27 +00:00
AmineAfia c420099dc3 Add webhook testing functionality to dashboard (#7173)
<!--

## 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 enhances the webhook testing functionality in the dashboard application by exporting the `testWebhook` function, adding a testing feature in the `WebhooksTable`, and creating a custom hook `useTestWebhook` to manage the testing state and results.

### Detailed summary
- Changed `testWebhook` from a local function to an exported function in `webhooks.ts`.
- Imported `PlayIcon` in `WebhooksTable.tsx` and added it to the UI.
- Implemented `handleTestWebhook` function to test webhooks and display results.
- Created `useTestWebhook` hook to manage testing state and results.
- Added error handling and success notifications for webhook testing.

> ✨ 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**
  - Added the ability to test webhooks directly from the webhooks table with a "Test" button, providing immediate feedback and status indicators during testing.
- **User Interface**
  - Enhanced the actions column in the webhooks table for improved layout and usability, including real-time spinner icons and error notifications during webhook testing.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 22:02:27 +00:00
AmineAfia dcb412fc27 Add webhooks page to project dashboard (#7172)
<!--

## 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 `CreateWebhookModal` component and enhances the `Webhooks` functionality in the dashboard. It implements a `WebhooksTable` for displaying webhooks and their details, along with error handling and user notifications for actions like deleting webhooks.

### Detailed summary
- Added `CreateWebhookModal` component for creating new webhooks.
- Updated `ProjectSidebarLayout` to include a link to webhooks with a new badge.
- Changed `WebhookResponse` and `WebhookFilters` interfaces to `export`.
- Modified `WebhooksPage` to handle project and webhook loading with error management.
- Introduced `WebhooksTable` for displaying webhooks with actions.
- Implemented `RelativeTime` component to show formatted timestamps.
- Added deletion functionality for webhooks with user notifications.

> ✨ 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**
  - Introduced a "Webhooks" section in the project sidebar, highlighted with a "New" badge.
  - Added a dedicated Webhooks page displaying a list of webhooks in a sortable table with options to copy URLs and delete entries.
  - Included a "New Webhook" button and modal for future webhook creation.
  - Implemented a component to display relative creation times for webhooks.
- **Bug Fixes**
  - Improved error handling and user feedback for webhook-related actions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 22:02:26 +00:00
catalyst17 4705a599a2 feat: redesign aggregate parameter input with improved UI (#7179)
# [Dashboard] Feature: Redesign Aggregate Parameter Input Component

## Notes for the reviewer

This PR completely redesigns the aggregate parameter input component with a more user-friendly interface. The new design uses a popover pattern instead of the previous MultiSelect approach, making it easier to view and select aggregation presets.

## How to test

1. Open any insight blueprint that uses aggregation
2. Click on the aggregate parameter input
3. Test searching for presets, selecting/deselecting options
4. Verify that manual text entry still works in the textarea
5. Check that the selected aggregations display correctly when the popover is closed
2025-05-28 21:48:48 +00:00
catalyst17 f7331f15a2 feat: enhance aggregate parameter input with multi-select presets (#7168)
## [Dashboard] Feature: Enhance Aggregate Parameter Input with Multi-Select Functionality

## Notes for the reviewer
This PR replaces the simple dropdown select with a more robust multi-select component for aggregate parameter inputs. The new implementation allows users to select multiple presets and displays them as badges.

## How to test
Test the new aggregate parameter input by:
1. Opening the insight blueprint page
2. Selecting multiple presets from the dropdown
3. Verifying that selected values appear as badges
4. Testing the search functionality within the preset selector
5. Confirming that manual input still works alongside preset selection

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

- **New Features**
  - Enhanced aggregate parameter input with combined manual entry and multi-select for presets.
  - Added search functionality within the multi-select component for easier preset selection.
  - Updated parameter descriptions and examples for "aggregate" to clarify multi-selection usage.
- **Refactor**
  - Made input options optional and improved synchronization between manual input and multi-select.
  - Adjusted tooltip positioning for better UI alignment on aggregate parameters.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR enhances the `ParameterSection` and `AggregateParameterInput` components to provide dynamic descriptions and examples based on the parameter type. It also refines the handling of selected values and manual input for aggregations, replacing the `Select` component with a `MultiSelect`.

### Detailed summary
- Updated `description` and `exampleToShow` in `ParameterSection` based on `param.name`.
- Introduced `MultiSelect` in `AggregateParameterInput` for selecting aggregation presets.
- Added state management for manual input and selected values.
- Removed the `Select` component in favor of a more flexible input system.

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

<!-- end pr-codex -->
2025-05-28 21:48:47 +00:00
AmineAfia a5d6e769db Add webhook API functions for insight dashboard (#7171)
<!--

## 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 functionality for managing webhooks in the application. It includes a temporary `WebhooksPage` for displaying webhook data and implements several API functions for creating, retrieving, deleting, and testing webhooks.

### Detailed summary
- Added `WebhooksPage` component in `page.tsx` to display webhook data.
- Implemented `getWebhooks` function to fetch webhooks from the API.
- Created interfaces for webhook responses and payloads.
- Added `createWebhook`, `deleteWebhook`, and `testWebhook` functions for managing webhooks.
- Handled API errors with appropriate responses.

> ✨ 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**
  - Introduced the ability to create, view, delete, and test webhooks through the dashboard interface, allowing users to manage webhook integrations more easily.
  - Added a new dashboard page displaying webhook data for better visibility and management.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 21:20:24 +00:00
jnsdls 97b8926024 [Dashboard] migrate external links form (#7156)
## Summary
- refactor contract publish resources inputs
- use shadcn/ui Button, Input, and Separator
- apply tailwind classes

## Testing
- `pnpm biome check --apply apps/dashboard/src/components/contract-components/contract-publish-form/external-links-fieldset.tsx apps/dashboard/src/components/contract-components/contract-publish-form/external-links-input.tsx`
- `pnpm test` *(fails: spawn anvil ENOENT)*

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the UI components in the `ExternalLinksFieldset` and `ExternalLinksInput` files to improve the styling and structure using custom components instead of those from `tw-components` and `@chakra-ui/react`.

### Detailed summary
- Replaced `Heading` and `Text` with custom HTML elements in `ExternalLinksFieldset`.
- Updated button styles in `ExternalLinksFieldset` to use `variant="outline"` and added a `className`.
- Refactored `ExternalLinksInput` to use custom components (`Button`, `Input`, `Label`, `Separator`) instead of Chakra UI components.
- Changed layout structure in `ExternalLinksInput` to use `div` elements with flexbox for better styling.
- Added error message handling below input fields in `ExternalLinksInput`.

> ✨ 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

- **Style**
  - Updated form and button components to use new UI primitives and Tailwind CSS classes for a refreshed appearance.
  - Improved accessibility by linking input labels and error messages with appropriate HTML attributes.

- **Refactor**
  - Replaced Chakra UI components with custom or alternative UI components, maintaining existing functionality and validation logic.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 15:47:22 +00:00
Joaquim VergesandGitHub 655df037dd [SDK] fix hiddenWallets prop (#7183) 2025-05-28 01:46:03 -07:00
Joaquim VergesandGitHub cbde32e974 [Dashboard] add wallet user search (#7182) 2025-05-28 01:14:14 -07:00
Joaquim VergesandGitHub 8ed5ef3f81 [Dashboard] Change "Network" label to "Select Testnet" in analytics test transaction form (#7178) 2025-05-28 00:52:08 -07:00
Joe-Thirdweb e14a1349e1 [Dashboard] Add token request route to dashboard (#7112)
TOOL-4443
TOOL-4559

How to Test
1. Log into dashboard
2. Select a project
3. Click on Universal Bridge on left hand side
4. Click on Settings
5. Scroll down to add token section

-  Failure input
Chain: Ethereum
Token Address: 0x7613c48e0cd50e42dd9bf0f6c235063145f6f8db

-Success input
Chain: Ethereum
Token Address:0x7613c48e0cd50e42dd9bf0f6c235063145f6f8dc

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a new validation schema for route discovery, enhances the UI for token submission, and integrates a new `RouteDiscovery` component to facilitate token discovery in the dashboard.

### Detailed summary
- Added `routeDiscoveryValidationSchema` in `validations.ts` for validating token discovery inputs.
- Created `RouteDiscovery` component to handle token submission.
- Updated `page.tsx` to include `RouteDiscovery` below `PayConfig`.
- Implemented `addUniversalBridgeTokenRoute` function in `tokens.ts` for API token submission.
- Added `RouteDiscoveryCard` component for better UI presentation of token discovery.

> ✨ 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**
  - Introduced a Route Discovery workflow, allowing users to submit tokens for route discovery on selected blockchain networks.
  - Added a new card component for displaying route discovery information and actions.
  - Integrated Route Discovery into the Universal Bridge settings page for easier access.

- **Enhancements**
  - Added validation for token address and chain selection to ensure proper input.
  - Provided user feedback through success and error messages, including toast notifications.

- **Style**
  - Minor cleanup of extra blank lines in the Project General Settings page for improved readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-27 22:14:03 +00:00
gregGitHubcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
acd8b9e535 Feat: tokenAddress and amount bridge params (#7176)
Signed-off-by: greg <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-05-27 13:28:36 -07:00
Robby UitbeijerseandGitHub 52d451ff70 [SDK] ensure that the default spinner stroke color gets inherited from the parentnode (#7157) 2025-05-27 12:28:10 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c03616666b chore(deps): bump @radix-ui/react-select from 2.2.2 to 2.2.5 (#7159)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-27 12:21:22 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bb7a8988ef chore(deps): bump @radix-ui/react-separator from 1.1.4 to 1.1.7 (#7161)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-27 11:51:20 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8d0ffedd41 chore(deps): bump papaparse from 5.5.2 to 5.5.3 (#7162)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-27 11:51:04 -07:00
Jonas DanielsandGitHub 5edfb81ec5 [Dashboard] consolidate solution page rewrites with dynamic slug (#7175) 2025-05-27 11:50:23 -07:00
iuwqyir f115b4d2db new tokens route (#7170)
## [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 -->
2025-05-27 17:02:25 +00:00
Joaquim VergesandGitHub 0e4390b2c7 [Docs] Add Onramp extension to sidebar and typedoc (#7167) 2025-05-27 01:18:31 -07:00
Joaquim VergesandGitHub aec8d88af2 [Wallet] Move 7702 batch transaction test to integration tests (#7166) 2025-05-26 20:53:10 -07:00
gregandGitHub 80207ae240 [Dashboard] Refactor: Bridge UI Cleanup and Fixes (#7165) 2025-05-26 19:12:23 -07:00
Joaquim VergesandGitHub ec7bc2bb1e [Insight] Make clientId optional and improve error handling (#7158) 2025-05-26 14:34:12 -07:00
MananTank 12475027d1 Add Contract layout in team/project (#7152)
<!--

## 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 enhancements to the handling of contract pages, adding new types for parameters and project metadata, while refactoring existing components to incorporate team and project-specific data.

### Detailed summary
- Added `PublicContractPageParams` and `ProjectContractPageParams` types.
- Introduced `ProjectMeta` type for project metadata.
- Refactored components to accept `teamSlug`, `projectSlug`, and `projectMeta`.
- Updated routing and links to include project-specific paths.
- Enhanced handling of contract page data retrieval and UI rendering.

> The following files were skipped due to too many changes: `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/account/AccountPage.client.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/TokenIdPage.client.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/account-permissions/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/ContractNFTPage.client.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/contract-page-layout.client.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/explorer/shared-explorer-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/explorer/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/permissions/ContractPermissionsPage.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components/ContractChecklist.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/permissions/shared-permissions-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/split/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/proposals/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/account-permissions/shared-account-permissions-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/account/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/permissions/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/split/shared-split-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/shared-accounts-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/contract-page-layout.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/shared-modules-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/proposals/shared-proposals-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/english-auctions/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/account/shared-account-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/english-auctions/shared-english-auctions-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/shared-direct-listings-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/shared-nfts-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/data-table.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/claim-conditions/shared-claim-conditions-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/claim-conditions/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/shared-settings-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/shared-overview-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/analytics/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/analytics/shared-analytics-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/shared-nfts-token-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/ContractOverviewPage.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/events/events-feed.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/layout.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components/MarketplaceDetails.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/shared-cross-chain-page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/page.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/shared-layout.tsx`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/layout.tsx`

> ✨ 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 routing to include project and team slugs, enabling project-aware navigation for contract, NFT, marketplace, analytics, permissions, and proposal pages.
  - Passed project metadata (team and project info) throughout various pages and components for contextual consistency.
  - Introduced shared layout and page components for contract overview, NFTs, analytics, permissions, and settings, streamlining the user experience.

- **Refactor**
  - Removed internal data fetching, validation, and conditional rendering from pages, delegating logic to shared components.
  - Updated navigation links and breadcrumbs to dynamically incorporate project and team slugs when available.
  - Centralized metadata and layout generation into utility functions to reduce duplication.

- **Bug Fixes**
  - Improved handling of missing or invalid project/team data by triggering notFound responses appropriately.

- **Chores**
  - Extended component props and interfaces to accept projectMeta objects.
  - Simplified page components to directly render shared components with minimal logic.
  - Updated URL construction to utilize utility functions for project-aware paths.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-26 20:59:12 +00:00
catalyst17 9479d252b4 feat: add aggregate parameter input with presets (#7146)
<!-- start pr-codex -->

## PR-Codex overview
This PR introduces the `AggregateParameterInput` component to handle aggregate parameters in the `BlueprintPlayground`. It adds new presets for various data types and modifies the `ParameterSection` to utilize this new component, enhancing the functionality of the parameter input system.

### Detailed summary
- Added `AggregateParameterInput` component to handle aggregate parameters.
- Introduced multiple preset options for aggregates, transactions, events, and blocks.
- Updated `ParameterSection` to include a check for the `aggregate` parameter and render the new component.
- Modified placeholder logic in `ParameterSection` to use `param.description` or `param.name`.
- Passed `endpointPath` prop to `AggregateParameterInput` for context on preset selection.

> ✨ 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**
  - Introduced a specialized input with preset selection for aggregate query parameters, enhancing usability when configuring aggregate values.
  - The playground UI now displays this new input component for aggregate parameters, providing relevant preset options based on the selected endpoint.
- **Improvements**
  - Placeholders for parameter inputs now more accurately reflect the parameter’s description or name for better clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-25 19:14:20 +00:00
Joaquim VergesandGitHub 5139857db9 [Portal] fix portal build (#7154) 2025-05-23 22:56:39 -07:00
Joaquim VergesandGitHub ad4341a7ad [Portal] Add AI chat functionality with markdown support (#7139) 2025-05-23 20:55:13 -07:00
Joaquim VergesandGitHub ebd58f49b6 [Portal] Redesign header with improved mobile menu layout (#7138) 2025-05-23 20:12:18 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
3862bc7a94 Version Packages (#7150)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-23 20:03:03 -07:00
gregfromstl 5277eddb70 [SDK] Fix: Webhook Schema (#7151)
<!--

## 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 focuses on updating the `Webhook` schema in the `thirdweb` package to enhance the structure of `originToken` and `destinationToken` by replacing simple address strings with detailed objects containing additional properties.

### Detailed summary
- Updated `originToken` and `destinationToken` to be objects with properties:
  - `chainId`
  - `address`
  - `name`
  - `symbol`
  - `decimals`
  - `priceUsd`
  - `iconUri`
- Adjusted the test file to reflect these changes with appropriate object structures.

> ✨ 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

- **Bug Fixes**
  - Enhanced webhook support to include detailed token information such as chain ID, name, symbol, decimals, price, and icon for origin and destination tokens.
- **Tests**
  - Updated test data to match the new detailed token structure in webhook payloads.
- **Chores**
  - Added a changeset to document this patch update.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 23:10:14 +00:00
jnsdls 6c180b5c8a [Dashboard] migrate solidity inputs to shadcn (#7148)
## Summary
- migrate solidity bool, int, bytes, and string inputs to shadcn/ui and tailwind

## Testing
- `pnpm biome check --apply apps/dashboard/src/contract-ui/components/solidity-inputs/bool-input.tsx apps/dashboard/src/contract-ui/components/solidity-inputs/bytes-input.tsx apps/dashboard/src/contract-ui/components/solidity-inputs/int-input.tsx apps/dashboard/src/contract-ui/components/solidity-inputs/string-input.tsx`
- `pnpm test` *(fails: spawn anvil ENOENT)*

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on refactoring the UI components in the `solidity-inputs` directory to use a consistent styling approach and improve the layout by replacing certain components with more flexible alternatives.

### Detailed summary
- Updated imports from `tw-components` to a local `@/components/ui` for `Button` and `Input`.
- Replaced `ButtonGroup` with a `div` for better styling control in `SolidityBoolInput`.
- Adjusted button variants from `solid` to `default` for consistency.
- Introduced a `showConversionButton` flag in `SolidityIntInput` for conditional rendering.
- Changed `InputGroup` to `div` in `SolidityIntInput` and `SolidityStringInput` for layout flexibility.
- Used `cn` utility for conditional class names in `Input` components.
- Updated button and input placements to enhance responsiveness and styling.

> ✨ 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

- **Style**
  - Updated input components to use custom UI elements and Tailwind CSS for consistent styling.
  - Replaced Chakra UI and third-party components with locally defined UI components and native HTML elements.
  - Improved button and input layouts for better visual consistency across boolean, integer, byte, and string input fields.

- **New Features**
  - Enhanced integer input with conditional display of a conversion button based on input value format.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 22:57:37 +00:00
Joaquim VergesandGitHub 3489ecec98 [SDK] Improve quote error handling (#7147) 2025-05-23 15:43:52 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
f9b34ff2f1 Version Packages (#7149)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-23 14:04:03 -07:00
Jonas DanielsandGitHub f3abea3276 Add webhook verification functionality for secure payload validation (#7103) 2025-05-23 13:59:46 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
adc738e536 Version Packages (#7116)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-23 12:44:58 -07:00
Robby UitbeijerseandGitHub dd2fb1b13d [SDK] Feature: Allow for supported providers to be passed to PayEmbed (#7108) 2025-05-23 12:01:27 -07:00
Joaquim VergesandGitHub 69fdef07f5 [thirdweb] Ensure bigints are stringified before usage with server wallets (#7145) 2025-05-23 11:57:43 -07:00
MananTank 362c086bf6 Dashboard: Move project pages inside (sidebar) layout (#7144)
<!--

## 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 primarily focuses on refactoring the codebase to organize components and hooks into a new `(sidebar)` directory structure, enhancing modularity and maintainability. It also updates import paths to reflect these changes.

### Detailed summary
- Moved various components and hooks to a new `(sidebar)` directory.
- Updated import paths across multiple files.
- Adjusted layout files to accommodate the new directory structure.
- Ensured proper functionality of components post-migration.

> ✨ 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

- **Chores**
  - Updated and standardized import paths across the dashboard and component files for improved code organization and maintainability.
  - No changes to end-user functionality or visible features.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 18:12:01 +00:00
jnsdls f9b609e7a2 [Dashboard] replace Chakra fieldset with shadcn (#7143)
Migrates the NetworksFieldset component from Chakra UI to shadcn/ui and Tailwind.

- Drop Chakra Flex, FormControl and Select
- Use shadcn Select primitives with tailwind classes
- Adjust layout with Tailwind via `cn`

Fixes #0

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on refactoring the `NetworksFieldset` component in `networks-fieldset.tsx` to use a new `Select` component from the UI library, improving styling and functionality while maintaining the same overall behavior.

### Detailed summary
- Replaced `Flex` and `FormControl` components with a new `div` structure and `Select` component.
- Updated the `Select` component to use `SelectTrigger`, `SelectContent`, and `SelectItem`.
- Changed event handlers from `onChange` to `onValueChange` for better state management.
- Maintained layout and functionality with updated class names for styling.

> ✨ 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

- **Refactor**
  - Updated the network selection field to use a custom select component and Tailwind-based layout for a more consistent user interface.
- **Style**
  - Improved the visual appearance and spacing of the network selection field.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 18:00:04 +00:00
MananTank 916ecf494c [TOOL-4591] Fix resolveImplementation jsdoc code example in jsdoc (#7141)
<!--

## 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 updates the import path for the `resolveImplementation` function to reflect its new location within the `thirdweb/utils` directory.

### Detailed summary
- Changed import statement for `resolveImplementation` from `thirdweb` to `thirdweb/utils`.

> ✨ 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

- **Documentation**
  - Updated example import path in documentation for improved clarity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 17:11:46 +00:00
MananTank d1ca9af2f4 Remove SIWA feedback buttons from nebula (#7142)
<!--

## 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 primarily focuses on refactoring the `Chats` component and its related functionalities. It removes unused code and simplifies the props being passed, particularly the `teamId`. Additionally, it eliminates the feedback buttons and associated functionality.

### Detailed summary
- Removed `teamId` prop from various instances of the `Chats` component.
- Deleted the `FeedbackButtons` component and its related logic.
- Simplified imports in the `Chats` component by removing unused imports.
- Cleaned up the `RenderMessage` function by omitting `teamId` from props.

> ✨ 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**
	- None.

- **Bug Fixes**
	- None.

- **Refactor**
	- Removed the feedback feature, including thumbs up/down buttons and related tracking, from chat components.
	- Simplified chat components by removing the unused or redundant team selection prop.

- **Chores**
	- Cleaned up code by deleting unnecessary feedback-related imports and props.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 16:02:33 +00:00
jnsdls 317211a48e [Dashboard] migrate CurrencySelector to shadcn (#7137)
## Summary
- migrate shared CurrencySelector from Chakra UI to shadcn/ui
- use tailwindcss classes and Radix-based Select

## Checklist
- [x] `pnpm biome check apps/dashboard/src/components/shared/CurrencySelector.tsx --apply`
- [ ] `pnpm test` *(fails: spawn anvil ENOENT)*

<!-- start pr-codex -->

---

## PR-Codex overview
This PR refactors the `CurrencySelector` component to improve its structure and styling. It replaces certain UI elements with a new `Select` component, enhances props for better functionality, and updates the layout for a more modern appearance.

### Detailed summary
- Changed `CurrencySelectorProps` to include new props: `onChange`, `className`, `isDisabled`.
- Refactored the component to use a `Select` from the UI library instead of native HTML elements.
- Updated event handling to utilize `onValueChange` for the `Select`.
- Improved styling and layout for better user experience.
- Replaced `Flex` components with `div` and applied conditional class names for styling.

> ✨ 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

- **Refactor**
  - Updated the CurrencySelector component to use custom UI components and Tailwind CSS for styling, replacing Chakra UI elements.
  - Simplified the component's props and adjusted event handling for the new select interface.
  - Maintained existing functionality and behavior while improving consistency with the app's design system.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 04:52:16 +00:00
gregfromstl 6cd64e7368 [Dashboard] Fix: Routes page pagination beyond 1, add og image (#7136)
<!--

## 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 focuses on updating titles for better clarity and modifying the pagination logic in the routes table component to directly use `routesToRender`, enhancing the user experience in the dashboard.

### Detailed summary
- Updated `title` in `page.tsx` files for clarity.
- Changed the condition from `paginatedRoutes.length` to `routesToRender.length` in the routes table component.
- Removed pagination logic variables (`activePage`, `pageSize`, `startIndex`, `endIndex`, `paginatedRoutes`).
- Updated pagination component to use `Number(props.searchParams.page) || 1`.

> ✨ 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**
  - Updated page titles and metadata for improved clarity and consistency, including changes from "On-Ramp" to "Onramp" and a new title for the routes page.
- **Refactor**
  - Simplified the routes list rendering by removing local pagination logic, now displaying data directly as provided without client-side slicing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 04:43:14 +00:00
jnsdls 005acce714 Update PostHog import to use React hook (#7135)
# Update PostHog import to use React hook

This PR updates the PostHog implementation in the `useTrack` hook to use the React-specific hook from PostHog instead of the direct import. The changes include:

- Replaced the direct import of `posthog` with `usePostHog` from `posthog-js/react`
- Added the PostHog instance as a dependency to the `useCallback` hook
- Added a null check before calling `posthog.capture()` to handle cases where PostHog might not be initialized

These changes ensure proper React integration with PostHog and prevent potential issues with the hook's dependency array.
2025-05-23 04:34:30 +00:00
jnsdls cde2dd941f Make free plan badge clickable to upgrade (#7134)
# Add Upgrade Paths for Free Plan Teams

This PR enhances the user experience for teams on the free plan by adding clear upgrade paths throughout the dashboard:

- Makes the free plan badge clickable, linking directly to the billing page with pricing modal open
- Adds analytics tracking to billing-related links for better conversion insights
- Implements a new `FreePlanUpsellBannerUI` component on the team dashboard page
- Ensures only one billing alert banner shows at a time (following priority order)
- Updates all `TeamPlanBadge` components to include the team slug parameter
- Improves billing alert banners with proper analytics tracking

These changes aim to increase conversions from free to paid plans by providing contextual upgrade opportunities throughout the product.

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

- **New Features**
  - Introduced a promotional upsell banner for teams on the free plan, encouraging upgrades with a direct link to view available plans.
  - Added a customizable promotional banner component with multiple accent color themes for enhanced marketing displays.

- **Enhancements**
  - Team plan badges now provide direct links to billing settings for teams on the free plan, with analytics tracking for user interactions.
  - Improved analytics tracking on billing-related banners and links throughout the dashboard.

- **Refactor**
  - Updated multiple components to pass team identifiers to plan badges for more contextual display and interaction.
  - Streamlined the display logic for billing-related banners to prioritize service status and plan type.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the `TeamPlanBadge` component by adding a `teamSlug` prop across various files and implementing a new `FreePlanUpsellBannerUI` component to encourage free plan users to upgrade. It also updates links to use `TrackedLinkTW` for better tracking.

### Detailed summary
- Added `teamSlug` prop to `TeamPlanBadge` in multiple components.
- Introduced `FreePlanUpsellBannerUI` to promote upgrades for free plan users.
- Replaced `<Link>` with `<TrackedLinkTW>` for better tracking in several instances.
- Updated conditional rendering logic for billing alerts in the team layout.

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

<!-- end pr-codex -->
2025-05-23 04:21:27 +00:00
7130f9a929 [Dashboard] siwa chat widget (#7128)
Co-authored-by: Joaquim Verges <[email protected]>
2025-05-22 21:20:45 -07:00
1e0b1422f3 [SDK] Implement allowedSmsCountryCodes option (#7090)
Co-authored-by: Jonas Daniels <[email protected]>
2025-05-22 21:14:29 -07:00
jnsdls 70a519ada4 [Dashboard] migrate authorized wallets components to shadcn (#7131)
## Summary
- migrate authorized wallets revoke modal from Chakra to shadcn dialog
- replace Chakra button/text in AuthorizedWalletsTable with shadcn + tailwind
- drop Chakra provider wrapper from account devices page
- cleanup modal title/description and remove node cache

## Testing
- `pnpm biome check --apply apps/dashboard/src/components/settings/AuthorizedWallets/AuthorizedWalletRevokeModal.tsx .gitignore`
- `pnpm test` *(fails: spawn anvil ENOENT)*

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on refactoring the `AccountDevicesPage` and the `AuthorizedWalletRevokeModal` components to replace the `Chakra UI` modal with a new `Dialog` component. It also updates the `AuthorizedWalletsTable` to use local state for modal visibility and modifies UI elements for consistency.

### Detailed summary
- Removed `ChakraProviderSetup` from `AccountDevicesPage`.
- Replaced `Modal` components with `Dialog` components in `AuthorizedWalletRevokeModal`.
- Updated modal structure and styling in `AuthorizedWalletRevokeModal`.
- Changed state management for modal visibility in `AuthorizedWalletsTable`.
- Updated text rendering from `Text` to `span` for consistency in `AuthorizedWalletsTable`.
- Changed button styles in `AuthorizedWalletsTable` for revocation actions.

> ✨ 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

- **Refactor**
  - Replaced Chakra UI components with custom UI library components in wallet authorization modals and tables.
  - Updated modal and button styling for a consistent look and feel.
  - Simplified modal state management in the authorized wallets table.

- **Chores**
  - Updated `.gitignore` to exclude dashboard node compilation cache.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 03:54:27 +00:00
gregandGitHub 678c00e322 Fix: Update routes page to use server-side pagination and filtering (#7133) 2025-05-22 17:26:36 -07:00
MananTank 5ab59ff400 Dashboard: Add token selector in asset creation wizard (#7132)
<!--

## 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 focuses on enhancing the token sale functionality within the application. It introduces new properties, refines existing structures, and improves the token selection process to accommodate native tokens and better handle token sales.

### Detailed summary
- Added `saleTokenAddress` to the form validation schema.
- Updated `CreateTokenAssetPage` to handle native token address logic.
- Changed `TokenSelector` to support selected tokens and improved token address handling.
- Enhanced `TokenSaleSection` to include a currency field for token sales.
- Refined state management in `PaymentLinkForm` for better token handling.
- Modified `TokenInfoFieldset` to trigger updates on chain changes.

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

<!-- end pr-codex -->
2025-05-22 23:15:23 +00:00
MananTank 73629e9f0e [TOOL-4531] Dashboard: Add Token Asset creation wizard (#7081)
<!--

## 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 several enhancements and features related to asset management, including deployment tracking, UI updates, and new forms for creating and managing tokens. It also refines existing components and adds new functionalities for improved user experience.

### Detailed summary
- Added `deploymentType` and `contractType` properties in various components.
- Introduced `revalidatePathAction` for path revalidation.
- Updated UI components for better asset management.
- Enhanced forms for token creation with validation.
- Implemented multi-step status tracking for token launch processes.
- Improved error handling and user feedback in forms.
- Added new charts for token distribution visualization.

> The following files were skipped due to too many changes: `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/launch/launch-token.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/distribution/token-airdrop.tsx`

> ✨ 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**
  - Introduced a comprehensive asset management interface for creating, importing, and managing ERC-20 tokens within team and project dashboards.
  - Added a multi-step token creation flow with form validation, including token info, distribution, sale settings, airdrop CSV upload, and launch process with real-time status tracking.
  - Implemented visual token allocation charts and multi-step progress indicators for enhanced user experience.
  - Added a dedicated "Assets" section in the sidebar with a "New" badge.
  - Added a horizontal segmented distribution bar chart component for visualizing token allocations.
  - Introduced a multi-step status component to track asynchronous step executions with retry capabilities.
  - Added token airdrop CSV upload and validation feature with user-friendly UI and error handling.
  - Added token sale configuration section with price and allocation inputs.
  - Enhanced import modal to support both contract and asset imports with contextual UI and behavior.
  - Added new pages and components to support token asset creation and management workflows, including cards for asset actions.
  - Added server-side path revalidation support for pages and layouts.

- **Improvements**
  - Enhanced contract and asset import workflows with clearer UI, context-aware dialogs, and improved contract table variant handling.
  - Updated number input fields to remove browser-native spinners for a cleaner appearance.
  - Improved analytics event tracking for user interactions and deployment steps.
  - Refined UI components for consistent styling and accessibility.
  - Fixed sidebar badge placement and updated UI text for clarity.
  - Updated dialogs and payment embeds to reference transaction chain instead of active wallet chain and set default payment amounts.
  - Changed token supply label to "Circulating Supply" for clarity.
  - Replaced Chakra UI spinner and styled elements with local components for simplified UI.

- **Bug Fixes**
  - Corrected UI typos and improved analytics event tracking for deployment errors.

- **Documentation**
  - Added Storybook stories for new components to facilitate UI testing and documentation.

- **Chores**
  - Refactored and extended types and props to support new asset and contract features, ensuring future extensibility.
  - Added tracking utilities for token deployment and asset creation analytics.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-22 23:15:23 +00:00
23029db9ef Feature: Add image support to payment links (#7129)
Co-authored-by: Claude <[email protected]>
2025-05-22 12:47:05 -07:00
jnsdls 526b6b54cf Add useAuthToken hook for in-app wallet authentication (#7120)
# Add `useAuthToken` hook for in-app wallet authentication

This PR adds a new React hook `useAuthToken()` that returns a JWT authentication token for the currently active in-app wallet. This token can be used to authorize API calls to backend servers.

Key changes:
- Added `useAuthToken()` hook that returns the auth token when an in-app wallet is active
- Modified the `InAppConnector` interface to expose the storage property
- Updated the wallet interface to include a `getAuthToken()` method for in-app wallets
- Implemented token retrieval in the in-app wallet core implementation

The hook ensures the token is only returned when the active wallet is an in-app wallet and matches the active account.

Example usage:
```tsx
function MyComponent() {
  const authToken = useAuthToken();

  const fetchData = async () => {
    const response = await fetch('https://api.example.com/data', {
      headers: {
        'Authorization': `Bearer ${authToken}`
      }
    });
    // ... handle response
  };
}
```

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

- **New Features**
	- Introduced a new hook to retrieve authentication tokens for in-app wallets, enabling secure authorization for API calls.
- **Documentation**
	- Added usage examples and clarifications regarding authentication token availability for wallets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the wallet functionality by introducing an authentication token feature and updating the visibility of certain properties. It adds a method for retrieving an authentication token and modifies the storage property to be public.

### Detailed summary
- Changed `storage` property from `private` to `public` in `native-connector.ts` and `web-connector.ts`.
- Added `getAuthToken` method to the wallet interface in `wallet.ts` with documentation.
- Included `storage` in the `InAppConnector` interface.
- Implemented `authToken` handling in `createInAppWallet` function.
- Created `useAuthToken` hook for retrieving the JWT of the active wallet.

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

<!-- end pr-codex -->
2025-05-22 18:01:48 +00:00
Jonas DanielsandGitHub f31116ea5a [SDK] fix avatar image detection on Node (#7123)
Signed-off-by: Jonas Daniels <[email protected]>
2025-05-22 11:00:48 -07:00
arcoraven c1f7aaadc1 chore: redirect /team to /team/~ to select a team (#7124)
## [Dashboard] Fix: Simplify team redirection logic

## Notes for the reviewer
This PR modifies the team redirection logic by:
1. Renaming `getLastVisitedTeamOrDefaultTeam()` to `getLastVisitedTeam()`
2. Removing the fallback to `getDefaultTeam()` when no last visited team is found
3. Updating the team root page to redirect to `/team/~` when no team is found instead of showing a 404

## How to test
Verify that users are properly redirected to their last visited team when available, and to `/team/~` when no team history exists.

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

## Summary by CodeRabbit

- **Bug Fixes**
	- Improved handling when no last visited team is found by redirecting users to a fallback page instead of showing a not found error.

- **Refactor**
	- Updated team selection logic to remove fallback to a default team and streamline user redirection.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR refactors the `getLastVisitedTeamOrDefaultTeam` function to `getLastVisitedTeam`, changing its behavior to return `null` instead of a default team. It updates the `TeamRootPage` to handle the absence of a team by redirecting to a fallback URL.

### Detailed summary
- Renamed function `getLastVisitedTeamOrDefaultTeam` to `getLastVisitedTeam`.
- Changed return value of `getLastVisitedTeam` from `getDefaultTeam()` to `null`.
- Updated `TeamRootPage` to redirect to `/team/~` if no team is found, instead of calling `notFound()`.

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

<!-- end pr-codex -->
2025-05-22 06:42:40 +00:00
arcoraven 1ad109f3bc chore: update endpoint to rotate secret key (#7122)
## [Dashboard] Fix: Update Secret Key Rotation API Endpoint

## Notes for the reviewer

This PR updates the secret key rotation functionality to use the new team-based API endpoint structure. The `rotateSecretKeyClient` function now requires both `teamId` and `projectId` parameters, and the API endpoint has been updated to follow the `/v1/teams/{teamId}/projects/{projectId}/rotate-secret-key` pattern.

## How to test

Test the secret key rotation functionality in:
1. Project FTUX
2. Nebula FTUX
3. Project General Settings page

Verify that the secret key can be successfully rotated in all these locations.

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

- **Refactor**
  - Updated secret key rotation to require both team and project identifiers for enhanced security and context.
  - Modified components to include team ID alongside project data, improving integration and user experience in project-related sections.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the handling of project and team identifiers in the `NebulaFTUX` and related components, enhancing the functionality for rotating secret keys by including the `teamId` alongside the `projectId`.

### Detailed summary
- Added `teamId` prop to the `NebulaFTUX` component.
- Passed `teamId` from `NebulaFTUX` to `SecretKeySection`.
- Updated `rotateSecretKeyClient` to accept an object with `teamId` and `projectId`.
- Modified the API call in `rotateSecretKeyClient` to use the new parameters.
- Updated the `SecretKeySection` to handle the new `teamId` prop.

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

<!-- end pr-codex -->
2025-05-22 06:25:22 +00:00
376bdb23d2 [Dashboard] Feature: Setup payment link UI (#7121)
Co-authored-by: Claude <[email protected]>
2025-05-21 22:40:59 -07:00
Joaquim VergesandGitHub dcd6b99e67 [SDK] Improve error handling in PayEmbed (#7119) 2025-05-21 21:52:31 -07:00
Jonas DanielsandGitHub 88533d9113 Remove advancedEnabled field from Account interface (#7118) 2025-05-21 16:16:21 -07:00
Jonas DanielsandGitHub 6c3a8d36a7 Remove unused account usage API and interface (#7117) 2025-05-21 16:09:16 -07:00
Robby UitbeijerseandGitHub a31ac0c065 [Docs] Chore: Remove Kado references (#7109) 2025-05-21 15:21:40 -07:00
7b72e88611 [SDK] Fix: Apply accentButtonText theme key to the Spinner inside of PayEmbed Buttons (#7110)
Co-authored-by: Joaquim Verges <[email protected]>
2025-05-21 15:21:14 -07:00
Joaquim VergesandGitHub 4b9a506fdf [service-utils] Improve 403 error messages with team and project details (#7114) 2025-05-21 14:07:40 -07:00
Joaquim VergesandGitHub 77da352366 [Dashboard] Add ecosystem name editing functionality (#7115) 2025-05-21 13:54:12 -07:00
Joaquim VergesandGitHub 72cc27a69a [Dashboard] Add ecosystem logo upload functionality (#7113) 2025-05-21 11:02:18 -07:00
Joaquim VergesGitHubJonas Danielsgraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
46d1dab11e [Docs] Add Vault SDK documentation and guides (#7054)
Signed-off-by: Joaquim Verges <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-21 11:01:56 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
a1c432ca17 Version Packages (#7105)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-21 09:59:10 -07:00
kumaryash90 243c661929 Update deploy config (#7111)
<!--

## 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 focuses on updating the value of `DEFAULT_FEE_BPS_NEW` in the `addresses.ts` file to reflect a new default fee setting.

### Detailed summary
- Updated the value of `DEFAULT_FEE_BPS_NEW` from `150` to `200` in `apps/dashboard/src/constants/addresses.ts`.

> ✨ 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

- **Chores**
  - Updated the default fee value from 150 to 200.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-21 16:07:00 +00:00
GiselleNessi b64ffe369a Gi/portal knowledge base (#6993)
<!--

## 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 primarily focuses on enhancing the `thirdweb Knowledge Base` by adding new troubleshooting guides, updating existing resources, and improving documentation structure for better user support.

### Detailed summary
- Added a new troubleshooting guide for `Nebula`.
- Introduced detailed steps for resolving `device link errors` in `thirdweb CLI`.
- Updated support links in `Header.tsx`.
- Created new sections for `batch upload issues` and `airdrop contract troubleshooting`.
- Improved layout in `layout.tsx` with `DocLayout`.
- Removed unused `ContractsIcon` from `page.tsx`.
- Enhanced the `knowledge base` sidebar structure.
- Added visual guides and images in multiple `mdx` files for clarity.
- Improved metadata for better SEO and documentation clarity.

> ✨ 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**
  - Introduced a comprehensive Knowledge Base with structured navigation, guides, and troubleshooting for web3 development and thirdweb support.
  - Added detailed documentation on deploying NFT mint sites, creating soulbound tokens, sharing console errors, and resolving CLI device link errors.
  - Launched troubleshooting guides for airdrop contracts, batch upload issues, embed feature changes, and Nebula-specific support.

- **Improvements**
  - Updated navigation links to add a Nebula API reference and consolidated support links to internal resources.

- **Removals**
  - Removed the "Contracts" article card from the learning resources section.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-21 10:32:06 +00:00
Joaquim VergesandGitHub 30fafd16db [SDK] Fix SIWE auth forcing unnecessary chain switch (#7104) 2025-05-20 23:28:53 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
99901dcfd7 Version Packages (#7079)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-20 15:48:08 -07:00
jnsdls f5072d882e Rename "Secret Key" to "Webhook Secret" for consistency (#7102)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Style**
  - Updated labels and tooltips to use "Webhook Secret" instead of "Secret Key" for improved clarity in the webhook creation interface.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-20 22:10:27 +00:00
iuwqyir e7f7a32dd4 show block gas limit on the chain page (#7101)
## [Dashboard] Feature: Add Block Gas Limit to Chain Live Stats

## Notes for the reviewer

as requested by @0xFirekeeper

This PR enhances the chain live stats component by adding the block gas limit information. The RPC method has been updated from `eth_blockNumber` to `eth_getBlockByNumber` to fetch additional block data including the gas limit.

## How to test

The block gas limit should now be displayed alongside other chain statistics in the dashboard. The component handles loading and error states appropriately.

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

## Summary by CodeRabbit

- **New Features**
  - Added display of the latest block's gas limit in the live stats section, including proper handling of loading, error, and unavailable states.

- **Enhancements**
  - Improved the accuracy of live stats by retrieving and displaying more detailed block information.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `live-stats.tsx` component to fetch the latest block information using the `eth_getBlockByNumber` method instead of `eth_blockNumber`. It also introduces the display of the block gas limit in the UI.

### Detailed summary
- Changed JSON-RPC method from `eth_blockNumber` to `eth_getBlockByNumber`.
- Updated parameters to fetch the latest block.
- Added parsing for `blockGasLimit` from the response.
- Modified return object to include `blockGasLimit`.
- Introduced a new UI section to display the block gas limit.

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

<!-- end pr-codex -->
2025-05-20 21:55:31 +00:00
d2098ad0bf [SDK] Fix stray keccak256 reference (#7089)
Co-authored-by: Jonas Daniels <[email protected]>
2025-05-20 14:54:41 -07:00
+1
Joaquim VergesGitHubgregfromstlClaudekumaryash90Prithvish BaidyasaminaMaximilian Hubertgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>Jonas Danielsarcoraven
d6239785cf [SDK] Always show pay modal even on non-supported UB chains (#7092)
Signed-off-by: samina <[email protected]>
Signed-off-by: Maximilian Hubert <[email protected]>
Co-authored-by: gregfromstl <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: kumaryash90 <[email protected]>
Co-authored-by: Prithvish Baidya <[email protected]>
Co-authored-by: samina <[email protected]>
Co-authored-by: Maximilian Hubert <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: arcoraven <[email protected]>
2025-05-20 14:51:58 -07:00
iuwqyir 20fdd5b6d7 show deprecation in playground UI (#7100)
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on adding a `deprecated` property to various types and components within the application, allowing for better handling and display of deprecated links and features in the UI.

### Detailed summary
- Added `deprecated` property to `pathInfo` in `navLinks.ts`.
- Updated `MinimalBlueprintSpec` type in `utils.ts` to include `deprecated`.
- Modified `SidebarLink` type in `sidebar.tsx` to optionally include `crossedOut`.
- Enhanced UI to visually indicate deprecated items in `page.tsx`.
- Included `deprecated` status for various API endpoints in `insightBlueprints.ts`.

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

<!-- end pr-codex -->
2025-05-20 21:04:28 +00:00
iuwqyir 438c019f01 replace chain with chain_id in insight playground (#7099)
## [Playground] Fix: Update chain parameter handling in blueprint playground

## Notes for the reviewer
This PR updates the blueprint playground to use `chain_id` instead of `chain` parameter throughout the codebase. It also adds logic to remove deprecated parameters from the form schema and specifically removes the `chain` parameter if it's present.

## How to test
Test the blueprint playground with various chain selections to ensure the chain_id parameter is correctly populated and that deprecated parameters are not displayed in the form.

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

- **Refactor**
  - Updated all references from "chain" to "chain_id" for improved consistency across the playground interface.
  - Deprecated parameters are now excluded from form generation and display.

- **New Features**
  - Blueprint listings can now indicate if a blueprint is deprecated.

- **Chores**
  - Made the API domain configurable via environment variables with a default fallback.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces changes to the `BlueprintSection`, `fetchBlueprintSpec`, and other components to enhance the handling of blueprint parameters, including the addition of a `deprecated` flag and renaming of parameters for consistency. It also updates the API URL handling.

### Detailed summary
- Added optional `deprecated` property to `blueprints` in `BlueprintSection`.
- Introduced `THIRDWEB_INSIGHT_API_DOMAIN` for dynamic API URL in `fetchBlueprintSpec`.
- Renamed parameter `chain` to `chain_id` in multiple places for consistency.
- Removed `chain` parameter if present in `modifyParametersForPlayground`.
- Updated form handling to use `chain_id` instead of `chain` in `ParameterSection`.
- Skipped deprecated parameters in schema creation with `createParametersFormSchema`.

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

<!-- end pr-codex -->
2025-05-20 20:46:17 +00:00
Jonas DanielsandGitHub 61044013c8 update dependencies (#7098) 2025-05-20 11:52:26 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e6213db8af chore(deps-dev): bump @storybook/react-vite from 8.6.12 to 8.6.14 (#7088)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 11:24:24 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c46b2597be chore(deps-dev): bump vitest from 3.1.2 to 3.1.4 (#7087)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 11:24:12 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9ff97688ce chore(deps-dev): bump vite from 6.3.4 to 6.3.5 in the npm_and_yarn group (#7068)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 11:20:20 -07:00
gregandGitHub b4f5cc7b5a Fix: Bridge jsdoc to not mention ox (#7097) 2025-05-20 11:15:06 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
256850d1c6 chore(deps): bump @next/mdx from 15.3.1 to 15.3.2 (#7085)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 11:13:10 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
acb2b9f85f chore(deps): bump github/codeql-action from 3.28.17 to 3.28.18 (#7084)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 11:12:54 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6ac62ffe96 chore(deps): bump codecov/codecov-action from 5.4.2 to 5.4.3 (#7083)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 11:12:40 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
80f4bd4e53 chore(deps): bump changesets/action from 1.5.0 to 1.5.3 (#7082)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 11:12:25 -07:00
Joe-Thirdweb a3072c4335 [Dashboard] Adding EDU Chain custom info + assets (#7095)
Adding custom chain info for
EDU Mainnet ( 41923 )
EDU Testnet ( 656476 )

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces new assets and metadata for an education-focused blockchain initiative, enhancing the dashboard with information about the `EDU Mainnet` and `EDU Testnet`.

### Detailed summary
- Added new image imports: `eduBanner` and `eduCTA`.
- Introduced metadata for `EDU Mainnet` (ID: 41923) with header image, description, and CTA.
- Introduced metadata for `EDU Testnet` (ID: 656476) with similar structure as `EDU Mainnet`.

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

<!-- end pr-codex -->
2025-05-20 17:53:29 +00:00
saminacodes 3277cf6e8e [Docs] Fixed broken links (#7091)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR primarily focuses on updating references from "backend wallets" to "server wallets" across various files and adding a new `ArticleCardIndex` component in the `page.tsx` file.

### Detailed summary
- In `sidebar.tsx`, updated `href` for the "Overview" link.
- Added a new `ArticleCardIndex` for "Universal Bridge" in `page.tsx`.
- Changed text from "backend wallets" to "server wallets" in `page.mdx`.
- Updated link in `engine-overview.tsx` to point to server wallet documentation.

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

<!-- end pr-codex -->
2025-05-20 17:44:56 +00:00
Jake LooandGitHub 77938c4d5c Update page.mdx for thirdweb-mcp (#7096)
Signed-off-by: Jake Loo <[email protected]>
2025-05-20 10:15:57 -07:00
Vasiliy KirochkaandGitHub 3080a9baba fixing code snippets (#7094) 2025-05-20 09:04:18 -07:00
Joaquim VergesandGitHub 6cf92c6b11 Add AGENTS.md with guidelines (#7093) 2025-05-20 00:18:02 -07:00
+1
Joaquim VergesGitHubgregfromstlClaudekumaryash90Prithvish BaidyasaminaMaximilian Hubertgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>Jonas Danielsarcoraven
89ccc80d9c Add Bridge.Onramp functions + port old functions (#7076)
Signed-off-by: samina <[email protected]>
Signed-off-by: Maximilian Hubert <[email protected]>
Co-authored-by: gregfromstl <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: kumaryash90 <[email protected]>
Co-authored-by: Prithvish Baidya <[email protected]>
Co-authored-by: samina <[email protected]>
Co-authored-by: Maximilian Hubert <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: arcoraven <[email protected]>
2025-05-19 19:24:32 -07:00
saminacodes 713ebe0a2d [Docs] Update Engine Pricing (#7080)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the FAQ section in the `page.mdx` file regarding pricing calculations for Engine Cloud. It clarifies the types of requests that incur costs and modifies the note about legacy pricing plans.

### Detailed summary
- Updated pricing calculation to include both write and sign requests.
- Changed the cost description for requests to specify both write and sign requests.
- Revised the note on legacy pricing plans to include a link to the pricing page and clarify the fee specifics.

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

<!-- end pr-codex -->
2025-05-19 15:51:01 +00:00
saminacodes bfdac10dcc [Docs] UB Migration & Other Small Things (#7075)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on restructuring the `pay` section of the portal by updating links, modifying sidebar navigation, and adding new assets and pages to improve the user experience and documentation clarity.

### Detailed summary
- Added new links to the `links` array for `Bridge`.
- Updated `href` values in `apisLinks` for the Insight API.
- Modified `FooterLinkItem` labels for consistency.
- Created and adjusted multiple `.mdx` pages for the `pay` section.
- Introduced `payRedirects` for improved navigation.
- Updated the sidebar structure for the `pay` section, including new links and icons.
- Added new layout and metadata to `layout.tsx` for better documentation presentation.

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

<!-- end pr-codex -->
2025-05-19 04:26:51 +00:00
+1
gregGitHubClaudeJoaquim Vergeskumaryash90Prithvish BaidyasaminaMaximilian Hubertgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>Jonas Danielsarcoraven
64964da22e [SDK] Refactor: Update Pay Functions to use UB (#7064)
Signed-off-by: samina <[email protected]>
Signed-off-by: Maximilian Hubert <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Joaquim Verges <[email protected]>
Co-authored-by: kumaryash90 <[email protected]>
Co-authored-by: Prithvish Baidya <[email protected]>
Co-authored-by: samina <[email protected]>
Co-authored-by: Maximilian Hubert <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: arcoraven <[email protected]>
2025-05-19 16:05:15 +12:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
260c2fd370 Version Packages (#7078)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-18 19:12:58 -07:00
Joaquim VergesandGitHub c61e258ec3 [SDK] Expose getInstalledWallets() utility (#7077) 2025-05-18 19:07:42 -07:00
Joaquim VergesandGitHub fdd344184b [Dashboard] Remove taint for THIRDWEB_ENGINE_URL (#7074) 2025-05-17 00:51:54 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
0c853e8709 Version Packages (#7073)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-17 00:36:55 -07:00
arcoraven 7d47b4cde0 chore: Update Accelerate features list (#7053)
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on updating the pricing plans and features for the embedded wallets in the dashboard application. It adjusts the plan requirements and modifies the features associated with different plans.

### Detailed summary
- Changed `authRequiredPlan` from `"accelerate"` to `"growth"`.
- Added `"Custom Wallet Branding & Auth"` to the features list.
- Removed `"Custom Wallet Branding & Auth"` from the `TEAM_PLANS` features.
- Increased `$400 Usage Credits` to `$500 Usage Credits` in the `TEAM_PLANS` features.

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

<!-- end pr-codex -->
2025-05-17 07:01:00 +00:00
Jonas DanielsandGitHub feae304da2 Prioritize JWT over service API keys in authentication (#7020) 2025-05-16 16:39:45 -07:00
Joaquim VergesandGitHub 8f605d989c [SDK] Update package READMEs with correct naming and documentation links (#7071) 2025-05-16 05:55:22 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
d0c2ac63a9 Version Packages (#7042)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-16 05:06:17 -07:00
Joaquim VergesandGitHub 170f14fb54 [Dashboard] Add pagination to server wallets page (#7070) 2025-05-16 05:04:26 -07:00
Joaquim VergesandGitHub da2a2a0e86 [SDK] Fix buyWithCrypto false not respected when returning from quote (#7069) 2025-05-16 04:57:48 -07:00
saminaandGitHub e62fd3fe40 [Docs] Engine Update (#7052)
Signed-off-by: samina <[email protected]>
2025-05-16 04:09:33 -07:00
Joaquim VergesandGitHub 99a7cce624 [Engine] Add all testnets to test transaction options (#7066) 2025-05-16 04:08:17 -07:00
Joaquim VergesandGitHub 61152dd098 [Engine] Add FAILED status to execution result and update error handling (#7065) 2025-05-16 03:34:27 -07:00
Maximilian HubertandGitHub 05519fcdde [DOCS] fix link in contributing.md (#7063)
Signed-off-by: Maximilian Hubert <[email protected]>
2025-05-16 00:11:57 -07:00
saminaandGitHub 7257747520 [Docs] Engine (#7057)
Signed-off-by: samina <[email protected]>
2025-05-16 00:10:35 -07:00
Prithvish BaidyaandGitHub e71e7d70a6 [Vault] default to engine-cloud vault proxy (#7058) 2025-05-15 16:44:03 -07:00
Joaquim VergesandGitHub 8d47864967 [SDK] Export prepareUserOp and add support for new wallets (#7061) 2025-05-15 16:43:11 -07:00
kumaryash90 4a8adc143f [Docs] Stylus dev workflow (#7060)
<!--

## 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 documentation and assets for integrating thirdweb tools into the Stylus contract development workflow, specifically for Rust. It includes setup instructions, publishing and deployment commands, and images to enhance the documentation.

### Detailed summary
- Added new sections in `page.mdx` for Arbitrum Stylus.
- Included prerequisites for Rust and Solidity installations.
- Provided setup commands for creating a Stylus project.
- Added commands for publishing and deploying Stylus contracts.
- Included images (`stylus-publish-page.png`, `stylus-deploy-page.png`) to illustrate the process.

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

<!-- end pr-codex -->
2025-05-15 21:30:32 +00:00
MananTank db538473cf [NEB-248] Show native token balances in assets, show popular tokens on top (#7056)
<!--

## 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 enhances the `AssetsSection` component by integrating wallet balance retrieval, modifying how assets are displayed, and implementing new logic for sorting tokens. It also introduces a new constant for native tokens and adjusts rendering based on whether an asset is native.

### Detailed summary
- Added `NATIVE_TOKEN_ADDRESS` and `getWalletBalance` import from `thirdweb`.
- Updated `key` for `AssetItem` to include `chain_id`.
- Introduced `isNativeToken` to conditionally render the `ChainIconClient`.
- Modified the `href` for `Link` based on whether the asset is a native token.
- Added a new set `tokensToShowOnTop` for sorting specific tokens.
- Implemented `nativeBalances` query to fetch wallet balances for various chains.
- Combined `nativeBalances` and `assetsQuery` data for rendering in `AssetsSectionUI`.

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

<!-- end pr-codex -->
2025-05-15 20:52:49 +00:00
Manan TankandGitHub 2057546934 Nebula: Recent Activity improvements in sidebar (#7055) 2025-05-15 13:52:15 -07:00
gregandGitHub ba52e68eab [Dashboard] Fix: Trend markers and UB volume type dropdown (#7059) 2025-05-15 12:05:40 -07:00
0eff64824b [Dashboard] Feature: Add Universal Bridge to analytics dashboard (#7051)
Co-authored-by: Claude <[email protected]>
2025-05-14 18:07:07 -07:00
saminacodes ae7407dca4 [Docs] engine and ub changes (#7049)
<!--

## 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 focuses on enhancing the documentation and user guidance for the `thirdweb` platform, specifically around the Engine v3 features, onramp providers, and pricing details. It introduces new FAQs, clarifies migration steps, and adds visual content.

### Detailed summary
- Added new section for "Onramp Providers" in `sidebar.tsx`.
- Updated Engine FAQs in `page.mdx` with pricing and transaction details.
- Revised migration guide in `page.mdx` with clearer instructions and a callout for wallet migration.
- Enhanced `faqs/page.mdx` with additional questions about Universal Bridge and supported payment methods.
- Updated "Buy With Fiat" availability to 160+ countries.
- Included images for creating a vault and sending transactions in the `get-started/page.mdx`.
- Revised onramp providers section to clarify provider preferences and fees in `onramp-providers/page.mdx`.

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

<!-- end pr-codex -->
2025-05-14 22:53:11 +00:00
Joe-Thirdweb a443b309dc Adding NeoX custom chain info. (#7045)
Adding Custom chain info to

- NeoX Mainnet 47763
- NeoX Testnt 12227332

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces new assets and metadata for the `Neo X` blockchain, enhancing the dashboard with images and information about its features and offerings.

### Detailed summary
- Added imports for `NeoXBanner` and `NeoXCTA` images.
- Introduced metadata for `Neo X` (ID: 47763) including:
  - `headerImgUrl`
  - `about` description
  - `cta` object with `backgroundImageUrl`, `title`, `buttonLink`, and `buttonText`.
- Duplicated metadata for `Neo X Testnet` (ID: 12227332) with similar structure.

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

<!-- end pr-codex -->
2025-05-14 22:44:28 +00:00
Joaquim VergesGitHubgraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
ae2ff743c0 [Engine] Update OpenAPI spec and configuration (#7050)
Signed-off-by: Joaquim Verges <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-14 15:43:30 -07:00
MananTank dfa8603593 [NEB-213] Nebula: Show wallet Assets and Activity in sidebar (#7046)
<!--

## 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 primarily focuses on enhancing the `AssetsSection` and `TransactionsSection` components by adding new features and improving the UI. It also modifies several existing components for better functionality and user experience.

### Detailed summary
- Changed `mergedSessions.push(session)` to `mergedSessions.unshift(session)` in `useSessionsWithLocalOverrides.ts`.
- Updated the width of the sidebar in `ChatPageLayout.tsx` from `280px` to `300px`.
- Added `customDetailsButton` prop to `NebulaConnectWallet` in `NebulaConnectButton.tsx`.
- Implemented conditional rendering for `customDetailsButton` in `NebulaConnectWallet`.
- Created storybook stories for `AssetsSection` and `TransactionsSection` with stubs for tokens and transactions.
- Enhanced `AssetsSection` and `TransactionsSection` components to handle loading states and display messages when there are no assets or transactions.
- Introduced `WalletDetails` component in `ChatSidebar` to manage assets and transactions tabs.
- Refactored `WalletSelector` to integrate `useActiveWallet` for better wallet management and user feedback.
- Improved button components with tooltips for better accessibility and UX.

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

<!-- end pr-codex -->
2025-05-14 21:47:42 +00:00
saminacodes 9f1ca54c26 Update page.mdx (#7048)
CORE-0000

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `preferredProvider` options in the `detailsModal` configuration for the `connectbutton` component, enhancing payment provider flexibility.

### Detailed summary
- Modified `preferredProvider` options in `detailsModal`:
  - Removed `"KADO"`
  - Added `"COINBASE"`

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

<!-- end pr-codex -->
2025-05-14 17:44:23 +00:00
MananTank 7df81b7323 [TOOL-4493] Dashboard: Add starter legacy discontinuation banner (#7047)
<!--

## 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 `StarterLegacyDiscontinuedBanner` component to the `RootTeamLayout` in `layout.tsx`. It displays a notification for users on the "starter_legacy" billing plan, informing them of the discontinuation and providing a link to select a new plan.

### Detailed summary
- Added a conditional rendering for `StarterLegacyDiscontinuedBanner` based on the team's billing plan.
- Created the `StarterLegacyDiscontinuedBanner` component to inform users about the discontinuation of starter legacy plans.
- Included a button with a link to the billing settings for selecting a new plan, featuring an `ArrowRightIcon`.

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

<!-- end pr-codex -->
2025-05-14 16:25:35 +00:00
GiselleNessi ab74fcdaf8 add new apis tab to nav (#7044)
<!--

## 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 adds a new section to the `Header` component in the `Header.tsx` file, introducing `apisLinks` for API documentation links and integrating a `DropdownLinks` component for displaying these links.

### Detailed summary
- Added a new constant `apisLinks` containing links to API documentation.
- Introduced a `DropdownLinks` component to display `apisLinks` in the header.
- Adjusted padding in the header's layout from `xl:px-2` to `xl:px-1` for the new dropdown.

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

<!-- end pr-codex -->
2025-05-14 15:09:12 +00:00
Joaquim VergesandGitHub 1191d5dad9 [Engine] Add EOA read/create permissions for server wallets (#7043) 2025-05-14 22:32:35 +12:00
Joaquim VergesandGitHub 20b5ba943a [SDK] Propagate 401 errors when connecting in-app wallet (#7040) 2025-05-14 02:03:41 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
f0f8da8fab Version Packages (#7032)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-13 19:50:56 -07:00
Joaquim VergesandGitHub da3fc99c0b [SDK] Default to in-memory storage for inAppWallet outside browser (#7038) 2025-05-13 18:32:37 -07:00
fb4c190eb3 [Dashboard] Feature: Default analytics range to 30 days and save preference (#7039)
Co-authored-by: Claude <[email protected]>
2025-05-13 15:25:09 -07:00
FirekeeperandGitHub 1c31a1e4df [Portal] .NET ThirdwebBridge Onramping & InAppWallet 7702 Account Abstraction (#7017) 2025-05-13 14:14:45 -07:00
MananTank 04c10f82fd [TOOL-4471] GatedSwitch updates, Make In-app wallet branding gated by starter+ (#7021)
<!--

## 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 focuses on enhancing the billing and plan management features in the dashboard. It introduces new props for handling plan highlights and open plan sheets, modifies tooltip styles, and adjusts billing card components to improve user experience.

### Detailed summary
- Updated `tooltip.tsx` to change padding in tooltip content.
- Changed `requiredPlan` from `authRequiredPlan` to `brandingRequiredPlan` in `Configure/index.tsx`.
- Added `openPlanSheetButtonByDefault` and `highlightPlan` props in various components.
- Modified `PlanInfoCardClient` and `Billing` components to utilize new props.
- Updated `TeamPlanBadge` to include an optional postfix.
- Enhanced `BillingPricing` logic to handle plan highlights.
- Adjusted `GatedSwitch` tooltip content for better user guidance.

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

<!-- end pr-codex -->
2025-05-13 20:22:10 +00:00
MananTank ab173886ac [TOOL-4483] Move changelog to team landing page from notifications (#7037)
<!--

## 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 focuses on refactoring notification handling in the application, removing unused functions, and enhancing the UI components related to notifications and alerts.

### Detailed summary
- Removed `getChangelogNotifications` and related props from several components.
- Introduced `DismissibleAlert` component for better alert management.
- Updated `NotificationButtonUI` to streamline notification handling.
- Adjusted UI elements for consistency and clarity.

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

<!-- end pr-codex -->
2025-05-13 19:19:55 +00:00
Joe-Thirdweb df06bec699 [Dashboard]Adding zkCandy + Onyx chain updates (#7035)
Adding custom chain info to

- Onyx Mainnet
- zkCandy Mainnet

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces new assets and updates the `chainMetaRecord` object to include information for the `Onyx` and `zkCandy` blockchains, enhancing the dashboard with additional details and visuals.

### Detailed summary
- Added imports for `onyxBanner`, `onyxCTA`, and `zkCandyBanner` images.
- Introduced `Onyx` blockchain entry in `chainMetaRecord` with header image, description, and CTA.
- Added `zkCandy` blockchain entry in `chainMetaRecord` with header image, description, and CTA.
- Updated comment for `zkCandy` entry to specify it as "zkCandy Testnet".

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

<!-- end pr-codex -->
2025-05-13 15:42:08 +00:00
Joaquim VergesandGitHub 6000dacfbb [Docs] Add Engine v2 to v3 migration guide (#7036) 2025-05-13 04:12:27 -07:00
Joaquim VergesandGitHub fc6535069b [SDK] Preload wallet balances on pay embed (#7034) 2025-05-13 17:08:26 +12:00
Joaquim VergesandGitHub b15c3c0747 Add contract availability documentation to ERC methods (#7033) 2025-05-12 17:47:28 -07:00
Joaquim VergesandGitHub 1985de89aa [SDK] Expose inMemoryStorage for inAppWallet backend usage (#7016) 2025-05-12 16:04:22 -07:00
MananTank 2b87b7bb75 [NEB-246] Nebula: handle aborted session with no messages (#7025)
<!--

## 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 focuses on enhancing the `ChatSidebar`, `useSessionsWithLocalOverrides`, and `ChatPageContent` components. It improves session handling, updates the chat sidebar title, and adds a user-friendly message for sessions without messages.

### Detailed summary
- Updated `title` prop in `<ChatSidebarLink>` to default to "Untitled Chat".
- Merged new sessions with existing ones in `useSessionsWithLocalOverrides`.
- Introduced a message and icon for sessions with no messages in `ChatPageContent`.
- Conditional rendering of `<Chats>` based on message availability.

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

<!-- end pr-codex -->
2025-05-12 20:54:35 +00:00
MananTank d99a985ab4 [NEB-238] Show ENS name in selected account badge (#7024)
<!--

## 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 focuses on updating the rendering of the `AccountName` component in the `ChatBar.tsx` file to improve the styling and structure of the address display.

### Detailed summary
- Replaced `span` with `AccountName` component for displaying the selected address.
- Added `className="text-xs"` to the `AccountName` component.
- Updated `loadingComponent` and `fallbackComponent` to use a consistent `span` with `className="text-xs"`.
- Changed `className` of `span` in `WalletSelector` from `font-mono text-sm` to `text-sm` for a consistent style.

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

<!-- end pr-codex -->
2025-05-12 20:54:35 +00:00
MananTank e74574ccf5 [NEB-239] Fix chain search not working properly for chain name starting with number (#7023)
<!--

## 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 focuses on improving the code by replacing `Number.parseInt` with `Number` for checking if a value is an integer across multiple files, enhancing readability and consistency.

### Detailed summary
- In `TokenSelector.tsx`, changed `Number.parseInt(searchValue)` to `Number(searchValue)`.
- In `single-network-selector.tsx`, modified the same integer check.
- In `ConfigureCustomChain.tsx`, updated integer check for `chainSlug`.
- In `NetworkSelectors.tsx`, replaced the integer check similarly.

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

<!-- end pr-codex -->
2025-05-12 20:54:35 +00:00
MananTank 98d05d6fb6 [NEB-247] Show error event in chat UI (#7022)
<!--

## 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 error handling for chat responses in the `ChatPageContent` and `chat.ts` files. It adds functionality to display error messages when an error event is received.

### Detailed summary
- Added handling for `"error"` case in `ChatPageContent.tsx` to update messages with error details.
- Implemented parsing of error data in `chat.ts` to extract error code and message.
- Updated `ChatStreamedEvent` type to include an `"error"` event with relevant data structure.

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

<!-- end pr-codex -->
2025-05-13 02:09:03 +05:30
MananTank f4ac3c2a3a [NEB-245] Limit image format types for upload (#7019)
<!--

## 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 focuses on enhancing the `ImageUploadButton` component by allowing it to accept specific image file types and updating the `ChatBar` component to utilize this feature.

### Detailed summary
- In `ChatBar.tsx`, added `accept` attribute with value `"image/jpeg,image/png,image/webp"` to the file input.
- In `image-upload-button.tsx`, changed `accept` property from a static value `"image/*"` to a dynamic value using `props.accept`.
- Updated `ImageUploadButton` to include `accept` in its props definition.

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

<!-- end pr-codex -->
2025-05-12 20:26:53 +00:00
MananTank a3a4bf4361 Nebula: Fix User Image message type (#7018)
<!--

## 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 focuses on updating the image handling in the `types.ts` and related components by modifying the structure of image objects, allowing for optional `image_url` and `b64` properties.

### Detailed summary
- In `types.ts`, changed the `image` type to include `image_url: string | null` and `b64: string | null`.
- In `ChatBar.tsx`, added `image_url: null` when pushing the image object to `userMessage.content`.
- In `Chats.tsx`, updated the condition to check if `msg.b64` is a string and used `msg.image_url ?? ""` for the URL.
- In `NebulaImage.tsx`, adjusted the skeleton div to have a minimum height of 300px.

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

<!-- end pr-codex -->
2025-05-12 17:15:52 +00:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
e8ec54e6e2 Version Packages (#7014)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-12 01:43:18 -07:00
Joaquim VergesandGitHub 58e343c10c [SDK] Improve EIP-5792 wallet capabilities support (#7003) 2025-05-12 01:25:30 -07:00
Prithvish BaidyaandGitHub bad9db9760 postfix slash to engine url (#7013) 2025-05-12 00:41:45 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
6a1e54ec69 Version Packages (#7010)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-11 16:16:33 -07:00
7ddedfbed1 Fix: Catch siwe doLogin errors (#7012)
Co-authored-by: Claude <[email protected]>
2025-05-12 10:45:32 +12:00
98eda9dd3d Fix: Auto-signin to autoconnect for all cases (#7011)
Co-authored-by: Claude <[email protected]>
2025-05-11 14:41:47 -07:00
5a13ad4521 [SDK] Fix: Automatically trigger login for connected wallets whe… (#7009)
Co-authored-by: Claude <[email protected]>
2025-05-11 14:02:23 -07:00
gregGitHubgraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
557a29a960 [Dashboard] Fix: Copying payment link on iOS (#7008)
Signed-off-by: greg <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-11 08:03:07 -07:00
gregandGitHub ff565cb0f8 Fix: Trend badge formatting (#7007) 2025-05-10 10:40:23 -07:00
gregfromstl 816aa6137b [Dashboard] Fix: Display latest value in PayNewCustomers component (#7002)
🤖 Generated with [Claude Code](https://claude.ai/code)

<!--

## 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 focuses on improving the logic used to display the total value in the `SkeletonContainer` of the `PayNewCustomers` component. It ensures that when `graphData` is empty, it returns "NA", and otherwise, it retrieves the last value or defaults to 0.

### Detailed summary
- Updated the logic in `SkeletonContainer`:
  - Changed the expression to return `graphData[graphData.length - 1]?.value || 0` when `graphData` is not empty.
  - Maintained the output of "NA" when `isEmpty` is true.

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

<!-- end pr-codex -->
2025-05-10 17:10:32 +00:00
MananTank 7de273c59d Dashboard: Reset last-used-* cookies on login page (#7005)
<!--

## 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 focuses on adding a `deleteCookie` function to manage cookies and incorporates a new component, `ResetLastUsedCookies`, in the `LoginPage` to clear specific cookies upon rendering.

### Detailed summary
- Added `deleteCookie` function in `cookie.ts` to delete cookies by name.
- Imported constants `LAST_USED_PROJECT_ID`, `LAST_USED_TEAM_ID`, and `LAST_VISITED_TEAM_PAGE_PATH` in `LoginPage.tsx`.
- Implemented `ResetLastUsedCookies` component to delete specific cookies on mount.

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

<!-- end pr-codex -->
2025-05-10 13:18:36 +00:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
95cc441edd Version Packages (#7006)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-10 06:18:04 -07:00
Joaquim VergesandGitHub 6f1d4b1fcf [SDK] Handle tx with value on engineAccount (#7004) 2025-05-10 06:13:54 -07:00
7ede361870 Fix testnet filtering in NetworkSelectors (#7001)
Co-authored-by: Claude <[email protected]>
2025-05-09 23:05:51 -07:00
8b50779229 [Dashboard] Feature: Disable testnets in Payment Link form (#7000)
Co-authored-by: Claude <[email protected]>
2025-05-09 22:51:41 -07:00
gregGitHubClaudegraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
282d9f2c39 [Dashboard] Fix: Use x-client-id + x-team-id for all UB requests (#6999)
Signed-off-by: greg <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-09 22:17:01 -07:00
jnsdls e739de158d Only set secret key or client ID when not using auth token (#6994)
This PR modifies the header setting logic in `getClientFetch` to ensure that secret keys and client IDs are only set when not using an auth token. This prevents potential conflicts between different authentication methods by making the header setting logic mutually exclusive.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR modifies the logic in the `fetch.ts` file to ensure that the `x-secret-key` and `x-client-id` headers are only set when not using the authentication token, enhancing security and clarity in header management.

### Detailed summary
- Added an `else` clause to only set `x-secret-key` if not using the auth token.
- Rearranged the condition for setting `x-client-id` to follow the new logic.

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

<!-- end pr-codex -->
2025-05-10 02:54:20 +00:00
gregandGitHub 451594c80c Feature: Migrate Universal Bridge Analytics (#6988) 2025-05-09 18:16:43 -07:00
gregfromstl 9634e49113 Feature: Add client id to checkout form url (#6997)
<!--

## 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 focuses on enhancing the `CheckoutLinkForm` component by passing a `client` prop to it and improving its functionality. It also refines the styling and class management using the `cn` utility for better readability and maintainability.

### Detailed summary
- Modified `page.tsx` to create a `client` using `getClientThirdwebClient` and pass it to `CheckoutLinkForm`.
- Changed the `CheckoutLinkForm` function signature to accept a `client` prop.
- Updated multiple instances in `CheckoutLinkForm` to utilize `client.clientId`.
- Replaced static class names with the `cn` utility for dynamic class management in the button and div elements.
- Adjusted the conditional rendering of classes for better readability and performance in the component.

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

<!-- end pr-codex -->
2025-05-10 01:05:38 +00:00
gregandGitHub a4e12c5516 Fix: Auth method for checkout page api requests to ub service (#6996) 2025-05-09 17:29:49 -07:00
MananTank 2297915633 [NEB-210] Nebula: Add image upload (#6995)
<!--

## 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 image upload functionality within the chat application, enhancing user interaction by allowing users to send images along with text messages. It also includes updates to various components to support this feature.

### Detailed summary
- Added `allowImageUpload` prop to multiple components.
- Introduced `ImageUploadButton` for image selection.
- Modified `ChatBar` to handle image uploads and message composition.
- Updated `FloatingChatContentLoggedIn`, `ChatPageContent`, and `EmptyStateChatPageContent` to accommodate new props.
- Enhanced `NebulaImage` for displaying uploaded images.
- Implemented image preview and removal functionality in `ChatBar`.

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

<!-- end pr-codex -->
2025-05-09 23:19:08 +00:00
gregandGitHub 585ba2f575 Feature: Checkout link creation page (#6989) 2025-05-09 13:51:26 -07:00
MananTank a68ec74d25 Dashboard: Use React taint API for envs, envs cleanup (#6992)
<!--

## 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 primarily focuses on refactoring the environment variables used throughout the application, shifting from a centralized `env` file to a more modular `public-envs` and `server-envs` structure. This enhances organization and clarity regarding environment variable usage.

### Detailed summary
- Deleted `env.ts` and introduced `public-envs.ts` and `server-envs.ts`.
- Updated imports across various files to use new environment variable structure.
- Replaced direct `process.env` calls with imported constants.
- Added `taint` feature for sensitive server environment variables.
- Adjusted fetch URLs to use `NEXT_PUBLIC_THIRDWEB_API_HOST` instead of `API_SERVER_URL`.

> The following files were skipped due to too many changes: `apps/dashboard/src/@/constants/server-envs.ts`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_utils/getContractPageMetadata.ts`, `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_utils/getContractPageMetadataSetup.ts`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/server-wallets/components/try-it-out.tsx`

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

<!-- end pr-codex -->
2025-05-09 17:12:44 +00:00
MananTank 7ae3a81a11 [NEB-241] Nebula: /chat endpoint schema update related changes (#6982)
<!--

## 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 focuses on refactoring the message structure in the chat components to utilize a new `NebulaUserMessage` type, enhancing the way messages are handled and displayed throughout the application.

### Detailed summary
- Updated message structure in `Chats` and `ChatBar` to use `NebulaUserMessage`.
- Changed message content handling in `FloatingChatContent` and `ChatPageContent`.
- Modified `NebulaImage` component to accept new props.
- Adjusted `EmptyStateChatPageContent` and `Chats` to support new message format.
- Enhanced message rendering logic in `RenderMessage` and `RenderResponse` components.

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

<!-- end pr-codex -->
2025-05-09 17:03:50 +00:00
MananTank ccb9cd5d0a Dashboard: Fix team links in header on pages outside /team layout (#6981)
<!--

## 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 modifies the `href` attribute of the `Link` component in the `TeamSelectionUI.tsx` file to ensure that the URL path is correctly constructed when navigating between team pages.

### Detailed summary
- Updated the `href` logic to check if `pathname` starts with `/team`.
- Changed the `replace` method to use the full path for `currentTeam.slug` and `team.slug`.
- Ensured that the fallback URL for the `Link` defaults to `/team/${team.slug}` when conditions are not met.

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

<!-- end pr-codex -->
2025-05-09 11:33:34 +00:00
MananTank 3dc11c087a Dashboard: Contract pages cleanup (#6991)
<!--

## 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 primarily focuses on refactoring the contract-related code to consistently use `clientContract` and `serverContract` variables instead of `contract`. This improves clarity and ensures that the correct contract instance is used in various components.

### Detailed summary
- Replaced instances of `info.contract` with `info.clientContract` or `info.serverContract` across multiple files.
- Updated conditions checking for localhost to use `info.isLocalhostChain`.
- Modified return statements in several components to use the appropriate contract variable.
- Adjusted metadata fetching and handling to align with the new contract structure.
- Removed `ContractAnalyticsPageClient` usage in favor of direct `ContractAnalyticsPage` with `clientContract`.

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

<!-- end pr-codex -->
2025-05-09 11:18:35 +00:00
Joaquim VergesandGitHub 49479d40b0 [Dashboard] Replace serverThirdwebClient with getUserThirdwebClient (#6990) 2025-05-09 00:23:29 -07:00
Joaquim VergesGitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3d7c2d4f67 [Auth] Replace mainnet with ANVIL_CHAIN in verifyTypedData tests (#6985)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-08 22:01:46 -07:00
Manan TankandGitHub 5b40f76b4d Dashboard: thirdweb client refactor (#6987) 2025-05-09 03:15:41 +02:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ef1550cff5 Version Packages (#6986)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-09 02:34:56 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b1719fd4ff chore(deps): bump github/codeql-action from 3.28.16 to 3.28.17 (#6940)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-09 02:27:42 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
598d4006d9 chore(deps): bump changesets/action from 1.4.10 to 1.5.0 (#6939)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-09 02:27:23 +02:00
Jonas DanielsandGitHub bc75ae6826 Handle JWT auth method explicitly in service-utils (#6984) 2025-05-09 02:25:42 +02:00
Joe-ThirdwebGitHubsaminagraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
8fb8a7530c [Portal] Block native to thridweb guide (#6977)
Signed-off-by: samina <[email protected]>
Co-authored-by: samina <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-08 14:37:28 -07:00
Joaquim VergesandGitHub 106ca3cd01 [Dashboard] more robust engine cloud FTUX (#6980) 2025-05-08 14:29:14 -07:00
Jonas DanielsandGitHub 76a718c8f5 Force auth token usage for storage uploads (#6973) 2025-05-08 22:44:04 +02:00
GiselleNessi 1e924e037f updated alert description in team overview dashboard page (#6979)
<!--

## 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 focuses on updating the content in the `page.tsx` file related to the `TeamProjectsPage` component and modifying the alert message to provide clearer information about managing engines within projects.

### Detailed summary
- Reordered the placement of the `<TeamProjectsPage>` component.
- Updated the alert message to clarify that engines, contracts, project settings, and more are managed within projects.

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

<!-- end pr-codex -->
2025-05-08 16:06:27 +00:00
Joaquim VergesandGitHub 99d2497b51 [Dashboard] Add Indonesia to SMS country select options (#6978) 2025-05-08 01:43:23 -07:00
Joaquim VergesandGitHub a5a1d17f3b [Dashboard] Add info alert about Engines moving to projects (#6976) 2025-05-07 20:47:18 -07:00
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
62c179d775 Version Packages (#6975)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-07 18:44:36 -07:00
Joaquim VergesandGitHub e96ebba2cb [SDK] Add 7702 support + minimal account implementation (#6874) 2025-05-07 18:09:14 -07:00
2025 changed files with 92891 additions and 38139 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ We use [Turborepo](https://turbo.build/repo/docs) to manage the repository, and
We use [pnpm](https://pnpm.io) for package management across the repo. `pnpm` is similar to `npm` or `yarn` but with more efficient disk space usage.
**With the v5 SDK, we've consolidated everything into a single project at [/packages/thirdweb](./packages/thirdweb). You can still find the legacy packages at [/legacy_packages](./legacy_packages).**
**With the v5 SDK, we've consolidated everything into a single project at [/packages/thirdweb](../packages/thirdweb). You can still find the legacy packages at [/legacy_packages](../legacy_packages).**
This single package provides a performant & lightweight SDK to interact with any EVM chain across Node, React, and React Native. Learn more about how to use the thirdweb SDK in our [documentation](https://portal.thirdweb.com/typescript/v5).
+2 -2
View File
@@ -61,7 +61,7 @@ jobs:
uses: ./.github/composite-actions/install
- name: Setup Biome
uses: biomejs/setup-biome@f382a98e582959e6aaac8e5f8b17b31749018780 # v2.5.0
uses: biomejs/setup-biome@a9763ed3d2388f5746f9dc3e1a55df7f4609bc89 # v2.5.1
with:
version: latest
@@ -89,7 +89,7 @@ jobs:
- run: pnpm test
- name: Code Coverage
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
directory: packages/
flags: packages
+3 -3
View File
@@ -46,7 +46,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -59,7 +59,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/autobuild@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -72,4 +72,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
- name: Create release Pull Request or publish to NPM
id: changesets
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc #v1.4.0
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba #v1.4.0
with:
publish: pnpm release
version: pnpm version-packages
+3 -1
View File
@@ -16,6 +16,7 @@ yalc.lock
./build/
playwright-report/
.env/
.pnpm-store/
# codecov binary
codecov
@@ -31,4 +32,5 @@ storybook-static
.aider*
tsconfig.tsbuildinfo
.cursor
.cursor
apps/dashboard/node-compile-cache
+125
View File
@@ -0,0 +1,125 @@
🤖 Codex Agent Guidelines for thirdweb-dev/js
Welcome, AI copilots! This guide captures the coding standards, architectural decisions, and workflow conventions that every automated agent (and human contributor!) must follow. Unless a rule explicitly targets a sub‑project, it applies repo‑wide.
⸻
1. GitHub Workflow & Etiquette
- Pull‑request titles must start with the affected workspace in brackets (e.g. [SDK], [Dashboard], [Portal], [Playground]).
- Begin the PR description with a one‑sentence summary, then add a checklist of changes and reference issues with Fixes #123.
- Keep commits small and topical – one logical change per commit.
- Branch names should follow area/brief-topic (e.g. sdk/fix-gas-estimate). Avoid personal names.
- Request at least one core maintainer review. Do not self‑merge unless you are the sole owner of that package.
- All CI checks (type‑check, Biome, tests) must pass before merging.
⸻
2. Formatting & Linting
- Biome governs formatting and linting; its rules live in biome.json.
- Run pnpm biome check --apply before committing.
- Avoid editor‑specific configs; rely on the shared settings.
- make sure everything builds after each file change by running `pnpm build`
⸻
3. TypeScript Style Guide
- Write idiomatic TypeScript: explicit function declarations and return types.
- Limit each file to one stateless, single‑responsibility function for clarity and testability.
- Re‑use shared types from @/types or local types.ts barrels.
- Prefer type aliases over interface except for nominal shapes.
- Avoid any and unknown unless unavoidable; narrow generics whenever possible.
- Choose composition over inheritance; leverage utility types (Partial, Pick, etc.).
⸻
4. Testing Strategy
- Co‑locate tests: foo.ts ↔ foo.test.ts.
- Use real function invocations with stub data; avoid brittle mocks.
- For network interactions, use Mock Service Worker (MSW) to intercept fetch/HTTP calls, mocking only scenarios that are hard to reproduce.
- Keep tests deterministic and side‑effect free; Vitest is pre‑configured.
- to run the tests: `cd packages thirdweb & pnpm test:dev <filename>`
⸻
5. packages/thirdweb
5.1 Public API Surface
- Export everything via the exports/ directory, grouped by feature.
- Every public symbol must have comprehensive TSDoc:
- Include at least one @example block that compiles.
- Tag with one custom annotation (@beta, @internal, @experimental, etc.).
- Comment only ambiguous logic; avoid restating TypeScript in prose.
5.2 Performance
- Lazy‑load heavy dependencies inside async paths to keep the initial bundle lean:
`const { jsPDF } = await import("jspdf");`
⸻
6. apps/dashboard & apps/playground
6.1 Core UI Toolkit
- Import primitives from @/components/ui/\_ (e.g. Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator).
- Use NavLink for internal navigation so active states are handled automatically.
- Group feature‑specific components under feature/components/\_ and expose a barrel index.ts when necessary.
6.2 Styling Conventions
- Tailwind CSS is the styling system – no inline styles or CSS modules.
- Merge class names with cn() from @/lib/utils to keep conditional logic readable.
- Stick to design tokens: backgrounds (bg-card), borders (border-border), muted text (text-muted-foreground), etc.
- Expose a className prop on the root element of every component for overrides.
6.3 Component Patterns
- Server Components (run on the Node edge):
-- Read cookies/headers with next/headers.
-- Access server‑only environment variables or secrets.
-- Perform heavy data fetching that should not ship to the client.
-- Implement redirect logic with redirect() from next/navigation.
-- Start files with import "server-only"; to prevent client bundling.
- Client Components (run in the browser):
-- Begin files with 'use client'; before imports.
-- Handle interactive UI relying on React hooks (useState, useEffect, React Query, wallet hooks).
-- Access browser APIs (localStorage, window, IntersectionObserver, etc.).
-- Support fast transitions where data is prefetched on the client.
6.4 Data Fetching Guidelines
- Server Side
-- Always call getAuthToken() to retrieve the JWT from cookies.
-- Inject the token as an Authorization: Bearer header – never embed it in the URL.
-- Return typed results (Project[], User[], …) – avoid any.
- Client Side
-- Wrap calls in React Query (@tanstack/react-query).
-- Use descriptive, stable queryKeys for cache hits.
-- Configure staleTime / cacheTime based on freshness requirements (default ≥ 60 s).
-- Keep tokens secret by calling internal API routes or server actions.
⸻
7. Performance & Bundle Size
- Track bundle budgets via package.json#size-limit.
- Lazy‑import optional features; avoid top‑level side‑effects.
- De‑duplicate dependencies across packages through pnpm workspace hoisting.
⸻
8. Documentation & Developer Experience
- Each change in packages/\* should contain a changeset for the appropriate package, with the appropriate version bump
- patch for changes that don't impact the public API
- minor for any new/modified public API
- Surface breaking changes prominently in PR descriptions.
- For new UI components, add Storybook stories (\*.stories.tsx) alongside the code.
+1 -2
View File
@@ -13,9 +13,8 @@ const config: StorybookConfig = {
addons: [
getAbsolutePath("@storybook/addon-onboarding"),
getAbsolutePath("@storybook/addon-links"),
getAbsolutePath("@storybook/addon-essentials"),
getAbsolutePath("@chromatic-com/storybook"),
getAbsolutePath("@storybook/addon-interactions"),
getAbsolutePath("@storybook/addon-docs"),
],
framework: {
name: getAbsolutePath("@storybook/nextjs"),
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Preview } from "@storybook/react";
import type { Preview } from "@storybook/nextjs";
import "../src/global.css";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { MoonIcon, SunIcon } from "lucide-react";
+3 -5
View File
@@ -27,10 +27,7 @@ module.exports = [
// -- engine
"/engine",
// -- solutions pages --
"/solutions/gaming",
"/solutions/consumer-apps",
"/solutions/defi",
"/solutions/ecosystem",
"/solutions/:solution_slug",
// -- campaigns --
// "/unlimited-wallets", -- OFF for now
// -- TPP --
@@ -43,7 +40,8 @@ module.exports = [
"/community/ambassadors",
"/community/startup-program",
// -- grants --
"/grant/superchain",
"/grants",
"/superchain",
// -- templates --
"/templates",
"/templates/:template_slug",
-1
View File
@@ -10,7 +10,6 @@
"project": ["src/**"],
"ignoreBinaries": ["only-allow", "biome"],
"ignoreDependencies": [
"@storybook/blocks",
"@thirdweb-dev/service-utils",
"@thirdweb-dev/vault-sdk",
"@types/color",
+2 -1
View File
@@ -12,7 +12,7 @@ const ContentSecurityPolicy = `
style-src 'self' 'unsafe-inline' vercel.live;
font-src 'self' vercel.live assets.vercel.com framerusercontent.com fonts.gstatic.com;
frame-src * data:;
script-src 'self' 'unsafe-eval' 'unsafe-inline' 'wasm-unsafe-eval' 'inline-speculation-rules' *.thirdweb.com *.thirdweb-dev.com vercel.live js.stripe.com framerusercontent.com events.framer.com challenges.cloudflare.com;
script-src 'self' 'unsafe-eval' 'unsafe-inline' 'wasm-unsafe-eval' 'inline-speculation-rules' *.thirdweb.com *.thirdweb-dev.com vercel.live js.stripe.com framerusercontent.com events.framer.com challenges.cloudflare.com googletagmanager.com us-assets.i.posthog.com edit.framer.com;
connect-src * data: blob:;
worker-src 'self' blob:;
block-all-mixed-content;
@@ -123,6 +123,7 @@ const baseNextConfig: NextConfig = {
webpackBuildWorker: true,
webpackMemoryOptimizations: true,
serverSourceMaps: false,
taint: true,
},
serverExternalPackages: ["pino-pretty"],
async headers() {
+48 -53
View File
@@ -29,30 +29,30 @@
"@emotion/styled": "11.14.0",
"@hookform/resolvers": "^3.9.1",
"@marsidev/react-turnstile": "^1.1.0",
"@radix-ui/react-accordion": "^1.2.7",
"@radix-ui/react-alert-dialog": "^1.1.10",
"@radix-ui/react-avatar": "^1.1.6",
"@radix-ui/react-checkbox": "^1.2.2",
"@radix-ui/react-dialog": "1.1.10",
"@radix-ui/react-dropdown-menu": "^2.1.11",
"@radix-ui/react-hover-card": "^1.1.10",
"@radix-ui/react-label": "^2.1.4",
"@radix-ui/react-popover": "^1.1.10",
"@radix-ui/react-progress": "^1.1.4",
"@radix-ui/react-radio-group": "^1.3.3",
"@radix-ui/react-select": "^2.2.2",
"@radix-ui/react-separator": "^1.1.4",
"@radix-ui/react-slot": "^1.2.0",
"@radix-ui/react-switch": "^1.2.2",
"@radix-ui/react-tooltip": "1.2.3",
"@radix-ui/react-accordion": "^1.2.11",
"@radix-ui/react-alert-dialog": "^1.1.14",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-checkbox": "^1.3.2",
"@radix-ui/react-dialog": "1.1.14",
"@radix-ui/react-dropdown-menu": "^2.1.15",
"@radix-ui/react-hover-card": "^1.1.14",
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-popover": "^1.1.14",
"@radix-ui/react-progress": "^1.1.7",
"@radix-ui/react-radio-group": "^1.3.7",
"@radix-ui/react-select": "^2.2.5",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-switch": "^1.2.5",
"@radix-ui/react-tooltip": "1.2.7",
"@scalar/api-reference-react": "^0.6.19",
"@sentry/nextjs": "9.13.0",
"@shazow/whatsabi": "0.21.0",
"@tanstack/react-query": "5.74.4",
"@sentry/nextjs": "9.28.1",
"@shazow/whatsabi": "0.22.2",
"@tanstack/react-query": "5.80.7",
"@tanstack/react-table": "^8.21.3",
"@thirdweb-dev/service-utils": "workspace:*",
"@thirdweb-dev/vault-sdk": "workspace:*",
"@vercel/functions": "2.0.0",
"@vercel/functions": "2.1.0",
"@vercel/og": "^0.6.8",
"abitype": "1.0.8",
"chakra-react-select": "^4.7.6",
@@ -61,23 +61,22 @@
"color": "5.0.0",
"compare-versions": "^6.1.0",
"date-fns": "4.1.0",
"fast-xml-parser": "^5.2.1",
"fast-xml-parser": "^5.2.5",
"fetch-event-stream": "0.1.5",
"flat": "^6.0.1",
"framer-motion": "12.9.2",
"framer-motion": "12.17.0",
"fuse.js": "7.1.0",
"idb-keyval": "^6.2.1",
"input-otp": "^1.4.1",
"ioredis": "^5.6.1",
"ipaddr.js": "^2.2.0",
"lucide-react": "0.503.0",
"next": "15.3.1",
"lucide-react": "0.514.0",
"next": "15.3.3",
"next-plausible": "^3.12.4",
"next-themes": "^0.4.6",
"nextjs-toploader": "^1.6.12",
"nuqs": "^2.4.3",
"p-limit": "^6.2.0",
"papaparse": "^5.5.2",
"papaparse": "^5.5.3",
"pluralize": "^8.0.0",
"posthog-js": "1.67.1",
"prettier": "3.5.3",
@@ -89,61 +88,57 @@
"react-dropzone": "^14.3.8",
"react-error-boundary": "^5.0.0",
"react-hook-form": "7.55.0",
"react-markdown": "^9.0.1",
"react-markdown": "10.1.0",
"react-table": "^7.8.0",
"recharts": "2.15.3",
"remark-gfm": "4.0.1",
"responsive-rsc": "0.0.7",
"server-only": "^0.0.1",
"shiki": "1.27.0",
"sonner": "2.0.3",
"sonner": "2.0.5",
"spdx-correct": "^3.2.0",
"stripe": "17.7.0",
"swagger-ui-react": "^5.21.0",
"swagger-ui-react": "^5.24.1",
"tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7",
"thirdweb": "workspace:*",
"tiny-invariant": "^1.3.3",
"use-debounce": "^10.0.4",
"zod": "3.24.3"
"use-debounce": "^10.0.5",
"vaul": "^1.1.2",
"zod": "3.25.62"
},
"devDependencies": {
"@chakra-ui/cli": "^2.4.1",
"@chromatic-com/storybook": "3.2.6",
"@next/bundle-analyzer": "15.3.1",
"@next/eslint-plugin-next": "15.3.1",
"@playwright/test": "1.52.0",
"@storybook/addon-essentials": "8.6.12",
"@storybook/addon-interactions": "8.6.12",
"@storybook/addon-links": "8.6.12",
"@storybook/addon-onboarding": "8.6.12",
"@storybook/addon-viewport": "8.6.12",
"@storybook/blocks": "8.6.12",
"@storybook/nextjs": "8.6.12",
"@storybook/react": "8.6.12",
"@storybook/test": "8.6.12",
"@chromatic-com/storybook": "4.0.0",
"@next/bundle-analyzer": "15.3.3",
"@next/eslint-plugin-next": "15.3.3",
"@playwright/test": "1.53.0",
"@storybook/addon-docs": "9.0.8",
"@storybook/addon-links": "9.0.8",
"@storybook/addon-onboarding": "9.0.8",
"@storybook/nextjs": "9.0.8",
"@types/color": "4.2.0",
"@types/node": "22.14.1",
"@types/papaparse": "^5.3.15",
"@types/papaparse": "^5.3.16",
"@types/pluralize": "^0.0.33",
"@types/qrcode": "^1.5.5",
"@types/react": "19.1.2",
"@types/react-dom": "19.1.2",
"@types/react": "19.1.8",
"@types/react-dom": "19.1.6",
"@types/react-table": "^7.7.20",
"@types/spdx-correct": "^3.1.3",
"@types/swagger-ui-react": "^5.18.0",
"@typescript-eslint/eslint-plugin": "7.14.1",
"@typescript-eslint/parser": "7.14.1",
"autoprefixer": "^10.4.21",
"checkly": "5.2.0",
"checkly": "5.6.0",
"eslint": "8.57.0",
"eslint-config-biome": "1.9.4",
"eslint-plugin-react-compiler": "19.0.0-beta-e993439-20250405",
"eslint-plugin-storybook": "0.12.0",
"knip": "5.50.5",
"eslint-plugin-react-compiler": "19.1.0-rc.2",
"eslint-plugin-storybook": "9.0.8",
"knip": "5.60.2",
"next-sitemap": "^4.2.3",
"postcss": "8.5.3",
"storybook": "8.6.12",
"postcss": "8.5.5",
"storybook": "9.0.8",
"tailwindcss": "3.4.17",
"typescript": "5.8.3"
}
+6
View File
@@ -368,6 +368,12 @@ async function redirects() {
destination: "/learn/guides",
permanent: false,
},
// redirect to /grant/superchain to /superchain
{
source: "/grant/superchain",
destination: "/superchain",
permanent: false,
},
...legacyDashboardToTeamRedirects,
];
+2 -2
View File
@@ -1,7 +1,7 @@
"use server";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export async function acceptInvite(options: {
teamId: string;
@@ -17,7 +17,7 @@ export async function acceptInvite(options: {
}
const res = await fetch(
`${API_SERVER_URL}/v1/teams/${options.teamId}/invites/${options.inviteId}/accept`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${options.teamId}/invites/${options.inviteId}/accept`,
{
method: "POST",
headers: {
+2 -2
View File
@@ -1,7 +1,7 @@
"use server";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export async function reSubscribePlan(options: {
teamId: string;
@@ -14,7 +14,7 @@ export async function reSubscribePlan(options: {
}
const res = await fetch(
`${API_SERVER_URL}/v1/teams/${options.teamId}/checkout/resubscribe-plan`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${options.teamId}/checkout/resubscribe-plan`,
{
method: "PUT",
headers: {
+13 -10
View File
@@ -1,7 +1,7 @@
"use server";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export async function confirmEmailWithOTP(otp: string) {
const token = await getAuthToken();
@@ -12,16 +12,19 @@ export async function confirmEmailWithOTP(otp: string) {
};
}
const res = await fetch(`${API_SERVER_URL}/v1/account/confirmEmail`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
const res = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/account/confirmEmail`,
{
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
body: JSON.stringify({
confirmationToken: otp,
}),
},
body: JSON.stringify({
confirmationToken: otp,
}),
});
);
if (!res.ok) {
const json = await res.json();
@@ -0,0 +1,75 @@
"use server";
import "server-only";
// biome-ignore lint/style/useNodejsImportProtocol: breaks storybook if it's `node:` prefixed
import { randomBytes } from "crypto";
import type { Team } from "@/api/team";
import { format } from "date-fns";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export async function createTeam(options?: {
name?: string;
slug?: string;
}) {
const token = await getAuthToken();
if (!token) {
return {
status: "error",
errorMessage: "You are not authorized to perform this action",
} as const;
}
const res = await fetch(`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name:
options?.name ?? `Your Projects ${format(new Date(), "MMM d yyyy")}`,
slug: options?.slug ?? randomBytes(20).toString("hex"),
billingEmail: null,
image: null,
}),
});
if (!res.ok) {
const reason = await res.text();
console.error("failed to create team", {
status: res.status,
reason,
});
switch (res.status) {
case 400: {
return {
status: "error",
errorMessage: "Invalid team name or slug.",
} as const;
}
case 401: {
return {
status: "error",
errorMessage: "You are not authorized to perform this action.",
} as const;
}
default: {
return {
status: "error",
errorMessage: "An unknown error occurred.",
} as const;
}
}
}
const json = (await res.json()) as {
result: Team;
};
return {
status: "success",
data: json.result,
} as const;
}
@@ -0,0 +1,70 @@
"use server";
import "server-only";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export async function deleteTeam(options: {
teamId: string;
}) {
const token = await getAuthToken();
if (!token) {
return {
status: "error",
errorMessage: "You are not authorized to perform this action.",
} as const;
}
const res = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${options.teamId}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${token}`,
},
},
);
// handle errors
if (!res.ok) {
const reason = await res.text();
console.error("failed to delete team", {
status: res.status,
reason,
});
switch (res.status) {
case 400: {
return {
status: "error",
errorMessage: "Invalid team ID.",
} as const;
}
case 401: {
return {
status: "error",
errorMessage: "You are not authorized to perform this action.",
} as const;
}
case 403: {
return {
status: "error",
errorMessage: "You do not have permission to delete this team.",
} as const;
}
case 404: {
return {
status: "error",
errorMessage: "Team not found.",
} as const;
}
default: {
return {
status: "error",
errorMessage: "An unknown error occurred.",
} as const;
}
}
}
return {
status: "success",
} as const;
}
@@ -2,7 +2,8 @@
import { defineDashboardChain } from "lib/defineDashboardChain";
import { ZERO_ADDRESS, isAddress, toTokens } from "thirdweb";
import { getWalletBalance } from "thirdweb/wallets";
import { getUserThirdwebClient } from "../../app/(app)/api/lib/getAuthToken";
import { MORALIS_API_KEY } from "../constants/server-envs";
import { serverThirdwebClient } from "../constants/thirdweb-client.server";
type BalanceQueryResponse = Array<{
balance: string;
@@ -23,7 +24,6 @@ export async function getTokenBalancesFromMoralis(params: {
error: string;
}
> {
const client = await getUserThirdwebClient();
const { contractAddress, chainId } = params;
if (!isAddress(contractAddress)) {
@@ -39,7 +39,7 @@ export async function getTokenBalancesFromMoralis(params: {
const balance = await getWalletBalance({
address: contractAddress,
chain,
client,
client: serverThirdwebClient,
});
return [
{
@@ -61,7 +61,7 @@ export async function getTokenBalancesFromMoralis(params: {
const resp = await fetch(tokenBalanceEndpoint, {
method: "GET",
headers: {
"x-api-key": process.env.MORALIS_API_KEY || "",
"x-api-key": MORALIS_API_KEY,
},
});
@@ -12,7 +12,8 @@ import type { WalletNFT } from "lib/wallet/nfts/types";
import { getVercelEnv } from "../../lib/vercel-utils";
import { isAlchemySupported } from "../../lib/wallet/nfts/isAlchemySupported";
import { isMoralisSupported } from "../../lib/wallet/nfts/isMoralisSupported";
import { DASHBOARD_THIRDWEB_CLIENT_ID } from "../constants/env";
import { NEXT_PUBLIC_DASHBOARD_CLIENT_ID } from "../constants/public-envs";
import { MORALIS_API_KEY } from "../constants/server-envs";
type WalletNFTApiReturn =
| { result: WalletNFT[]; error?: undefined }
@@ -59,13 +60,13 @@ export async function getWalletNFTs(params: {
}
}
if (isMoralisSupported(chainId) && process.env.MORALIS_API_KEY) {
if (isMoralisSupported(chainId) && MORALIS_API_KEY) {
const url = generateMoralisUrl({ chainId, owner });
const response = await fetch(url, {
method: "GET",
headers: {
"X-API-Key": process.env.MORALIS_API_KEY,
"X-API-Key": MORALIS_API_KEY,
},
next: {
revalidate: 10, // cache for 10 seconds
@@ -148,7 +149,7 @@ async function getWalletNFTsFromInsight(params: {
const response = await fetch(url, {
headers: {
"x-client-id": DASHBOARD_THIRDWEB_CLIENT_ID,
"x-client-id": NEXT_PUBLIC_DASHBOARD_CLIENT_ID,
},
});
+8 -13
View File
@@ -1,7 +1,11 @@
"use server";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL, THIRDWEB_ENGINE_CLOUD_URL } from "../constants/env";
import {
NEXT_PUBLIC_ENGINE_CLOUD_URL,
NEXT_PUBLIC_THIRDWEB_API_HOST,
} from "../constants/public-envs";
import { ANALYTICS_SERVICE_URL } from "../constants/server-envs";
type ProxyActionParams = {
pathname: string;
@@ -76,22 +80,13 @@ async function proxy<T>(
}
export async function apiServerProxy<T>(params: ProxyActionParams) {
return proxy<T>(API_SERVER_URL, params);
return proxy<T>(NEXT_PUBLIC_THIRDWEB_API_HOST, params);
}
export async function engineCloudProxy<T>(params: ProxyActionParams) {
return proxy<T>(THIRDWEB_ENGINE_CLOUD_URL, params);
}
export async function payServerProxy<T>(params: ProxyActionParams) {
return proxy<T>(
process.env.NEXT_PUBLIC_PAY_URL
? `https://${process.env.NEXT_PUBLIC_PAY_URL}`
: "https://pay.thirdweb-dev.com",
params,
);
return proxy<T>(NEXT_PUBLIC_ENGINE_CLOUD_URL, params);
}
export async function analyticsServerProxy<T>(params: ProxyActionParams) {
return proxy<T>(process.env.ANALYTICS_SERVICE_URL || "", params);
return proxy<T>(ANALYTICS_SERVICE_URL, params);
}
@@ -0,0 +1,10 @@
"use server";
import { revalidatePath } from "next/cache";
export async function revalidatePathAction(
path: string,
type: "page" | "layout",
) {
revalidatePath(path, type);
}
+14 -11
View File
@@ -1,7 +1,7 @@
"use server";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export async function sendTeamInvites(options: {
teamId: string;
@@ -40,17 +40,20 @@ async function sendInvite(
invite: { email: string; role: "OWNER" | "MEMBER" },
token: string,
) {
const res = await fetch(`${API_SERVER_URL}/v1/teams/${teamId}/invites`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
const res = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamId}/invites`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
inviteEmail: invite.email,
inviteRole: invite.role,
}),
},
body: JSON.stringify({
inviteEmail: invite.email,
inviteRole: invite.role,
}),
});
);
if (!res.ok) {
const errorMessage = await res.text();
+14 -2
View File
@@ -2,13 +2,12 @@ import "server-only";
import Stripe from "stripe";
import type { Team } from "../api/team";
import { STRIPE_SECRET_KEY } from "../constants/server-envs";
let existingStripe: Stripe | undefined;
function getStripe() {
if (!existingStripe) {
const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY;
if (!STRIPE_SECRET_KEY) {
throw new Error("STRIPE_SECRET_KEY is not set");
}
@@ -60,3 +59,16 @@ export async function getTeamInvoices(
throw new Error("Failed to fetch billing history");
}
}
async function getStripeCustomer(customerId: string) {
return await getStripe().customers.retrieve(customerId);
}
export async function getStripeBalance(customerId: string) {
const customer = await getStripeCustomer(customerId);
if (customer.deleted) {
return 0;
}
// Stripe returns a positive balance for credits, so we need to divide by -100 to get the actual balance (as long as the balance is not 0)
return customer.balance === 0 ? 0 : customer.balance / -100;
}
@@ -1,6 +1,6 @@
"use server";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export async function updateAccount(values: {
name?: string;
@@ -13,7 +13,7 @@ export async function updateAccount(values: {
throw new Error("No Auth token");
}
const res = await fetch(`${API_SERVER_URL}/v1/account`, {
const res = await fetch(`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/account`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
+82 -25
View File
@@ -3,14 +3,18 @@ import "server-only";
import type {
AnalyticsQueryParams,
EcosystemWalletStats,
EngineCloudStats,
InAppWalletStats,
RpcMethodStats,
TransactionStats,
UniversalBridgeStats,
UniversalBridgeWalletStats,
UserOpStats,
WalletStats,
WalletUserStats,
} from "types/analytics";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { ANALYTICS_SERVICE_URL } from "../constants/server-envs";
import { getChains } from "./chain";
async function fetchAnalytics(
@@ -18,7 +22,6 @@ async function fetchAnalytics(
init?: RequestInit,
): Promise<Response> {
const token = await getAuthToken();
if (!token) {
throw new Error("You are not authorized to perform this action");
}
@@ -29,34 +32,27 @@ async function fetchAnalytics(
}
// create a new URL object for the analytics server
const ANALYTICS_SERVICE_URL = new URL(
process.env.ANALYTICS_SERVICE_URL || "https://analytics.thirdweb.com",
const analyticsServiceUrl = new URL(
ANALYTICS_SERVICE_URL || "https://analytics.thirdweb.com",
);
ANALYTICS_SERVICE_URL.pathname = pathname;
analyticsServiceUrl.pathname = pathname;
for (const param of searchParams?.split("&") || []) {
const [key, value] = param.split("=");
if (!key || !value) {
throw new Error("Invalid input, no key or value provided");
}
ANALYTICS_SERVICE_URL.searchParams.append(
analyticsServiceUrl.searchParams.append(
decodeURIComponent(key),
decodeURIComponent(value),
);
}
// client id DEBUG OVERRIDE
// ANALYTICS_SERVICE_URL.searchParams.delete("clientId");
// ANALYTICS_SERVICE_URL.searchParams.delete("accountId");
// ANALYTICS_SERVICE_URL.searchParams.append(
// "clientId",
// "...",
// );
return fetch(ANALYTICS_SERVICE_URL, {
return fetch(analyticsServiceUrl, {
...init,
headers: {
"content-type": "application/json",
Authorization: `Bearer ${token}`,
...init?.headers,
authorization: `Bearer ${token}`,
},
});
}
@@ -91,7 +87,6 @@ export async function getWalletConnections(
`v2/sdk/wallet-connects?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);
@@ -115,7 +110,6 @@ export async function getInAppWalletUsage(
`v2/wallet/connects?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);
@@ -139,7 +133,6 @@ export async function getUserOpUsage(
`v2/bundler/usage?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);
@@ -197,7 +190,6 @@ export async function getClientTransactions(
`v2/sdk/contract-transactions?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);
@@ -221,7 +213,6 @@ export async function getRpcMethodUsage(
`v2/rpc/evm-methods?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);
@@ -242,7 +233,6 @@ export async function getWalletUsers(
`v2/sdk/wallet-connects/users?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);
@@ -279,7 +269,6 @@ export async function isProjectActive(params: {
`v2/active-usage?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);
@@ -349,9 +338,6 @@ export async function getEcosystemWalletUsage(args: {
`v2/wallet/connects?${searchParams.toString()}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
},
);
@@ -367,3 +353,74 @@ export async function getEcosystemWalletUsage(args: {
return json.data as EcosystemWalletStats[];
}
export async function getUniversalBridgeUsage(args: {
teamId: string;
projectId?: string;
from?: Date;
to?: Date;
period?: "day" | "week" | "month" | "year" | "all";
}) {
const searchParams = buildSearchParams(args);
const res = await fetchAnalytics(`v2/universal?${searchParams.toString()}`, {
method: "GET",
});
if (res?.status !== 200) {
const reason = await res?.text();
console.error(
`Failed to fetch universal bridge stats: ${res?.status} - ${res.statusText} - ${reason}`,
);
return [];
}
const json = await res.json();
return json.data as UniversalBridgeStats[];
}
export async function getUniversalBridgeWalletUsage(args: {
teamId: string;
projectId: string;
from?: Date;
to?: Date;
period?: "day" | "week" | "month" | "year" | "all";
}) {
const searchParams = buildSearchParams(args);
const res = await fetchAnalytics(
`v2/universal/wallets?${searchParams.toString()}`,
{
method: "GET",
},
);
if (res?.status !== 200) {
const reason = await res?.text();
console.error(
`Failed to fetch universal bridge wallet stats: ${res?.status} - ${res.statusText} - ${reason}`,
);
return [];
}
const json = await res.json();
return json.data as UniversalBridgeWalletStats[];
}
export async function getEngineCloudMethodUsage(
params: AnalyticsQueryParams,
): Promise<EngineCloudStats[]> {
const searchParams = buildSearchParams(params);
const res = await fetchAnalytics(
`v2/engine-cloud/requests?${searchParams.toString()}`,
{
method: "GET",
},
);
if (res?.status !== 200) {
console.error("Failed to fetch Engine Cloud method usage");
return [];
}
const json = await res.json();
return json.data as EngineCloudStats[];
}
+91
View File
@@ -0,0 +1,91 @@
"use server";
import "server-only";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export type AuditLogEntry = {
who: {
text: string;
metadata?: {
email?: string;
image?: string;
wallet?: string;
clientId?: string;
};
type: "user" | "apikey" | "system";
path?: string;
};
what: {
text: string;
action: "create" | "update" | "delete";
path?: string;
in?: {
text: string;
path?: string;
};
description?: string;
resourceType:
| "team"
| "project"
| "team-member"
| "team-invite"
| "contract"
| "secret-key";
};
when: string;
};
type AuditLogApiResponse = {
result: AuditLogEntry[];
nextCursor?: string;
hasMore: boolean;
};
export async function getAuditLogs(teamSlug: string, cursor?: string) {
const authToken = await getAuthToken();
if (!authToken) {
throw new Error("No auth token found");
}
const url = new URL(
`/v1/teams/${teamSlug}/audit-log`,
NEXT_PUBLIC_THIRDWEB_API_HOST,
);
if (cursor) {
url.searchParams.set("cursor", cursor);
}
// artifically limit page size to 15 for now
url.searchParams.set("take", "15");
const response = await fetch(url, {
next: {
// revalidate this query once per 10 seconds (does not need to be more granular than that)
revalidate: 10,
},
headers: {
Authorization: `Bearer ${authToken}`,
},
});
if (!response.ok) {
// if the status is 402, the most likely reason is that the team is on a free plan
if (response.status === 402) {
return {
status: "error",
reason: "higher_plan_required",
} as const;
}
const body = await response.text();
return {
status: "error",
reason: "unknown",
body,
} as const;
}
const data = (await response.json()) as AuditLogApiResponse;
return {
status: "success",
data,
} as const;
}
+16 -12
View File
@@ -1,21 +1,25 @@
import "server-only";
import type { ChainMetadata } from "thirdweb/chains";
import type { ChainService } from "../../app/(app)/(dashboard)/(chain)/types/chain";
import { API_SERVER_URL, THIRDWEB_API_SECRET } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
import { API_SERVER_SECRET } from "../constants/server-envs";
export async function getGasSponsoredChains() {
if (!THIRDWEB_API_SECRET) {
if (!API_SERVER_SECRET) {
throw new Error("API_SERVER_SECRET is not set");
}
const res = await fetch(`${API_SERVER_URL}/v1/chains/gas-sponsored`, {
headers: {
"Content-Type": "application/json",
"x-service-api-key": THIRDWEB_API_SECRET,
const res = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/chains/gas-sponsored`,
{
headers: {
"Content-Type": "application/json",
"x-service-api-key": API_SERVER_SECRET,
},
next: {
revalidate: 15 * 60, //15 minutes
},
},
next: {
revalidate: 15 * 60, //15 minutes
},
});
);
if (!res.ok) {
console.error(
@@ -37,7 +41,7 @@ export async function getGasSponsoredChains() {
export function getChains() {
return fetch(
`${API_SERVER_URL}/v1/chains`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/chains`,
// revalidate every 60 minutes
{ next: { revalidate: 60 * 60 } },
).then((res) => res.json()) as Promise<{ data: ChainMetadata[] }>;
@@ -45,7 +49,7 @@ export function getChains() {
export function getChainServices() {
return fetch(
`${API_SERVER_URL}/v1/chains/services`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/chains/services`,
// revalidate every 60 minutes
{ next: { revalidate: 60 * 60 } },
).then((res) => res.json()) as Promise<{
@@ -0,0 +1,239 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
"use server";
import { getAuthToken } from "app/(app)/api/lib/getAuthToken";
import { THIRDWEB_INSIGHT_API_DOMAIN } from "constants/urls";
export interface WebhookResponse {
id: string;
name: string;
team_id: string;
project_id: string;
webhook_url: string;
webhook_secret: string;
filters: WebhookFilters;
suspended_at: string | null;
suspended_reason: string | null;
disabled: boolean;
created_at: string;
updated_at: string | null;
}
export interface WebhookFilters {
"v1.events"?: {
chain_ids?: string[];
addresses?: string[];
signatures?: Array<{
sig_hash: string;
abi?: string;
params?: Record<string, unknown>;
}>;
};
"v1.transactions"?: {
chain_ids?: string[];
from_addresses?: string[];
to_addresses?: string[];
signatures?: Array<{
sig_hash: string;
abi?: string;
params?: Record<string, unknown>;
}>;
};
}
interface CreateWebhookPayload {
name: string;
webhook_url: string;
filters: WebhookFilters;
}
interface WebhooksListResponse {
data: WebhookResponse[];
error?: string;
}
interface WebhookSingleResponse {
data: WebhookResponse | null;
error?: string;
}
interface TestWebhookPayload {
webhook_url: string;
type?: "event" | "transaction";
}
interface TestWebhookResponse {
success: boolean;
error?: string;
}
type SupportedWebhookChainsResponse =
| { chains: Array<number> }
| { error: string };
export async function createWebhook(
payload: CreateWebhookPayload,
clientId: string,
): Promise<WebhookSingleResponse> {
try {
const authToken = await getAuthToken();
const response = await fetch(
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-client-id": clientId,
Authorization: `Bearer ${authToken}`,
},
body: JSON.stringify(payload),
},
);
if (!response.ok) {
const errorText = await response.text();
return {
data: null,
error: `Failed to create webhook: ${errorText}`,
};
}
return (await response.json()) as WebhookSingleResponse;
} catch (error) {
return {
data: null,
error: `Network or parsing error: ${error instanceof Error ? error.message : "Unknown error"}`,
};
}
}
export async function getWebhooks(
clientId: string,
): Promise<WebhooksListResponse> {
try {
const authToken = await getAuthToken();
const response = await fetch(
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks`,
{
method: "GET",
headers: {
"x-client-id": clientId,
Authorization: `Bearer ${authToken}`,
},
},
);
if (!response.ok) {
const errorText = await response.text();
return {
data: [],
error: `Failed to get webhooks: ${errorText}`,
};
}
return (await response.json()) as WebhooksListResponse;
} catch (error) {
return {
data: [],
error: `Network or parsing error: ${error instanceof Error ? error.message : "Unknown error"}`,
};
}
}
export async function deleteWebhook(
webhookId: string,
clientId: string,
): Promise<WebhookSingleResponse> {
try {
const authToken = await getAuthToken();
const response = await fetch(
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks/${encodeURIComponent(webhookId)}`,
{
method: "DELETE",
headers: {
"x-client-id": clientId,
Authorization: `Bearer ${authToken}`,
},
},
);
if (!response.ok) {
const errorText = await response.text();
return {
data: null,
error: `Failed to delete webhook: ${errorText}`,
};
}
return (await response.json()) as WebhookSingleResponse;
} catch (error) {
return {
data: null,
error: `Network or parsing error: ${error instanceof Error ? error.message : "Unknown error"}`,
};
}
}
export async function testWebhook(
payload: TestWebhookPayload,
clientId: string,
): Promise<TestWebhookResponse> {
try {
const authToken = await getAuthToken();
const response = await fetch(
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks/test`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-client-id": clientId,
Authorization: `Bearer ${authToken}`,
},
body: JSON.stringify(payload),
},
);
if (!response.ok) {
const errorText = await response.text();
return {
success: false,
error: `Failed to test webhook: ${errorText}`,
};
}
return (await response.json()) as TestWebhookResponse;
} catch (error) {
return {
success: false,
error: `Network or parsing error: ${error instanceof Error ? error.message : "Unknown error"}`,
};
}
}
export async function getSupportedWebhookChains(): Promise<SupportedWebhookChainsResponse> {
try {
const response = await fetch(
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/service/chains`,
{
method: "GET",
headers: {
"x-service-api-key": process.env.INSIGHT_SERVICE_API_KEY || "",
},
},
);
if (!response.ok) {
const errorText = await response.json();
return { error: `Failed to fetch supported chains: ${errorText.error}` };
}
const data = await response.json();
if (Array.isArray(data.data)) {
return { chains: data.data };
}
return { error: "Unexpected response format" };
} catch (error) {
console.error("Error fetching supported chains:", error);
return { error: `Failed to fetch supported chains: ${error}` };
}
}
+8 -5
View File
@@ -1,5 +1,5 @@
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export type LinkedWallet = {
createdAt: string;
@@ -14,11 +14,14 @@ export async function getLinkedWallets() {
return null;
}
const res = await fetch(`${API_SERVER_URL}/v1/account/wallets`, {
headers: {
Authorization: `Bearer ${token}`,
const res = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/account/wallets`,
{
headers: {
Authorization: `Bearer ${token}`,
},
},
});
);
if (res.ok) {
const json = (await res.json()) as {
+157
View File
@@ -0,0 +1,157 @@
"use server";
import "server-only";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export type Notification = {
id: string;
createdAt: string;
accountId: string;
teamId: string | null;
description: string;
readAt: string | null;
ctaText: string;
ctaUrl: string;
};
export type NotificationsApiResponse = {
result: Notification[];
nextCursor?: string;
};
export async function getUnreadNotifications(cursor?: string) {
const authToken = await getAuthToken();
if (!authToken) {
throw new Error("No auth token found");
}
const url = new URL(
"/v1/dashboard-notifications/unread",
NEXT_PUBLIC_THIRDWEB_API_HOST,
);
if (cursor) {
url.searchParams.set("cursor", cursor);
}
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${authToken}`,
},
});
if (!response.ok) {
const body = await response.text();
return {
status: "error",
reason: "unknown",
body,
} as const;
}
const data = (await response.json()) as NotificationsApiResponse;
return {
status: "success",
data,
} as const;
}
export async function getArchivedNotifications(cursor?: string) {
const authToken = await getAuthToken();
if (!authToken) {
throw new Error("No auth token found");
}
const url = new URL(
"/v1/dashboard-notifications/archived",
NEXT_PUBLIC_THIRDWEB_API_HOST,
);
if (cursor) {
url.searchParams.set("cursor", cursor);
}
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${authToken}`,
},
});
if (!response.ok) {
const body = await response.text();
return {
status: "error",
reason: "unknown",
body,
} as const;
}
const data = (await response.json()) as NotificationsApiResponse;
return {
status: "success",
data,
} as const;
}
export async function getUnreadNotificationsCount() {
const authToken = await getAuthToken();
if (!authToken) {
throw new Error("No auth token found");
}
const url = new URL(
"/v1/dashboard-notifications/unread-count",
NEXT_PUBLIC_THIRDWEB_API_HOST,
);
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${authToken}`,
},
});
if (!response.ok) {
const body = await response.text();
return {
status: "error",
reason: "unknown",
body,
} as const;
}
const data = (await response.json()) as {
result: {
unreadCount: number;
};
};
return {
status: "success",
data,
} as const;
}
export async function markNotificationAsRead(notificationId?: string) {
const authToken = await getAuthToken();
if (!authToken) {
throw new Error("No auth token found");
}
const url = new URL(
"/v1/dashboard-notifications/mark-as-read",
NEXT_PUBLIC_THIRDWEB_API_HOST,
);
const response = await fetch(url, {
method: "PUT",
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
// if notificationId is provided, mark it as read, otherwise mark all as read
body: JSON.stringify(notificationId ? { notificationId } : {}),
});
if (!response.ok) {
const body = await response.text();
return {
status: "error",
reason: "unknown",
body,
} as const;
}
return {
status: "success",
} as const;
}
+3 -3
View File
@@ -1,5 +1,5 @@
import "server-only";
import { API_SERVER_URL } from "@/constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
import type { ProjectResponse } from "@thirdweb-dev/service-utils";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
@@ -13,7 +13,7 @@ export async function getProjects(teamSlug: string) {
}
const teamsRes = await fetch(
`${API_SERVER_URL}/v1/teams/${teamSlug}/projects`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamSlug}/projects`,
{
headers: {
Authorization: `Bearer ${token}`,
@@ -34,7 +34,7 @@ export async function getProject(teamSlug: string, projectSlug: string) {
}
const teamsRes = await fetch(
`${API_SERVER_URL}/v1/teams/${teamSlug}/projects/${projectSlug}`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamSlug}/projects/${projectSlug}`,
{
headers: {
Authorization: `Bearer ${token}`,
+15 -10
View File
@@ -1,4 +1,6 @@
import { API_SERVER_URL, THIRDWEB_API_SECRET } from "../constants/env";
import "server-only";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
import { API_SERVER_SECRET } from "../constants/server-envs";
export type SMSCountryTiers = {
tier1: string[];
@@ -9,18 +11,21 @@ export type SMSCountryTiers = {
};
export async function getSMSCountryTiers() {
if (!THIRDWEB_API_SECRET) {
if (!API_SERVER_SECRET) {
throw new Error("API_SERVER_SECRET is not set");
}
const res = await fetch(`${API_SERVER_URL}/v1/sms/list-country-tiers`, {
headers: {
"Content-Type": "application/json",
"x-service-api-key": THIRDWEB_API_SECRET,
const res = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/sms/list-country-tiers`,
{
headers: {
"Content-Type": "application/json",
"x-service-api-key": API_SERVER_SECRET,
},
next: {
revalidate: 15 * 60, //15 minutes
},
},
next: {
revalidate: 15 * 60, //15 minutes
},
});
);
if (!res.ok) {
console.error(
+2 -2
View File
@@ -1,5 +1,5 @@
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export type TeamInvite = {
id: string;
@@ -25,7 +25,7 @@ export async function getTeamInvites(
}
const res = await fetch(
`${API_SERVER_URL}/v1/teams/${teamId}/invites?skip=${options.start}&take=${options.count}`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamId}/invites?skip=${options.start}&take=${options.count}`,
{
headers: {
Authorization: `Bearer ${authToken}`,
+10 -4
View File
@@ -1,5 +1,5 @@
import "server-only";
import { API_SERVER_URL } from "@/constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
const TeamAccountRole = {
@@ -33,7 +33,7 @@ export async function getMembers(teamSlug: string) {
}
const teamsRes = await fetch(
`${API_SERVER_URL}/v1/teams/${teamSlug}/members`,
new URL(`/v1/teams/${teamSlug}/members`, NEXT_PUBLIC_THIRDWEB_API_HOST),
{
headers: {
Authorization: `Bearer ${token}`,
@@ -48,7 +48,10 @@ export async function getMembers(teamSlug: string) {
return undefined;
}
export async function getMemberById(teamSlug: string, memberId: string) {
export async function getMemberByAccountId(
teamSlug: string,
accountId: string,
) {
const token = await getAuthToken();
if (!token) {
@@ -56,7 +59,10 @@ export async function getMemberById(teamSlug: string, memberId: string) {
}
const res = await fetch(
`${API_SERVER_URL}/v1/teams/${teamSlug}/members/${memberId}`,
new URL(
`/v1/teams/${teamSlug}/members/${accountId}`,
NEXT_PUBLIC_THIRDWEB_API_HOST,
),
{
headers: {
Authorization: `Bearer ${token}`,
@@ -1,5 +1,5 @@
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
import type { ProductSKU } from "../lib/billing";
type InvoiceLine = {
@@ -47,7 +47,7 @@ export async function getTeamSubscriptions(slug: string) {
}
const teamRes = await fetch(
`${API_SERVER_URL}/v1/teams/${slug}/subscriptions`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${slug}/subscriptions`,
{
headers: {
Authorization: `Bearer ${token}`,
+43 -13
View File
@@ -1,9 +1,12 @@
import "server-only";
import { API_SERVER_URL, THIRDWEB_API_SECRET } from "@/constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
import { API_SERVER_SECRET } from "@/constants/server-envs";
import type { TeamResponse } from "@thirdweb-dev/service-utils";
import { cookies } from "next/headers";
import { getValidAccount } from "../../app/(app)/account/settings/getAccount";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { LAST_USED_TEAM_ID } from "../../constants/cookies";
import { getMemberByAccountId } from "./team-members";
export type Team = TeamResponse & { stripeCustomerId: string | null };
@@ -14,11 +17,14 @@ export async function getTeamBySlug(slug: string) {
return null;
}
const teamRes = await fetch(`${API_SERVER_URL}/v1/teams/${slug}`, {
headers: {
Authorization: `Bearer ${token}`,
const teamRes = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${slug}`,
{
headers: {
Authorization: `Bearer ${token}`,
},
},
});
);
if (teamRes.ok) {
return (await teamRes.json())?.result as Team;
}
@@ -26,11 +32,14 @@ export async function getTeamBySlug(slug: string) {
}
export async function service_getTeamBySlug(slug: string) {
const teamRes = await fetch(`${API_SERVER_URL}/v1/teams/${slug}`, {
headers: {
"x-service-api-key": THIRDWEB_API_SECRET,
const teamRes = await fetch(
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${slug}`,
{
headers: {
"x-service-api-key": API_SERVER_SECRET,
},
},
});
);
if (teamRes.ok) {
return (await teamRes.json())?.result as Team;
@@ -49,7 +58,7 @@ export async function getTeams() {
return null;
}
const teamsRes = await fetch(`${API_SERVER_URL}/v1/teams`, {
const teamsRes = await fetch(`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams`, {
headers: {
Authorization: `Bearer ${token}`,
},
@@ -60,13 +69,14 @@ export async function getTeams() {
return null;
}
/** @deprecated */
export async function getDefaultTeam() {
const token = await getAuthToken();
if (!token) {
return null;
}
const res = await fetch(`${API_SERVER_URL}/v1/teams/~`, {
const res = await fetch(`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/~`, {
headers: {
Authorization: `Bearer ${token}`,
},
@@ -77,7 +87,7 @@ export async function getDefaultTeam() {
return null;
}
export async function getLastVisitedTeamOrDefaultTeam() {
export async function getLastVisitedTeam() {
const token = await getAuthToken();
if (!token) {
return null;
@@ -93,5 +103,25 @@ export async function getLastVisitedTeamOrDefaultTeam() {
}
}
return getDefaultTeam();
return null;
}
export async function hasToCompleteTeamOnboarding(
team: Team,
pagePath: string,
) {
// if the team is already onboarded, we don't need to check anything else here
if (team.isOnboarded) {
return false;
}
const account = await getValidAccount(pagePath);
const teamMember = await getMemberByAccountId(team.slug, account.id);
// if the team member is not an owner (or we cannot find them), they cannot complete onboarding anyways
if (teamMember?.role !== "OWNER") {
return false;
}
// if we get here the team is not onboarded and the team member is an owner, so we need to show the onboarding page
return true;
}
@@ -0,0 +1 @@
export const UB_BASE_URL = process.env.NEXT_PUBLIC_THIRDWEB_BRIDGE_HOST;
@@ -1,7 +1,8 @@
"use server";
import { getAuthToken } from "app/(app)/api/lib/getAuthToken";
import { NEXT_PUBLIC_THIRDWEB_BRIDGE_HOST } from "../../constants/public-envs";
const UB_BASE_URL = process.env.NEXT_PUBLIC_THIRDWEB_BRIDGE_HOST;
const UB_BASE_URL = NEXT_PUBLIC_THIRDWEB_BRIDGE_HOST;
type Webhook = {
url: string;
@@ -15,13 +16,15 @@ type Webhook = {
export async function getWebhooks(props: {
clientId: string;
teamId: string;
}) {
const authToken = await getAuthToken();
const res = await fetch(`${UB_BASE_URL}/v1/developer/webhooks`, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-client-id-override": props.clientId,
"x-client-id": props.clientId,
"x-team-id": props.teamId,
Authorization: `Bearer ${authToken}`,
},
});
@@ -37,12 +40,14 @@ export async function getWebhooks(props: {
export async function createWebhook(props: {
clientId: string;
teamId: string;
version?: number;
url: string;
label: string;
secret?: string;
}) {
const authToken = await getAuthToken();
const res = await fetch(`${UB_BASE_URL}/v1/developer/webhooks`, {
method: "POST",
body: JSON.stringify({
@@ -53,7 +58,8 @@ export async function createWebhook(props: {
}),
headers: {
"Content-Type": "application/json",
"x-client-id-override": props.clientId,
"x-client-id": props.clientId,
"x-team-id": props.teamId,
Authorization: `Bearer ${authToken}`,
},
});
@@ -68,6 +74,7 @@ export async function createWebhook(props: {
export async function deleteWebhook(props: {
clientId: string;
teamId: string;
webhookId: string;
}) {
const authToken = await getAuthToken();
@@ -77,7 +84,8 @@ export async function deleteWebhook(props: {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"x-client-id-override": props.clientId,
"x-client-id": props.clientId,
"x-team-id": props.teamId,
Authorization: `Bearer ${authToken}`,
},
},
@@ -108,7 +116,7 @@ export async function getFees(props: {
headers: {
"Content-Type": "application/json",
"x-team-id": props.teamId,
"x-client-id-override": props.clientId,
"x-client-id": props.clientId,
Authorization: `Bearer ${authToken}`,
},
});
@@ -133,8 +141,8 @@ export async function updateFee(props: {
method: "PUT",
headers: {
"Content-Type": "application/json",
"x-client-id-override": props.clientId,
"x-team-id": props.teamId,
"x-client-id": props.clientId,
Authorization: `Bearer ${authToken}`,
},
body: JSON.stringify({
@@ -150,3 +158,87 @@ export async function updateFee(props: {
return;
}
export type PaymentsResponse = {
data: Payment[];
meta: {
totalCount: number;
};
};
export type Payment = {
id: string;
blockNumber?: bigint;
transactionId: string;
clientId: string;
sender: string;
receiver: string;
developerFeeRecipient: string;
developerFeeBps: number;
transactions: Array<{
chainId: number;
transactionHash: string;
}>;
status: "PENDING" | "COMPLETED" | "FAILED" | "NOT_FOUND";
type: "buy" | "sell" | "transfer";
originAmount: bigint;
destinationAmount: bigint;
purchaseData: unknown;
originToken: {
address: string;
symbol: string;
decimals: number;
chainId: number;
};
destinationToken: {
address: string;
symbol: string;
decimals: number;
chainId: number;
};
createdAt: string;
};
export async function getPayments(props: {
clientId: string;
teamId: string;
limit?: number;
offset?: number;
}) {
const authToken = await getAuthToken();
// Build URL with query parameters if provided
let url = `${UB_BASE_URL}/v1/developer/payments`;
const queryParams = new URLSearchParams();
if (props.limit) {
queryParams.append("limit", props.limit.toString());
}
if (props.offset) {
queryParams.append("offset", props.offset.toString());
}
// Append query params to URL if any exist
const queryString = queryParams.toString();
if (queryString) {
url = `${url}?${queryString}`;
}
const res = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-client-id": props.clientId,
"x-team-id": props.teamId,
Authorization: `Bearer ${authToken}`,
},
});
if (!res.ok) {
const text = await res.text();
throw new Error(text);
}
const json = await res.json();
return json as PaymentsResponse;
}
@@ -0,0 +1,47 @@
import "server-only";
import { DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/server-envs";
import { UB_BASE_URL } from "./constants";
type PaymentLink = {
clientId: string;
title?: string;
imageUrl?: string;
receiver: string;
destinationToken: {
address: string;
symbol: string;
decimals: number;
chainId: number;
};
amount: bigint | undefined;
purchaseData: Record<string, unknown> | undefined;
};
export async function getPaymentLink(props: {
paymentId: string;
}) {
const res = await fetch(`${UB_BASE_URL}/v1/links/${props.paymentId}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-secret-key": DASHBOARD_THIRDWEB_SECRET_KEY,
},
});
if (!res.ok) {
const text = await res.text();
throw new Error(text);
}
const { data } = await res.json();
return {
clientId: data.clientId,
title: data.title,
imageUrl: data.imageUrl,
receiver: data.receiver,
destinationToken: data.destinationToken,
amount: data.amount ? BigInt(data.amount) : undefined,
purchaseData: data.purchaseData,
} as PaymentLink;
}
@@ -0,0 +1,71 @@
"use server";
import { DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/server-envs";
import type { ProjectResponse } from "@thirdweb-dev/service-utils";
import { getAuthToken } from "app/(app)/api/lib/getAuthToken";
import { UB_BASE_URL } from "./constants";
export type TokenMetadata = {
name: string;
symbol: string;
address: string;
decimals: number;
chainId: number;
iconUri?: string;
};
export async function getUniversalBridgeTokens(props: {
chainId?: number;
}) {
const url = new URL(`${UB_BASE_URL}/v1/tokens`);
if (props.chainId) {
url.searchParams.append("chainId", String(props.chainId));
}
url.searchParams.append("limit", "1000");
const res = await fetch(url.toString(), {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-secret-key": DASHBOARD_THIRDWEB_SECRET_KEY,
} as Record<string, string>,
});
if (!res.ok) {
const text = await res.text();
throw new Error(text);
}
const json = await res.json();
return json.data as Array<TokenMetadata>;
}
export async function addUniversalBridgeTokenRoute(props: {
chainId: number;
tokenAddress: string;
project: ProjectResponse;
}) {
const authToken = await getAuthToken();
const url = new URL(`${UB_BASE_URL}/v1/tokens`);
const res = await fetch(url.toString(), {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${authToken}`,
"x-client-id": props.project.publishableKey,
} as Record<string, string>,
body: JSON.stringify({
chainId: props.chainId,
tokenAddress: props.tokenAddress,
}),
});
if (!res.ok) {
const text = await res.text();
throw new Error(text);
}
const json = await res.json();
return json.data as Array<TokenMetadata>;
}
@@ -0,0 +1,66 @@
import "server-only";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
import { getAuthToken } from "../../../app/(app)/api/lib/getAuthToken";
type LineItem = {
quantity: number;
amountUsdCents: number;
unitAmountUsdCents: string;
description: string;
};
export type UsageCategory = {
category: string;
unitName: string;
lineItems: LineItem[];
};
type UsageApiResponse = {
result: UsageCategory[];
periodStart: string;
periodEnd: string;
planVersion: number;
};
export async function getBilledUsage(teamSlug: string) {
const authToken = await getAuthToken();
if (!authToken) {
throw new Error("No auth token found");
}
const response = await fetch(
new URL(
`/v1/teams/${teamSlug}/billing/billed-usage`,
NEXT_PUBLIC_THIRDWEB_API_HOST,
),
{
next: {
// revalidate this query once per minute (does not need to be more granular than that)
revalidate: 60,
},
headers: {
Authorization: `Bearer ${authToken}`,
},
},
);
if (!response.ok) {
// if the status is 404, the most likely reason is that the team is on a free plan
if (response.status === 404) {
return {
status: "error",
reason: "free_plan",
} as const;
}
const body = await response.text();
return {
status: "error",
reason: "unknown",
body,
} as const;
}
const data = (await response.json()) as UsageApiResponse;
return {
status: "success",
data,
} as const;
}
+2 -53
View File
@@ -1,57 +1,6 @@
import "server-only";
import { unstable_cache } from "next/cache";
export type RPCUsageDataItem = {
date: string;
usageType: "included" | "overage" | "rate-limit";
count: string;
};
export const fetchRPCUsage = unstable_cache(
async (params: {
teamId: string;
projectId?: string;
authToken: string;
from: string;
to: string;
period: "day" | "week" | "month" | "year" | "all";
}) => {
const analyticsEndpoint = process.env.ANALYTICS_SERVICE_URL as string;
const url = new URL(`${analyticsEndpoint}/v2/rpc/usage-types`);
url.searchParams.set("teamId", params.teamId);
if (params.projectId) {
url.searchParams.set("projectId", params.projectId);
}
url.searchParams.set("from", params.from);
url.searchParams.set("to", params.to);
url.searchParams.set("period", params.period);
const res = await fetch(url, {
headers: {
Authorization: `Bearer ${params.authToken}`,
},
});
if (!res.ok) {
const error = await res.text();
return {
ok: false as const,
error: error,
};
}
const resData = await res.json();
return {
ok: true as const,
data: resData.data as RPCUsageDataItem[],
};
},
["rpc-usage"],
{
revalidate: 60 * 60, // 1 hour
},
);
import { ANALYTICS_SERVICE_URL } from "../../constants/server-envs";
type Last24HoursRPCUsageApiResponse = {
peakRate: {
@@ -79,7 +28,7 @@ export const getLast24HoursRPCUsage = unstable_cache(
projectId?: string;
authToken: string;
}) => {
const analyticsEndpoint = process.env.ANALYTICS_SERVICE_URL as string;
const analyticsEndpoint = ANALYTICS_SERVICE_URL;
const url = new URL(`${analyticsEndpoint}/v2/rpc/24-hours`);
url.searchParams.set("teamId", params.teamId);
if (params.projectId) {
+3 -3
View File
@@ -2,7 +2,7 @@
import "server-only";
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
export type VerifiedDomainResponse =
| {
@@ -27,7 +27,7 @@ export async function checkDomainVerification(
}
const res = await fetch(
`${API_SERVER_URL}/v1/teams/${teamIdOrSlug}/verified-domain`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamIdOrSlug}/verified-domain`,
{
headers: {
Authorization: `Bearer ${token}`,
@@ -54,7 +54,7 @@ export async function createDomainVerification(
}
const res = await fetch(
`${API_SERVER_URL}/v1/teams/${teamIdOrSlug}/verified-domain`,
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamIdOrSlug}/verified-domain`,
{
method: "POST",
body: JSON.stringify({ domain }),
@@ -0,0 +1,25 @@
"use client";
import { Suspense } from "react";
import { ClientOnly } from "../../components/ClientOnly/ClientOnly";
import { useIsMobile } from "../hooks/use-mobile";
export function ResponsiveLayout(props: {
desktop: React.ReactNode;
mobile: React.ReactNode;
fallback: React.ReactNode;
debugMode?: boolean;
}) {
const isMobile = useIsMobile();
if (props.debugMode) {
return props.fallback;
}
return (
<Suspense fallback={props.fallback}>
<ClientOnly ssr={props.fallback}>
{isMobile ? props.mobile : props.desktop}
</ClientOnly>
</Suspense>
);
}
+3 -2
View File
@@ -84,12 +84,13 @@ export function BillingPortalButton(props: {
props.buttonProps?.onClick?.(e);
}}
>
<Link
<a
href={buildBillingPortalUrl({ teamSlug: props.teamSlug })}
target="_blank"
rel="noreferrer"
>
{props.children}
</Link>
</a>
</Button>
);
}
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useState } from "react";
import {
BadgeContainer,
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useState } from "react";
import {
BadgeContainer,
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { BadgeContainer } from "../../../stories/utils";
import { DangerSettingCard } from "./DangerSettingCard";
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { ImageIcon } from "lucide-react";
import { useState } from "react";
import { BadgeContainer } from "../../../stories/utils";
@@ -11,6 +11,7 @@ type imgElementProps = React.DetailedHTMLProps<
skeleton?: React.ReactNode;
fallback?: React.ReactNode;
src: string | undefined;
containerClassName?: string;
};
export function Img(props: imgElementProps) {
@@ -23,7 +24,8 @@ export function Img(props: imgElementProps) {
: props.src === ""
? "fallback"
: _status;
const { className, fallback, skeleton, ...restProps } = props;
const { className, fallback, skeleton, containerClassName, ...restProps } =
props;
const defaultSkeleton = <div className="animate-pulse bg-accent" />;
const defaultFallback = <div className="bg-accent" />;
const imgRef = useRef<HTMLImageElement>(null);
@@ -47,7 +49,7 @@ export function Img(props: imgElementProps) {
}, []);
return (
<div className="relative shrink-0">
<div className={cn("relative shrink-0", containerClassName)}>
<img
{...restProps}
// avoid setting empty src string to prevent request to the entire page
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useState } from "react";
import {
BadgeContainer,
@@ -3,10 +3,10 @@
import { MultiSelect } from "@/components/blocks/multi-select";
import { SelectWithSearch } from "@/components/blocks/select-with-search";
import { Badge } from "@/components/ui/badge";
import { ChainIconClient } from "components/icons/ChainIcon";
import { useAllChainsData } from "hooks/chains/allChains";
import { useCallback, useMemo } from "react";
import type { ThirdwebClient } from "thirdweb";
import { ChainIconClient } from "../../../components/icons/ChainIcon";
import { useAllChainsData } from "../../../hooks/chains/allChains";
function cleanChainName(chainName: string) {
return chainName.replace("Mainnet", "");
@@ -27,8 +27,15 @@ export function MultiNetworkSelector(props: {
side?: "left" | "right" | "top" | "bottom";
showSelectedValuesInModal?: boolean;
client: ThirdwebClient;
chainIds?: number[];
}) {
const { allChains, idToChain } = useAllChainsData();
let { allChains, idToChain } = useAllChainsData();
if (props.chainIds && props.chainIds.length > 0) {
allChains = allChains.filter((chain) =>
props.chainIds?.includes(chain.chainId),
);
}
const options = useMemo(() => {
let sortedChains = allChains;
@@ -71,7 +78,7 @@ export function MultiNetworkSelector(props: {
return false;
}
if (Number.isInteger(Number.parseInt(searchValue))) {
if (Number.isInteger(Number(searchValue))) {
return String(chain.chainId).startsWith(searchValue);
}
return chain.name.toLowerCase().includes(searchValue.toLowerCase());
@@ -144,18 +151,26 @@ export function SingleNetworkSelector(props: {
side?: "left" | "right" | "top" | "bottom";
disableChainId?: boolean;
align?: "center" | "start" | "end";
disableTestnets?: boolean;
placeholder?: string;
client: ThirdwebClient;
}) {
const { allChains, idToChain } = useAllChainsData();
const chainsToShow = useMemo(() => {
if (!props.chainIds) {
return allChains;
let chains = allChains;
if (props.disableTestnets) {
chains = chains.filter((chain) => !chain.testnet);
}
const chainIdSet = new Set(props.chainIds);
return allChains.filter((chain) => chainIdSet.has(chain.chainId));
}, [allChains, props.chainIds]);
if (props.chainIds) {
const chainIdSet = new Set(props.chainIds);
chains = chains.filter((chain) => chainIdSet.has(chain.chainId));
}
return chains;
}, [allChains, props.chainIds, props.disableTestnets]);
const options = useMemo(() => {
return chainsToShow.map((chain) => {
@@ -173,7 +188,7 @@ export function SingleNetworkSelector(props: {
return false;
}
if (Number.isInteger(Number.parseInt(searchValue))) {
if (Number.isInteger(Number(searchValue))) {
return String(chain.chainId).startsWith(searchValue);
}
return chain.name.toLowerCase().includes(searchValue.toLowerCase());
@@ -218,6 +233,7 @@ export function SingleNetworkSelector(props: {
<SelectWithSearch
searchPlaceholder="Search by Name or Chain ID"
value={String(props.chainId)}
showCheck={false}
options={options}
onValueChange={(chainId) => {
props.onChange(Number(chainId));
@@ -0,0 +1,84 @@
import { Spinner } from "@/components/ui/Spinner/Spinner";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import type React from "react";
export function RouteDiscoveryCard(
props: React.PropsWithChildren<{
bottomText: React.ReactNode;
header?: {
description: string | undefined;
title: string;
};
errorText: string | undefined;
noPermissionText: string | undefined;
saveButton?: {
onClick?: () => void;
disabled: boolean;
isPending: boolean;
type?: "submit";
variant?:
| "ghost"
| "default"
| "primary"
| "destructive"
| "outline"
| "secondary";
className?: string;
label?: string;
};
}>,
) {
return (
<div className="relative rounded-lg border border-border bg-card">
<div
className={cn(
"relative border-border border-b px-4 py-6 lg:px-6",
props.noPermissionText && "cursor-not-allowed",
)}
>
{props.header && (
<>
<h3 className="font-semibold text-xl tracking-tight">
{props.header.title}
</h3>
{props.header.description && (
<p className="mt-1.5 mb-4 text-foreground text-sm">
{props.header.description}
</p>
)}
</>
)}
{props.children}
</div>
<div className="flex min-h-[60px] items-center justify-between gap-2 px-4 py-3 lg:px-6">
{props.noPermissionText ? (
<p className="text-muted-foreground text-sm">
{props.noPermissionText}
</p>
) : props.errorText ? (
<p className="text-destructive-text text-sm">{props.errorText}</p>
) : (
<p className="text-muted-foreground text-sm">{props.bottomText}</p>
)}
{props.saveButton && !props.noPermissionText && (
<Button
size="sm"
className={cn("gap-2", props.saveButton.className)}
onClick={props.saveButton.onClick}
disabled={props.saveButton.disabled || props.saveButton.isPending}
variant={props.saveButton.variant || "outline"}
type={props.saveButton.type}
>
{props.saveButton.isPending && <Spinner className="size-3" />}
{props.saveButton.label ||
(props.saveButton.isPending ? "Submit" : "Submit Token")}
</Button>
)}
</div>
</div>
);
}
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { BadgeContainer } from "../../../stories/utils";
import { SettingsCard } from "./SettingsCard";
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { SidebarLayout } from "./SidebarLayout";
const meta = {
@@ -137,7 +137,7 @@ function RenderSidebarGroup(props: {
}
if ("separator" in link) {
return <SidebarSeparator className="my-1" />;
return <SidebarSeparator key={Math.random()} className="my-1" />;
}
return (
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useState } from "react";
import {
BadgeContainer,
@@ -0,0 +1,63 @@
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useState } from "react";
import {
BadgeContainer,
storybookThirdwebClient,
} from "../../../stories/utils";
import { TokenSelector } from "./TokenSelector";
const meta = {
title: "blocks/Cards/TokenSelector",
component: Story,
parameters: {
nextjs: {
appDirectory: true,
},
},
} satisfies Meta<typeof Story>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Variants: Story = {
args: {},
};
function Story() {
return (
<div className="container flex max-w-6xl flex-col gap-8 py-10">
<Variant label="No Chains selected by default" />
</div>
);
}
function Variant(props: {
label: string;
selectedChainId?: number;
}) {
const [token, setToken] = useState<
| {
address: string;
chainId: number;
}
| undefined
>(undefined);
return (
<BadgeContainer label={props.label}>
<TokenSelector
addNativeTokenIfMissing={false}
showCheck={false}
selectedToken={token}
chainId={props.selectedChainId}
client={storybookThirdwebClient}
onChange={(v) => {
setToken({
address: v.address,
chainId: v.chainId,
});
}}
/>
</BadgeContainer>
);
}
@@ -0,0 +1,201 @@
import { useAllChainsData } from "hooks/chains/allChains";
import { useTokensData } from "hooks/tokens/tokens";
import { useCallback, useMemo } from "react";
import {
NATIVE_TOKEN_ADDRESS,
type ThirdwebClient,
getAddress,
} from "thirdweb";
import { shortenAddress } from "thirdweb/utils";
import { replaceIpfsUrl } from "../../../lib/sdk";
import { fallbackChainIcon } from "../../../utils/chain-icons";
import type { TokenMetadata } from "../../api/universal-bridge/tokens";
import { cn } from "../../lib/utils";
import { Badge } from "../ui/badge";
import { Img } from "./Img";
import { SelectWithSearch } from "./select-with-search";
type Option = { label: string; value: string };
const checksummedNativeTokenAddress = getAddress(NATIVE_TOKEN_ADDRESS);
export function TokenSelector(props: {
selectedToken: { chainId: number; address: string } | undefined;
onChange: (token: TokenMetadata) => void;
className?: string;
popoverContentClassName?: string;
chainId?: number;
side?: "left" | "right" | "top" | "bottom";
disableAddress?: boolean;
align?: "center" | "start" | "end";
placeholder?: string;
client: ThirdwebClient;
disabled?: boolean;
enabled?: boolean;
showCheck: boolean;
addNativeTokenIfMissing: boolean;
}) {
const tokensQuery = useTokensData({
chainId: props.chainId,
enabled: props.enabled,
});
const { idToChain } = useAllChainsData();
const tokens = useMemo(() => {
if (!tokensQuery.data) {
return [];
}
if (props.addNativeTokenIfMissing) {
const hasNativeToken = tokensQuery.data.some(
(token) => token.address === checksummedNativeTokenAddress,
);
if (!hasNativeToken && props.chainId) {
return [
{
name:
idToChain.get(props.chainId)?.nativeCurrency.name ??
"Native Token",
symbol:
idToChain.get(props.chainId)?.nativeCurrency.symbol ?? "ETH",
decimals: 18,
chainId: props.chainId,
address: checksummedNativeTokenAddress,
} satisfies TokenMetadata,
...tokensQuery.data,
];
}
}
return tokensQuery.data;
}, [
tokensQuery.data,
props.chainId,
props.addNativeTokenIfMissing,
idToChain,
]);
const addressChainToToken = useMemo(() => {
const value = new Map<string, TokenMetadata>();
for (const token of tokens) {
value.set(`${token.chainId}:${token.address}`, token);
}
return value;
}, [tokens]);
const options = useMemo(() => {
return (
tokens.map((token) => {
return {
label: token.symbol,
value: `${token.chainId}:${token.address}`,
};
}) || []
);
}, [tokens]);
const searchFn = useCallback(
(option: Option, searchValue: string) => {
const token = addressChainToToken.get(option.value);
if (!token) {
return false;
}
if (Number.isInteger(Number(searchValue))) {
return String(token.chainId).startsWith(searchValue);
}
return (
token.name.toLowerCase().includes(searchValue.toLowerCase()) ||
token.symbol.toLowerCase().includes(searchValue.toLowerCase()) ||
token.address.toLowerCase().includes(searchValue.toLowerCase())
);
},
[addressChainToToken],
);
const renderOption = useCallback(
(option: Option) => {
const token = addressChainToToken.get(option.value);
if (!token) {
return option.label;
}
const resolvedSrc = token.iconUri
? replaceIpfsUrl(token.iconUri, props.client)
: fallbackChainIcon;
return (
<div className="flex items-center justify-between gap-4">
<span className="flex grow gap-2 truncate text-left">
<Img
// render different image element if src changes to avoid showing old image while loading new one
key={resolvedSrc}
className={cn("size-5 rounded-full object-contain")}
src={resolvedSrc}
loading={"lazy"}
alt=""
// eslint-disable-next-line @next/next/no-img-element
fallback={<img src={fallbackChainIcon} alt="" />}
skeleton={
<div className="animate-pulse rounded-full bg-border" />
}
/>
{token.symbol}
</span>
{!props.disableAddress && (
<Badge variant="outline" className="gap-2 py-1 max-sm:hidden">
<span className="text-muted-foreground">Address</span>
{shortenAddress(token.address, 4)}
</Badge>
)}
</div>
);
},
[addressChainToToken, props.disableAddress, props.client],
);
const selectedValue = props.selectedToken
? `${props.selectedToken.chainId}:${props.selectedToken.address}`
: undefined;
// if selected value is not in options, add it
if (
selectedValue &&
!options.find((option) => option.value === selectedValue)
) {
options.push({
label: props.selectedToken?.address || "Unknown",
value: selectedValue,
});
}
return (
<SelectWithSearch
searchPlaceholder="Search by name or symbol"
value={selectedValue}
options={options}
onValueChange={(tokenAddress) => {
const token = addressChainToToken.get(tokenAddress);
if (!token) {
return;
}
props.onChange(token);
}}
closeOnSelect={true}
showCheck={props.showCheck}
placeholder={
tokensQuery.isPending
? "Loading Tokens"
: props.placeholder || "Select Token"
}
overrideSearchFn={searchFn}
renderOption={renderOption}
className={props.className}
popoverContentClassName={props.popoverContentClassName}
disabled={tokensQuery.isPending || props.disabled}
side={props.side}
align={props.align}
/>
);
}
@@ -0,0 +1,75 @@
import type { Meta, StoryObj } from "@storybook/nextjs";
import { ArrowRightIcon, RocketIcon, StarIcon } from "lucide-react";
import { BadgeContainer } from "../../../stories/utils";
import { UpsellBannerCard } from "./UpsellBannerCard";
function Story() {
return (
<div className="container flex max-w-4xl flex-col gap-8 py-10">
<BadgeContainer label="Green with icon (default)">
<UpsellBannerCard
title="Unlock more with thirdweb"
description="Upgrade to increase limits and access advanced features."
cta={{
text: "View plans",
icon: <ArrowRightIcon className="size-4" />,
link: "#",
}}
trackingCategory="storybook"
trackingLabel="green"
icon={<RocketIcon className="size-5" />}
accentColor="green"
/>
</BadgeContainer>
<BadgeContainer label="Blue accent">
<UpsellBannerCard
title="Need more storage?"
description="Add additional space to your account."
cta={{
text: "Upgrade storage",
icon: <ArrowRightIcon className="size-4" />,
link: "#",
}}
trackingCategory="storybook"
trackingLabel="blue"
icon={<StarIcon className="size-5" />}
accentColor="blue"
/>
</BadgeContainer>
<BadgeContainer label="Purple without leading icon">
<UpsellBannerCard
title="Join the beta"
description="Get early access to experimental features."
cta={{
text: "Request access",
icon: <ArrowRightIcon className="size-4" />,
link: "#",
}}
trackingCategory="storybook"
trackingLabel="purple"
accentColor="purple"
/>
</BadgeContainer>
</div>
);
}
const meta = {
title: "blocks/Banners/UpsellBannerCard",
component: Story,
parameters: {
nextjs: {
appDirectory: true,
},
},
} satisfies Meta<typeof Story>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Variants: Story = {
args: {},
};
@@ -0,0 +1,119 @@
"use client";
import { Button } from "@/components/ui/button";
import { TrackedLinkTW } from "@/components/ui/tracked-link";
import { cn } from "@/lib/utils";
import type React from "react";
const ACCENT = {
green: {
border: "border-green-600 dark:border-green-700",
bgFrom: "from-green-50 dark:from-green-900/20",
blur: "bg-green-600",
title: "text-green-900 dark:text-green-200",
desc: "text-green-800 dark:text-green-300",
iconBg: "bg-green-600 text-white",
btn: "bg-green-600 text-white hover:bg-green-700",
},
blue: {
border: "border-blue-600 dark:border-blue-700",
bgFrom: "from-blue-50 dark:from-blue-900/20",
blur: "bg-blue-600",
title: "text-blue-900 dark:text-blue-200",
desc: "text-blue-800 dark:text-blue-300",
iconBg: "bg-blue-600 text-white",
btn: "bg-blue-600 text-white hover:bg-blue-700",
},
purple: {
border: "border-purple-600 dark:border-purple-700",
bgFrom: "from-purple-50 dark:from-purple-900/20",
blur: "bg-purple-600",
title: "text-purple-900 dark:text-purple-200",
desc: "text-purple-800 dark:text-purple-300",
iconBg: "bg-purple-600 text-white",
btn: "bg-purple-600 text-white hover:bg-purple-700",
},
} as const;
type UpsellBannerCardProps = {
title: React.ReactNode;
description: React.ReactNode;
cta: {
text: React.ReactNode;
icon?: React.ReactNode;
target?: "_blank";
link: string;
};
trackingCategory: string;
trackingLabel: string;
accentColor?: keyof typeof ACCENT;
icon?: React.ReactNode;
};
export function UpsellBannerCard(props: UpsellBannerCardProps) {
const color = ACCENT[props.accentColor || "green"];
return (
<div
className={cn(
"relative overflow-hidden rounded-lg border bg-gradient-to-r p-4 lg:p-6",
color.border,
color.bgFrom,
)}
>
{/* Decorative blur */}
<div
className={cn(
"-right-10 -top-10 pointer-events-none absolute size-28 rounded-full opacity-20 blur-2xl",
color.blur,
)}
/>
<div className="relative flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div className="flex items-start gap-3">
{props.icon ? (
<div
className={cn(
"mt-0.5 hidden h-9 w-9 shrink-0 items-center justify-center rounded-full lg:flex",
color.iconBg,
)}
>
{props.icon}
</div>
) : null}
<div>
<h3
className={cn(
"font-semibold text-lg tracking-tight",
color.title,
)}
>
{props.title}
</h3>
<p className={cn("text-sm", color.desc)}>{props.description}</p>
</div>
</div>
<Button
asChild
size="sm"
className={cn(
"mt-2 gap-2 hover:translate-y-0 hover:shadow-inner sm:mt-0",
color.btn,
)}
>
<TrackedLinkTW
href={props.cta.link}
category={props.trackingCategory}
label={props.trackingLabel}
target={props.cta.target}
>
{props.cta.text}
{props.cta.icon && <span className="ml-2">{props.cta.icon}</span>}
</TrackedLinkTW>
</Button>
</div>
</div>
);
}
@@ -15,14 +15,14 @@ import {
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
import { formatDate } from "date-fns";
import { useMemo } from "react";
import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";
import { cn } from "@/lib/utils";
import {
EmptyChartState,
LoadingChartState,
} from "../../../../components/analytics/empty-chart-state";
import { cn } from "../../../lib/utils";
} from "components/analytics/empty-chart-state";
import { format } from "date-fns";
import { useMemo } from "react";
import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";
type ThirdwebAreaChartProps<TConfig extends ChartConfig> = {
header?: {
@@ -46,8 +46,12 @@ type ThirdwebAreaChartProps<TConfig extends ChartConfig> = {
// chart className
chartClassName?: string;
isPending: boolean;
className?: string;
cardContentClassName?: string;
hideLabel?: boolean;
toolTipLabelFormatter?: (label: string, payload: unknown) => React.ReactNode;
toolTipValueFormatter?: (value: unknown) => React.ReactNode;
emptyChartState?: React.ReactElement;
};
export function ThirdwebAreaChart<TConfig extends ChartConfig>(
@@ -56,7 +60,7 @@ export function ThirdwebAreaChart<TConfig extends ChartConfig>(
const configKeys = useMemo(() => Object.keys(props.config), [props.config]);
return (
<Card>
<Card className={props.className}>
{props.header && (
<CardHeader>
<CardTitle className={cn("mb-2", props.header.titleClassName)}>
@@ -70,12 +74,16 @@ export function ThirdwebAreaChart<TConfig extends ChartConfig>(
{props.customHeader && props.customHeader}
<CardContent className={cn(!props.header && "pt-6")}>
<CardContent
className={cn(!props.header && "pt-6", props.cardContentClassName)}
>
<ChartContainer config={props.config} className={props.chartClassName}>
{props.isPending ? (
<LoadingChartState />
) : props.data.length === 0 ? (
<EmptyChartState />
<EmptyChartState type="area">
{props.emptyChartState}
</EmptyChartState>
) : (
<AreaChart accessibilityLayer data={props.data}>
<CartesianGrid vertical={false} />
@@ -86,7 +94,7 @@ export function ThirdwebAreaChart<TConfig extends ChartConfig>(
axisLine={false}
tickMargin={20}
tickFormatter={(value) =>
formatDate(
format(
new Date(value),
props.xAxis?.sameDay ? "MMM dd, HH:mm" : "MMM dd",
)
@@ -100,6 +108,7 @@ export function ThirdwebAreaChart<TConfig extends ChartConfig>(
props.hideLabel !== undefined ? props.hideLabel : true
}
labelFormatter={props.toolTipLabelFormatter}
valueFormatter={props.toolTipValueFormatter}
/>
}
/>
@@ -17,13 +17,13 @@ import {
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
import { formatDate } from "date-fns";
import { useMemo } from "react";
import { cn } from "@/lib/utils";
import {
EmptyChartState,
LoadingChartState,
} from "../../../../components/analytics/empty-chart-state";
import { cn } from "../../../lib/utils";
} from "components/analytics/empty-chart-state";
import { format } from "date-fns";
import { useMemo } from "react";
type ThirdwebBarChartProps<TConfig extends ChartConfig> = {
// metadata
@@ -75,7 +75,9 @@ export function ThirdwebBarChart<TConfig extends ChartConfig>(
{props.isPending ? (
<LoadingChartState />
) : props.data.length === 0 ? (
<EmptyChartState>{props.emptyChartState}</EmptyChartState>
<EmptyChartState type="bar">
{props.emptyChartState}
</EmptyChartState>
) : (
<BarChart accessibilityLayer data={props.data}>
<CartesianGrid vertical={false} />
@@ -84,7 +86,7 @@ export function ThirdwebBarChart<TConfig extends ChartConfig>(
tickLine={false}
axisLine={false}
tickMargin={10}
tickFormatter={(value) => formatDate(new Date(value), "MMM d")}
tickFormatter={(value) => format(new Date(value), "MMM d")}
/>
<ChartTooltip
content={
@@ -6,7 +6,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useState } from "react";
import { BadgeContainer } from "stories/utils";
import { type CodeEnvironment, CodeSegment } from "./code-segment.client";
@@ -0,0 +1,36 @@
"use client";
import { useLocalStorage } from "hooks/useLocalStorage";
import { XIcon } from "lucide-react";
import { Button } from "../ui/button";
export function DismissibleAlert(props: {
title: React.ReactNode;
description: React.ReactNode;
localStorageId: string;
}) {
const [isVisible, setIsVisible] = useLocalStorage(
props.localStorageId,
true,
false,
);
if (!isVisible) return null;
return (
<div className="relative rounded-lg border border-border bg-card p-4">
<Button
onClick={() => setIsVisible(false)}
className="absolute top-4 right-4 h-auto w-auto p-1 text-muted-foreground"
aria-label="Close alert"
variant="ghost"
>
<XIcon className="size-5" />
</Button>
<div>
<h2 className="mb-0.5 font-semibold">{props.title} </h2>
<div className="text-muted-foreground text-sm">{props.description}</div>
</div>
</div>
);
}
@@ -0,0 +1,78 @@
import { cn } from "@/lib/utils";
export type Segment = {
label: string;
percent: number;
color: string;
};
type DistributionBarChartProps = {
segments: Segment[];
title: string;
};
export function DistributionBarChart(props: DistributionBarChartProps) {
const totalPercentage = props.segments.reduce(
(sum, segment) => sum + segment.percent,
0,
);
const invalidTotalPercentage = totalPercentage !== 100;
return (
<div>
<div className="mb-2 flex items-center justify-between">
<h3 className="font-medium text-sm">{props.title}</h3>
<div
className={cn(
"font-medium text-muted-foreground text-sm",
invalidTotalPercentage && "text-red-500",
)}
>
Total: {totalPercentage}%
</div>
</div>
{/* Bar */}
<div className="flex h-3 overflow-hidden rounded-lg">
{props.segments.map((segment) => {
return (
<div
key={segment.label}
className="flex h-full items-center justify-center transition-all duration-200"
style={{
width: `${segment.percent}%`,
backgroundColor: segment.color,
}}
/>
);
})}
</div>
{/* Legends */}
<div className="mt-3 flex flex-col gap-1 lg:flex-row lg:gap-6">
{props.segments.map((segment) => {
return (
<div key={segment.label} className="flex items-center gap-1.5">
<div
className="size-3 rounded-full"
style={{
backgroundColor: segment.color,
}}
/>
<p
className={cn(
"text-sm",
(segment.percent > 100 || segment.percent < 0) &&
"text-destructive-text",
)}
>
{segment.label}: {segment.percent}%
</p>
</div>
);
})}
</div>
</div>
);
}
@@ -0,0 +1,53 @@
import type { Meta, StoryObj } from "@storybook/nextjs";
import { DropZone } from "./drop-zone";
const meta = {
title: "blocks/DropZone",
component: DropZone,
decorators: [
(Story) => (
<div className="container max-w-6xl py-10">
<Story />
</div>
),
],
} satisfies Meta<typeof DropZone>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
isError: false,
onDrop: () => {},
title: "This is a title",
description: "This is a description for drop zone",
accept: undefined,
resetButton: undefined,
},
};
export const ErrorState: Story = {
args: {
isError: true,
onDrop: () => {},
title: "this is title",
description: "This is a description",
accept: undefined,
resetButton: undefined,
},
};
export const ErrorStateWithResetButton: Story = {
args: {
isError: true,
onDrop: () => {},
title: "this is title",
description: "This is a description",
accept: undefined,
resetButton: {
label: "Remove Files",
onClick: () => {},
},
},
};
@@ -0,0 +1,81 @@
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { UploadIcon, XIcon } from "lucide-react";
import { useDropzone } from "react-dropzone";
export function DropZone(props: {
isError: boolean;
onDrop: (acceptedFiles: File[]) => void;
title: string;
description: string;
resetButton:
| {
label: string;
onClick: () => void;
}
| undefined;
className?: string;
accept: string | undefined;
}) {
const { getRootProps, getInputProps } = useDropzone({
onDrop: props.onDrop,
});
const { resetButton } = props;
return (
<div
className={cn(
"flex cursor-pointer items-center justify-center rounded-md border border-dashed bg-card py-10 hover:border-active-border",
props.isError &&
"border-red-500 bg-red-200/30 text-red-500 hover:border-red-600 dark:border-red-900 dark:bg-red-900/30 dark:hover:border-red-800",
props.className,
)}
{...getRootProps()}
>
<input {...getInputProps()} accept={props.accept} />
<div className="flex flex-col items-center justify-center gap-3">
{!props.isError && (
<div className="flex flex-col items-center">
<div className="mb-3 flex size-11 items-center justify-center rounded-full border bg-card">
<UploadIcon className="size-5" />
</div>
<h2 className="mb-0.5 text-center font-medium text-lg">
{props.title}
</h2>
<p className="text-center font-medium text-muted-foreground text-sm">
{props.description}
</p>
</div>
)}
{props.isError && (
<div className="flex flex-col items-center">
<div className="mb-3 flex size-11 items-center justify-center rounded-full border border-red-500 bg-red-200/50 text-red-500 dark:border-red-900 dark:bg-red-900/30 dark:text-foreground">
<XIcon className="size-5" />
</div>
<h2 className="mb-0.5 text-center font-medium text-foreground text-lg">
{props.title}
</h2>
<p className="text-balance text-center text-sm">
{props.description}
</p>
{resetButton && (
<Button
className="relative z-50 mt-4"
size="sm"
onClick={(e) => {
e.stopPropagation();
resetButton.onClick();
}}
>
{resetButton.label}
</Button>
)}
</div>
)}
</div>
</div>
);
}
@@ -0,0 +1,37 @@
"use client";
import { useEffect, useState } from "react";
import { MediaRenderer, type MediaRendererProps } from "thirdweb/react";
import { cn } from "../../lib/utils";
import { Skeleton } from "../ui/skeleton";
export function CustomMediaRenderer(props: MediaRendererProps) {
const [loadedSrc, setLoadedSrc] = useState<string | undefined>(undefined);
// eslint-disable-next-line no-restricted-syntax
useEffect(() => {
if (loadedSrc && loadedSrc !== props.src) {
setLoadedSrc(undefined);
}
}, [loadedSrc, props.src]);
return (
<div
className="relative"
onLoad={() => {
if (props.src) {
setLoadedSrc(props.src);
}
}}
>
{!loadedSrc && <Skeleton className="absolute inset-0" />}
<MediaRenderer
{...props}
className={cn(
props.className,
"[&>div]:!bg-accent [&_a]:!text-muted-foreground [&_a]:!no-underline [&_svg]:!size-6 [&_svg]:!text-muted-foreground relative z-10",
)}
/>
</div>
);
}
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useMemo, useState } from "react";
import { BadgeContainer } from "../../../stories/utils";
import { MultiSelect } from "./multi-select";
@@ -0,0 +1,50 @@
import type { Meta, StoryObj } from "@storybook/nextjs";
import { MultiStepStatus } from "./multi-step-status";
const meta = {
title: "Blocks/MultiStepStatus",
component: MultiStepStatus,
decorators: [
(Story) => (
<div className="container w-full max-w-md py-10">
<Story />
</div>
),
],
} satisfies Meta<typeof MultiStepStatus>;
export default meta;
type Story = StoryObj<typeof meta>;
export const AllStates: Story = {
args: {
onRetry: () => {},
steps: [
{
status: { type: "completed" },
label: "Connect Wallet",
id: "connect-wallet",
},
{
status: { type: "pending" },
label: "Sign Message",
id: "sign-message",
},
{
status: { type: "error", message: "This is an error message" },
label: "Approve Transaction",
id: "approve-transaction",
},
{
status: { type: "idle" },
label: "Confirm Transaction",
id: "confirm-transaction",
},
{
status: { type: "idle" },
label: "Finalize",
id: "finalize",
},
],
},
};
@@ -0,0 +1,91 @@
"use client";
import { Button } from "@/components/ui/button";
import {
AlertCircleIcon,
CircleCheckIcon,
CircleIcon,
RefreshCwIcon,
} from "lucide-react";
import { DynamicHeight } from "../../ui/DynamicHeight";
import { Spinner } from "../../ui/Spinner/Spinner";
export type MultiStepState<T extends string> = {
id: T;
status:
| {
type: "idle" | "pending" | "completed";
}
| {
type: "error";
message: React.ReactNode;
};
label: string;
description?: string;
};
export function MultiStepStatus<T extends string>(props: {
steps: MultiStepState<T>[];
onRetry: (step: MultiStepState<T>) => void;
}) {
return (
<DynamicHeight>
<div className="space-y-4">
{props.steps.map((step) => (
<div key={step.label} className="flex items-start space-x-3 ">
{step.status.type === "completed" ? (
<CircleCheckIcon className="mt-0.5 size-5 flex-shrink-0 text-green-500" />
) : step.status.type === "pending" ? (
<Spinner className="mt-0.5 size-5 flex-shrink-0 text-foreground" />
) : step.status.type === "error" ? (
<AlertCircleIcon className="mt-0.5 size-5 flex-shrink-0 text-red-500" />
) : (
<CircleIcon className="mt-0.5 size-5 flex-shrink-0 text-muted-foreground/70" />
)}
<div className="flex-1">
<p
className={`font-medium ${
step.status.type === "pending"
? "text-foreground"
: step.status.type === "completed"
? "text-green-500"
: step.status.type === "error"
? "text-red-500"
: "text-muted-foreground/70"
}`}
>
{step.label}
</p>
{/* show description when this step is active */}
{(step.status.type === "pending" ||
step.status.type === "error") &&
step.description && (
<p className="text-muted-foreground text-sm">
{step.description}
</p>
)}
{step.status.type === "error" && (
<div className="mt-1 space-y-2">
<p className="mb-1 text-red-500 text-sm">
{step.status.message}
</p>
<Button
variant="destructive"
size="sm"
className="gap-2"
onClick={() => props.onRetry(step)}
>
<RefreshCwIcon className="size-4" />
Retry
</Button>
</div>
)}
</div>
</div>
))}
</div>
</DynamicHeight>
);
}
@@ -0,0 +1,65 @@
"use client";
import { Button } from "@/components/ui/button";
import {
Drawer,
DrawerContent,
DrawerTitle,
DrawerTrigger,
} from "@/components/ui/drawer";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
import { useIsMobile } from "@/hooks/use-mobile";
import { BellIcon } from "lucide-react";
import { useMemo, useState } from "react";
import { NotificationList } from "./notification-list";
import { useNotifications } from "./state/manager";
export function NotificationsButton(props: { accountId: string }) {
const manager = useNotifications(props.accountId);
const [open, setOpen] = useState(false);
const isMobile = useIsMobile();
const trigger = useMemo(
() => (
<Button variant="outline" size="icon" className="relative rounded-full">
<BellIcon className="h-4 w-4" />
{(manager.unreadNotificationsCount || 0) > 0 && (
<span className="absolute top-0 right-0 flex h-2 w-2">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-75" />
<span className="relative inline-flex h-2 w-2 rounded-full bg-primary" />
</span>
)}
</Button>
),
[manager.unreadNotificationsCount],
);
if (isMobile) {
return (
<Drawer open={open} onOpenChange={setOpen}>
<DrawerTrigger asChild>{trigger}</DrawerTrigger>
<DrawerContent className="max-h-[90vh] min-h-[66vh]">
<DrawerTitle className="sr-only">Notifications</DrawerTitle>
<NotificationList {...manager} />
</DrawerContent>
</Drawer>
);
}
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>{trigger}</PopoverTrigger>
<PopoverContent
className="max-h-[90vh] min-h-[500px] w-[400px] max-w-md p-0"
align="end"
>
<NotificationList {...manager} />
</PopoverContent>
</Popover>
);
}
@@ -0,0 +1,82 @@
"use client";
import type { Notification } from "@/api/notifications";
import { Button } from "@/components/ui/button";
import {
format,
formatDistanceToNow,
isBefore,
parseISO,
subDays,
} from "date-fns";
import { ArchiveIcon } from "lucide-react";
import { useMemo } from "react";
interface NotificationEntryProps {
notification: Notification;
onMarkAsRead?: (id: string) => void;
}
export function NotificationEntry({
notification,
onMarkAsRead,
}: NotificationEntryProps) {
const timeAgo = useMemo(() => {
try {
const now = new Date();
const date = parseISO(notification.createdAt);
// if the date is older than 1 day, show the date
// otherwise, show the time ago
if (isBefore(date, subDays(now, 1))) {
return format(date, "MMM d, yyyy");
}
return formatDistanceToNow(date, {
addSuffix: true,
});
} catch (error) {
console.error("Failed to parse date", error);
return null;
}
}, [notification.createdAt]);
return (
<div className="flex flex-row py-1.5">
{onMarkAsRead && (
<div className="min-h-full w-1 shrink-0 rounded-r-lg bg-primary" />
)}
<div className="flex w-full flex-row justify-between gap-2 border-b px-4 py-2 transition-colors last:border-b-0">
<div className="flex items-start gap-3">
<div className="flex-1 space-y-1">
<p className="text-sm">{notification.description}</p>
{timeAgo && (
<p className="text-muted-foreground text-xs">{timeAgo}</p>
)}
<div className="flex flex-row justify-between gap-2 pt-1">
<Button asChild variant="link" size="sm" className="px-0">
<a
href={notification.ctaUrl}
target="_blank"
rel="noopener noreferrer"
>
{notification.ctaText}
</a>
</Button>
</div>
</div>
</div>
{onMarkAsRead && (
<Button
variant="ghost"
size="icon"
onClick={() => onMarkAsRead(notification.id)}
className="text-muted-foreground hover:text-foreground"
>
<ArchiveIcon className="h-4 w-4" />
</Button>
)}
</div>
</div>
);
}
@@ -0,0 +1,202 @@
"use client";
import { TabButtons } from "@/components/ui/tabs";
import { ArchiveIcon, BellIcon, Loader2Icon } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { Badge } from "../../ui/badge";
import { NotificationEntry } from "./notification-entry";
import type { useNotifications } from "./state/manager";
export function NotificationList(props: ReturnType<typeof useNotifications>) {
// default to inbox if there are unread notifications, otherwise default to archive
const [activeTab, setActiveTab] = useState(
props.unreadNotificationsCount > 0
? "inbox"
: // if we have archived notifications, default to archive
props.archivedNotifications.length > 0
? "archive"
: // otherwise defualt to inbox (if there are no archived notifications either)
"inbox",
);
const scrollContainerRef = useRef<HTMLDivElement>(null);
return (
<div className="flex w-full flex-1 flex-col">
<TabButtons
tabContainerClassName="space-x-6 px-4 pt-2"
tabClassName="!text-sm hover:!bg-transparent !px-0 !py-1"
tabs={[
{
name: (
<div className="flex items-center gap-1">
Inbox
{props.unreadNotificationsCount > 0 && (
<Badge variant="secondary">
{props.unreadNotificationsCount}
</Badge>
)}
</div>
),
onClick: () => setActiveTab("inbox"),
isActive: activeTab === "inbox",
},
{
name: "Archive",
onClick: () => setActiveTab("archive"),
isActive: activeTab === "archive",
},
]}
/>
<div
className="h-full w-full flex-1 overflow-y-auto"
ref={scrollContainerRef}
>
{activeTab === "inbox" ? (
<InboxTab
unreadNotifications={props.unreadNotifications}
isLoadingUnread={props.isLoadingUnread}
hasMoreUnread={props.hasMoreUnread}
isFetchingMoreUnread={props.isFetchingMoreUnread}
loadMoreUnread={props.loadMoreUnread}
markAsRead={props.markAsRead}
markAllAsRead={props.markAllAsRead}
scrollContainerRef={scrollContainerRef}
/>
) : (
<ArchiveTab
archivedNotifications={props.archivedNotifications}
isLoadingArchived={props.isLoadingArchived}
hasMoreArchived={props.hasMoreArchived}
isFetchingMoreArchived={props.isFetchingMoreArchived}
loadMoreArchived={props.loadMoreArchived}
scrollContainerRef={scrollContainerRef}
/>
)}
</div>
</div>
);
}
function InboxTab(
props: Pick<
ReturnType<typeof useNotifications>,
| "unreadNotifications"
| "isLoadingUnread"
| "hasMoreUnread"
| "isFetchingMoreUnread"
| "loadMoreUnread"
| "markAsRead"
| "markAllAsRead"
> & {
scrollContainerRef: React.RefObject<HTMLDivElement | null>;
},
) {
return props.unreadNotifications.length === 0 ? (
<div className="flex h-full flex-col items-center justify-center gap-4 p-8 text-center">
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-muted">
<BellIcon className="h-4 w-4 text-muted-foreground" />
</div>
<p className="text-muted-foreground text-sm">No new notifications</p>
</div>
) : (
<>
{props.unreadNotifications.map((notification) => (
<NotificationEntry
key={notification.id}
notification={notification}
onMarkAsRead={props.markAsRead}
/>
))}
<AutoLoadMore
hasMore={props.hasMoreUnread}
loadMore={props.loadMoreUnread}
isLoading={props.isFetchingMoreUnread || props.isLoadingUnread}
scrollContainerRef={props.scrollContainerRef}
/>
</>
);
}
function ArchiveTab(
props: Pick<
ReturnType<typeof useNotifications>,
| "archivedNotifications"
| "isLoadingArchived"
| "hasMoreArchived"
| "isFetchingMoreArchived"
| "loadMoreArchived"
> & {
scrollContainerRef: React.RefObject<HTMLDivElement | null>;
},
) {
return props.archivedNotifications.length === 0 ? (
<div className="flex flex-col items-center justify-center gap-4 p-8 text-center">
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-muted">
<ArchiveIcon className="h-4 w-4 text-muted-foreground" />
</div>
<p className="text-muted-foreground text-sm">No archived notifications</p>
</div>
) : (
<>
{props.archivedNotifications.map((notification) => (
<NotificationEntry key={notification.id} notification={notification} />
))}
<AutoLoadMore
hasMore={props.hasMoreArchived}
loadMore={props.loadMoreArchived}
isLoading={props.isFetchingMoreArchived || props.isLoadingArchived}
scrollContainerRef={props.scrollContainerRef}
/>
</>
);
}
function AutoLoadMore(props: {
hasMore: boolean;
isLoading: boolean;
loadMore: () => void;
scrollContainerRef: React.RefObject<HTMLDivElement | null>;
}) {
const ref = useRef<HTMLDivElement>(null);
// if the element is scrolled into view, load more
// eslint-disable-next-line no-restricted-syntax
useEffect(() => {
// only run if the ref and scroll container ref are defined
if (ref.current && props.scrollContainerRef.current) {
const observer = new IntersectionObserver(
(entries) => {
for (const entry of entries) {
if (entry.isIntersecting && !props.isLoading && props.hasMore) {
props.loadMore();
observer.unobserve(entry.target); // prevent duplicate fires
}
}
},
{ root: props.scrollContainerRef.current, threshold: 0.1 },
);
observer.observe(ref.current);
return () => observer.disconnect();
}
}, [
props.hasMore,
props.isLoading,
props.loadMore,
props.scrollContainerRef,
]);
if (!props.hasMore) return null;
if (props.isLoading) {
return (
<div className="flex items-center justify-center gap-2 text-muted-foreground">
<Loader2Icon className="h-4 w-4 animate-spin" />
</div>
);
}
return <div ref={ref} className="h-[1px] w-full opacity-0" aria-hidden />;
}
@@ -0,0 +1,223 @@
"use client";
import {
type Notification,
type NotificationsApiResponse,
getArchivedNotifications,
getUnreadNotifications,
getUnreadNotificationsCount,
markNotificationAsRead,
} from "@/api/notifications";
import {
type InfiniteData,
useInfiniteQuery,
useMutation,
useQuery,
useQueryClient,
} from "@tanstack/react-query";
import { useMemo } from "react";
import { toast } from "sonner";
/**
* Internal helper to safely flatten pages coming from useInfiniteQuery.
*/
function flattenPages<T extends { result: Notification[] }>(
data?: InfiniteData<T>,
): Notification[] {
return data?.pages.flatMap((p) => p.result) ?? [];
}
/**
* React hook that provides notifications state with optimistic archiving.
*
* Example:
* ```tsx
* const {
* unreadNotifications,
* archivedNotifications,
* unreadCount,
* markAsRead,
* markAllAsRead,
* loadMoreUnread,
* loadMoreArchived,
* hasMoreUnread,
* hasMoreArchived,
* } = useNotifications();
* ```
*/
export function useNotifications(accountId: string) {
const queryClient = useQueryClient();
// --------------------
// Query definitions
// --------------------
const unreadQueryKey = useMemo(
() => ["notifications", "unread", { accountId }],
[accountId],
);
const archivedQueryKey = useMemo(
() => ["notifications", "archived", { accountId }],
[accountId],
);
const unreadCountKey = useMemo(
() => ["notifications", "unread-count", { accountId }],
[accountId],
);
const unreadQuery = useInfiniteQuery<NotificationsApiResponse>({
queryKey: unreadQueryKey,
queryFn: async ({ pageParam }) => {
const cursor = (pageParam ?? undefined) as string | undefined;
const res = await getUnreadNotifications(cursor);
if (res.status === "error") {
throw new Error(res.reason ?? "unknown");
}
return res.data;
},
initialPageParam: undefined as string | undefined,
getNextPageParam: (lastPage) => lastPage?.nextCursor ?? undefined,
enabled: !!accountId,
refetchInterval: 60_000, // 1min
});
const archivedQuery = useInfiniteQuery<NotificationsApiResponse>({
queryKey: archivedQueryKey,
queryFn: async ({ pageParam }) => {
const cursor = (pageParam ?? undefined) as string | undefined;
const res = await getArchivedNotifications(cursor);
if (res.status === "error") {
throw new Error(res.reason ?? "unknown");
}
return res.data;
},
initialPageParam: undefined as string | undefined,
getNextPageParam: (lastPage) => lastPage?.nextCursor ?? undefined,
enabled: !!accountId,
refetchInterval: 60_000, // 1min
});
const unreadCountQuery = useQuery({
queryKey: unreadCountKey,
queryFn: async () => {
const res = await getUnreadNotificationsCount();
if (res.status === "error") {
throw new Error(res.reason ?? "unknown");
}
return res.data.result.unreadCount;
},
refetchInterval: 60_000, // 1min
enabled: !!accountId,
});
// --------------------
// Mutation (archive)
// --------------------
const archiveMutation = useMutation({
mutationFn: async (notificationId?: string) => {
const res = await markNotificationAsRead(notificationId);
if (res.status === "error") {
toast.error("Failed to mark notification as read");
throw new Error(res.reason ?? "unknown");
}
return { notificationId } as const;
},
// Optimistic update
onMutate: async (notificationId) => {
await Promise.all([
queryClient.cancelQueries({ queryKey: unreadQueryKey }),
queryClient.cancelQueries({ queryKey: archivedQueryKey }),
]);
const previousUnread =
queryClient.getQueryData<InfiniteData<NotificationsApiResponse>>(
unreadQueryKey,
);
const previousCount = queryClient.getQueryData<number>(unreadCountKey);
let optimisticUnread: InfiniteData<NotificationsApiResponse> | undefined;
let optimisticCount: number | undefined;
if (previousUnread) {
if (notificationId) {
// Remove a single notification
optimisticUnread = {
...previousUnread,
pages: previousUnread.pages.map((page) => ({
...page,
result: page.result.filter((n) => n.id !== notificationId),
})),
};
if (typeof previousCount === "number") {
optimisticCount = Math.max(previousCount - 1, 0);
}
} else {
// Clear all unread notifications
optimisticUnread = {
...previousUnread,
pages: previousUnread.pages.map((page) => ({
...page,
result: [],
})),
};
optimisticCount = 0;
}
queryClient.setQueryData(unreadQueryKey, optimisticUnread);
}
if (typeof optimisticCount === "number") {
queryClient.setQueryData(unreadCountKey, optimisticCount);
}
return { previousUnread, previousCount } as const;
},
// Rollback on error
onError: (_err, _vars, context) => {
if (context?.previousUnread) {
queryClient.setQueryData(unreadQueryKey, context.previousUnread);
}
if (typeof context?.previousCount === "number") {
queryClient.setQueryData(unreadCountKey, context.previousCount);
}
},
// Always refetch to ensure consistency
onSettled: () => {
queryClient.invalidateQueries({ queryKey: unreadQueryKey });
queryClient.invalidateQueries({ queryKey: archivedQueryKey });
queryClient.invalidateQueries({ queryKey: unreadCountKey });
},
});
// --------------------
// Derived helpers
// --------------------
const unreadNotifications = flattenPages(unreadQuery.data);
const archivedNotifications = flattenPages(archivedQuery.data);
const unreadNotificationsCount = unreadCountQuery.data ?? 0; // this is the total unread count
return {
// data
unreadNotifications,
archivedNotifications,
unreadNotificationsCount,
// booleans
isLoadingUnread: unreadQuery.isLoading,
isLoadingArchived: archivedQuery.isLoading,
hasMoreUnread: unreadQuery.hasNextPage ?? false,
hasMoreArchived: archivedQuery.hasNextPage ?? false,
isFetchingMoreUnread: unreadQuery.isFetchingNextPage,
isFetchingMoreArchived: archivedQuery.isFetchingNextPage,
// pagination helpers
loadMoreUnread: () => unreadQuery.fetchNextPage(),
loadMoreArchived: () => archivedQuery.fetchNextPage(),
// mutations
markAsRead: (id: string) => archiveMutation.mutate(id),
markAllAsRead: () => archiveMutation.mutate(undefined),
} as const;
}
@@ -4,19 +4,18 @@ import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { ToolTipLabel } from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { CheckIcon, CircleDollarSignIcon } from "lucide-react";
import { RenewSubscriptionButton } from "components/settings/Account/Billing/renew-subscription/renew-subscription-button";
import { useTrack } from "hooks/analytics/useTrack";
import { CheckIcon, DollarSignIcon } from "lucide-react";
import Link from "next/link";
import type React from "react";
import { remainingDays } from "utils/date-utils";
import { TEAM_PLANS } from "utils/pricing";
import { RenewSubscriptionButton } from "../../../components/settings/Account/Billing/renew-subscription/renew-subscription-button";
import { useTrack } from "../../../hooks/analytics/useTrack";
import { remainingDays } from "../../../utils/date-utils";
import type { ProductSKU } from "../../lib/billing";
import { CheckoutButton } from "../billing";
type PricingCardCta = {
hint?: string;
onClick?: () => void;
} & (
| {
@@ -58,12 +57,17 @@ export const PricingCard: React.FC<PricingCardProps> = ({
activeTrialEndsAt,
}) => {
const plan = TEAM_PLANS[billingPlan];
const isCustomPrice = typeof plan.price === "string";
const trackEvent = useTrack();
const remainingTrialDays =
(activeTrialEndsAt ? remainingDays(activeTrialEndsAt) : 0) || 0;
// if the team has just signed up and has not subscribed yet, and the billing plan is growth, then they get a 7 day trial
const has7DayTrial =
remainingTrialDays === 0 &&
billingStatus === "noPayment" &&
billingPlan === "growth";
const handleCTAClick = () => {
cta?.onClick?.();
trackEvent({
@@ -97,6 +101,7 @@ export const PricingCard: React.FC<PricingCardProps> = ({
{plan.title}
</h3>
{current && <Badge className="capitalize">Current plan</Badge>}
{has7DayTrial && <Badge variant="success">7 Day Free Trial</Badge>}
</div>
<p className="max-w-[320px] text-muted-foreground text-sm">
{plan.description}
@@ -105,15 +110,26 @@ export const PricingCard: React.FC<PricingCardProps> = ({
{/* Price */}
<div className="flex flex-col gap-0.5">
<div className="flex items-center gap-2">
<span className="font-semibold text-2xl text-foreground tracking-tight">
${plan.price}
</span>
{!isCustomPrice && (
{plan.isStartingPriceOnly && (
<span className="text-muted-foreground text-xs">Starting at</span>
)}
{has7DayTrial ? (
<div className="flex flex-col items-start gap-0">
<span className="font-bold text-2xl text-foreground tracking-tight">
7 days free
</span>
<span className="text-muted-foreground text-sm">
Then ${plan.price.toLocaleString()} / month
</span>
</div>
) : (
<div className="flex items-center gap-2">
<span className="font-semibold text-2xl text-foreground tracking-tight">
${plan.price.toLocaleString()}
</span>
<span className="text-muted-foreground">/ month</span>
)}
</div>
</div>
)}
{remainingTrialDays > 0 && (
<p className="text-muted-foreground text-sm">
@@ -152,7 +168,7 @@ export const PricingCard: React.FC<PricingCardProps> = ({
teamSlug={teamSlug}
sku={billingPlanToSkuMap[billingPlan]}
>
{cta.label}
{has7DayTrial ? "Start 7 Day Free Trial" : cta.label}
</CheckoutButton>
)}
@@ -163,7 +179,7 @@ export const PricingCard: React.FC<PricingCardProps> = ({
asChild
>
<Link href={cta.href} target="_blank" onClick={handleCTAClick}>
{cta.label}
{has7DayTrial ? "Start 7 Day Free Trial" : cta.label}
</Link>
</Button>
)}
@@ -183,13 +199,12 @@ const billingPlanToSkuMap: Record<Team["billingPlan"], ProductSKU | undefined> =
{
starter: "plan:starter",
growth: "plan:growth",
accelerate: "plan:accelerate",
scale: "plan:scale",
pro: "plan:pro",
// we can't render checkout buttons for these plans:
pro: undefined,
accelerate: undefined,
free: undefined,
growth_legacy: undefined,
starter_legacy: undefined,
};
type FeatureItemProps = {
@@ -201,16 +216,19 @@ function FeatureItem({ text }: FeatureItemProps) {
return (
<div className="flex items-center gap-2 text-sm">
<CheckIcon className="size-4 shrink-0 text-green-500" />
{Array.isArray(text) ? (
<ToolTipLabel label={text[1]}>
<DollarSignIcon className="size-4 shrink-0 text-green-500" />
</ToolTipLabel>
) : (
<CheckIcon className="size-4 shrink-0 text-green-500" />
)}
{Array.isArray(text) ? (
<div className="flex items-center gap-2">
<p className="text-muted-foreground">
{titleStr}{" "}
<span className="text-muted-foreground md:hidden">{text[1]}</span>
</p>
<ToolTipLabel label={text[1]}>
<CircleDollarSignIcon className="hidden size-4 text-muted-foreground md:block" />
</ToolTipLabel>
</div>
) : (
<p className="text-muted-foreground">{titleStr}</p>
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useMemo, useState } from "react";
import { BadgeContainer } from "../../../stories/utils";
import { SelectWithSearch } from "./select-with-search";
@@ -34,6 +34,7 @@ interface SelectWithSearchProps
side?: "left" | "right" | "top" | "bottom";
align?: "center" | "start" | "end";
closeOnSelect?: boolean;
showCheck?: boolean;
}
export const SelectWithSearch = React.forwardRef<
@@ -52,6 +53,7 @@ export const SelectWithSearch = React.forwardRef<
popoverContentClassName,
searchPlaceholder,
closeOnSelect,
showCheck = true,
...props
},
ref,
@@ -126,7 +128,7 @@ export const SelectWithSearch = React.forwardRef<
<span
className={cn(
"truncate text-muted-foreground text-sm",
selectedOption && "text-foreground",
selectedOption && "w-full text-foreground",
)}
>
{renderOption && selectedOption
@@ -193,9 +195,11 @@ export const SelectWithSearch = React.forwardRef<
i === optionsToShow.length - 1 ? lastItemRef : undefined
}
>
<div className="flex size-4 items-center justify-center">
{isSelected && <CheckIcon className="size-4" />}
</div>
{showCheck && (
<div className="flex size-4 items-center justify-center">
{isSelected && <CheckIcon className="size-4" />}
</div>
)}
<div className="min-w-0 grow">
{renderOption ? renderOption(option) : option.label}
@@ -0,0 +1,142 @@
"use client";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { cn } from "@/lib/utils";
import { CrownIcon, LockIcon, SparklesIcon } from "lucide-react";
import Link from "next/link";
import type React from "react";
import { TeamPlanBadge } from "../../../app/(app)/components/TeamPlanBadge";
import type { Team } from "../../api/team";
import { Badge } from "../ui/badge";
interface UpsellWrapperProps {
teamSlug: string;
children: React.ReactNode;
isLocked?: boolean;
requiredPlan: Team["billingPlan"];
currentPlan?: Team["billingPlan"];
featureName: string;
featureDescription: string;
benefits?: {
description: string;
status: "available" | "soon";
}[];
className?: string;
}
export function UpsellWrapper({
teamSlug,
children,
isLocked = true,
requiredPlan,
currentPlan = "free",
featureName,
featureDescription,
benefits = [],
className,
}: UpsellWrapperProps) {
if (!isLocked) {
return <>{children}</>;
}
return (
<div className={cn("relative flex-1", className)}>
{/* Background content - blurred and non-interactive */}
<div className="absolute inset-0 overflow-hidden">
<div className="pointer-events-none select-none opacity-60 blur-[1px]">
{children}
</div>
</div>
{/* Overlay gradient */}
<div className="absolute inset-0 bg-gradient-to-b from-muted/20 via-muted/30 to-background" />
{/* Upsell content */}
<div className="relative z-10 flex items-center justify-center p-16">
<Card className="w-full max-w-2xl border-2 shadow-2xl">
<CardHeader className="space-y-4 text-center">
<div className="mx-auto flex h-16 w-16 items-center justify-center rounded-full border-2 bg-muted">
<LockIcon className="h-8 w-8 text-muted-foreground" />
</div>
<div className="space-y-2">
<TeamPlanBadge
plan="scale"
teamSlug={teamSlug}
postfix=" Feature"
/>
<CardTitle className="font-bold text-2xl text-foreground md:text-3xl">
Unlock {featureName}
</CardTitle>
<CardDescription className="mx-auto max-w-md text-base text-muted-foreground">
{featureDescription}
</CardDescription>
</div>
</CardHeader>
<CardContent className="space-y-6">
{benefits.length > 0 && (
<div className="space-y-3">
<h4 className="font-semibold text-muted-foreground text-sm uppercase tracking-wide">
What you'll get:
</h4>
<div className="grid gap-2">
{benefits.map((benefit) => (
<div
key={benefit.description}
className="flex items-center gap-3"
>
<div className="flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-accent">
<SparklesIcon className="h-3 w-3 text-success-text" />
</div>
<span className="text-sm">{benefit.description}</span>
{benefit.status === "soon" && (
<Badge variant="secondary" className="text-xs">
Coming Soon
</Badge>
)}
</div>
))}
</div>
</div>
)}
<div className="flex flex-col gap-3 pt-4 sm:flex-row">
<Button className="flex-1 py-3 font-semibold" size="lg" asChild>
<Link
href={`/team/${teamSlug}/~/settings/billing?showPlans=true&highlight=${requiredPlan}`}
>
<CrownIcon className="mr-2 h-4 w-4" />
Upgrade to{" "}
<span className="ml-1 capitalize">{requiredPlan}</span>
</Link>
</Button>
<Button variant="outline" size="lg" className="md:flex-1" asChild>
<Link
href={`/team/${teamSlug}/~/settings/billing?showPlans=true`}
>
View All Plans
</Link>
</Button>
</div>
<div className="pt-2 text-center">
<p className="text-muted-foreground text-xs">
You are currently on the{" "}
<span className="font-medium capitalize">{currentPlan}</span>{" "}
plan.
</p>
</div>
</CardContent>
</Card>
</div>
</div>
);
}
@@ -5,7 +5,6 @@ import {
HoverCardContent,
HoverCardTrigger,
} from "@/components/ui/hover-card";
import { useThirdwebClient } from "@/constants/thirdweb.client";
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
import { useClipboard } from "hooks/useClipboard";
import { CheckIcon, CopyIcon, XIcon } from "lucide-react";
@@ -24,8 +23,9 @@ export function WalletAddress(props: {
shortenAddress?: boolean;
className?: string;
iconClassName?: string;
client: ThirdwebClient;
preventOpenOnFocus?: boolean;
}) {
const thirdwebClient = useThirdwebClient();
// default back to zero address if no address provided
const address = useMemo(() => props.address || ZERO_ADDRESS, [props.address]);
@@ -40,7 +40,7 @@ export function WalletAddress(props: {
const profiles = useSocialProfiles({
address: address,
client: thirdwebClient,
client: props.client,
});
const { onCopy, hasCopied } = useClipboard(address, 2000);
@@ -65,7 +65,10 @@ export function WalletAddress(props: {
return (
<HoverCard>
<HoverCardTrigger asChild>
<HoverCardTrigger
asChild
tabIndex={props.preventOpenOnFocus ? -1 : undefined}
>
<Button
onClick={(e) => e.stopPropagation()}
variant="link"
@@ -78,7 +81,7 @@ export function WalletAddress(props: {
<WalletAvatar
address={address}
profiles={profiles.data || []}
thirdwebClient={thirdwebClient}
thirdwebClient={props.client}
iconClassName={props.iconClassName}
/>
)}
@@ -122,7 +125,7 @@ export function WalletAddress(props: {
) : (
profiles.data?.map((profile) => {
const walletAvatarLink = resolveSchemeWithErrorHandler({
client: thirdwebClient,
client: props.client,
uri: profile.avatar,
});
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { useState } from "react";
import { BadgeContainer } from "stories/utils";
import { PaginationButtons } from "./pagination-buttons";
@@ -19,6 +19,7 @@ export const PaginationButtons = (props: {
activePage: number;
totalPages: number;
onPageClick: (page: number) => void;
className?: string;
}) => {
const { activePage, totalPages, onPageClick: setPage } = props;
const [inputHasError, setInputHasError] = useState(false);
@@ -40,11 +41,37 @@ export const PaginationButtons = (props: {
}
}
// if only two pages, show "prev" and "next"
if (totalPages === 2) {
return (
<Pagination className={props.className}>
<PaginationContent>
<PaginationItem>
<PaginationPrevious
disabled={activePage === 1}
onClick={() => {
setPage(activePage - 1);
}}
/>
</PaginationItem>
<PaginationItem>
<PaginationNext
disabled={activePage === totalPages}
onClick={() => {
setPage(activePage + 1);
}}
/>
</PaginationItem>
</PaginationContent>
</Pagination>
);
}
// just render all the page buttons directly
if (totalPages <= 6) {
const pages = [...Array(totalPages)].map((_, i) => i + 1);
return (
<Pagination>
<Pagination className={props.className}>
<PaginationContent>
{pages.map((page) => (
<PaginationItem key={page}>
@@ -64,7 +91,7 @@ export const PaginationButtons = (props: {
}
return (
<Pagination>
<Pagination className={props.className}>
<PaginationContent>
<PaginationItem>
<PaginationPrevious
@@ -42,7 +42,7 @@ export function CopyTextButton(props: {
variant={props.variant || "outline"}
aria-label={props.tooltip}
className={cn(
"flex h-auto w-auto gap-2 rounded-lg px-2.5 py-1.5 font-normal text-foreground",
"flex h-auto w-auto gap-2 rounded-lg px-1.5 py-0.5 font-normal text-foreground",
props.className,
)}
onClick={(e) => {
@@ -0,0 +1,10 @@
export function LoadingDots() {
return (
<div className="fade-in-0 flex animate-in gap-2 duration-300">
<span className="sr-only">Loading...</span>
<div className="size-4 animate-bounce rounded-full bg-foreground [animation-delay:-0.3s]" />
<div className="size-4 animate-bounce rounded-full bg-foreground [animation-delay:-0.15s]" />
<div className="size-4 animate-bounce rounded-full bg-foreground" />
</div>
);
}
@@ -1,9 +1,9 @@
"use client";
import { cn } from "@/lib/utils";
import { useTrack } from "hooks/analytics/useTrack";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useTrack } from "../../../hooks/analytics/useTrack";
export type NavButtonProps = {
className?: string;
@@ -1,5 +1,5 @@
import { Button } from "@/components/ui/button";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { StarIcon } from "lucide-react";
import { BadgeContainer } from "../../../stories/utils";
+21 -3
View File
@@ -45,17 +45,35 @@ export interface ButtonProps
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
({ className, variant, size, asChild = false, disabled, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
// "button" elements automatically handle the `disabled` attribute.
// For non-button elements rendered via `asChild` (e.g. <a>), we still want
// to visually convey the disabled state and prevent user interaction.
// We do that by conditionally adding the same utility classes that the
// `disabled:` pseudo-variant would normally apply and by setting
// `aria-disabled` for accessibility.
const disabledClass = disabled ? "pointer-events-none opacity-50" : "";
const btnOnlyProps =
Comp === "button"
? { type: props.type || ("button" as const) }
? {
type:
(props as React.ButtonHTMLAttributes<HTMLButtonElement>).type ||
("button" as const),
}
: undefined;
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
className={cn(
buttonVariants({ variant, size, className }),
disabledClass,
)}
ref={ref}
aria-disabled={disabled ? true : undefined}
disabled={disabled}
{...props}
{...btnOnlyProps}
/>
@@ -12,6 +12,7 @@ export type ChartConfig = {
[k in string]: {
label?: React.ReactNode;
icon?: React.ComponentType;
isCurrency?: boolean;
} & (
| { color?: string; theme?: never }
| { color?: never; theme: Record<keyof typeof THEMES, string> }
@@ -6,13 +6,17 @@ export type CodeProps = {
code: string;
lang: BundledLanguage;
className?: string;
ignoreFormattingErrors?: boolean;
};
export const CodeServer: React.FC<CodeProps> = async ({
code,
lang,
className,
ignoreFormattingErrors,
}) => {
const { html, formattedCode } = await getCodeHtml(code, lang);
const { html, formattedCode } = await getCodeHtml(code, lang, {
ignoreFormattingErrors,
});
return <RenderCode code={formattedCode} html={html} className={className} />;
};
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { BadgeContainer } from "stories/utils";
import { CodeClient } from "./code.client";
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { BadgeContainer } from "stories/utils";
import { PlainTextCodeBlock } from "./plaintext-code";
@@ -0,0 +1,39 @@
import { Input } from "./input";
export function DecimalInput(props: {
value: string;
onChange: (value: string) => void;
maxValue?: number;
id?: string;
className?: string;
placeholder?: string;
disabled?: boolean;
}) {
return (
<Input
id={props.id}
type="text"
value={props.value}
className={props.className}
inputMode="decimal"
placeholder={props.placeholder}
disabled={props.disabled}
onChange={(e) => {
const number = Number(e.target.value);
// ignore if string becomes invalid number
if (Number.isNaN(number)) {
return;
}
if (props.maxValue && number > props.maxValue) {
return;
}
// replace leading multiple zeros with single zero
let cleanedValue = e.target.value.replace(/^0+/, "0");
// replace leading zero before decimal point
if (!cleanedValue.includes(".")) {
cleanedValue = cleanedValue.replace(/^0+/, "");
}
props.onChange(cleanedValue || "0");
}}
/>
);
}
@@ -0,0 +1,118 @@
"use client";
import * as React from "react";
import { Drawer as DrawerPrimitive } from "vaul";
import { cn } from "@/lib/utils";
const Drawer = ({
shouldScaleBackground = true,
...props
}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
<DrawerPrimitive.Root
shouldScaleBackground={shouldScaleBackground}
{...props}
/>
);
Drawer.displayName = "Drawer";
const DrawerTrigger = DrawerPrimitive.Trigger;
const DrawerPortal = DrawerPrimitive.Portal;
const DrawerClose = DrawerPrimitive.Close;
const DrawerOverlay = React.forwardRef<
React.ElementRef<typeof DrawerPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<DrawerPrimitive.Overlay
ref={ref}
className={cn("fixed inset-0 z-50 bg-black/80", className)}
{...props}
/>
));
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
const DrawerContent = React.forwardRef<
React.ElementRef<typeof DrawerPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<DrawerPortal>
<DrawerOverlay />
<DrawerPrimitive.Content
ref={ref}
className={cn(
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
className,
)}
{...props}
>
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
{children}
</DrawerPrimitive.Content>
</DrawerPortal>
));
DrawerContent.displayName = "DrawerContent";
const DrawerHeader = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
{...props}
/>
);
DrawerHeader.displayName = "DrawerHeader";
const DrawerFooter = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
{...props}
/>
);
DrawerFooter.displayName = "DrawerFooter";
const DrawerTitle = React.forwardRef<
React.ElementRef<typeof DrawerPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
>(({ className, ...props }, ref) => (
<DrawerPrimitive.Title
ref={ref}
className={cn(
"font-semibold text-lg leading-none tracking-tight",
className,
)}
{...props}
/>
));
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
const DrawerDescription = React.forwardRef<
React.ElementRef<typeof DrawerPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
>(({ className, ...props }, ref) => (
<DrawerPrimitive.Description
ref={ref}
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
));
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
export {
Drawer,
DrawerPortal,
DrawerOverlay,
DrawerTrigger,
DrawerClose,
DrawerContent,
DrawerHeader,
DrawerFooter,
DrawerTitle,
DrawerDescription,
};
@@ -0,0 +1,45 @@
"use client";
import { Button } from "@/components/ui/button";
import type React from "react";
import { useRef } from "react";
interface ImageUploadProps {
value: File | undefined;
onChange?: (files: File[]) => void;
children?: React.ReactNode;
variant?: React.ComponentProps<typeof Button>["variant"];
className?: string;
multiple?: boolean;
accept: string;
}
export function ImageUploadButton(props: ImageUploadProps) {
const fileInputRef = useRef<HTMLInputElement>(null);
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const files = Array.from(e.target.files || []);
props.onChange?.(files);
};
return (
<div>
<Button
variant={props.variant}
onClick={() => fileInputRef.current?.click()}
className={props.className}
>
{props.children}
</Button>
<input
ref={fileInputRef}
type="file"
multiple={props.multiple}
accept={props.accept}
onChange={handleFileChange}
className="hidden"
aria-label="Upload image"
/>
</div>
);
}
@@ -7,7 +7,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import { BadgeContainer } from "../../../stories/utils";
const meta = {
@@ -8,7 +8,7 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/nextjs";
import Link from "next/link";
import { BadgeContainer } from "../../../stories/utils";
import { cn } from "../../lib/utils";
+8 -1
View File
@@ -22,6 +22,7 @@ export function TabLinks(props: {
tabContainerClassName?: string;
shadowColor?: string;
scrollableClassName?: string;
bottomLineClassName?: string;
}) {
const { containerRef, lineRef, activeTabRef } =
useUnderline<HTMLAnchorElement>();
@@ -29,7 +30,12 @@ export function TabLinks(props: {
return (
<div className={cn("relative", props.className)}>
{/* Bottom line */}
<div className="absolute right-0 bottom-0 left-0 h-[1px] bg-border" />
<div
className={cn(
"absolute right-0 bottom-0 left-0 h-[1px] bg-border",
props.bottomLineClassName,
)}
/>
<ScrollShadow
scrollableClassName={cn("pb-[8px] relative", props.scrollableClassName)}
@@ -216,6 +222,7 @@ export function TabPathLinks(props: {
tabContainerClassName?: string;
shadowColor?: string;
scrollableClassName?: string;
bottomLineClassName?: string;
}) {
const pathname = usePathname() || "";
const { links, ...restProps } = props;
@@ -54,11 +54,11 @@ export function ToolTipLabel(props: {
align={props.align}
sideOffset={10}
className={cn(
"max-w-[400px] whitespace-normal leading-relaxed",
"max-w-[400px] whitespace-normal p-0 leading-relaxed",
props.contentClassName,
)}
>
<div className="flex items-center gap-1.5 p-2 text-sm">
<div className="flex items-center gap-1.5 p-4 text-sm">
{props.leftIcon}
{props.label}
{props.rightIcon}

Some files were not shown because too many files have changed in this diff Show More