This commit is contained in:
tim
2025-01-16 20:17:03 -04:00
parent 19a8ffbbd4
commit 0545cd6e97
51 changed files with 482 additions and 436 deletions

View File

@@ -3,7 +3,7 @@ import {useStore} from "@/store/store.js";
import {flushOrders} from "@/blockchain/wallet.js";
import {parseElaboratedOrderStatus} from "@/blockchain/orderlib.js";
import { DataFeed } from "./charts/datafeed";
import {notify, notifyFillEvent} from "@/notify.js";
import {notifyFillEvent} from "@/notify.js";
export const socket = io(import.meta.env.VITE_WS_URL || undefined, {transports: ["websocket"]})
@@ -105,7 +105,7 @@ socket.on( 'of', (chainId, vault, orderIndex, filled)=>{
}
const status = s.orders[vault][orderIndex]
// console.log('apply fills', status, filled)
console.log('apply fills', status, filled)
let orderIn = 0n
let orderOut = 0n
@@ -123,7 +123,7 @@ socket.on( 'of', (chainId, vault, orderIndex, filled)=>{
fee = BigInt(fee)
filledIn += fi
filledOut += fo
if (i<=numOld) {
if (i>=numOld) {
// new fill detected
const f = {tx, time, filledIn: fi, filledOut: fo, fee, filled: status.order.amountIsInput ? fi : fo};
console.log('new fill', f)
@@ -141,5 +141,5 @@ socket.on( 'of', (chainId, vault, orderIndex, filled)=>{
status.filledOut = orderOut
status.filled = status.order.amountIsInput ? orderIn : orderOut
// console.log('apply fills completed', status)
console.log('apply fills completed', status)
})