@@ -8,7 +8,7 @@ import { toast } from "sonner";
88import { ArrowDownUp , HelpCircle , Settings } from "lucide-react" ;
99import { useAccount , usePublicClient , useWriteContract } from "wagmi" ;
1010import { ContractClient } from "@/lib/contract-client" ;
11- import { ETH , Token } from "@/types/token" ;
11+ import { Token , getNativeCurrencyToken } from "@/types/token" ;
1212import { SellRequest , SellResult } from "@/types/trades" ;
1313import { RowPool } from "@/types/pool" ;
1414import { formatEther } from "viem" ;
@@ -50,6 +50,7 @@ export function SellForm({
5050 ) ;
5151 const { chain } = useAccount ( ) ;
5252 const baseUrl = chain ?. blockExplorers ?. default . url ;
53+ const nativeCurrencySymbol = chain ?. nativeCurrency ?. symbol || "ETH" ;
5354 const [ ethAmount , setEthAmount ] = useState ( "" ) ;
5455 const [ token , setToken ] = useState < Token | undefined > ( undefined ) ;
5556 const [ tokenAmount , setTokenAmount ] = useState ( "" ) ;
@@ -74,7 +75,7 @@ export function SellForm({
7475 if ( Number ( ethValue ) * 1e18 > Number ( ethInReserve ) * 0.1 ) {
7576 const maxEthAllowed = String ( ( Number ( ethInReserve ) * 0.1 ) / 1e18 ) ;
7677 setValidationError (
77- `Amount exceeds 10% of reserve. Maximum: ${ maxEthAllowed } ETH `
78+ `Amount exceeds 10% of reserve. Maximum: ${ maxEthAllowed } ${ nativeCurrencySymbol } `
7879 ) ;
7980 return "" ;
8081 }
@@ -84,7 +85,7 @@ export function SellForm({
8485 if ( Number ( value ) * 1e18 > Number ( ethInReserve ) * 0.1 ) {
8586 const maxEthAllowed = String ( ( Number ( ethInReserve ) * 0.1 ) / 1e18 ) ;
8687 setValidationError (
87- `Amount exceeds 10% of reserve. Maximum: ${ maxEthAllowed } ETH `
88+ `Amount exceeds 10% of reserve. Maximum: ${ maxEthAllowed } ${ nativeCurrencySymbol } `
8889 ) ;
8990 return "" ;
9091 }
@@ -189,7 +190,7 @@ export function SellForm({
189190 < div className = "w-6 h-6 rounded-full bg-accent/20 flex items-center justify-center" >
190191 < span className = "text-sm font-bold text-accent" > E</ span >
191192 </ div >
192- < span className = "text-base" > ETH </ span >
193+ < span className = "text-base" > { nativeCurrencySymbol } </ span >
193194 </ div >
194195 </ Button >
195196 </ >
@@ -288,7 +289,7 @@ export function SellForm({
288289 < div className = "w-6 h-6 rounded-full bg-accent/20 flex items-center justify-center" >
289290 < span className = "text-sm font-bold text-accent" > E</ span >
290291 </ div >
291- < span className = "text-base" > ETH </ span >
292+ < span className = "text-base" > { nativeCurrencySymbol } </ span >
292293 </ div >
293294 </ Button >
294295 </ >
@@ -302,7 +303,7 @@ export function SellForm({
302303 < span className = "text-white/50 font-medium" > Rate</ span >
303304 < span className = "text-white/80 font-medium" >
304305 1 { token . symbol . toUpperCase ( ) } ={ " " }
305- { Number ( ethAmount ) / Number ( tokenAmount ) } { "ETH" }
306+ { Number ( ethAmount ) / Number ( tokenAmount ) } { nativeCurrencySymbol }
306307 </ span >
307308 </ div >
308309 { /* Slippage Tolerance - Only show in Advanced Mode */ }
@@ -390,7 +391,7 @@ export function SellForm({
390391 onClose = { ( ) => setShowPreview ( false ) }
391392 onConfirm = { handleConfirmSell }
392393 tokenIn = { token ! }
393- tokenOut = { ETH }
394+ tokenOut = { getNativeCurrencyToken ( chain ) }
394395 amountIn = { tokenAmount }
395396 amountOut = { ethAmount }
396397 loading = { isSwapping }
0 commit comments