From e20c0ceaa2529d8961c019ac67ecfce2c5bea19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CF=87=C2=B2?= <88190723+ChiTimesChi@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:01:30 +0000 Subject: [PATCH] fix(synapse-interface): remove RFQ output amount check (#3491) --- .../StateManagedBridge/BridgeTransactionButton.tsx | 11 ----------- .../StateManagedBridge/hooks/useBridgeValidations.ts | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx b/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx index d1621313a4..e5837338c0 100644 --- a/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx +++ b/packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx @@ -72,7 +72,6 @@ export const BridgeTransactionButton = ({ hasSufficientBalance, doesBridgeStateMatchQuote, isBridgeFeeGreaterThanInput, - isBridgeQuoteAmountGreaterThanInputForRfq, onSelectedChain, } = useBridgeValidations() @@ -83,7 +82,6 @@ export const BridgeTransactionButton = ({ isWalletPending || !hasValidInput || !doesBridgeStateMatchQuote || - isBridgeQuoteAmountGreaterThanInputForRfq || (isConnected && !hasValidQuote) || (isConnected && !hasSufficientBalance) || (isConnected && isQuoteStale) || @@ -175,15 +173,6 @@ export const BridgeTransactionButton = ({ destinationTokenAddressForState: toToken.addresses[toChainId], bridgeQuote, }) - } else if ( - !isLoading && - isBridgeQuoteAmountGreaterThanInputForRfq && - hasValidInput - ) { - buttonProperties = { - label: t('Invalid bridge quote'), - onClick: null, - } } else if (destinationAddress && !isAddress(destinationAddress)) { buttonProperties = { label: t('Invalid Destination address'), diff --git a/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeValidations.ts b/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeValidations.ts index 58084cf65b..1dabc31e4d 100644 --- a/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeValidations.ts +++ b/packages/synapse-interface/components/StateManagedBridge/hooks/useBridgeValidations.ts @@ -76,17 +76,6 @@ export const useBridgeValidations = () => { return stringifiedBridgeQuote === stringifiedBridgeState }, [stringifiedBridgeQuote, stringifiedBridgeState]) - const isBridgeQuoteAmountGreaterThanInputForRfq = useMemo(() => { - return ( - bridgeQuote.bridgeModuleName === 'SynapseRFQ' && - bridgeQuote.outputAmount > debouncedFromValueBigInt - ) - }, [ - bridgeQuote.outputAmount, - bridgeQuote.bridgeModuleName, - debouncedFromValueBigInt, - ]) - const isBridgeFeeGreaterThanInput = useMemo(() => { return ( bridgeQuote.bridgeModuleName !== null && @@ -107,7 +96,6 @@ export const useBridgeValidations = () => { hasSufficientBalance, doesBridgeStateMatchQuote, isBridgeFeeGreaterThanInput, - isBridgeQuoteAmountGreaterThanInputForRfq, onSelectedChain, } }