Skip to content

[SDK] Feature: Adds Universal Bridge #6464

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 20, 2025

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Mar 12, 2025


PR-Codex overview

This PR introduces a new Bridge module to the thirdweb SDK, enabling users to perform buy and sell operations across chains, retrieve bridge routes, and check transaction statuses.

Detailed summary

  • Added Bridge module for Universal Bridge access.
  • Implemented Bridge.Buy and Bridge.Sell for token transactions.
  • Created functions for quoting and preparing transactions.
  • Introduced routes function to retrieve available bridge routes.
  • Added status function to check transaction statuses.
  • Enhanced error handling with descriptive messages.

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

@gregfromstl gregfromstl requested review from a team as code owners March 12, 2025 00:09
Copy link

linear bot commented Mar 12, 2025

Copy link

changeset-bot bot commented Mar 12, 2025

🦋 Changeset detected

Latest commit: 654f879

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
thirdweb Minor
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Mar 12, 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 20, 2025 9:33pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 9:33pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 9:33pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 9:33pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 9:33pm

Copy link
Contributor

graphite-app bot commented Mar 12, 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 packages SDK Involves changes to the thirdweb SDK labels Mar 12, 2025
@gregfromstl gregfromstl marked this pull request as draft March 12, 2025 00:10
@gregfromstl gregfromstl changed the title WIP [SDK] Feature: WIP [SDK] Feature: Adds Universal Bridge Mar 12, 2025
Copy link
Contributor

github-actions bot commented Mar 12, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.56 KB (+1.59% 🔺) 952 ms (+1.59% 🔺) 145 ms (+139.42% 🔺) 1.1 s
thirdweb (cjs) 127.31 KB (+0.12% 🔺) 2.6 s (+0.12% 🔺) 219 ms (+37.61% 🔺) 2.8 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 87 ms (+1788.67% 🔺) 199 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 41 ms (+1373.13% 🔺) 51 ms
thirdweb/react (minimal + tree-shaking) 19.34 KB (0%) 387 ms (0%) 96 ms (+698.94% 🔺) 483 ms

<!--

## 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 `Bridge` module to the `thirdweb` SDK, enabling users to perform token buy and sell operations across chains, along with route discovery and transaction status checks.

### Detailed summary
- Added `Bridge` module for Universal Bridge operations.
- Implemented `Bridge.Buy` and `Bridge.Sell` for token transactions.
- Created `quote` and `prepare` functions for both buy and sell operations.
- Introduced `routes` function to discover available bridge routes.
- Added `status` function to check transaction statuses.
- Defined TypeScript types: `Route`, `Status`, `Quote`, `PreparedQuote`.

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

Successfully merging this pull request may close these issues.

2 participants