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),