websocket testnet url fix

This commit is contained in:
Dmitry Martynenko 2021-12-16 13:58:23 +02:00 committed by softsimon
parent b5a8a5dc24
commit ce56c1b03b
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 3 additions and 3 deletions

View File

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

View File

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