Skip to content
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

chore: Swap/UI updates #2760

Merged
merged 16 commits into from
Oct 13, 2023
Merged

chore: Swap/UI updates #2760

merged 16 commits into from
Oct 13, 2023

Conversation

SorinC6
Copy link
Contributor

@SorinC6 SorinC6 commented Oct 12, 2023

tasks:

result['metadata'] = metadata
return acc.concat(result as MappedRawOrder)
} catch (error) {
console.warn('Error parsing json metadata', error)
Copy link
Contributor

Choose a reason for hiding this comment

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

would an alert be ok here?

Alert.alert(strings.generalErrorTitle, strings.generalErrorMessage(error.message))

@@ -122,7 +134,8 @@ export const ExpandableOrder = ({order}: {order: MappedRawOrder}) => {
const buyQuantity = Quantities.format(metadata.buyQuantity as Balance.Quantity, buyTokenInfo.decimals ?? 0)
const sellQuantity = Quantities.format(metadata.sellQuantity as Balance.Quantity, sellTokenInfo.decimals ?? 0)
const tokenPrice = asQuantity(new BigNumber(metadata.sellQuantity).dividedBy(metadata.buyQuantity).toString())
const marketPrice = Quantities.format(tokenPrice, sellTokenInfo.decimals ?? 0, MAX_DECIMALS)
const denomination = (sellTokenInfo.decimals ?? 0) - (buyTokenInfo.decimals ?? 0)
const marketPrice = Quantities.format(tokenPrice ?? Quantities.zero, denomination, PRECISION)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is gonna have to be abstracted if we keep using it in more places.

@stackchain stackchain changed the title Swap/UI updates chore: Swap/UI updates Oct 13, 2023
@stackchain stackchain added this to the 5.0.0 milestone Oct 13, 2023
@stackchain stackchain merged commit 84612cd into develop Oct 13, 2023
@stackchain stackchain deleted the swap/ui-updates branch October 13, 2023 10:37
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.

5 participants