Skip to content

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented Aug 18, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

Whew, lots of changes to review here.

asset: asCryptoAsset,
targetFiat: asString,
isoDate: asOptional(asString), // Defaults to today if not specified
expiration: asNumber
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: Since we are updating this file format, and don't need to be compatible anymore, we could potentially convert this to a date string instead of a number. However, I do understand that the number is going to be smaller on-disk. OTOH, the number is inconsistent with the isoDate string on the line above.

destWallet.currencyInfo.denominations[0].multiplier
)
),
mul('5.05', div('1', polygonPrice === '0' ? '1' : polygonPrice)),
Copy link

Choose a reason for hiding this comment

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

Bug: Currency Conversion Logic Errors

The updated currency conversion logic has several issues. The minFeeSwapAmount calculation is incorrect due to an inverted conversion direction or incorrect amount parameter. Fiat-to-crypto conversions in ExchangedFlipInput2.tsx are also flawed, as getExchangeRate provides a crypto-to-fiat rate while the division assumes the inverse. This may also cause hardcoded USD values to be misinterpreted based on the user's preferred fiat.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

Approved, but please check the AI comment (I think it's confused) and maybe address the two weird imports I mentioned.

@@ -8,11 +8,13 @@ import { useDisplayDenom } from '../../hooks/useDisplayDenom'
import { useHandler } from '../../hooks/useHandler'
import { lstrings } from '../../locales/strings'
import { getExchangeDenom } from '../../selectors/DenominationSelectors'
import { getExchangeRate } from '../../selectors/WalletSelectors'
import {
convertCurrency as convertCurrencyFromExchangeRates,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why rename the import? Was this a mistake?

@@ -8,10 +8,12 @@ import {
getExchangeDenom,
selectDisplayDenom
} from '../../selectors/DenominationSelectors'
import { getExchangeRate } from '../../selectors/WalletSelectors'
import {
convertCurrency as convertCurrencyFromExchangeRates,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why rename the import?

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.

2 participants