Commit 6a311aa6 authored by Moody Salem's avatar Moody Salem

fix(v1 swap): exact out swaps not working

parent e78b6d61
...@@ -123,14 +123,16 @@ export function useV1Trade( ...@@ -123,14 +123,16 @@ export function useV1Trade(
pairs = [inputPair, outputPair] pairs = [inputPair, outputPair]
} }
const route = inputCurrency && pairs && pairs.length > 0 && new Route(pairs, inputCurrency) const route = inputCurrency && pairs && pairs.length > 0 && new Route(pairs, inputCurrency, outputCurrency)
let v1Trade: Trade | undefined let v1Trade: Trade | undefined
try { try {
v1Trade = v1Trade =
route && exactAmount route && exactAmount
? new Trade(route, exactAmount, isExactIn ? TradeType.EXACT_INPUT : TradeType.EXACT_OUTPUT) ? new Trade(route, exactAmount, isExactIn ? TradeType.EXACT_INPUT : TradeType.EXACT_OUTPUT)
: undefined : undefined
} catch {} } catch (error) {
console.error('Failed to create V1 trade', error)
}
return v1Trade return v1Trade
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment