@solana/web3.js 1.92.2 → 1.93.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.92.2",
3
+ "version": "1.93.0",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -55,7 +55,7 @@
55
55
  "test:unit:node": "cross-env NODE_ENV=test NODE_OPTIONS='--import tsx' mocha './test/**/*.test.ts'"
56
56
  },
57
57
  "dependencies": {
58
- "@babel/runtime": "^7.24.6",
58
+ "@babel/runtime": "^7.24.7",
59
59
  "@noble/curves": "^1.4.0",
60
60
  "@noble/hashes": "^1.4.0",
61
61
  "@solana/buffer-layout": "^4.0.1",
@@ -68,7 +68,7 @@
68
68
  "fast-stable-stringify": "^1.0.0",
69
69
  "jayson": "^4.1.0",
70
70
  "node-fetch": "^2.7.0",
71
- "rpc-websockets": "^7.11.1",
71
+ "rpc-websockets": "^9.0.0",
72
72
  "superstruct": "^1.0.4"
73
73
  }
74
74
  }
@@ -1,19 +1,17 @@
1
- import RpcWebSocketCommonClient from 'rpc-websockets/dist/lib/client.cjs';
2
- import WebSocketBrowserImpl from 'rpc-websockets/dist/lib/client/websocket.cjs';
3
1
  import {
2
+ CommonClient,
4
3
  ICommonWebSocket,
5
4
  IWSClientAdditionalOptions,
6
5
  NodeWebSocketType,
7
6
  NodeWebSocketTypeOptions,
8
- } from 'rpc-websockets/dist/lib/client/client.types.cjs';
9
-
10
- import createRpc from './rpc-websocket-factory';
7
+ WebSocket as createRpc,
8
+ } from 'rpc-websockets';
11
9
 
12
10
  interface IHasReadyState {
13
11
  readyState: WebSocket['readyState'];
14
12
  }
15
13
 
16
- export default class RpcWebSocketClient extends RpcWebSocketCommonClient {
14
+ export default class RpcWebSocketClient extends CommonClient {
17
15
  private underlyingSocket: IHasReadyState | undefined;
18
16
  constructor(
19
17
  address?: string,
@@ -32,9 +30,7 @@ export default class RpcWebSocketClient extends RpcWebSocketCommonClient {
32
30
  ...options,
33
31
  });
34
32
  if ('socket' in rpc) {
35
- this.underlyingSocket = rpc.socket as ReturnType<
36
- typeof WebSocketBrowserImpl
37
- >;
33
+ this.underlyingSocket = rpc.socket as ReturnType<typeof createRpc>;
38
34
  } else {
39
35
  this.underlyingSocket = rpc as NodeWebSocketType;
40
36
  }
@@ -43,8 +39,8 @@ export default class RpcWebSocketClient extends RpcWebSocketCommonClient {
43
39
  super(webSocketFactory, address, options, generate_request_id);
44
40
  }
45
41
  call(
46
- ...args: Parameters<RpcWebSocketCommonClient['call']>
47
- ): ReturnType<RpcWebSocketCommonClient['call']> {
42
+ ...args: Parameters<CommonClient['call']>
43
+ ): ReturnType<CommonClient['call']> {
48
44
  const readyState = this.underlyingSocket?.readyState;
49
45
  if (readyState === 1 /* WebSocket.OPEN */) {
50
46
  return super.call(...args);
@@ -60,8 +56,8 @@ export default class RpcWebSocketClient extends RpcWebSocketCommonClient {
60
56
  );
61
57
  }
62
58
  notify(
63
- ...args: Parameters<RpcWebSocketCommonClient['notify']>
64
- ): ReturnType<RpcWebSocketCommonClient['notify']> {
59
+ ...args: Parameters<CommonClient['notify']>
60
+ ): ReturnType<CommonClient['notify']> {
65
61
  const readyState = this.underlyingSocket?.readyState;
66
62
  if (readyState === 1 /* WebSocket.OPEN */) {
67
63
  return super.notify(...args);
@@ -1 +0,0 @@
1
- export {default} from 'rpc-websockets/dist/lib/client/websocket.browser.cjs';
@@ -1 +0,0 @@
1
- export {default} from 'rpc-websockets/dist/lib/client/websocket.browser.cjs';
@@ -1,4 +0,0 @@
1
- import {ICommonWebSocketFactory} from 'rpc-websockets/dist/lib/client/client.types.cjs';
2
- import WebsocketFactory from 'rpc-websockets/dist/lib/client/websocket.cjs';
3
-
4
- export default WebsocketFactory as ICommonWebSocketFactory;