@solana/rpc-subscriptions
Advanced tools
Comparing version 2.0.0-canary-20241004222707 to 2.0.0-canary-20241004230256
@@ -6,5 +6,3 @@ export * from '@solana/rpc-subscriptions-api'; | ||
export * from './rpc-subscriptions-clusters'; | ||
export * from './rpc-subscriptions-json'; | ||
export * from './rpc-subscriptions-channel'; | ||
export * from './rpc-subscriptions-transport'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,25 +0,3 @@ | ||
import type { RpcSubscriptions, RpcSubscriptionsChannel, RpcSubscriptionsChannelCreator, RpcSubscriptionsTransport } from '@solana/rpc-subscriptions-spec'; | ||
import type { RpcSubscriptions, RpcSubscriptionsTransport } from '@solana/rpc-subscriptions-spec'; | ||
import type { ClusterUrl, DevnetUrl, MainnetUrl, TestnetUrl } from '@solana/rpc-types'; | ||
export type RpcSubscriptionsChannelCreatorDevnet<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannelCreator<TOutboundMessage, TInboundMessage> & { | ||
'~cluster': 'devnet'; | ||
}; | ||
export type RpcSubscriptionsChannelCreatorTestnet<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannelCreator<TOutboundMessage, TInboundMessage> & { | ||
'~cluster': 'testnet'; | ||
}; | ||
export type RpcSubscriptionsChannelCreatorMainnet<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannelCreator<TOutboundMessage, TInboundMessage> & { | ||
'~cluster': 'mainnet'; | ||
}; | ||
export type RpcSubscriptionsChannelCreatorWithCluster<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannelCreatorDevnet<TOutboundMessage, TInboundMessage> | RpcSubscriptionsChannelCreatorMainnet<TOutboundMessage, TInboundMessage> | RpcSubscriptionsChannelCreatorTestnet<TOutboundMessage, TInboundMessage>; | ||
export type RpcSubscriptionsChannelCreatorFromClusterUrl<TClusterUrl extends ClusterUrl, TOutboundMessage, TInboundMessage> = TClusterUrl extends DevnetUrl ? RpcSubscriptionsChannelCreatorDevnet<TOutboundMessage, TInboundMessage> : TClusterUrl extends TestnetUrl ? RpcSubscriptionsChannelCreatorTestnet<TOutboundMessage, TInboundMessage> : TClusterUrl extends MainnetUrl ? RpcSubscriptionsChannelCreatorMainnet<TOutboundMessage, TInboundMessage> : RpcSubscriptionsChannelCreator<TOutboundMessage, TInboundMessage>; | ||
export type RpcSubscriptionsChannelDevnet<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannel<TOutboundMessage, TInboundMessage> & { | ||
'~cluster': 'devnet'; | ||
}; | ||
export type RpcSubscriptionsChannelTestnet<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannel<TOutboundMessage, TInboundMessage> & { | ||
'~cluster': 'testnet'; | ||
}; | ||
export type RpcSubscriptionsChannelMainnet<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannel<TOutboundMessage, TInboundMessage> & { | ||
'~cluster': 'mainnet'; | ||
}; | ||
export type RpcSubscriptionsChannelWithCluster<TOutboundMessage, TInboundMessage> = RpcSubscriptionsChannelDevnet<TOutboundMessage, TInboundMessage> | RpcSubscriptionsChannelMainnet<TOutboundMessage, TInboundMessage> | RpcSubscriptionsChannelTestnet<TOutboundMessage, TInboundMessage>; | ||
export type RpcSubscriptionsChannelFromClusterUrl<TClusterUrl extends ClusterUrl, TOutboundMessage, TInboundMessage> = TClusterUrl extends DevnetUrl ? RpcSubscriptionsChannelDevnet<TOutboundMessage, TInboundMessage> : TClusterUrl extends TestnetUrl ? RpcSubscriptionsChannelTestnet<TOutboundMessage, TInboundMessage> : TClusterUrl extends MainnetUrl ? RpcSubscriptionsChannelMainnet<TOutboundMessage, TInboundMessage> : RpcSubscriptionsChannel<TOutboundMessage, TInboundMessage>; | ||
export type RpcSubscriptionsTransportDevnet = RpcSubscriptionsTransport & { | ||
@@ -26,0 +4,0 @@ '~cluster': 'devnet'; |
@@ -1,9 +0,9 @@ | ||
import { RpcSubscriptionsChannelCreator, RpcSubscriptionsTransport } from '@solana/rpc-subscriptions-spec'; | ||
import { ClusterUrl } from '@solana/rpc-types'; | ||
import { RpcSubscriptionsChannelCreatorDevnet, RpcSubscriptionsChannelCreatorFromClusterUrl, RpcSubscriptionsChannelCreatorMainnet, RpcSubscriptionsChannelCreatorTestnet, RpcSubscriptionsTransportDevnet, RpcSubscriptionsTransportFromClusterUrl, RpcSubscriptionsTransportMainnet, RpcSubscriptionsTransportTestnet } from './rpc-subscriptions-clusters'; | ||
import type { ClusterUrl } from '@solana/rpc-types'; | ||
import { RpcSubscriptionsTransportFromClusterUrl } from './rpc-subscriptions-clusters'; | ||
export type DefaultRpcSubscriptionsTransportConfig<TClusterUrl extends ClusterUrl> = Readonly<{ | ||
createChannel: RpcSubscriptionsChannelCreatorFromClusterUrl<TClusterUrl, unknown, unknown>; | ||
intervalMs?: number; | ||
sendBufferHighWatermark?: number; | ||
url: TClusterUrl; | ||
}>; | ||
export declare function createDefaultRpcSubscriptionsTransport<TClusterUrl extends ClusterUrl>({ createChannel, }: DefaultRpcSubscriptionsTransportConfig<TClusterUrl>): RpcSubscriptionsTransportFromClusterUrl<TClusterUrl>; | ||
export declare function createRpcSubscriptionsTransportFromChannelCreator<TChannelCreator extends RpcSubscriptionsChannelCreator<TOutboundMessage, TInboundMessage>, TInboundMessage, TOutboundMessage>(createChannel: TChannelCreator): TChannelCreator extends RpcSubscriptionsChannelCreatorDevnet<TOutboundMessage, TInboundMessage> ? RpcSubscriptionsTransportDevnet : TChannelCreator extends RpcSubscriptionsChannelCreatorTestnet<TOutboundMessage, TInboundMessage> ? RpcSubscriptionsTransportTestnet : TChannelCreator extends RpcSubscriptionsChannelCreatorMainnet<TOutboundMessage, TInboundMessage> ? RpcSubscriptionsTransportMainnet : RpcSubscriptionsTransport; | ||
export declare function createDefaultRpcSubscriptionsTransport<TClusterUrl extends ClusterUrl>(config: DefaultRpcSubscriptionsTransportConfig<TClusterUrl>): RpcSubscriptionsTransportFromClusterUrl<TClusterUrl>; | ||
//# sourceMappingURL=rpc-subscriptions-transport.d.ts.map |
import type { SolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api'; | ||
import { RpcSubscriptionsApiMethods, type RpcSubscriptionsTransport } from '@solana/rpc-subscriptions-spec'; | ||
import { ClusterUrl } from '@solana/rpc-types'; | ||
import { DefaultRpcSubscriptionsChannelConfig } from './rpc-subscriptions-channel'; | ||
import type { RpcSubscriptionsFromTransport } from './rpc-subscriptions-clusters'; | ||
import { DefaultRpcSubscriptionsTransportConfig } from './rpc-subscriptions-transport'; | ||
interface DefaultRpcSubscriptionsConfig<TClusterUrl extends ClusterUrl> extends DefaultRpcSubscriptionsTransportConfig<TClusterUrl>, DefaultRpcSubscriptionsChannelConfig<TClusterUrl> { | ||
} | ||
export declare function createSolanaRpcSubscriptions<TClusterUrl extends ClusterUrl>(clusterUrl: TClusterUrl, config?: Omit<DefaultRpcSubscriptionsConfig<TClusterUrl>, 'url'>): RpcSubscriptionsFromTransport<SolanaRpcSubscriptionsApi, import("./rpc-subscriptions-clusters").RpcSubscriptionsTransportFromClusterUrl<TClusterUrl>>; | ||
export declare function createSolanaRpcSubscriptions<TClusterUrl extends ClusterUrl, TApi extends RpcSubscriptionsApiMethods = SolanaRpcSubscriptionsApi>(clusterUrl: TClusterUrl, config?: Omit<DefaultRpcSubscriptionsTransportConfig<TClusterUrl>, 'url'>): RpcSubscriptionsFromTransport<TApi, import("./rpc-subscriptions-clusters").RpcSubscriptionsTransportFromClusterUrl<TClusterUrl>>; | ||
export declare function createSolanaRpcSubscriptions_UNSTABLE<TClusterUrl extends ClusterUrl>(clusterUrl: TClusterUrl, config?: Omit<DefaultRpcSubscriptionsTransportConfig<TClusterUrl>, 'url'>): RpcSubscriptionsFromTransport<import("@solana/rpc-subscriptions-api").AccountNotificationsApi & import("@solana/rpc-subscriptions-api").LogsNotificationsApi & import("@solana/rpc-subscriptions-api").ProgramNotificationsApi & import("@solana/rpc-subscriptions-api").RootNotificationsApi & import("@solana/rpc-subscriptions-api").SignatureNotificationsApi & import("@solana/rpc-subscriptions-api").SlotNotificationsApi & import("@solana/rpc-subscriptions-api").BlockNotificationsApi & import("@solana/rpc-subscriptions-api").SlotsUpdatesNotificationsApi & import("@solana/rpc-subscriptions-api").VoteNotificationsApi, import("./rpc-subscriptions-clusters").RpcSubscriptionsTransportFromClusterUrl<TClusterUrl>>; | ||
export declare function createSolanaRpcSubscriptionsFromTransport<TTransport extends RpcSubscriptionsTransport, TApi extends RpcSubscriptionsApiMethods = SolanaRpcSubscriptionsApi>(transport: TTransport): RpcSubscriptionsFromTransport<TApi, TTransport>; | ||
export {}; | ||
export declare function createSolanaRpcSubscriptionsFromTransport_UNSTABLE<TTransport extends RpcSubscriptionsTransport>(transport: TTransport): RpcSubscriptionsFromTransport<import("@solana/rpc-subscriptions-api").AccountNotificationsApi & import("@solana/rpc-subscriptions-api").LogsNotificationsApi & import("@solana/rpc-subscriptions-api").ProgramNotificationsApi & import("@solana/rpc-subscriptions-api").RootNotificationsApi & import("@solana/rpc-subscriptions-api").SignatureNotificationsApi & import("@solana/rpc-subscriptions-api").SlotNotificationsApi & import("@solana/rpc-subscriptions-api").BlockNotificationsApi & import("@solana/rpc-subscriptions-api").SlotsUpdatesNotificationsApi & import("@solana/rpc-subscriptions-api").VoteNotificationsApi, TTransport>; | ||
//# sourceMappingURL=rpc-subscriptions.d.ts.map |
{ | ||
"name": "@solana/rpc-subscriptions", | ||
"version": "2.0.0-canary-20241004222707", | ||
"version": "2.0.0-canary-20241004230256", | ||
"description": "A library for subscribing to Solana RPC notifications", | ||
@@ -57,11 +57,9 @@ "exports": { | ||
"dependencies": { | ||
"@solana/errors": "2.0.0-canary-20241004222707", | ||
"@solana/promises": "2.0.0-canary-20241004222707", | ||
"@solana/rpc-subscriptions-api": "2.0.0-canary-20241004222707", | ||
"@solana/functional": "2.0.0-canary-20241004222707", | ||
"@solana/rpc-subscriptions-channel-websocket": "2.0.0-canary-20241004222707", | ||
"@solana/rpc-subscriptions-spec": "2.0.0-canary-20241004222707", | ||
"@solana/rpc-transformers": "2.0.0-canary-20241004222707", | ||
"@solana/rpc-types": "2.0.0-canary-20241004222707", | ||
"@solana/subscribable": "2.0.0-canary-20241004222707" | ||
"@solana/errors": "2.0.0-canary-20241004230256", | ||
"@solana/rpc-subscriptions-api": "2.0.0-canary-20241004230256", | ||
"@solana/promises": "2.0.0-canary-20241004230256", | ||
"@solana/rpc-subscriptions-spec": "2.0.0-canary-20241004230256", | ||
"@solana/rpc-subscriptions-transport-websocket": "2.0.0-canary-20241004230256", | ||
"@solana/rpc-types": "2.0.0-canary-20241004230256", | ||
"@solana/rpc-transformers": "2.0.0-canary-20241004230256" | ||
}, | ||
@@ -68,0 +66,0 @@ "peerDependencies": { |
@@ -21,15 +21,2 @@ [![npm][npm-image]][npm-url] | ||
### `createDefaultRpcSubscriptionsChannelCreator(config)` | ||
Creates a function that returns new subscription channels when called. | ||
#### Arguments | ||
A config object with the following properties: | ||
- `intervalMs`: The number of milliseconds to wait since the last message sent or received over the channel before sending a ping message to keep the channel open. | ||
- `maxSubscriptionsPerChannel`: The number of subscribers that may share a channel before a new channel must be created. Set this to the maximum number of subscriptions that your RPC provider recommends making over a single connection. | ||
- `minChannels`: The number of channels to create before reusing a channel for a new subscription. | ||
- `sendBufferHighWatermark`: The number of bytes of data to admint into the `WebSocket` buffer before buffering data on the client. -`url`: The URL of the web socket server. Must use the `ws` or `wss` protocols. | ||
### `getChannelPoolingChannelCreator(createChannel, { maxSubscriptionsPerChannel, minChannels })` | ||
@@ -52,5 +39,1 @@ | ||
Given an `RpcSubscriptionsChannel`, will return a new channel that sends a ping message to the inner channel if a message has not been sent or received in the last `intervalMs`. In web browsers, this implementation sends no ping when the network is down, and sends a ping immediately upon the network coming back up. | ||
### `getRpcSubscriptionsTransportWithSubscriptionCoalescing(transport)` | ||
Given an `RpcSubscriptionsTransport`, will return a new transport that coalesces identical subscriptions into a single subscription request to the server. The determination of whether a subscription is the same as another is based on the `subscriptionConfigurationHash` returned by its `RpcSubscriptionsPlan`. The subscription will only be aborted once all subscribers abort, or there is an error. |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8
0
1
75805
25
476
38
+ Added@solana/rpc-subscriptions-transport-websocket@2.0.0-canary-20241004230256
+ Added@solana/addresses@2.0.0-canary-20241004230256(transitive)
+ Added@solana/assertions@2.0.0-canary-20241004230256(transitive)
+ Added@solana/codecs-core@2.0.0-canary-20241004230256(transitive)
+ Added@solana/codecs-data-structures@2.0.0-canary-20241004230256(transitive)
+ Added@solana/codecs-numbers@2.0.0-canary-20241004230256(transitive)
+ Added@solana/codecs-strings@2.0.0-canary-20241004230256(transitive)
+ Added@solana/errors@2.0.0-canary-20241004230256(transitive)
+ Added@solana/functional@2.0.0-canary-20241004230256(transitive)
+ Added@solana/instructions@2.0.0-canary-20241004230256(transitive)
+ Added@solana/keys@2.0.0-canary-20241004230256(transitive)
+ Added@solana/promises@2.0.0-canary-20241004230256(transitive)
+ Added@solana/rpc-spec@2.0.0-canary-20241004230256(transitive)
+ Added@solana/rpc-spec-types@2.0.0-canary-20241004230256(transitive)
+ Added@solana/rpc-subscriptions-api@2.0.0-canary-20241004230256(transitive)
+ Added@solana/rpc-subscriptions-spec@2.0.0-canary-20241004230256(transitive)
+ Added@solana/rpc-subscriptions-transport-websocket@2.0.0-canary-20241004230256(transitive)
+ Added@solana/rpc-transformers@2.0.0-canary-20241004230256(transitive)
+ Added@solana/rpc-types@2.0.0-canary-20241004230256(transitive)
+ Added@solana/subscribable@2.0.0-canary-20241004230256(transitive)
+ Added@solana/transaction-messages@2.0.0-canary-20241004230256(transitive)
+ Added@solana/transactions@2.0.0-canary-20241004230256(transitive)
- Removed@solana/rpc-subscriptions-channel-websocket@2.0.0-canary-20241004222707
- Removed@solana/addresses@2.0.0-canary-20241004222707(transitive)
- Removed@solana/assertions@2.0.0-canary-20241004222707(transitive)
- Removed@solana/codecs-core@2.0.0-canary-20241004222707(transitive)
- Removed@solana/codecs-data-structures@2.0.0-canary-20241004222707(transitive)
- Removed@solana/codecs-numbers@2.0.0-canary-20241004222707(transitive)
- Removed@solana/codecs-strings@2.0.0-canary-20241004222707(transitive)
- Removed@solana/errors@2.0.0-canary-20241004222707(transitive)
- Removed@solana/fast-stable-stringify@2.0.0-canary-20241004222707(transitive)
- Removed@solana/functional@2.0.0-canary-20241004222707(transitive)
- Removed@solana/instructions@2.0.0-canary-20241004222707(transitive)
- Removed@solana/keys@2.0.0-canary-20241004222707(transitive)
- Removed@solana/promises@2.0.0-canary-20241004222707(transitive)
- Removed@solana/rpc-spec@2.0.0-canary-20241004222707(transitive)
- Removed@solana/rpc-spec-types@2.0.0-canary-20241004222707(transitive)
- Removed@solana/rpc-subscriptions-api@2.0.0-canary-20241004222707(transitive)
- Removed@solana/rpc-subscriptions-channel-websocket@2.0.0-canary-20241004222707(transitive)
- Removed@solana/rpc-subscriptions-spec@2.0.0-canary-20241004222707(transitive)
- Removed@solana/rpc-transformers@2.0.0-canary-20241004222707(transitive)
- Removed@solana/rpc-types@2.0.0-canary-20241004222707(transitive)
- Removed@solana/subscribable@2.0.0-canary-20241004222707(transitive)
- Removed@solana/transaction-messages@2.0.0-canary-20241004222707(transitive)
- Removed@solana/transactions@2.0.0-canary-20241004222707(transitive)
Updated@solana/rpc-subscriptions-api@2.0.0-canary-20241004230256
Updated@solana/rpc-subscriptions-spec@2.0.0-canary-20241004230256