File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
apps/dashboard/src/app/nebula-app/(app)/components/Swap Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import { TransactionButton } from "components/buttons/TransactionButton";
22import { useV5DashboardChain } from "lib/v5-adapter" ;
33import { ArrowRightLeftIcon , CheckIcon } from "lucide-react" ;
44import {
5+ NATIVE_TOKEN_ADDRESS ,
56 type PreparedTransaction ,
67 type ThirdwebClient ,
8+ getAddress ,
79 prepareTransaction ,
810 toTokens ,
911} from "thirdweb" ;
@@ -39,6 +41,9 @@ export function SwapTransactionCardLayout(props: {
3941 const { swapData } = props ;
4042 const txChain = useV5DashboardChain ( swapData . transaction . chainId ) ;
4143
44+ const isSellingNativeToken =
45+ getAddress ( swapData . from . address ) === getAddress ( NATIVE_TOKEN_ADDRESS ) ;
46+
4247 return (
4348 < div className = "max-w-lg" >
4449 < div className = "rounded-xl border bg-card" >
@@ -102,6 +107,12 @@ export function SwapTransactionCardLayout(props: {
102107 client : props . client ,
103108 data : swapData . transaction . data ,
104109 to : swapData . transaction . to ,
110+ erc20Value : isSellingNativeToken
111+ ? undefined
112+ : {
113+ amountWei : BigInt ( swapData . from . amount ) ,
114+ tokenAddress : swapData . from . address ,
115+ } ,
105116 } ) ;
106117
107118 props . sendTx ( tx ) ;
You can’t perform that action at this time.
0 commit comments