Skip to content
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

[SDK] fix: Disable quote retries and show fiat values #6210

Merged

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Feb 8, 2025


PR-Codex overview

This PR focuses on improving the handling of fiat transactions in the thirdweb package by eliminating retries on quote errors and ensuring the fiat value is displayed at every step.

Detailed summary

  • Updated the toTokenInfo to include a space after the formatted number.
  • Removed the retry logic from useBuyWithFiatQuote and useBuyWithCryptoQuote, setting retry to false.
  • Added the FiatValue component to SelectedTokenInfo to display fiat value based on the selected token and chain.
  • Adjusted the Container gap from xs to xxs in SelectedTokenInfo.

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

Copy link

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

Copy link

changeset-bot bot commented Feb 8, 2025

🦋 Changeset detected

Latest commit: f210a59

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

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch
thirdweb-login 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

@joaquim-verges joaquim-verges marked this pull request as ready for review February 8, 2025 12:26
@joaquim-verges joaquim-verges requested a review from a team as a code owner February 8, 2025 12:26
@joaquim-verges joaquim-verges requested a review from a team as a code owner February 8, 2025 12:26
@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Feb 8, 2025
Copy link
Member Author

joaquim-verges commented Feb 8, 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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.28 KB (0%) 926 ms (0%) 2.2 s (-2.92% 🔽) 3.1 s
thirdweb (cjs) 122.06 KB (0%) 2.5 s (0%) 5.7 s (-3.77% 🔽) 8.1 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 112 ms (0%) 452 ms (+142.21% 🔺) 564 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 85 ms (+3.77% 🔺) 95 ms
thirdweb/react (minimal + tree-shaking) 19.3 KB (0%) 386 ms (0%) 589 ms (+19.61% 🔺) 974 ms

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 56.76%. Comparing base (92266b7) to head (f210a59).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...act/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx 11.11% 8 Missing ⚠️
.../src/react/core/hooks/pay/useBuyWithCryptoQuote.ts 0.00% 1 Missing ⚠️
...eb/src/react/core/hooks/pay/useBuyWithFiatQuote.ts 0.00% 1 Missing ⚠️
...eb/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (8.33%) 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    #6210      +/-   ##
==========================================
+ Coverage   56.72%   56.76%   +0.03%     
==========================================
  Files        1161     1161              
  Lines       64289    64265      -24     
  Branches     5196     5198       +2     
==========================================
+ Hits        36468    36480      +12     
+ Misses      27095    27056      -39     
- Partials      726      729       +3     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 92266b7
packages 54.94% <8.33%> (+0.04%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
.../src/react/core/hooks/pay/useBuyWithCryptoQuote.ts 15.78% <0.00%> (+7.21%) ⬆️
...eb/src/react/core/hooks/pay/useBuyWithFiatQuote.ts 15.78% <0.00%> (+7.21%) ⬆️
...eb/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx 4.56% <0.00%> (ø)
...act/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx 4.37% <11.11%> (+0.07%) ⬆️

... and 7 files with indirect coverage changes

@joaquim-verges joaquim-verges merged commit 2fbf105 into main Feb 11, 2025
32 of 34 checks passed
@joaquim-verges joaquim-verges deleted the _SDK_fix_Disable_quote_retries_and_show_fiat_values branch February 11, 2025 03:41
@joaquim-verges joaquim-verges mentioned this pull request Feb 11, 2025
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.

1 participant