Skip to content

[Portal] Add cross-chain swapping guide and add bridge submodules #6571

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Mar 27, 2025


PR-Codex overview

This PR focuses on enhancing the documentation and functionality related to cross-chain swapping using the thirdweb Universal Bridge, including updates to existing guides and the introduction of new examples for better user understanding.

Detailed summary

  • Updated yarn command in page.mdx for installing thirdweb.
  • Renamed the sidebar item from "Build a Custom Experience" to "Build a Custom Onramp Experience".
  • Introduced a new sidebar item for "Cross-Chain Swapping".
  • Expanded block tag filtering to include @bridge.
  • Updated documentation in Buy.ts and Sell.ts to specify @bridge with respective namespaces.
  • Added a new guide for cross-chain swapping in cross-chain-swapping/page.mdx, including:
    • Steps for installation, client ID retrieval, route finding, quote retrieval, transaction preparation, execution, and status checking.
    • Code examples demonstrating the use of the Bridge namespace for cross-chain operations.

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

@gregfromstl gregfromstl requested review from a team as code owners March 27, 2025 17:58
Copy link

linear bot commented Mar 27, 2025

TOOL-3709 Update Docs

Copy link

changeset-bot bot commented Mar 27, 2025

⚠️ No Changeset found

Latest commit: d4f5a9d

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

This PR includes no changesets

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

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

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

Copy link

vercel bot commented Mar 27, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 7:15pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 7:15pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 7:15pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 7:15pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 7:15pm

Copy link
Contributor

graphite-app bot commented Mar 27, 2025

How to use the Graphite Merge Queue

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

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

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

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

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

@github-actions github-actions bot added Portal Involves changes to the Portal (docs) codebase. packages SDK Involves changes to the thirdweb SDK labels Mar 27, 2025
<Step title='Install the Connect SDK'>
<InstallTabs
npm="npm i thirdweb"
yarn="yarn install thirdweb"
Copy link
Contributor

Choose a reason for hiding this comment

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

The yarn command is incorrect. It should be yarn add thirdweb rather than yarn install thirdweb. The install command in yarn is used to install all dependencies from package.json, while add is used to add a specific package.

Suggested change
yarn="yarn install thirdweb"
yarn="yarn add thirdweb"

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor

github-actions bot commented Mar 27, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.56 KB (0%) 952 ms (0%) 217 ms (+112.39% 🔺) 1.2 s
thirdweb (cjs) 127.31 KB (0%) 2.6 s (0%) 335 ms (+43.58% 🔺) 2.9 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 68 ms (+671.6% 🔺) 180 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 56 ms (+2426.49% 🔺) 66 ms
thirdweb/react (minimal + tree-shaking) 19.34 KB (0%) 387 ms (0%) 148 ms (+820.83% 🔺) 535 ms

<Callout variant="info">
The `Buy` namespace is purpose-built for when you want to obtain a specific amount of the output token.
If you have a specific input amount and are flexible on the output amount, you can use the `Sell` namespace.
Learn more about sells [here](
Copy link
Contributor

Choose a reason for hiding this comment

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

The Callout component contains an incomplete URL reference. The markdown link is missing its URL and closing parenthesis. Please complete the link with the appropriate destination URL:

Learn more about sells [here](https://portal.thirdweb.com/connect/pay/guides/cross-chain-swapping)

Or another appropriate URL that explains the Sell namespace functionality.

Suggested change
Learn more about sells [here](
Learn more about sells [here](https://portal.thirdweb.com/connect/pay/guides/cross-chain-swapping)

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.06%. Comparing base (3b827ea) to head (d4f5a9d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6571   +/-   ##
=======================================
  Coverage   55.05%   55.06%           
=======================================
  Files         883      883           
  Lines       55361    55361           
  Branches     3786     3787    +1     
=======================================
+ Hits        30481    30486    +5     
+ Misses      24785    24780    -5     
  Partials       95       95           
Flag Coverage Δ
packages 55.06% <ø> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
packages/thirdweb/src/bridge/Buy.ts 96.55% <ø> (ø)
packages/thirdweb/src/bridge/Sell.ts 96.55% <ø> (ø)
packages/thirdweb/src/bridge/Status.ts 43.75% <ø> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vercel vercel bot temporarily deployed to Preview – login March 27, 2025 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www March 27, 2025 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground March 27, 2025 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui March 27, 2025 18:45 Inactive
@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Mar 27, 2025
Copy link
Member Author

gregfromstl commented Mar 27, 2025

Merge activity

  • Mar 27, 2:54 PM EDT: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 27, 2:54 PM EDT: gregfromstl added this pull request to the Graphite merge queue.
  • Mar 27, 3:16 PM EDT: A user merged this pull request with the Graphite merge queue.

)

<!--

## 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 functionality surrounding the `thirdweb` Universal Bridge, particularly for cross-chain swapping and related features. It updates guides, introduces new functionalities, and improves the clarity of the code.

### Detailed summary
- Updated `yarn` command in `page.mdx` for installing `thirdweb`.
- Renamed the guide from "Build a Custom Experience" to "Build a Custom Onramp Experience" in `sidebar.tsx`.
- Added a new guide for "Cross-Chain Swapping" in `page.mdx`.
- Enhanced tag filtering in `slugs.ts` to include `@bridge`.
- Updated comments in `Buy.ts` and `Sell.ts` to specify `@bridge Buy` and `@bridge Sell`.
- Improved sidebar link generation in `getSidebarLinkGroups.ts` to include `@bridge` links.
- Added comprehensive steps for cross-chain swapping in the new guide, including installation, obtaining quotes, preparing transactions, and checking swap status.

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

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Portal Involves changes to the Portal (docs) codebase. SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants