From ce56c1b03b62a06271a9e40a6463a8e023843cce Mon Sep 17 00:00:00 2001 From: Dmitry Martynenko Date: Thu, 16 Dec 2021 13:58:23 +0200 Subject: [PATCH] websocket testnet url fix --- src/app/bitcoin/websocket.ts | 4 ++-- src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/bitcoin/websocket.ts b/src/app/bitcoin/websocket.ts index 4326dfbf5..702971873 100644 --- a/src/app/bitcoin/websocket.ts +++ b/src/app/bitcoin/websocket.ts @@ -2,9 +2,9 @@ import { WsInterface, WsInstance } from '../../interfaces/bitcoin/websockets'; import wsClient from '../../services/ws/client'; import wsServer from '../../services/ws/server'; -export const useWebsocket = (hostname: string): WsInstance => { +export const useWebsocket = (hostname: string, network: string): WsInstance => { - const wsEndpoint = `wss://${hostname}/api/v1/ws`; + const wsEndpoint = `wss://${hostname}${network === 'main' ? '' : `/${network}`}/api/v1/ws`; return { initClient: ({ options }: WsInterface) => wsClient(options, wsEndpoint), diff --git a/src/index.ts b/src/index.ts index 0b8b80fc5..39d950bd9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -52,7 +52,7 @@ const mempool = ( fees: useFees(apiBitcoin), mempool: useMempool(apiBitcoin), transactions: useTransactions(apiBitcoin), - websocket: useWebsocket(hostname), + websocket: useWebsocket(hostname, network), }, bisq: { statistics: useStatisticsBisq(apiBisq),