Skip to content

Commit

Permalink
fix(synapse-interface): remove RFQ output amount check (#3491)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi authored Jan 16, 2025
1 parent 3d2adea commit e20c0ce
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const BridgeTransactionButton = ({
hasSufficientBalance,
doesBridgeStateMatchQuote,
isBridgeFeeGreaterThanInput,
isBridgeQuoteAmountGreaterThanInputForRfq,
onSelectedChain,
} = useBridgeValidations()

Expand All @@ -83,7 +82,6 @@ export const BridgeTransactionButton = ({
isWalletPending ||
!hasValidInput ||
!doesBridgeStateMatchQuote ||
isBridgeQuoteAmountGreaterThanInputForRfq ||
(isConnected && !hasValidQuote) ||
(isConnected && !hasSufficientBalance) ||
(isConnected && isQuoteStale) ||
Expand Down Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -107,7 +96,6 @@ export const useBridgeValidations = () => {
hasSufficientBalance,
doesBridgeStateMatchQuote,
isBridgeFeeGreaterThanInput,
isBridgeQuoteAmountGreaterThanInputForRfq,
onSelectedChain,
}
}
Expand Down

0 comments on commit e20c0ce

Please sign in to comment.