@solana/rpc-subscriptions-transport-websocket
Advanced tools
Comparing version 2.0.0-experimental.65af153 to 2.0.0-experimental.6bfb261
@@ -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.65af153", | ||
"version": "2.0.0-experimental.6bfb261", | ||
"description": "An RPC Subscriptions transport that uses WebSockets", | ||
@@ -49,3 +49,4 @@ "exports": { | ||
"dependencies": { | ||
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.65af153" | ||
"@solana/errors": "2.0.0-experimental.6bfb261", | ||
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.6bfb261" | ||
}, | ||
@@ -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
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
122216
1127
3
+ Added@solana/errors@2.0.0-experimental.6bfb261(transitive)
+ Added@solana/rpc-spec-types@2.0.0-experimental.6bfb261(transitive)
+ Added@solana/rpc-subscriptions-spec@2.0.0-experimental.6bfb261(transitive)
+ Addedchalk@5.4.1(transitive)
+ Addedcommander@12.1.0(transitive)
- Removed@solana/rpc-spec-types@2.0.0-experimental.65af153(transitive)
- Removed@solana/rpc-subscriptions-spec@2.0.0-experimental.65af153(transitive)
Updated@solana/rpc-subscriptions-spec@2.0.0-experimental.6bfb261