Skip to content

[SDK] Handle Hedera native currency decimals for smart wallet calls #6969

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

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented May 7, 2025


PR-Codex overview

This PR introduces adjustments to handle the decimal values of native currency for smart wallet calls specifically for hedera chains, ensuring compatibility in contract transactions.

Detailed summary

  • Updated expect statement to check if nft.owner is defined instead of a specific address.
  • Changed the nft.owner value in the inline snapshot.
  • Added special handling for hedera chains in packages/thirdweb/src/wallets/smart/lib/calls.ts:
    • Adjusted transaction.value by dividing it for specific chain IDs (295 and 296).
    • Implemented similar handling for batch transactions, modifying the values accordingly.

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

Copy link

changeset-bot bot commented May 7, 2025

🦋 Changeset detected

Latest commit: a2bc3f3

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

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@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 May 7, 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 7, 2025 8:52am
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2025 8:52am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2025 8:52am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2025 8:52am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2025 8:52am

@joaquim-verges joaquim-verges marked this pull request as ready for review May 7, 2025 08:36
@joaquim-verges joaquim-verges requested review from a team as code owners May 7, 2025 08:36
@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels May 7, 2025
Copy link
Member Author


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

github-actions bot commented May 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 51.01 KB (0%) 1.1 s (0%) 200 ms (+111.88% 🔺) 1.3 s
thirdweb (cjs) 143.18 KB (+0.04% 🔺) 2.9 s (+0.04% 🔺) 316 ms (+21.97% 🔺) 3.2 s
thirdweb (minimal + tree-shaking) 5.67 KB (0%) 114 ms (0%) 83 ms (+951.42% 🔺) 196 ms
thirdweb/chains (tree-shaking) 514 B (0%) 11 ms (0%) 27 ms (+1116.29% 🔺) 37 ms
thirdweb/react (minimal + tree-shaking) 19.47 KB (0%) 390 ms (0%) 82 ms (+370.23% 🔺) 471 ms

Copy link

codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.

Project coverage is 55.02%. Comparing base (bdb4c31) to head (a2bc3f3).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/wallets/smart/lib/calls.ts 36.36% 4 Missing and 3 partials ⚠️

❌ Your patch status has failed because the patch coverage (36.36%) 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    #6969      +/-   ##
==========================================
- Coverage   55.03%   55.02%   -0.01%     
==========================================
  Files         898      898              
  Lines       57347    57352       +5     
  Branches     3966     3965       -1     
==========================================
- Hits        31561    31560       -1     
- Misses      25689    25693       +4     
- Partials       97       99       +2     
Flag Coverage Δ
packages 55.02% <36.36%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
packages/thirdweb/src/wallets/smart/lib/calls.ts 75.71% <36.36%> (-3.55%) ⬇️

... and 1 file 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.

@joaquim-verges joaquim-verges merged commit 4e42158 into main May 7, 2025
23 of 24 checks passed
@joaquim-verges joaquim-verges deleted the _SDK_Handle_Hedera_native_currency_decimals_for_smart_wallet_calls branch May 7, 2025 08:54
@joaquim-verges joaquim-verges mentioned this pull request May 7, 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.

2 participants