-
Notifications
You must be signed in to change notification settings - Fork 50
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
chore: Swap/UI updates #2760
Conversation
result['metadata'] = metadata | ||
return acc.concat(result as MappedRawOrder) | ||
} catch (error) { | ||
console.warn('Error parsing json metadata', error) |
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.
would an alert be ok here?
yoroi/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx
Line 81 in 8068c57
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) |
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.
This is gonna have to be abstracted if we keep using it in more places.
tasks:
Complete order
tab