alpaca-ts
alpaca-ts copied to clipboard
fix error message type for WebSocket events
I noticed that the error object looks as follows:
{
"code": 406,
"msg": "connection limit exceeded",
"T": "error"
}
My test code:
import {AlpacaStream, Message} from '@master-chief/alpaca';
const connection = new AlpacaStream({
credentials: {
key: options.apiKey,
paper: options.usePaperTrading,
secret: options.apiSecret,
},
source: 'iex',
type: "market_data",
});
connection.once("error", (error: Message) => {
console.log(error);
});