-
Notifications
You must be signed in to change notification settings - Fork 635
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
Review button states #5854
Review button states #5854
Conversation
* add more fns * accept string or number * update errors
* . * oop * oop * okay ty ben * change background opacity to 1 * . * oop * .
* perf * ✨ * useWhyDidYouUpdate * EstimatedSwapGasFee * keepPreviousData * AnimatedText * isSameAddress
* fix * android fix
const network = getNetworkFromChainId(chainId); | ||
const { nativeCurrency } = getNetworkObj(network); | ||
const { mainnetAddress, address } = nativeCurrency; | ||
const uniqueId = mainnetAddress ? `${mainnetAddress}_${Network.mainnet}` : `${address}_${network}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless something changed, this is not how it's supposed to be. UniqueIds should be created as ${mainnetAddress || address}_${chainId}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we're using chainId format for new swaps stuff. Will be incrementally adopting this new pattern elsewhere in the app later @greg-schrammel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or wait i'm not sure why this file was touched actually.. this is for old user assets logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@greg-schrammel for swaps work, we've been duplicating the general resources
files for assets and placing them here: __swaps__/screens/Swap/resources/assets
; we hadn't copied over the useUserAsset
function but we should be doing that for now (clean up of this duplication of resources
will be tackled later)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a useUserAsset
that selects a single asset from useUserAssets
, I created in the same file a useUserNativeNetworkAsset
to make it easier to grab the network native asset
is there another hook/way of doing that already?
don't see a reason to clone this file
for context Im using this hook to know the user network native balance, and check if he has enough for the transaction
|
||
const gasAmount = formatUnits(safeBigInt(totalWei), nativeNetworkAsset.decimals).toString(); | ||
const feeInUserCurrency = multiply(networkAssetPrice, gasAmount); | ||
const feeFormatted = formatUnits(safeBigInt(fee), nativeNetworkAsset.decimals).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a theory that the reason we see 0 sometimes as the gas price is because there are decimals in the fee and the safeBigInt returns 0. IMO it's preferably to round up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be using wei
for everything here
but makes sense gonna test it
* Fixes APP-1601: adds missing useThreshold for gas fee showing $0.00 * Tweak confirm button prop labels logic and ordering * Prep work: remove reliance of asset balance display in valueBasedDecimalFormatter * niceIncrementerFormatter returns asset balance if max swap * Update formattedInputValue Instead of using the niceIncrementFormatter for formatting slider-based values: for max: use the valueBasedDecimalFormatter on the input value which has already been set to maxSwappableAmount for everything else: add commas to the input value as it has already been formatted using the niceIncrementFormatter
…able-unit-tests * 'develop' of github.com:rainbow-me/rainbow: rerun only failed tests (#5878) bump versions to v1.9.28 (#5893) input asset regression fix on v1 (#5891) bump to version 1.9.27 (#5890) take into account l1 op gas fee for claimBridge (#5889) Points UI (#5866) Remove input value typeof checks (#5886) Fix swap button presses, adjust button state logic (#5884) Swaps: Gas fee range to use for native asset maxSwappableAmount buffer (#5881) clear custom gas settings (#5875) Review button states (#5854) fix handler (#5880) Use graphql ens key everywhere (#5882) Fix chain badges on android (#5867) fix android padding calc (#5877) add unknown type as failed (#5871) Swaps: gas icons, review sheet cleanup (#5872) Swap flashbots min priority fee (#5869)
Fixes APP-1486
Fixes APP-1600
Fixes APP-1601
Fixes APP-1602
Fixes APP-1617
Fixes APP-1580
What changed (plus any additional context for devs)
Screen recordings / screenshots
What to test