Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serum-vial

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serum-vial - npm Package Compare versions

Comparing version 1.3.7 to 1.3.8

41

dist/data_mapper.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc