Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solana/rpc-subscriptions

Package Overview
Dependencies
Maintainers
15
Versions
890
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-experimental.d06660c to 2.0.0-experimental.d8524d8

65

dist/index.browser.js

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

import { createSolanaRpcSubscriptionsApi, createSolanaRpcSubscriptionsApi_UNSTABLE } from '@solana/rpc-subscriptions-api';
import { createSolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api';
export * from '@solana/rpc-subscriptions-api';

@@ -67,3 +67,3 @@ import { createSubscriptionRpc } from '@solana/rpc-subscriptions-spec';

getAbortSignalFromInputArgs,
getCacheEntryMissingError,
getCacheEntryMissingErrorMessage,
getCacheKeyFromInputArgs,

@@ -77,3 +77,3 @@ onCacheHit,

if (!currentCacheEntry) {
throw getCacheEntryMissingError(cacheKey);
throw new Error(getCacheEntryMissingErrorMessage ? getCacheEntryMissingErrorMessage(cacheKey) : void 0);
}

@@ -179,7 +179,3 @@ return currentCacheEntry;

getAbortSignalFromInputArgs: ({ abortSignal }) => abortSignal,
getCacheEntryMissingError(deduplicationKey2) {
return new Error(
`Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\``
);
},
getCacheEntryMissingErrorMessage: __DEV__ ? (deduplicationKey2) => `Invariant: Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\`` : void 0,
getCacheKeyFromInputArgs: () => deduplicationKey,

@@ -243,22 +239,2 @@ async onCacheHit(_iterable, _config) {

// src/rpc-subscriptions.ts
function createSolanaRpcSubscriptions(config) {
return pipe(
createSubscriptionRpc({
...config,
api: createSolanaRpcSubscriptionsApi(DEFAULT_RPC_CONFIG)
}),
(rpcSubscriptions) => getRpcSubscriptionsWithSubscriptionCoalescing({
getDeduplicationKey: (...args) => fastStableStringify(args),
rpcSubscriptions
})
);
}
function createSolanaRpcSubscriptions_UNSTABLE(config) {
return createSubscriptionRpc({
...config,
api: createSolanaRpcSubscriptionsApi_UNSTABLE(DEFAULT_RPC_CONFIG)
});
}
// src/rpc-subscriptions-autopinger.ts

@@ -340,5 +316,3 @@ var PING_PAYLOAD = {

getAbortSignalFromInputArgs: ({ signal }) => signal,
getCacheEntryMissingError(shardKey) {
return new Error(`Found no cache entry for connection with shard key \`${shardKey?.toString()}\``);
},
getCacheEntryMissingErrorMessage: __DEV__ ? (shardKey) => `Invariant: Found no cache entry for connection with shard key \`${shardKey?.toString()}\`` : void 0,
getCacheKeyFromInputArgs: ({ payload }) => getShard ? getShard(payload) : NULL_SHARD_CACHE_KEY,

@@ -373,4 +347,31 @@ onCacheHit: (connection, { payload }) => connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(payload),

export { createDefaultRpcSubscriptionsTransport, createSolanaRpcSubscriptions, createSolanaRpcSubscriptions_UNSTABLE };
// src/rpc-subscriptions.ts
function createSolanaRpcSubscriptions(clusterUrl, config) {
const transport = createDefaultRpcSubscriptionsTransport({ url: clusterUrl, ...config });
return createSolanaRpcSubscriptionsFromTransport(transport);
}
function createSolanaRpcSubscriptions_UNSTABLE(clusterUrl, config) {
return createSolanaRpcSubscriptions(
clusterUrl,
config
);
}
function createSolanaRpcSubscriptionsFromTransport(transport) {
return pipe(
createSubscriptionRpc({
api: createSolanaRpcSubscriptionsApi(DEFAULT_RPC_CONFIG),
transport
}),
(rpcSubscriptions) => getRpcSubscriptionsWithSubscriptionCoalescing({
getDeduplicationKey: (...args) => fastStableStringify(args),
rpcSubscriptions
})
);
}
function createSolanaRpcSubscriptionsFromTransport_UNSTABLE(transport) {
return createSolanaRpcSubscriptionsFromTransport(transport);
}
export { createDefaultRpcSubscriptionsTransport, createSolanaRpcSubscriptions, createSolanaRpcSubscriptionsFromTransport, createSolanaRpcSubscriptionsFromTransport_UNSTABLE, createSolanaRpcSubscriptions_UNSTABLE };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.browser.js.map

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

import { createSolanaRpcSubscriptionsApi, createSolanaRpcSubscriptionsApi_UNSTABLE } from '@solana/rpc-subscriptions-api';
import { createSolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api';
export * from '@solana/rpc-subscriptions-api';

@@ -67,3 +67,3 @@ import { createSubscriptionRpc } from '@solana/rpc-subscriptions-spec';

getAbortSignalFromInputArgs,
getCacheEntryMissingError,
getCacheEntryMissingErrorMessage,
getCacheKeyFromInputArgs,

@@ -77,3 +77,3 @@ onCacheHit,

if (!currentCacheEntry) {
throw getCacheEntryMissingError(cacheKey);
throw new Error(getCacheEntryMissingErrorMessage ? getCacheEntryMissingErrorMessage(cacheKey) : void 0);
}

@@ -179,7 +179,3 @@ return currentCacheEntry;

getAbortSignalFromInputArgs: ({ abortSignal }) => abortSignal,
getCacheEntryMissingError(deduplicationKey2) {
return new Error(
`Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\``
);
},
getCacheEntryMissingErrorMessage: __DEV__ ? (deduplicationKey2) => `Invariant: Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\`` : void 0,
getCacheKeyFromInputArgs: () => deduplicationKey,

@@ -243,22 +239,2 @@ async onCacheHit(_iterable, _config) {

// src/rpc-subscriptions.ts
function createSolanaRpcSubscriptions(config) {
return pipe(
createSubscriptionRpc({
...config,
api: createSolanaRpcSubscriptionsApi(DEFAULT_RPC_CONFIG)
}),
(rpcSubscriptions) => getRpcSubscriptionsWithSubscriptionCoalescing({
getDeduplicationKey: (...args) => fastStableStringify(args),
rpcSubscriptions
})
);
}
function createSolanaRpcSubscriptions_UNSTABLE(config) {
return createSubscriptionRpc({
...config,
api: createSolanaRpcSubscriptionsApi_UNSTABLE(DEFAULT_RPC_CONFIG)
});
}
// src/rpc-subscriptions-autopinger.ts

@@ -329,5 +305,3 @@ var PING_PAYLOAD = {

getAbortSignalFromInputArgs: ({ signal }) => signal,
getCacheEntryMissingError(shardKey) {
return new Error(`Found no cache entry for connection with shard key \`${shardKey?.toString()}\``);
},
getCacheEntryMissingErrorMessage: __DEV__ ? (shardKey) => `Invariant: Found no cache entry for connection with shard key \`${shardKey?.toString()}\`` : void 0,
getCacheKeyFromInputArgs: ({ payload }) => getShard ? getShard(payload) : NULL_SHARD_CACHE_KEY,

@@ -362,4 +336,31 @@ onCacheHit: (connection, { payload }) => connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(payload),

export { createDefaultRpcSubscriptionsTransport, createSolanaRpcSubscriptions, createSolanaRpcSubscriptions_UNSTABLE };
// src/rpc-subscriptions.ts
function createSolanaRpcSubscriptions(clusterUrl, config) {
const transport = createDefaultRpcSubscriptionsTransport({ url: clusterUrl, ...config });
return createSolanaRpcSubscriptionsFromTransport(transport);
}
function createSolanaRpcSubscriptions_UNSTABLE(clusterUrl, config) {
return createSolanaRpcSubscriptions(
clusterUrl,
config
);
}
function createSolanaRpcSubscriptionsFromTransport(transport) {
return pipe(
createSubscriptionRpc({
api: createSolanaRpcSubscriptionsApi(DEFAULT_RPC_CONFIG),
transport
}),
(rpcSubscriptions) => getRpcSubscriptionsWithSubscriptionCoalescing({
getDeduplicationKey: (...args) => fastStableStringify(args),
rpcSubscriptions
})
);
}
function createSolanaRpcSubscriptionsFromTransport_UNSTABLE(transport) {
return createSolanaRpcSubscriptionsFromTransport(transport);
}
export { createDefaultRpcSubscriptionsTransport, createSolanaRpcSubscriptions, createSolanaRpcSubscriptionsFromTransport, createSolanaRpcSubscriptionsFromTransport_UNSTABLE, createSolanaRpcSubscriptions_UNSTABLE };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.native.js.map

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

import { createSolanaRpcSubscriptionsApi, createSolanaRpcSubscriptionsApi_UNSTABLE } from '@solana/rpc-subscriptions-api';
import { createSolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api';
export * from '@solana/rpc-subscriptions-api';

@@ -67,3 +67,3 @@ import { createSubscriptionRpc } from '@solana/rpc-subscriptions-spec';

getAbortSignalFromInputArgs,
getCacheEntryMissingError,
getCacheEntryMissingErrorMessage,
getCacheKeyFromInputArgs,

@@ -77,3 +77,3 @@ onCacheHit,

if (!currentCacheEntry) {
throw getCacheEntryMissingError(cacheKey);
throw new Error(getCacheEntryMissingErrorMessage ? getCacheEntryMissingErrorMessage(cacheKey) : void 0);
}

@@ -179,7 +179,3 @@ return currentCacheEntry;

getAbortSignalFromInputArgs: ({ abortSignal }) => abortSignal,
getCacheEntryMissingError(deduplicationKey2) {
return new Error(
`Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\``
);
},
getCacheEntryMissingErrorMessage: __DEV__ ? (deduplicationKey2) => `Invariant: Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\`` : void 0,
getCacheKeyFromInputArgs: () => deduplicationKey,

@@ -243,22 +239,2 @@ async onCacheHit(_iterable, _config) {

// src/rpc-subscriptions.ts
function createSolanaRpcSubscriptions(config) {
return pipe(
createSubscriptionRpc({
...config,
api: createSolanaRpcSubscriptionsApi(DEFAULT_RPC_CONFIG)
}),
(rpcSubscriptions) => getRpcSubscriptionsWithSubscriptionCoalescing({
getDeduplicationKey: (...args) => fastStableStringify(args),
rpcSubscriptions
})
);
}
function createSolanaRpcSubscriptions_UNSTABLE(config) {
return createSubscriptionRpc({
...config,
api: createSolanaRpcSubscriptionsApi_UNSTABLE(DEFAULT_RPC_CONFIG)
});
}
// src/rpc-subscriptions-autopinger.ts

@@ -329,5 +305,3 @@ var PING_PAYLOAD = {

getAbortSignalFromInputArgs: ({ signal }) => signal,
getCacheEntryMissingError(shardKey) {
return new Error(`Found no cache entry for connection with shard key \`${shardKey?.toString()}\``);
},
getCacheEntryMissingErrorMessage: __DEV__ ? (shardKey) => `Invariant: Found no cache entry for connection with shard key \`${shardKey?.toString()}\`` : void 0,
getCacheKeyFromInputArgs: ({ payload }) => getShard ? getShard(payload) : NULL_SHARD_CACHE_KEY,

@@ -362,4 +336,31 @@ onCacheHit: (connection, { payload }) => connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(payload),

export { createDefaultRpcSubscriptionsTransport, createSolanaRpcSubscriptions, createSolanaRpcSubscriptions_UNSTABLE };
// src/rpc-subscriptions.ts
function createSolanaRpcSubscriptions(clusterUrl, config) {
const transport = createDefaultRpcSubscriptionsTransport({ url: clusterUrl, ...config });
return createSolanaRpcSubscriptionsFromTransport(transport);
}
function createSolanaRpcSubscriptions_UNSTABLE(clusterUrl, config) {
return createSolanaRpcSubscriptions(
clusterUrl,
config
);
}
function createSolanaRpcSubscriptionsFromTransport(transport) {
return pipe(
createSubscriptionRpc({
api: createSolanaRpcSubscriptionsApi(DEFAULT_RPC_CONFIG),
transport
}),
(rpcSubscriptions) => getRpcSubscriptionsWithSubscriptionCoalescing({
getDeduplicationKey: (...args) => fastStableStringify(args),
rpcSubscriptions
})
);
}
function createSolanaRpcSubscriptionsFromTransport_UNSTABLE(transport) {
return createSolanaRpcSubscriptionsFromTransport(transport);
}
export { createDefaultRpcSubscriptionsTransport, createSolanaRpcSubscriptions, createSolanaRpcSubscriptionsFromTransport, createSolanaRpcSubscriptionsFromTransport_UNSTABLE, createSolanaRpcSubscriptions_UNSTABLE };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.node.js.map
type CacheKey = string | symbol;
type Config<TInput extends unknown[], TIterable extends AsyncIterable<unknown>> = Readonly<{
getAbortSignalFromInputArgs: (...args: TInput) => AbortSignal;
getCacheEntryMissingError: (cacheKey: CacheKey) => Error;
getCacheEntryMissingErrorMessage?: (cacheKey: CacheKey) => string;
getCacheKeyFromInputArgs: (...args: TInput) => CacheKey | undefined;

@@ -9,4 +9,4 @@ onCacheHit: (iterable: TIterable, ...args: TInput) => Promise<void>;

}>;
export declare function getCachedAbortableIterableFactory<TInput extends unknown[], TIterable extends AsyncIterable<unknown>>({ getAbortSignalFromInputArgs, getCacheEntryMissingError, getCacheKeyFromInputArgs, onCacheHit, onCreateIterable, }: Config<TInput, TIterable>): (...args: TInput) => Promise<TIterable>;
export declare function getCachedAbortableIterableFactory<TInput extends unknown[], TIterable extends AsyncIterable<unknown>>({ getAbortSignalFromInputArgs, getCacheEntryMissingErrorMessage, getCacheKeyFromInputArgs, onCacheHit, onCreateIterable, }: Config<TInput, TIterable>): (...args: TInput) => Promise<TIterable>;
export {};
//# sourceMappingURL=cached-abortable-iterable.d.ts.map
import type { ClusterUrl } from '@solana/rpc-types';
import { RpcSubscriptionsTransportFromClusterUrl } from './rpc-subscriptions-clusters.js';
type Config<TClusterUrl extends ClusterUrl> = Readonly<{
export type DefaultRpcSubscriptionsTransportConfig<TClusterUrl extends ClusterUrl> = Readonly<{
url: TClusterUrl;
}>;
export declare function createDefaultRpcSubscriptionsTransport<TClusterUrl extends ClusterUrl>(config: Config<TClusterUrl> & {
/**

@@ -15,4 +13,4 @@ * You might like to open more subscriptions per connection than your RPC provider allows

sendBufferHighWatermark?: number;
}): RpcSubscriptionsTransportFromClusterUrl<TClusterUrl>;
export {};
}>;
export declare function createDefaultRpcSubscriptionsTransport<TClusterUrl extends ClusterUrl>(config: DefaultRpcSubscriptionsTransportConfig<TClusterUrl>): RpcSubscriptionsTransportFromClusterUrl<TClusterUrl>;
//# sourceMappingURL=rpc-subscriptions-transport.d.ts.map

@@ -1,10 +0,10 @@

import type { SolanaRpcSubscriptionsApi, SolanaRpcSubscriptionsApiUnstable } from '@solana/rpc-subscriptions-api';
import { type RpcSubscriptionsTransport } from '@solana/rpc-subscriptions-spec';
import type { SolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api';
import { RpcSubscriptionsApiMethods, type RpcSubscriptionsTransport } from '@solana/rpc-subscriptions-spec';
import { ClusterUrl } from '@solana/rpc-types';
import type { RpcSubscriptionsFromTransport } from './rpc-subscriptions-clusters.js';
type RpcSubscriptionsConfig<TTransport extends RpcSubscriptionsTransport> = Readonly<{
transport: TTransport;
}>;
export declare function createSolanaRpcSubscriptions<TTransport extends RpcSubscriptionsTransport>(config: RpcSubscriptionsConfig<TTransport>): RpcSubscriptionsFromTransport<SolanaRpcSubscriptionsApi, TTransport>;
export declare function createSolanaRpcSubscriptions_UNSTABLE<TTransport extends RpcSubscriptionsTransport>(config: RpcSubscriptionsConfig<TTransport>): RpcSubscriptionsFromTransport<SolanaRpcSubscriptionsApi & SolanaRpcSubscriptionsApiUnstable, TTransport>;
export {};
import { DefaultRpcSubscriptionsTransportConfig } from './rpc-subscriptions-transport.js';
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 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-experimental.d06660c",
"version": "2.0.0-experimental.d8524d8",
"description": "A library for subscribing to Solana RPC notifications",

@@ -50,9 +50,9 @@ "exports": {

"fast-stable-stringify": "^1.0.0",
"@solana/errors": "2.0.0-experimental.d06660c",
"@solana/rpc-subscriptions-api": "2.0.0-experimental.d06660c",
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.d06660c",
"@solana/functional": "2.0.0-experimental.d06660c",
"@solana/rpc-subscriptions-transport-websocket": "2.0.0-experimental.d06660c",
"@solana/rpc-transformers": "2.0.0-experimental.d06660c",
"@solana/rpc-types": "2.0.0-experimental.d06660c"
"@solana/errors": "2.0.0-experimental.d8524d8",
"@solana/functional": "2.0.0-experimental.d8524d8",
"@solana/rpc-subscriptions-api": "2.0.0-experimental.d8524d8",
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.d8524d8",
"@solana/rpc-subscriptions-transport-websocket": "2.0.0-experimental.d8524d8",
"@solana/rpc-transformers": "2.0.0-experimental.d8524d8",
"@solana/rpc-types": "2.0.0-experimental.d8524d8"
},

@@ -59,0 +59,0 @@ "bundlewatch": {

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