Skip to content

Commit

Permalink
tx sim: other natives (#5585)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylarbarrera authored Apr 3, 2024
1 parent 748d73a commit 551997b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/screens/SignTransactionSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
import { Network } from '@/networks/types';
import { ETH_ADDRESS } from '@/references';
import {
convertAmountToNativeDisplay,
convertHexToString,
convertRawAmountToBalance,
delay,
Expand Down Expand Up @@ -143,7 +144,7 @@ export const SignTransactionSheet = () => {
const { goBack, navigate } = useNavigation();
const { colors, isDarkMode } = useTheme();
const { width: deviceWidth } = useDimensions();
const { accountAddress } = useAccountSettings();
const { accountAddress, nativeCurrency } = useAccountSettings();
const [simulationData, setSimulationData] = useState<TransactionSimulationResult | undefined>();
const [simulationError, setSimulationError] = useState<TransactionErrorType | undefined>(undefined);
const [simulationScanResult, setSimulationScanResult] = useState<TransactionScanResultType | undefined>(undefined);
Expand Down Expand Up @@ -407,6 +408,7 @@ export const SignTransactionSheet = () => {
// TX Signing
simulationData = await metadataPOSTClient.simulateTransactions({
chainId: chainId,
currency: nativeCurrency?.toLowerCase(),
transactions: [
{
from: req?.from,
Expand Down Expand Up @@ -1495,9 +1497,9 @@ const SimulatedEventRow = ({
assetCode = ETH_ADDRESS;
}
const showUSD = (eventType === 'send' || eventType === 'receive') && !!price;
const formattedPrice = `$${price?.toLocaleString?.('en-US', {
maximumFractionDigits: 2,
})}`;

const formattedPrice = price && convertAmountToNativeDisplay(price, nativeCurrency);

return (
<Box justifyContent="center" height={{ custom: CARD_ROW_HEIGHT }} width="full">
<Inline alignHorizontal="justify" alignVertical="center" space="20px" wrap={false}>
Expand Down

0 comments on commit 551997b

Please sign in to comment.