import { CurrencyAmount , ETHER , JSBI } from '@pancakeswap-libs/sdk' ; import { MIN_ETH } from '../constants' ; param currencyAmount export function maxAmountSpend ( currencyAmount ? ) { if ( ! currencyAmount ) return undefined ; if ( currencyAmount . currency === ETHER ) { if ( JSBI . greaterThan ( currencyAmount . raw , MIN_ETH ) ) { return CurrencyAmount . ether ( JSBI . subtract ( currencyAmount . raw , MIN_ETH ) ) ; } return CurrencyAmount . ether ( JSBI . BigInt ( 0 ) ) ; } return currencyAmount ; } export default maxAmountSpend ;