order placement doesnt crash
This commit is contained in:
@@ -159,7 +159,7 @@ async function findRoute() {
|
||||
}
|
||||
catch (e) {
|
||||
routes.value = []
|
||||
// console.log('routes exception', e)
|
||||
console.log('routes exception', e)
|
||||
return
|
||||
}
|
||||
// todo expose all available pools
|
||||
@@ -178,6 +178,7 @@ async function findRoute() {
|
||||
}
|
||||
}
|
||||
routes.value = [result]
|
||||
console.log('found route', result)
|
||||
}
|
||||
|
||||
const routeFinder = new SingletonCoroutine(findRoute,10)
|
||||
@@ -245,7 +246,7 @@ async function placeOrder() {
|
||||
const route = routes.value[0];
|
||||
const amountToken = amountIsTokenA ? ta : tb
|
||||
const amt = FixedNumber.fromString(amount.value.toString(), {decimals: amountToken.decimals}).value
|
||||
const amountIsInput = !buy.value ^ amountIsTokenA.value
|
||||
const amountIsInput = amountIsTokenA.value === buy.value
|
||||
|
||||
// build tranches
|
||||
const n = tranches.value // num tranches
|
||||
|
||||
Reference in New Issue
Block a user