Skip to content

[SDK] Refactor: Update Pay Functions to use UB #7064

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 37 commits into from
May 19, 2025

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented May 15, 2025


PR-Codex overview

This PR introduces significant enhancements to the thirdweb library, primarily focusing on the new Bridge.Transfer module for direct token transfers, along with various updates to existing components and functionalities.

Detailed summary

  • Added Bridge.Transfer module for handling direct token transfers.
  • Updated transaction handling to include feePayer options.
  • Introduced new constants for bridge domains.
  • Enhanced type definitions for tokens and routes.
  • Refactored transaction fetching and status handling.
  • Increased size limit in .size-limit.json.
  • Removed deprecated methods and improved error handling in transfer functions.

The following files were skipped due to too many changes: packages/thirdweb/src/bridge/Transfer.ts, packages/thirdweb/src/pay/buyWithCrypto/getQuote.ts

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

gregfromstl and others added 4 commits May 15, 2025 14:24
- Changes the behavior of buyWithCrypto to use the Universal Bridge service instead of the legacy API
- Updates getQuote and getTransfer implementation to use Bridge.Buy and Bridge.Sell
- Adds a new Transfer module to the Bridge namespace for token transfers
- Removes the legacy API endpoints from definitions.ts

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- Adds new Transfer module for direct token transfers
- Implements prepare function for getting transfer quotes and transactions
- Adds tests for the Transfer module

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
@gregfromstl gregfromstl requested review from a team as code owners May 15, 2025 23:24
Copy link

linear bot commented May 15, 2025

Copy link

vercel bot commented May 15, 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 May 19, 2025 1:39am
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 1:39am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 1:39am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 1:39am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 1:39am

Copy link

changeset-bot bot commented May 15, 2025

🦋 Changeset detected

Latest commit: 535ee7e

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
Contributor

graphite-app bot commented May 15, 2025

How to use the Graphite Merge Queue

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

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

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

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

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

Copy link
Contributor

github-actions bot commented May 15, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 56.29 KB (+3.92% 🔺) 1.2 s (+3.92% 🔺) 219 ms (+106.71% 🔺) 1.4 s
thirdweb (cjs) 304.46 KB (+56.89% 🔺) 6.1 s (+56.89% 🔺) 845 ms (+108.11% 🔺) 7 s
thirdweb (minimal + tree-shaking) 5.69 KB (+0.18% 🔺) 114 ms (+0.18% 🔺) 66 ms (+377.92% 🔺) 180 ms
thirdweb/chains (tree-shaking) 531 B (+1.34% 🔺) 11 ms (+1.34% 🔺) 33 ms (+1230.33% 🔺) 43 ms
thirdweb/react (minimal + tree-shaking) 19.51 KB (-0.11% 🔽) 391 ms (-0.11% 🔽) 88 ms (+357.03% 🔺) 478 ms

Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 15.03958% with 644 lines in your changes missing coverage. Please review.

Project coverage is 55.28%. Comparing base (fdd3441) to head (535ee7e).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ackages/thirdweb/src/pay/buyWithCrypto/getQuote.ts 2.97% 196 Missing ⚠️
...ckages/thirdweb/src/pay/buyWithCrypto/getStatus.ts 1.03% 191 Missing ⚠️
...ages/thirdweb/src/pay/buyWithCrypto/getTransfer.ts 4.76% 120 Missing ⚠️
...tWallet/screens/Buy/swap/useSwapSupportedChains.ts 3.22% 90 Missing ⚠️
...react/core/hooks/transaction/useSendTransaction.ts 3.84% 25 Missing ⚠️
packages/thirdweb/src/bridge/Status.ts 46.66% 8 Missing ⚠️
.../react/web/ui/ConnectWallet/TransactionsScreen.tsx 0.00% 5 Missing ⚠️
...act/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx 0.00% 3 Missing ⚠️
...eb/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx 0.00% 3 Missing ⚠️
packages/thirdweb/src/bridge/Transfer.ts 97.01% 2 Missing ⚠️
... and 1 more

❌ Your patch status has failed because the patch coverage (15.03%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7064      +/-   ##
==========================================
- Coverage   55.49%   55.28%   -0.22%     
==========================================
  Files         909      904       -5     
  Lines       58406    58493      +87     
  Branches     4072     4065       -7     
==========================================
- Hits        32415    32339      -76     
- Misses      25886    26050     +164     
+ Partials      105      104       -1     
Flag Coverage Δ
packages 55.28% <15.03%> (-0.22%) ⬇️
Files with missing lines Coverage Δ
packages/thirdweb/src/bridge/Buy.ts 96.63% <100.00%> (+0.11%) ⬆️
packages/thirdweb/src/bridge/Chains.ts 71.42% <100.00%> (ø)
packages/thirdweb/src/bridge/Routes.ts 87.50% <100.00%> (ø)
packages/thirdweb/src/bridge/Sell.ts 97.47% <100.00%> (+0.08%) ⬆️
packages/thirdweb/src/bridge/index.ts 100.00% <100.00%> (ø)
packages/thirdweb/src/pay/utils/definitions.ts 66.66% <ø> (+5.37%) ⬆️
...ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts 50.00% <100.00%> (-12.50%) ⬇️
...react/web/ui/TransactionButton/ExecutingScreen.tsx 12.87% <ø> (+0.24%) ⬆️
...ges/thirdweb/src/utils/any-evm/zksync/constants.ts 100.00% <ø> (ø)
packages/thirdweb/src/utils/domains.ts 96.22% <100.00%> (+0.22%) ⬆️
... and 11 more

... and 9 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.

Switch useSendTransaction and useSwapSupportedChains to use Bridge.routes endpoint for retrieving supported destinations.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
@gregfromstl gregfromstl force-pushed the greg/tool-4506-update-routes-endpoint branch from b1f25bc to 02b1c4a Compare May 15, 2025 23:39
@gregfromstl gregfromstl changed the title [SDK] Refactor: Update Pay Functions to use UB [SDK] Refactor: Update Pay Functions to use UB for Route Fetching May 15, 2025
@github-actions github-actions bot added Dashboard Involves changes to the Dashboard. Playground Changes involving the Playground codebase. labels May 15, 2025
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 17, 2025 09:11 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 May 17, 2025 09:11 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground May 17, 2025 09:11 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard. packages Playground Changes involving the Playground codebase. 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.

8 participants