fix(v1 swap): exact out swaps not working
This commit is contained in:
parent
e78b6d61f2
commit
6a311aa6d7
@ -123,14 +123,16 @@ export function useV1Trade(
|
||||
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
|
||||
try {
|
||||
v1Trade =
|
||||
route && exactAmount
|
||||
? new Trade(route, exactAmount, isExactIn ? TradeType.EXACT_INPUT : TradeType.EXACT_OUTPUT)
|
||||
: undefined
|
||||
} catch {}
|
||||
} catch (error) {
|
||||
console.error('Failed to create V1 trade', error)
|
||||
}
|
||||
return v1Trade
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user