Socket
Socket
Sign inDemoInstall

@solana/rpc-subscriptions-transport-websocket

Package Overview
Dependencies
Maintainers
15
Versions
783
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/rpc-subscriptions-transport-websocket - npm Package Compare versions

Comparing version 2.0.0-experimental.f45e92a to 2.0.0-experimental.fafdfb2

27

dist/index.browser.js

@@ -0,1 +1,3 @@

import { SolanaError, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_FAILED_TO_CONNECT, SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_STATE_MISSING, SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CONNECTION_CLOSED, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CLOSED_BEFORE_MESSAGE_BUFFERED } from '@solana/errors';
// ../build-scripts/env-shim.ts

@@ -47,4 +49,5 @@ var __DEV__ = /* @__PURE__ */ (() => process["env"].NODE_ENV === "development")();

reject(
// TODO: Coded error
new Error("WebSocket failed to connect", { cause: ev })
new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_FAILED_TO_CONNECT, {
errorEvent: ev
})
);

@@ -74,4 +77,5 @@ }

reject2(
// TODO: Coded error
new Error("WebSocket was closed before payload could be sent")
new SolanaError(
SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CLOSED_BEFORE_MESSAGE_BUFFERED
)
);

@@ -99,7 +103,9 @@ };

if (!state) {
throw new Error("Invariant: WebSocket message iterator is missing state storage");
throw new SolanaError(
SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_STATE_MISSING
);
}
if (state.__hasPolled) {
throw new Error(
"Invariant: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise"
throw new SolanaError(
SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE
);

@@ -124,3 +130,8 @@ }

} else {
throw new Error("WebSocket connection closed", { cause: e2 });
throw new SolanaError(
SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CONNECTION_CLOSED,
{
cause: e2
}
);
}

@@ -127,0 +138,0 @@ }

@@ -0,1 +1,3 @@

import { SolanaError, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_FAILED_TO_CONNECT, SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_STATE_MISSING, SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CONNECTION_CLOSED, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CLOSED_BEFORE_MESSAGE_BUFFERED } from '@solana/errors';
// ../build-scripts/env-shim.ts

@@ -47,4 +49,5 @@ var __DEV__ = /* @__PURE__ */ (() => process["env"].NODE_ENV === "development")();

reject(
// TODO: Coded error
new Error("WebSocket failed to connect", { cause: ev })
new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_FAILED_TO_CONNECT, {
errorEvent: ev
})
);

@@ -74,4 +77,5 @@ }

reject2(
// TODO: Coded error
new Error("WebSocket was closed before payload could be sent")
new SolanaError(
SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CLOSED_BEFORE_MESSAGE_BUFFERED
)
);

@@ -99,7 +103,9 @@ };

if (!state) {
throw new Error("Invariant: WebSocket message iterator is missing state storage");
throw new SolanaError(
SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_STATE_MISSING
);
}
if (state.__hasPolled) {
throw new Error(
"Invariant: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise"
throw new SolanaError(
SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE
);

@@ -124,3 +130,8 @@ }

} else {
throw new Error("WebSocket connection closed", { cause: e2 });
throw new SolanaError(
SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CONNECTION_CLOSED,
{
cause: e2
}
);
}

@@ -127,0 +138,0 @@ }

@@ -0,1 +1,2 @@

import { SolanaError, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_FAILED_TO_CONNECT, SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_STATE_MISSING, SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CONNECTION_CLOSED, SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CLOSED_BEFORE_MESSAGE_BUFFERED } from '@solana/errors';
import e from 'ws';

@@ -47,4 +48,5 @@

reject(
// TODO: Coded error
new Error("WebSocket failed to connect", { cause: ev })
new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_FAILED_TO_CONNECT, {
errorEvent: ev
})
);

@@ -74,4 +76,5 @@ }

reject2(
// TODO: Coded error
new Error("WebSocket was closed before payload could be sent")
new SolanaError(
SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CLOSED_BEFORE_MESSAGE_BUFFERED
)
);

@@ -99,7 +102,9 @@ };

if (!state) {
throw new Error("Invariant: WebSocket message iterator is missing state storage");
throw new SolanaError(
SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_STATE_MISSING
);
}
if (state.__hasPolled) {
throw new Error(
"Invariant: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise"
throw new SolanaError(
SOLANA_ERROR__INVARIANT_VIOLATION_WEBSOCKET_MESSAGE_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE
);

@@ -124,3 +129,8 @@ }

} else {
throw new Error("WebSocket connection closed", { cause: e2 });
throw new SolanaError(
SOLANA_ERROR__RPC_SUBSCRIPTIONS_TRANSPORT_CONNECTION_CLOSED,
{
cause: e2
}
);
}

@@ -127,0 +137,0 @@ }

{
"name": "@solana/rpc-subscriptions-transport-websocket",
"version": "2.0.0-experimental.f45e92a",
"version": "2.0.0-experimental.fafdfb2",
"description": "An RPC Subscriptions transport that uses WebSockets",

@@ -49,3 +49,4 @@ "exports": {

"dependencies": {
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.f45e92a"
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.fafdfb2",
"@solana/errors": "2.0.0-experimental.fafdfb2"
},

@@ -52,0 +53,0 @@ "peerDependencies": {

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc