order display bugfix
This commit is contained in:
@@ -70,6 +70,8 @@ function tokenAmount(tokenAddr, amount) {
|
||||
const t = token(tokenAddr)
|
||||
if( !t )
|
||||
return ''
|
||||
console.log('tokenAmount amount', typeof amount, amount)
|
||||
console.log('tokenAmount decimals', typeof t.decimals, t.decimals)
|
||||
const amt = FixedNumber.fromValue(amount, t.decimals, {width:256, decimals:t.decimals, signed:false})
|
||||
return `${amt} ${t.symbol}`
|
||||
}
|
||||
@@ -124,18 +126,18 @@ const orders = computed(()=>{
|
||||
// }
|
||||
if( vaultAddr.value in s.orders ) {
|
||||
for (const [index, status] of Object.entries(s.orders[vaultAddr.value]).reverse()) {
|
||||
console.log('order status', status)
|
||||
// console.log('order status', status)
|
||||
// [index, symbolA, symbolB, amount, amountSymbol, filled]
|
||||
const inTokenAddr = status[0][0]
|
||||
const outTokenAddr = status[0][1]
|
||||
const amountIsInput = !!(status[0][4])
|
||||
const amountTokenAddr = amountIsInput ? inTokenAddr : outTokenAddr
|
||||
console.log('getamount', status[0][3])
|
||||
const amount = status[0][3]
|
||||
console.log('amount', amount)
|
||||
console.log('getfilled', amountIsInput ? status[4] : status[5])
|
||||
const filled = amountIsInput ? status[4] : status[5]
|
||||
console.log('filled', filled)
|
||||
// console.log('getamount', status[0][3])
|
||||
const amount = BigInt(status[0][3])
|
||||
// console.log('amount', amount)
|
||||
// console.log('getfilled', amountIsInput ? status[4] : status[5])
|
||||
const filled = BigInt(amountIsInput ? status[4] : status[5])
|
||||
// console.log('filled', filled)
|
||||
const amountIn = BigInt(status[4])
|
||||
const amountOut = BigInt(status[5])
|
||||
const fmtX18 = {decimals: 18, width: 256, signed: false};
|
||||
@@ -145,7 +147,7 @@ const orders = computed(()=>{
|
||||
result.push([index, inTokenAddr, outTokenAddr, amount, amountTokenAddr, filled, avg, state])
|
||||
}
|
||||
}
|
||||
console.log('result', result)
|
||||
// console.log('result', result)
|
||||
return result
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user