@xandeum/web3.js 1.9.0 → 1.11.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/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./peek";
9
9
  export * from "./poke";
10
10
  export * from "./removeDirectory";
11
11
  export * from "./copyPath";
12
+ export * from "./move";
12
13
  export { exists } from "./exists";
13
14
  export { listDirectoryEntry } from "./listDirectoryEntery";
14
15
  export { getMetadata } from "./getMetadata";
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ __exportStar(require("./peek"), exports);
27
27
  __exportStar(require("./poke"), exports);
28
28
  __exportStar(require("./removeDirectory"), exports);
29
29
  __exportStar(require("./copyPath"), exports);
30
+ __exportStar(require("./move"), exports);
30
31
  var exists_1 = require("./exists");
31
32
  Object.defineProperty(exports, "exists", { enumerable: true, get: function () { return exists_1.exists; } });
32
33
  var listDirectoryEntery_1 = require("./listDirectoryEntery");
package/dist/move.js CHANGED
@@ -66,7 +66,7 @@ function move(fsid, srcPath, destPath, name, wallet) {
66
66
  (0, sanitizePath_1.sanitizePath)(name);
67
67
  rest = Buffer.from("".concat(srcPath, "\0").concat(destPath, "\0").concat(name), 'utf-8');
68
68
  instructionData = Buffer.concat([
69
- Buffer.from(Int8Array.from([9]).buffer),
69
+ Buffer.from(Int8Array.from([13]).buffer),
70
70
  Buffer.from(Uint8Array.of.apply(Uint8Array, new bn_js_1.default(fsid).toArray('le', 8))),
71
71
  rest
72
72
  ]);
package/dist/webSocket.js CHANGED
@@ -28,7 +28,11 @@ var ws_1 = __importDefault(require("ws"));
28
28
  */
29
29
  function subscribeResult(connection, tx, onResult, onError, onClose) {
30
30
  var rpcEndpoint = connection.rpcEndpoint;
31
- var ws = new ws_1.default(rpcEndpoint.replace('http', 'ws'));
31
+ var url = new URL(rpcEndpoint);
32
+ url.port = '8900'; // Set the port to 8900
33
+ url.protocol = url.protocol.replace('http', 'ws');
34
+ var wsEndpoint = url.toString();
35
+ var ws = new ws_1.default(wsEndpoint);
32
36
  ws.addEventListener('open', function () {
33
37
  var subscriptionMessage = {
34
38
  jsonrpc: '2.0',
@@ -72,7 +76,11 @@ function subscribeResult(connection, tx, onResult, onError, onClose) {
72
76
  */
73
77
  function unsubscribeResult(connection, subscriptionId) {
74
78
  var rpcEndpoint = connection.rpcEndpoint;
75
- var ws = new ws_1.default(rpcEndpoint.replace('http', 'ws'));
79
+ var url = new URL(rpcEndpoint);
80
+ url.port = '8900'; // Set the port to 8900
81
+ url.protocol = url.protocol.replace('http', 'ws');
82
+ var wsEndpoint = url.toString();
83
+ var ws = new ws_1.default(wsEndpoint);
76
84
  ws.addEventListener('open', function () {
77
85
  var unsubscribeMessage = {
78
86
  jsonrpc: '2.0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xandeum/web3.js",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "description": "Xandeum javascript api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./peek";
9
9
  export * from "./poke";
10
10
  export * from "./removeDirectory";
11
11
  export * from "./copyPath";
12
+ export * from "./move";
12
13
 
13
14
  export {exists } from "./exists";
14
15
  export {listDirectoryEntry} from "./listDirectoryEntery";
package/src/move.ts CHANGED
@@ -33,7 +33,7 @@ export async function move (
33
33
  const rest = Buffer.from(`${srcPath}\0${destPath}\0${name}`, 'utf-8')
34
34
 
35
35
  const instructionData = Buffer.concat([
36
- Buffer.from(Int8Array.from([9]).buffer),
36
+ Buffer.from(Int8Array.from([13]).buffer),
37
37
  Buffer.from(Uint8Array.of(...new BN(fsid).toArray('le', 8))),
38
38
  rest
39
39
  ])
package/src/webSocket.ts CHANGED
@@ -45,7 +45,11 @@ export function subscribeResult (
45
45
  onClose?: () => void
46
46
  ): void {
47
47
  let rpcEndpoint = connection.rpcEndpoint;
48
- const ws = new WebSocket(rpcEndpoint.replace('http', 'ws'));
48
+ const url = new URL(rpcEndpoint);
49
+ url.port = '8900'; // Set the port to 8900
50
+ url.protocol = url.protocol.replace('http', 'ws');
51
+ const wsEndpoint = url.toString();
52
+ const ws = new WebSocket(wsEndpoint);
49
53
 
50
54
  ws.addEventListener('open', () => {
51
55
  const subscriptionMessage = {
@@ -94,8 +98,12 @@ export function subscribeResult (
94
98
  */
95
99
 
96
100
  export function unsubscribeResult(connection: Connection,subscriptionId: string): void {
97
- let rpcEndpoint = connection.rpcEndpoint;
98
- const ws = new WebSocket(rpcEndpoint.replace('http', 'ws'));
101
+ let rpcEndpoint = connection.rpcEndpoint;
102
+ const url = new URL(rpcEndpoint);
103
+ url.port = '8900'; // Set the port to 8900
104
+ url.protocol = url.protocol.replace('http', 'ws');
105
+ const wsEndpoint = url.toString();
106
+ const ws = new WebSocket(wsEndpoint);
99
107
 
100
108
  ws.addEventListener('open', () => {
101
109
  const unsubscribeMessage = {