binance-connector-typescript icon indicating copy to clipboard operation
binance-connector-typescript copied to clipboard

Multiple subscriptions do not work with more than 2 subscriptions

Open abanchev opened this issue 9 months ago • 1 comments

https://github.com/binance/binance-connector-typescript/blob/8d3267389f9cff96863dac09bbee77514ea153ed/src/websocketStream.ts#L23

string.replace replaces only the first occurence of a symbol, so sub1,sub2,sub3,sub4 will incorrectly be changed to sub1/sub2,sub3,sub4

Better alternative is

 if (Array.isArray(stream)) stream = stream.join("/");

abanchev avatar May 05 '24 10:05 abanchev

I submitted a new pull request for this in https://github.com/binance/binance-connector-typescript/pull/26

josbert-m avatar May 05 '24 19:05 josbert-m