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] USD balance for AccountBalance #5533

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Nov 27, 2024

CNCT-2494


PR-Codex overview

This PR focuses on exporting utility functions for number formatting and implementing them in the AccountBalance component to enhance balance display, including support for fiat values.

Detailed summary

  • Exported formatNumber and shortenLargeNumber utilities.
  • Added tests for shortenLargeNumber.
  • Updated AccountBalance to use formatNumber and shortenLargeNumber.
  • Modified formatFn in AccountBalanceProps to accept new parameters.
  • Enhanced balance display logic to include fiat value formatting.

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

Copy link

changeset-bot bot commented Nov 27, 2024

🦋 Changeset detected

Latest commit: 7beaa25

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

This PR includes changesets to release 1 package
Name Type
thirdweb 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

graphite-app bot commented Nov 27, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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

Copy link

vercel bot commented Nov 27, 2024

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 Dec 2, 2024 10:47am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2024 10:47am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2024 10:47am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2024 10:47am

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Nov 27, 2024
Copy link
Contributor Author

kien-ngo commented Nov 27, 2024

@kien-ngo kien-ngo changed the title update [Experiment] USD balance for AccountBalance Nov 27, 2024
@kien-ngo kien-ngo marked this pull request as ready for review November 27, 2024 18:13
Copy link
Contributor

github-actions bot commented Nov 27, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.92 KB (0%) 959 ms (0%) 2.6 s (-29.27% 🔽) 3.6 s
thirdweb (cjs) 107.33 KB (0%) 2.2 s (0%) 5.8 s (-12.45% 🔽) 7.9 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 249 ms (+93.27% 🔺) 361 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 47 ms (-64.21% 🔽) 57 ms
thirdweb/react (minimal + tree-shaking) 18.28 KB (0%) 366 ms (0%) 731 ms (+19.08% 🔺) 1.1 s

@gregfromstl
Copy link
Member

Don't forget a changeset but lgtm

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 68 lines in your changes missing coverage. Please review.

Please upload report for BASE (kien/pay-convert-endpoints@ac08a47). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...dweb/src/react/web/ui/prebuilt/Account/balance.tsx 14.28% 54 Missing ⚠️
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 12.50% 14 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##             kien/pay-convert-endpoints    #5533   +/-   ##
=============================================================
  Coverage                              ?   46.21%           
=============================================================
  Files                                 ?     1086           
  Lines                                 ?    58866           
  Branches                              ?     3951           
=============================================================
  Hits                                  ?    27206           
  Misses                                ?    30977           
  Partials                              ?      683           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (?) Carriedforward from e2754df
packages 41.80% <33.33%> (?)

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

Files with missing lines Coverage Δ
packages/thirdweb/src/utils/formatNumber.ts 100.00% <ø> (ø)
packages/thirdweb/src/utils/shortenLargeNumber.ts 100.00% <100.00%> (ø)
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 7.53% <12.50%> (ø)
...dweb/src/react/web/ui/prebuilt/Account/balance.tsx 32.40% <14.28%> (ø)

Copy link
Member

@joaquim-verges joaquim-verges left a comment

Choose a reason for hiding this comment

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

looks like you need to bump the cjs size limit, make it 120000?

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.

3 participants