@cosmjs/tendermint-rpc
Advanced tools
Comparing version 0.32.1 to 0.32.2
@@ -22,4 +22,6 @@ "use strict"; | ||
if (typeof endpoint === "string") { | ||
// accept host.name:port and assume http protocol | ||
this.url = (0, rpcclient_1.hasProtocol)(endpoint) ? endpoint : "http://" + endpoint; | ||
if (!(0, rpcclient_1.hasProtocol)(endpoint)) { | ||
throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'."); | ||
} | ||
this.url = endpoint; | ||
} | ||
@@ -26,0 +28,0 @@ else { |
@@ -10,4 +10,6 @@ "use strict"; | ||
if (typeof endpoint === "string") { | ||
// accept host.name:port and assume http protocol | ||
this.url = (0, rpcclient_1.hasProtocol)(endpoint) ? endpoint : "http://" + endpoint; | ||
if (!(0, rpcclient_1.hasProtocol)(endpoint)) { | ||
throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'."); | ||
} | ||
this.url = endpoint; | ||
} | ||
@@ -14,0 +16,0 @@ else { |
@@ -119,7 +119,8 @@ "use strict"; | ||
this.subscriptionStreams = new Map(); | ||
// accept host.name:port and assume ws protocol | ||
if (!(0, rpcclient_1.hasProtocol)(baseUrl)) { | ||
throw new Error("Base URL is missing a protocol. Expected 'ws://' or 'wss://'."); | ||
} | ||
// make sure we don't end up with ...//websocket | ||
const path = baseUrl.endsWith("/") ? "websocket" : "/websocket"; | ||
const cleanBaseUrl = (0, rpcclient_1.hasProtocol)(baseUrl) ? baseUrl : "ws://" + baseUrl; | ||
this.url = cleanBaseUrl + path; | ||
this.url = baseUrl + path; | ||
this.socket = new socket_1.ReconnectingSocket(this.url); | ||
@@ -126,0 +127,0 @@ const errorSubscription = this.socket.events.subscribe({ |
{ | ||
"name": "@cosmjs/tendermint-rpc", | ||
"version": "0.32.1", | ||
"version": "0.32.2", | ||
"description": "Tendermint RPC clients", | ||
@@ -45,9 +45,9 @@ "contributors": [ | ||
"dependencies": { | ||
"@cosmjs/crypto": "^0.32.1", | ||
"@cosmjs/encoding": "^0.32.1", | ||
"@cosmjs/json-rpc": "^0.32.1", | ||
"@cosmjs/math": "^0.32.1", | ||
"@cosmjs/socket": "^0.32.1", | ||
"@cosmjs/stream": "^0.32.1", | ||
"@cosmjs/utils": "^0.32.1", | ||
"@cosmjs/crypto": "^0.32.2", | ||
"@cosmjs/encoding": "^0.32.2", | ||
"@cosmjs/json-rpc": "^0.32.2", | ||
"@cosmjs/math": "^0.32.2", | ||
"@cosmjs/socket": "^0.32.2", | ||
"@cosmjs/stream": "^0.32.2", | ||
"@cosmjs/utils": "^0.32.2", | ||
"axios": "^1.6.0", | ||
@@ -54,0 +54,0 @@ "readonly-date": "^1.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
420273
6872
Updated@cosmjs/crypto@^0.32.2
Updated@cosmjs/encoding@^0.32.2
Updated@cosmjs/json-rpc@^0.32.2
Updated@cosmjs/math@^0.32.2
Updated@cosmjs/socket@^0.32.2
Updated@cosmjs/stream@^0.32.2
Updated@cosmjs/utils@^0.32.2