@@ -9,9 +9,13 @@ const getStreams = require('./lib/getStreams');
99const DEFAULT_MAX_TABLE_LEN = 10000 ;
1010
1111const endpoints = {
12- production : 'wss://www .bitmex.com/realtime' ,
13- testnet : 'wss://testnet.bitmex.com/realtime'
12+ production : 'wss://ws .bitmex.com/realtime' ,
13+ testnet : 'wss://ws. testnet.bitmex.com/realtime'
1414} ;
15+ const httpEndpoints = {
16+ production : 'https://www.bitmex.com/api/v1' ,
17+ testnet : 'https://testnet.bitmex.com/api/v1'
18+ }
1519const noSymbolTables = BitMEXClient . noSymbolTables = [
1620 'account' ,
1721 'affiliate' ,
@@ -45,6 +49,9 @@ function BitMEXClient(options) {
4549 if ( ! options . endpoint ) {
4650 options . endpoint = options . testnet ? endpoints . testnet : endpoints . production ;
4751 }
52+ if ( ! options . httpEndpoint ) {
53+ options . httpEndpoint = options . testnet ? httpEndpoints . testnet : httpEndpoints . production ;
54+ }
4855 if ( process . env . BITMEX_ENDPOINT ) options . endpoint = process . env . BITMEX_ENDPOINT ;
4956 debug ( options )
5057
@@ -57,7 +64,7 @@ function BitMEXClient(options) {
5764 }
5865
5966 // Get valid streams so we can validate our subscriptions.
60- getStreams ( options . endpoint , function ( err , streams ) {
67+ getStreams ( options . httpEndpoint , function ( err , streams ) {
6168 if ( err ) throw err ;
6269 emitter . initialized = true ;
6370 emitter . streams = streams ;
0 commit comments