From 665a09943be82d05df493321dc871f2d570028e9 Mon Sep 17 00:00:00 2001 From: sandro Date: Fri, 8 Sep 2023 10:20:32 +0800 Subject: [PATCH 1/3] add missing value --- src/hooks/swap/useSendSwapTransaction.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hooks/swap/useSendSwapTransaction.tsx b/src/hooks/swap/useSendSwapTransaction.tsx index 2de1b65a1..28dfeeeea 100644 --- a/src/hooks/swap/useSendSwapTransaction.tsx +++ b/src/hooks/swap/useSendSwapTransaction.tsx @@ -36,6 +36,7 @@ export default function useSendSwapTransaction( callback: async function onSwap(): Promise { const approveTx = await approve({ chainId: trade.fromToken.chainId as ChainId, + toChainId: trade.toToken.wrapped.chainId, fromToken: trade.fromToken.wrapped.address, toToken: trade.fromToken.wrapped.address, amount: trade.inputAmount.quotient.toString(), From f81920c2555143cda156c0308a811b845f625270 Mon Sep 17 00:00:00 2001 From: sandro Date: Fri, 8 Sep 2023 11:18:24 +0800 Subject: [PATCH 2/3] use unwrapped address --- src/hooks/swap/useSendSwapTransaction.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/swap/useSendSwapTransaction.tsx b/src/hooks/swap/useSendSwapTransaction.tsx index 28dfeeeea..ca400969f 100644 --- a/src/hooks/swap/useSendSwapTransaction.tsx +++ b/src/hooks/swap/useSendSwapTransaction.tsx @@ -36,7 +36,7 @@ export default function useSendSwapTransaction( callback: async function onSwap(): Promise { const approveTx = await approve({ chainId: trade.fromToken.chainId as ChainId, - toChainId: trade.toToken.wrapped.chainId, + toChainId: trade.toToken.chainId, fromToken: trade.fromToken.wrapped.address, toToken: trade.fromToken.wrapped.address, amount: trade.inputAmount.quotient.toString(), From 74ce7514bb2da66a1d136fac3ecf34fb9b27a007 Mon Sep 17 00:00:00 2001 From: sandro Date: Fri, 8 Sep 2023 11:50:07 +0800 Subject: [PATCH 3/3] fix: use correct token --- src/hooks/swap/useSendSwapTransaction.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/swap/useSendSwapTransaction.tsx b/src/hooks/swap/useSendSwapTransaction.tsx index ca400969f..32a4ad9fb 100644 --- a/src/hooks/swap/useSendSwapTransaction.tsx +++ b/src/hooks/swap/useSendSwapTransaction.tsx @@ -38,7 +38,7 @@ export default function useSendSwapTransaction( chainId: trade.fromToken.chainId as ChainId, toChainId: trade.toToken.chainId, fromToken: trade.fromToken.wrapped.address, - toToken: trade.fromToken.wrapped.address, + toToken: trade.toToken.wrapped.address, amount: trade.inputAmount.quotient.toString(), })