diff --git a/config.js b/config.js index 39fa2cbbb..a22baad87 100644 --- a/config.js +++ b/config.js @@ -19,7 +19,7 @@ var defaultConfig = { url: 'https://test-insight.bitpay.com:443' }, livenet: { - url: 'https:insight.bitpay.com:443' + url: 'https://insight.bitpay.com:443' }, }, diff --git a/js/models/blockchain/Insight.js b/js/models/blockchain/Insight.js index b4d928c4c..aa53fb560 100644 --- a/js/models/blockchain/Insight.js +++ b/js/models/blockchain/Insight.js @@ -15,9 +15,7 @@ var preconditions = require('preconditions').singleton(); subscribing to transactions on adressess and blocks. Opts: - - host - - port - - schema + - url - reconnection (optional) - reconnectionDelay (optional) @@ -31,19 +29,18 @@ var preconditions = require('preconditions').singleton(); var Insight = function(opts) { preconditions.checkArgument(opts) .shouldBeObject(opts) - .checkArgument(opts.host) - .checkArgument(opts.port) - .checkArgument(opts.schema); + .checkArgument(opts.url) this.status = this.STATUS.DISCONNECTED; this.subscribed = {}; this.listeningBlocks = false; - this.url = opts.schema + '://' + opts.host + ':' + opts.port; + this.url = opts.url; + alert(this.url); this.opts = { 'reconnection': opts.reconnection || true, 'reconnectionDelay': opts.reconnectionDelay || 1000, - 'secure': opts.schema === 'https' + 'secure': opts.url.indexOf('https') > -1 }; this.socket = this.getSocket();