@xandeum/web3.js 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/webSocket.js CHANGED
@@ -29,7 +29,10 @@ var ws_1 = __importDefault(require("ws"));
29
29
  function subscribeResult(connection, tx, onResult, onError, onClose) {
30
30
  var rpcEndpoint = connection.rpcEndpoint;
31
31
  var url = new URL(rpcEndpoint);
32
- url.port = '8900'; // Set the port to 8900
32
+ // url.port = '8900'; // Set the port to 8900
33
+ if (url.port) {
34
+ url.port = '8900';
35
+ }
33
36
  url.protocol = url.protocol.replace('http', 'ws');
34
37
  var wsEndpoint = url.toString();
35
38
  var ws = new ws_1.default(wsEndpoint);
@@ -77,7 +80,9 @@ function subscribeResult(connection, tx, onResult, onError, onClose) {
77
80
  function unsubscribeResult(connection, subscriptionId) {
78
81
  var rpcEndpoint = connection.rpcEndpoint;
79
82
  var url = new URL(rpcEndpoint);
80
- url.port = '8900'; // Set the port to 8900
83
+ if (url.port) {
84
+ url.port = '8900';
85
+ }
81
86
  url.protocol = url.protocol.replace('http', 'ws');
82
87
  var wsEndpoint = url.toString();
83
88
  var ws = new ws_1.default(wsEndpoint);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xandeum/web3.js",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Xandeum javascript api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/webSocket.ts CHANGED
@@ -46,7 +46,10 @@ export function subscribeResult (
46
46
  ): void {
47
47
  let rpcEndpoint = connection.rpcEndpoint;
48
48
  const url = new URL(rpcEndpoint);
49
- url.port = '8900'; // Set the port to 8900
49
+ // url.port = '8900'; // Set the port to 8900
50
+ if (url.port) {
51
+ url.port = '8900';
52
+ }
50
53
  url.protocol = url.protocol.replace('http', 'ws');
51
54
  const wsEndpoint = url.toString();
52
55
  const ws = new WebSocket(wsEndpoint);
@@ -100,7 +103,9 @@ export function subscribeResult (
100
103
  export function unsubscribeResult(connection: Connection,subscriptionId: string): void {
101
104
  let rpcEndpoint = connection.rpcEndpoint;
102
105
  const url = new URL(rpcEndpoint);
103
- url.port = '8900'; // Set the port to 8900
106
+ if (url.port) {
107
+ url.port = '8900';
108
+ }
104
109
  url.protocol = url.protocol.replace('http', 'ws');
105
110
  const wsEndpoint = url.toString();
106
111
  const ws = new WebSocket(wsEndpoint);