From 63c7f7b7e7bde14efca8589a196975254dd88472 Mon Sep 17 00:00:00 2001 From: Apotheosis <97164662+0xApotheosis@users.noreply.github.com> Date: Tue, 12 Dec 2023 11:32:44 +1100 Subject: [PATCH] feat: enable lifi cross-account trades --- .../swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts | 3 --- src/state/helpers.ts | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/swapper/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts b/src/lib/swapper/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts index 1ddad399b1b..a5cda27948e 100644 --- a/src/lib/swapper/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts +++ b/src/lib/swapper/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts @@ -72,9 +72,6 @@ export async function getTradeQuote( toChainId: Number(fromChainId(buyAsset.chainId).chainReference), fromTokenAddress: getLifiEvmAssetAddress(sellAsset), toTokenAddress: getLifiEvmAssetAddress(buyAsset), - // HACK: use the receive address as the send address - // lifi's exchanges may use this to check allowance on their side - // this swapper is not cross-account so this works fromAddress: sendAddress, toAddress: receiveAddress, fromAmount: sellAmountIncludingProtocolFeesCryptoBaseUnit, diff --git a/src/state/helpers.ts b/src/state/helpers.ts index 58b64755f12..09971cefd84 100644 --- a/src/state/helpers.ts +++ b/src/state/helpers.ts @@ -5,11 +5,8 @@ import { assertUnreachable } from '../lib/utils' export const isCrossAccountTradeSupported = (swapperName: SwapperName) => { switch (swapperName) { case SwapperName.Thorchain: - return true - // NOTE: Before enabling cross-account for LIFI and OneInch - we must pass the sending address - // to the swappers up so allowance checks work. They're currently using the receive address - // assuming it's the same address as the sending address. case SwapperName.LIFI: + return true case SwapperName.OneInch: case SwapperName.Zrx: case SwapperName.CowSwap: