@master-chief/alpaca
Advanced tools
Comparing version 6.2.1 to 6.2.2
# Changelog | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
All notable changes to this project will be documented in this file. See | ||
[standard-version](https://github.com/conventional-changelog/standard-version) | ||
for commit guidelines. | ||
### [6.2.2](https://github.com/117/alpaca/compare/v6.2.1...v6.2.2) (2021-05-21) | ||
- Fixed `AlpacaStream` issue [#71](https://github.com/117/alpaca/issues/71) | ||
### [6.2.1](https://github.com/117/alpaca/compare/v6.2.0...v6.2.1) (2021-05-18) | ||
@@ -6,0 +12,0 @@ |
{ | ||
"name": "@master-chief/alpaca", | ||
"version": "6.2.1", | ||
"version": "6.2.2", | ||
"description": "A TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams.", | ||
@@ -5,0 +5,0 @@ "author": "117", |
@@ -107,7 +107,13 @@ import WebSocket from 'isomorphic-ws' | ||
this.connection.onmessage = (event: any) => { | ||
let parsed = JSON.parse(event.data), | ||
messages: any[] = this.params.type == 'account' ? [parsed] : parsed | ||
this.connection.onmessage = async (event: any) => { | ||
let data = event.data | ||
messages.forEach((message) => { | ||
if (data instanceof Blob) { | ||
data = await event.data.text() | ||
} | ||
let parsed = JSON.parse(data), | ||
messages = this.params.type == 'account' ? [parsed] : parsed | ||
messages.forEach((message: any) => { | ||
// pass the message | ||
@@ -114,0 +120,0 @@ this.emit('message', message) |
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
2401183
25210