Skip to content

Conversation

cosmo-ai-bot
Copy link

Fixed decimal conversion for destination amounts in transfer diagram. Raw blockchain values are now properly converted using token decimals.

Changes Made

  1. Created missing crypto.ts utility file - Added the missing crypto.ts file in apps/explorer/src/utils/ that was being imported but didn't exist
  2. Fixed decimal conversion in hook - Enhanced useTransactionHistoryItemFromUrlParams to only perform decimal conversion when decimals are defined (not undefined)
  3. Fixed TransferEventCard decimal handling - Updated currentAsset calculation to properly handle cases where decimals are undefined, preventing incorrect conversions with default decimal places
  4. Fixed TokenDetails decimal conversion - Updated the receivedToken calculation to handle undefined decimals properly
  5. Fixed Skip.go link generation - Ensured the "Try again" link properly converts amounts using correct decimals

Problem Solved

Previously, when token decimals were undefined, the conversion function would use the default 18 decimals, causing incorrect display values. For example, a 6-decimal token showing 1000000 raw value would incorrectly show as a tiny fraction instead of 1.0.

The fix ensures that:

  • Raw amounts are only converted when we have the correct decimal information
  • If decimals are undefined, the raw amount is preserved until proper decimals are available
  • All conversion sites (TransferEventCard, TokenDetails, hook) consistently handle undefined decimals

Copy link

changeset-bot bot commented Sep 5, 2025

⚠️ No Changeset found

Latest commit: f99179f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 5, 2025

@cosmo-ai-bot is attempting to deploy a commit to the Cosmos Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Sep 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
skip-go-explorer-ddru Ready Ready Preview Comment Sep 5, 2025 8:33am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant