Skip to content

Commit

Permalink
feat: use getAddress to sanitize address
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseRFelix authored and jonator committed Jul 2, 2024
1 parent f3a6347 commit 56516a3
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BridgeChain } from "@osmosis-labs/bridge";
import { isNil } from "@osmosis-labs/utils";
import { observer } from "mobx-react-lite";
import { useState } from "react";
import { getAddress } from "viem";

import { AmountScreen } from "~/components/bridge/immersive/amount-screen";
import { ImmersiveBridgeScreens } from "~/components/bridge/immersive/immersive-bridge";
Expand Down Expand Up @@ -60,13 +61,32 @@ export const AmountAndConfirmationScreen = observer(
? evmAddress
: toChainCosmosAccount?.address,
toChain: toChain,
toAsset: destinationAsset,
toAsset: destinationAsset
? {
address:
toChain?.chainType === "evm"
? getAddress(destinationAsset.address)
: destinationAsset.address,
decimals: destinationAsset.decimals,
denom: destinationAsset.denom,
}
: undefined,
fromAddress:
fromChain?.chainType === "evm"
? evmAddress
: fromChainCosmosAccount?.address,
fromChain: fromChain,
fromAsset: sourceAsset,
fromAsset: sourceAsset
? {
address:
fromChain?.chainType === "evm"
? getAddress(sourceAsset.address)
: sourceAsset.address,
decimals: sourceAsset.decimals,
denom: sourceAsset.denom,
amount: sourceAsset.amount,
}
: undefined,
direction,
onRequestClose: onClose,
inputAmount: cryptoAmount,
Expand Down

0 comments on commit 56516a3

Please sign in to comment.