serum-vial
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -194,9 +194,2 @@ "use strict"; | ||
const request = validationResult.request; | ||
const confirmationMessage = { | ||
type: request.op == 'subscribe' ? 'subscribed' : 'unsubscribed', | ||
channel: request.channel, | ||
markets: request.markets, | ||
timestamp: new Date().toISOString() | ||
}; | ||
await this._send(ws, () => JSON.stringify(confirmationMessage)); | ||
// 'unpack' channel to specific message types that will be published for it | ||
@@ -232,3 +225,10 @@ const requestedTypes = consts_1.MESSAGE_TYPES_PER_CHANNEL[request.channel]; | ||
} | ||
ws.subscribe(topic); | ||
const succeeded = ws.subscribe(topic); | ||
if (!succeeded) { | ||
logger_1.logger.log('info', `Subscribe failure`, { | ||
status, | ||
topic, | ||
bufferedAmount: ws.getBufferedAmount() | ||
}); | ||
} | ||
} | ||
@@ -240,2 +240,9 @@ else { | ||
} | ||
const confirmationMessage = { | ||
type: request.op == 'subscribe' ? 'subscribed' : 'unsubscribed', | ||
channel: request.channel, | ||
markets: request.markets, | ||
timestamp: new Date().toISOString() | ||
}; | ||
await this._send(ws, () => JSON.stringify(confirmationMessage)); | ||
logger_1.logger.log('debug', request.op == 'subscribe' ? 'Subscribe successfully' : 'Unsubscribed successfully', { | ||
@@ -272,3 +279,2 @@ successMessage: confirmationMessage, | ||
status, | ||
message, | ||
bufferedAmount: ws.getBufferedAmount() | ||
@@ -275,0 +281,0 @@ }); |
{ | ||
"name": "serum-vial", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=15" |
@@ -250,11 +250,2 @@ import { getLayoutVersion, Market } from '@project-serum/serum' | ||
const confirmationMessage: SuccessResponse = { | ||
type: request.op == 'subscribe' ? 'subscribed' : 'unsubscribed', | ||
channel: request.channel, | ||
markets: request.markets, | ||
timestamp: new Date().toISOString() | ||
} | ||
await this._send(ws, () => JSON.stringify(confirmationMessage)) | ||
// 'unpack' channel to specific message types that will be published for it | ||
@@ -295,3 +286,10 @@ const requestedTypes = MESSAGE_TYPES_PER_CHANNEL[request.channel] | ||
ws.subscribe(topic) | ||
const succeeded = ws.subscribe(topic) | ||
if (!succeeded) { | ||
logger.log('info', `Subscribe failure`, { | ||
status, | ||
topic, | ||
bufferedAmount: ws.getBufferedAmount() | ||
}) | ||
} | ||
} else { | ||
@@ -302,3 +300,11 @@ ws.unsubscribe(topic) | ||
} | ||
const confirmationMessage: SuccessResponse = { | ||
type: request.op == 'subscribe' ? 'subscribed' : 'unsubscribed', | ||
channel: request.channel, | ||
markets: request.markets, | ||
timestamp: new Date().toISOString() | ||
} | ||
await this._send(ws, () => JSON.stringify(confirmationMessage)) | ||
logger.log('debug', request.op == 'subscribe' ? 'Subscribe successfully' : 'Unsubscribed successfully', { | ||
@@ -337,3 +343,2 @@ successMessage: confirmationMessage, | ||
status, | ||
message, | ||
bufferedAmount: ws.getBufferedAmount() | ||
@@ -340,0 +345,0 @@ }) |
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
275518
4033