diff --git a/app/scripts/controllers/swaps/index.ts b/app/scripts/controllers/swaps/index.ts index 9160eb0b66e1..72195960abef 100644 --- a/app/scripts/controllers/swaps/index.ts +++ b/app/scripts/controllers/swaps/index.ts @@ -384,7 +384,7 @@ export default class SwapsController extends BaseController< // For a user to be able to swap a token, they need to have approved the MetaSwap contract to withdraw that token. // _getERC20Allowance() returns the amount of the token they have approved for withdrawal. If that amount is either - // zero or less than the soucreAmount of the swap, a new call of the ERC-20 approve method is required. + // zero or less than the sourceAmount of the swap, a new call of the ERC-20 approve method is required. approvalRequired = firstQuote.approvalNeeded && (allowance.eq(0) || allowance.lt(firstQuote.sourceAmount)) && diff --git a/shared/modules/bridge-utils/bridge.util.ts b/shared/modules/bridge-utils/bridge.util.ts index 58d844b2245a..c340790d779e 100644 --- a/shared/modules/bridge-utils/bridge.util.ts +++ b/shared/modules/bridge-utils/bridge.util.ts @@ -36,6 +36,10 @@ import { type TokenV3Asset, FeeType, } from '../../types/bridge'; +///: BEGIN:ONLY_INCLUDE_IF(solana-swaps) +import { MultichainNetworks } from '../../constants/multichain/networks'; +///: END:ONLY_INCLUDE_IF + import { formatAddressToString, formatChainIdToDec, @@ -174,6 +178,15 @@ export async function fetchBridgeQuotes( request: GenericQuoteRequest, signal: AbortSignal, ): Promise { + // Ignore slippage for solana swaps + let ignoreSlippage = false; + + ///: BEGIN:ONLY_INCLUDE_IF(solana-swaps) + ignoreSlippage = + request.srcChainId === request.destChainId && + request.destChainId === MultichainNetworks.SOLANA; + ///: END:ONLY_INCLUDE_IF + const normalizedRequest = { walletAddress: formatAddressToString(request.walletAddress), destWalletAddress: formatAddressToString( @@ -184,7 +197,7 @@ export async function fetchBridgeQuotes( srcTokenAddress: formatAddressToString(request.srcTokenAddress), destTokenAddress: formatAddressToString(request.destTokenAddress), srcTokenAmount: request.srcTokenAmount, - slippage: request.slippage.toString(), + ...(ignoreSlippage ? {} : { slippage: request.slippage.toString() }), insufficientBal: request.insufficientBal ? 'true' : 'false', resetApproval: request.resetApproval ? 'true' : 'false', }; diff --git a/ui/ducks/swaps/swaps.js b/ui/ducks/swaps/swaps.js index e79a6f54df47..668f09813adb 100644 --- a/ui/ducks/swaps/swaps.js +++ b/ui/ducks/swaps/swaps.js @@ -836,7 +836,7 @@ export const fetchQuotesAndSetQuoteState = ( ); // Firefox and Chrome have different implementations of the APIs - // that we rely on for communication accross the app. On Chrome big + // that we rely on for communication across the app. On Chrome big // numbers are converted into number strings, on firefox they remain // Big Number objects. As such, we convert them here for both // browsers.