Skip to content

Commit 36dbc36

Browse files
authored
[DVX-919] support exchanges for Business futures websockets — v8.2.0 alpha (#240)
* support optional exchange (for futures business connections) * 8.2.0-alpha.0
1 parent a1c9373 commit 36dbc36

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polygon.io/client-js",
3-
"version": "8.1.0",
3+
"version": "8.2.0-alpha.0",
44
"description": "Isomorphic Javascript client for Polygon.io Stocks, Forex, and Crypto APIs",
55
"main": "dist/main.js",
66
"types": "dist/main.d.ts",

src/websockets/futures/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ export interface IQuoteFuturesEvent {
4141

4242
export const getFuturesWebsocket = (
4343
apiKey: string,
44-
apiBase = "wss://socket.polygon.io"
45-
): websocket.w3cwebsocket => getWsClient(`${apiBase}/futures`, apiKey);
44+
apiBase = "wss://socket.polygon.io",
45+
exchange?: string
46+
): websocket.w3cwebsocket => getWsClient(`${apiBase}/futures${exchange ? `/${exchange}` : ""}`, apiKey);

src/websockets/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ export interface IWebsocketClient {
2424

2525
export const websocketClient = (
2626
apiKey: string,
27-
apiBase?: string
27+
apiBase?: string,
28+
exchange?: string
2829
): IWebsocketClient => ({
2930
crypto: () => getCryptoWebsocket(apiKey, apiBase),
3031
forex: () => getForexWebsocket(apiKey, apiBase),
3132
indices: () => getIndicesWebsocket(apiKey, apiBase),
3233
options: () => getOptionsWebsocket(apiKey, apiBase),
3334
stocks: () => getStocksWebsocket(apiKey, apiBase),
34-
futures: () => getFuturesWebsocket(apiKey, apiBase),
35+
futures: () => getFuturesWebsocket(apiKey, apiBase, exchange),
3536
});
3637

3738
export default websocketClient;

0 commit comments

Comments
 (0)