@solana/rpc-subscriptions-spec
Advanced tools
Comparing version 2.0.0-canary-20241026064848 to 2.0.0-canary-20241027102814
@@ -14,3 +14,5 @@ import { SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED, SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED, SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT, SolanaError } from '@solana/errors'; | ||
}>) => Promise<RpcSubscriptionsChannel<TOutboundMessage, TInboundMessage>>; | ||
export declare function transformChannelInboundMessages<TOutboundMessage, TNewInboundMessage, TInboundMessage>(channel: RpcSubscriptionsChannel<TOutboundMessage, TInboundMessage>, transform: (message: TInboundMessage) => TNewInboundMessage): RpcSubscriptionsChannel<TOutboundMessage, TNewInboundMessage>; | ||
export declare function transformChannelOutboundMessages<TNewOutboundMessage, TOutboundMessage, TInboundMessage>(channel: RpcSubscriptionsChannel<TOutboundMessage, TInboundMessage>, transform: (message: TNewOutboundMessage) => TOutboundMessage): RpcSubscriptionsChannel<TNewOutboundMessage, TInboundMessage>; | ||
export {}; | ||
//# sourceMappingURL=rpc-subscriptions-channel.d.ts.map |
{ | ||
"name": "@solana/rpc-subscriptions-spec", | ||
"version": "2.0.0-canary-20241026064848", | ||
"version": "2.0.0-canary-20241027102814", | ||
"description": "A generic implementation of JSON RPC Subscriptions using proxies", | ||
@@ -57,6 +57,6 @@ "exports": { | ||
"dependencies": { | ||
"@solana/errors": "2.0.0-canary-20241026064848", | ||
"@solana/rpc-spec-types": "2.0.0-canary-20241026064848", | ||
"@solana/subscribable": "2.0.0-canary-20241026064848", | ||
"@solana/promises": "2.0.0-canary-20241026064848" | ||
"@solana/errors": "2.0.0-canary-20241027102814", | ||
"@solana/promises": "2.0.0-canary-20241027102814", | ||
"@solana/rpc-spec-types": "2.0.0-canary-20241027102814", | ||
"@solana/subscribable": "2.0.0-canary-20241027102814" | ||
}, | ||
@@ -63,0 +63,0 @@ "peerDependencies": { |
@@ -69,1 +69,21 @@ [![npm][npm-image]][npm-url] | ||
4. Calls the `unsubscribeMethodName` on the remote RPC when the abort signal is fired. | ||
### `transformChannelInboundMessages(channel, transform)` | ||
Given a channel with inbound messages of type `T` and a function of type `T => U`, returns a new channel with inbound messages of type `U`. Note that this only affects messages of type `"message"` and thus, does not affect incoming error messages. | ||
For instance, it can be used to parse incoming JSON messages: | ||
```ts | ||
const transformedChannel = transformChannelInboundMessages(channel, JSON.parse); | ||
``` | ||
### `transformChannelOutboundMessages(channel, transform)` | ||
Given a channel with outbound messages of type `T` and a function of type `U => T`, returns a new channel with outbound messages of type `U`. | ||
For instance, it can be used to stringify JSON messages before sending them over the wire: | ||
```ts | ||
const transformedChannel = transformChannelOutboundMessages(channel, JSON.stringify); | ||
``` |
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
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
197076
1342
89
+ Added@solana/errors@2.0.0-canary-20241027102814(transitive)
+ Added@solana/promises@2.0.0-canary-20241027102814(transitive)
+ Added@solana/rpc-spec-types@2.0.0-canary-20241027102814(transitive)
+ Added@solana/subscribable@2.0.0-canary-20241027102814(transitive)
- Removed@solana/errors@2.0.0-canary-20241026064848(transitive)
- Removed@solana/promises@2.0.0-canary-20241026064848(transitive)
- Removed@solana/rpc-spec-types@2.0.0-canary-20241026064848(transitive)
- Removed@solana/subscribable@2.0.0-canary-20241026064848(transitive)