Skip to content

Handle tokens with invalid decimal places better#17

Merged
rkeene merged 3 commits intomainfrom
bug/handle-tokens-with-invalid-decimal-places
May 7, 2026
Merged

Handle tokens with invalid decimal places better#17
rkeene merged 3 commits intomainfrom
bug/handle-tokens-with-invalid-decimal-places

Conversation

@rkeene
Copy link
Copy Markdown
Member

@rkeene rkeene commented May 5, 2026

Description

This fixes an issue with the explorer handling of decimalPlaces which are not a number, and just converts them silently to 0.

@rkeene rkeene requested review from Copilot and ezraripps May 5, 2026 20:09
@rkeene rkeene self-assigned this May 5, 2026
@rkeene rkeene added the bug Something isn't working label May 5, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves robustness of token metadata parsing in the web explorer by normalizing decimalPlaces values derived from token metadata, preventing invalid values from propagating into token formatting/rendering.

Changes:

  • Refactors parseTokenMetadata to use a single default decimalPlaces value and return it consistently.
  • Sanitizes parsed decimalPlaces to coerce invalid numeric values (e.g., NaN, negatives) back to 0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/web/src/libs/token-batcher.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/web/src/libs/token-batcher.ts
Comment thread apps/web/src/libs/token-batcher.ts
@rkeene rkeene merged commit 4007ecb into main May 7, 2026
4 checks passed
rkeene added a commit to KeetaNetwork/anchor that referenced this pull request May 10, 2026
This change improves the robustness of parsing token metadata decimals
to match what the explorer does now (KeetaNetwork/explorer#17)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants