UNPKG

@etherspot/prime-sdk

Version:

Etherspot Prime (Account Abstraction) SDK

16 lines (15 loc) 350 B
let WebSocketConstructor = null; try { if (typeof WebSocket !== 'undefined') { WebSocketConstructor = WebSocket; } else { WebSocketConstructor = require('ws'); } } catch (err) { throw new Error('WebSocket not found. Please install `ws` for node.js'); } if (global) { global.WebSocket = WebSocketConstructor; }