Gaëtan Renaudeau
6 years ago
2 changed files with 8 additions and 28 deletions
@ -1,10 +1,18 @@ |
|||
// @flow
|
|||
import WebSocket from 'ws' |
|||
import { setNetwork, setWebSocketImplementation } from '@ledgerhq/live-common/lib/network' |
|||
import { logs as websocketLogs } from '@ledgerhq/live-common/lib/api/socket' |
|||
import { setEnv } from '@ledgerhq/live-common/lib/env' |
|||
import network from 'api/network' |
|||
import * as constants from 'config/constants' |
|||
import logger from 'logger' |
|||
|
|||
setWebSocketImplementation(WebSocket) |
|||
setNetwork(network) |
|||
setEnv('FORCE_PROVIDER', constants.FORCE_PROVIDER) |
|||
|
|||
websocketLogs.subscribe(({ type, message, ...rest }) => { |
|||
const obj = rest |
|||
if (message) obj.msg = message |
|||
logger.websocket(type, obj) |
|||
}) |
|||
|
Loading…
Reference in new issue