serum-vial
Advanced tools
Comparing version 1.3.7 to 1.3.8
@@ -58,18 +58,27 @@ "use strict"; | ||
if (hasMatchingOpenOrder === false) { | ||
const openMessage = { | ||
type: 'open', | ||
market: this._options.symbol, | ||
timestamp, | ||
slot, | ||
version: this._version, | ||
orderId: makerFill.orderId, | ||
clientId: makerFill.clientId, | ||
side: makerFill.side, | ||
price: makerFill.price, | ||
size: makerFill.size, | ||
account: makerFill.account, | ||
accountSlot: makerFill.accountSlot, | ||
feeTier: makerFill.feeTier | ||
}; | ||
l3Diff.push(openMessage); | ||
const matchingOpenOrder = l3Diff.find((l) => l.orderId === makerFill.orderId && l.type === 'open'); | ||
if (matchingOpenOrder !== undefined) { | ||
// check if we've already added an open order to the l3Diff as single maker order that was | ||
// matched in the same slot could be matched by multiple fills | ||
; | ||
matchingOpenOrder.size = (Number(makerFill.size) + Number(matchingOpenOrder.size)).toFixed(this._options.sizeDecimalPlaces); | ||
} | ||
else { | ||
const openMessage = { | ||
type: 'open', | ||
market: this._options.symbol, | ||
timestamp, | ||
slot, | ||
version: this._version, | ||
orderId: makerFill.orderId, | ||
clientId: makerFill.clientId, | ||
side: makerFill.side, | ||
price: makerFill.price, | ||
size: makerFill.size, | ||
account: makerFill.account, | ||
accountSlot: makerFill.accountSlot, | ||
feeTier: makerFill.feeTier | ||
}; | ||
l3Diff.push(openMessage); | ||
} | ||
} | ||
@@ -76,0 +85,0 @@ } |
{ | ||
"name": "serum-vial", | ||
"version": "1.3.7", | ||
"version": "1.3.8", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=15" |
@@ -115,19 +115,29 @@ import { EVENT_QUEUE_LAYOUT, Market, Orderbook, getLayoutVersion } from '@project-serum/serum' | ||
if (hasMatchingOpenOrder === false) { | ||
const openMessage: Open = { | ||
type: 'open', | ||
market: this._options.symbol, | ||
timestamp, | ||
slot, | ||
version: this._version, | ||
orderId: makerFill.orderId, | ||
clientId: makerFill.clientId, | ||
side: makerFill.side, | ||
price: makerFill.price, | ||
size: makerFill.size, | ||
account: makerFill.account, | ||
accountSlot: makerFill.accountSlot, | ||
feeTier: makerFill.feeTier | ||
const matchingOpenOrder = l3Diff.find((l) => l.orderId === makerFill.orderId && l.type === 'open') | ||
if (matchingOpenOrder !== undefined) { | ||
// check if we've already added an open order to the l3Diff as single maker order that was | ||
// matched in the same slot could be matched by multiple fills | ||
;(matchingOpenOrder as any).size = ( | ||
Number(makerFill.size) + Number((matchingOpenOrder as any).size) | ||
).toFixed(this._options.sizeDecimalPlaces) | ||
} else { | ||
const openMessage: Open = { | ||
type: 'open', | ||
market: this._options.symbol, | ||
timestamp, | ||
slot, | ||
version: this._version, | ||
orderId: makerFill.orderId, | ||
clientId: makerFill.clientId, | ||
side: makerFill.side, | ||
price: makerFill.price, | ||
size: makerFill.size, | ||
account: makerFill.account, | ||
accountSlot: makerFill.accountSlot, | ||
feeTier: makerFill.feeTier | ||
} | ||
l3Diff.push(openMessage) | ||
} | ||
l3Diff.push(openMessage) | ||
} | ||
@@ -134,0 +144,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
306089
4530