Skip to content

fix(decimal): render Reown/WalletConnect amounts with the network's decimal places - #898

Open
raul-oliveira wants to merge 1 commit into
masterfrom
feat/amount-format-reown
Open

fix(decimal): render Reown/WalletConnect amounts with the network's decimal places#898
raul-oliveira wants to merge 1 commit into
masterfrom
feat/amount-format-reown

Conversation

@raul-oliveira

@raul-oliveira raul-oliveira commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Third slice of the amount-decimals fix, on top of #891 (merged to master). Extends the network decimal_places fix to the Reown/WalletConnect request screens. Independent of #894 — based directly on master.

Acceptance Criteria

  • Reown/WalletConnect request screens render token amounts using the network's decimal_places (from serverInfo) instead of the wallet-lib default of 2
  • Covers: create-token request, get-utxos request, transaction fees, send-transaction request, and the nano-contract action/argument displays
  • No behavior change on a 2-decimal network; the fix is observable only where the network reports a different precision

Screenshots

image image image
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-07-30.at.16.17.11.mov

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@raul-oliveira, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e3f1091-f987-465d-93c6-e719fc2840c8

📥 Commits

Reviewing files that changed from the base of the PR and between b9eb962 and 2026cae.

📒 Files selected for processing (6)
  • src/components/Reown/CreateTokenRequest.js
  • src/components/Reown/GetUtxosRequest.js
  • src/components/Reown/NanoContract/NanoContractActions.js
  • src/components/Reown/NanoContract/NanoContractMethodArgs.js
  • src/components/Reown/SendTransactionRequest.js
  • src/components/Reown/TransactionFees.js
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/amount-format-reown

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@raul-oliveira
raul-oliveira force-pushed the feat/amount-format-two-line-input branch from 3ec25fa to 09eca73 Compare July 29, 2026 14:30
@raul-oliveira
raul-oliveira force-pushed the feat/amount-format-reown branch from df2d4c4 to c5b3989 Compare July 30, 2026 14:55
@raul-oliveira
raul-oliveira changed the base branch from feat/amount-format-two-line-input to master July 30, 2026 14:55
@raul-oliveira raul-oliveira self-assigned this Jul 30, 2026
@raul-oliveira raul-oliveira moved this from Todo to In Progress (WIP) in Hathor Network Jul 30, 2026
@raul-oliveira
raul-oliveira force-pushed the feat/amount-format-reown branch from c5b3989 to 6c12f0d Compare July 30, 2026 20:06
Extend the amount-format decimal fix to the Reown/WalletConnect request
screens (create token, get-utxos, transaction fees, send transaction)
and the nano-contract action/arg displays, deferred from the base PR.
These now render amounts at the network's decimal_places.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DfcfFFSBugJZYxtTjYLq4P
@raul-oliveira
raul-oliveira force-pushed the feat/amount-format-reown branch from 6c12f0d to 2026cae Compare July 30, 2026 20:07
@raul-oliveira raul-oliveira moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Jul 30, 2026
@tuliomir
tuliomir self-requested a review July 31, 2026 11:49

{/* ACQUIRE_AUTHORITY: Show only address (send the authority and create the output) */}
{action.type === NanoContractActionType.ACQUIRE_AUTHORITY && action.address && (
{/* WITHDRAWAL: Show only address (address to send the amount and create the output) */}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion(non-blocking): the layout restyle isn't covered by the acceptance criteria

This action item is restructured (addresses moved out of the icon row, indented by DEFAULT_ICON_SIZE + 16), and four files gain alignItems: 'flex-start' / textAlign: 'right' / maxWidth. Those render differently on a 2-decimal network too, so AC bullet 3 ("no behavior change on a 2-decimal network") no longer holds. Presumably it's making room for longer amounts — worth saying so in the description, so a reviewer knows to check the layout at the old precision as well.

*/
const Amount = ({ amount, isNft }) => {
const amountToRender = renderValue(amount, isNft);
const decimalPlaces = useSelector((state) => state.serverInfo?.decimal_places);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question(non-blocking): should these amounts honour the compressed/expanded preference?

renderValue's fourth argument is the wallet-wide amount format added in PR 891; TxDetailsModal passes getDisplayAmountFormat(state), the Reown screens don't, so they stay EXPANDED. Deliberate — full precision on a screen you're signing from — or just out of this slice's scope?

@tuliomir tuliomir moved this from In Progress (Done) to In Review (WIP) in Hathor Network Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review (WIP)

Development

Successfully merging this pull request may close these issues.

2 participants