SwapOrderStatus.startTime

This commit is contained in:
tim
2024-07-22 13:48:43 -04:00
parent 78a6671fdf
commit 9c17377b62
2 changed files with 8 additions and 7 deletions

View File

@@ -123,7 +123,8 @@ export function parseOrderStatus(chainId, status) {
order, order,
fillFeeHalfBps, fillFeeHalfBps,
state, state,
start, startTime,
startPrice,
ocoGroup, ocoGroup,
filledIn, filledIn,
filledOut, filledOut,
@@ -138,7 +139,7 @@ export function parseOrderStatus(chainId, status) {
trancheFilledOut = trancheFilledOut.map((f)=>BigInt(f)) trancheFilledOut = trancheFilledOut.map((f)=>BigInt(f))
trancheActivationTime = trancheActivationTime.map((v)=>Number(v)) trancheActivationTime = trancheActivationTime.map((v)=>Number(v))
return { return {
chainId, order, fillFeeHalfBps, state, start, ocoGroup, chainId, order, fillFeeHalfBps, state, startTime, startPrice, ocoGroup,
filledIn, filledOut, trancheFilledIn, trancheFilledOut, trancheActivationTime filledIn, filledOut, trancheFilledIn, trancheFilledOut, trancheActivationTime
} }
} }

View File

@@ -2,7 +2,7 @@
<div> <div>
<v-data-table :headers="datatableHeaders" :items="orders" item-value="id" <v-data-table :headers="datatableHeaders" :items="orders" item-value="id"
item-selectable="selectable" :show-select="false" :show-expand="true"> item-selectable="selectable" :show-select="false" :show-expand="true">
<template v-slot:item.start="{ value }">{{ timestampString(value) }}</template> <template v-slot:item.startTime="{ value }">{{ timestampString(value) }}</template>
<template v-slot:item.input="{ item }"> <template v-slot:item.input="{ item }">
<span v-if="item.order.amountIsInput"> <span v-if="item.order.amountIsInput">
<span v-if="item.state > OrderState.Signing"> <span v-if="item.state > OrderState.Signing">
@@ -223,7 +223,7 @@ const orders = computed(()=>{
result.push({ result.push({
chainId: pend.chainId, chainId: pend.chainId,
id: pend.id, id: pend.id,
start: pend.placementTime, startTime: pend.placementTime,
order: pend.order, order: pend.order,
filled: 0, filled: 0,
state: pend.state, state: pend.state,
@@ -270,7 +270,7 @@ const orders = computed(()=>{
st.token1 = o.tokenIn < o.tokenOut ? o.tokenOut : o.tokenIn st.token1 = o.tokenIn < o.tokenOut ? o.tokenOut : o.tokenIn
} }
} }
result.sort((a,b)=>b.start-a.start) result.sort((a,b)=>b.startTime-a.startTime)
console.log('orders', result) console.log('orders', result)
return result return result
}) })
@@ -280,12 +280,12 @@ function describeTrancheTime(st, isStart, t) {
if( t.minIsBarrier || t.maxIsBarrier ) if( t.minIsBarrier || t.maxIsBarrier )
return 'barrier' return 'barrier'
if( isStart && t.startTime > 0 ) { if( isStart && t.startTime > 0 ) {
const started = t.startTimeIsRelative ? st.start + t.startTime : t.startTime const started = t.startTimeIsRelative ? st.startTime + t.startTime : t.startTime
result += started*1000 < Date.now() ? 'Activated ' : 'Activates ' result += started*1000 < Date.now() ? 'Activated ' : 'Activates '
result += timestampString(started) + ' ' result += timestampString(started) + ' '
} }
if( !isStart && t.endTime < 4294967295 ) { if( !isStart && t.endTime < 4294967295 ) {
const ended = t.endTimeIsRelative ? st.start + t.endTime : t.endTime const ended = t.endTimeIsRelative ? st.startTime + t.endTime : t.endTime
result += ended*1000 < Date.now() ? 'Ended ' : 'Ending ' result += ended*1000 < Date.now() ? 'Ended ' : 'Ending '
result += timestampString(ended) result += timestampString(ended)
} }