Socket
Socket
Sign inDemoInstall

@solana/rpc-subscriptions

Package Overview
Dependencies
Maintainers
0
Versions
747
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/rpc-subscriptions - npm Package Compare versions

Comparing version 2.0.0-canary-20241004222707 to 2.0.0-canary-20241004230256

2

dist/types/index.d.ts

@@ -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';

12

dist/types/rpc-subscriptions-transport.d.ts

@@ -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

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