serum-vial
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -232,4 +232,12 @@ "use strict"; | ||
if (message.type === 'fill' && message.maker === false) { | ||
// this is rather fragile way of finding matching fill, can it be done better? | ||
const matchingMakerFill = l3Diff.find((m) => m.type === 'fill' && m.maker === true && m.size === message.size); | ||
let matchingMakerFill; | ||
for (let j = i - 1; j >= 0; j--) { | ||
const potentialFillMessage = l3Diff[j]; | ||
if (potentialFillMessage.type === 'fill' && | ||
potentialFillMessage.maker === true && | ||
potentialFillMessage.size === message.size) { | ||
matchingMakerFill = potentialFillMessage; | ||
break; | ||
} | ||
} | ||
const makerFillOrderId = matchingMakerFill !== undefined ? matchingMakerFill.orderId : undefined; | ||
@@ -236,0 +244,0 @@ const makerFillAccount = matchingMakerFill !== undefined ? matchingMakerFill.account : undefined; |
{ | ||
"name": "serum-vial", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=15" |
@@ -334,8 +334,17 @@ import { EVENT_QUEUE_LAYOUT, Market, Orderbook, getLayoutVersion } from '@project-serum/serum' | ||
if (message.type === 'fill' && message.maker === false) { | ||
// this is rather fragile way of finding matching fill, can it be done better? | ||
let matchingMakerFill | ||
const matchingMakerFill = l3Diff.find( | ||
(m) => m.type === 'fill' && m.maker === true && m.size === message.size | ||
) as Fill | undefined | ||
for (let j = i - 1; j >= 0; j--) { | ||
const potentialFillMessage = l3Diff[j]! | ||
if ( | ||
potentialFillMessage.type === 'fill' && | ||
potentialFillMessage.maker === true && | ||
potentialFillMessage.size === message.size | ||
) { | ||
matchingMakerFill = potentialFillMessage | ||
break | ||
} | ||
} | ||
const makerFillOrderId = matchingMakerFill !== undefined ? matchingMakerFill.orderId : undefined | ||
@@ -342,0 +351,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
306267
4520