@solana/rpc-subscriptions
Advanced tools
Comparing version 2.0.0-experimental.27479b3 to 2.0.0-experimental.28775df
@@ -7,3 +7,3 @@ import { createSolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api'; | ||
import fastStableStringify from 'fast-stable-stringify'; | ||
import { SolanaError, SOLANA_ERROR__RPC_INTEGER_OVERFLOW } from '@solana/errors'; | ||
import { SolanaError, SOLANA_ERROR__RPC__INTEGER_OVERFLOW, SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING } from '@solana/errors'; | ||
import { createWebSocketTransport } from '@solana/rpc-subscriptions-transport-websocket'; | ||
@@ -32,3 +32,3 @@ | ||
const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") : void 0; | ||
const error = new SolanaError(SOLANA_ERROR__RPC_INTEGER_OVERFLOW, { | ||
const error = new SolanaError(SOLANA_ERROR__RPC__INTEGER_OVERFLOW, { | ||
argumentLabel, | ||
@@ -54,4 +54,2 @@ keyPath, | ||
}; | ||
// src/cached-abortable-iterable.ts | ||
function registerIterableCleanup(iterable, cleanupFn) { | ||
@@ -70,3 +68,2 @@ (async () => { | ||
getAbortSignalFromInputArgs, | ||
getCacheEntryMissingErrorMessage, | ||
getCacheKeyFromInputArgs, | ||
@@ -80,3 +77,5 @@ onCacheHit, | ||
if (!currentCacheEntry) { | ||
throw new Error(getCacheEntryMissingErrorMessage ? getCacheEntryMissingErrorMessage(cacheKey) : void 0); | ||
throw new SolanaError(SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING, { | ||
cacheKey: cacheKey.toString() | ||
}); | ||
} | ||
@@ -182,3 +181,2 @@ return currentCacheEntry; | ||
getAbortSignalFromInputArgs: ({ abortSignal }) => abortSignal, | ||
getCacheEntryMissingErrorMessage: __DEV__ ? (deduplicationKey2) => `Invariant: Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\`` : void 0, | ||
getCacheKeyFromInputArgs: () => deduplicationKey, | ||
@@ -318,3 +316,2 @@ async onCacheHit(_iterable, _config) { | ||
getAbortSignalFromInputArgs: ({ signal }) => signal, | ||
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, | ||
@@ -321,0 +318,0 @@ onCacheHit: (connection, { payload }) => connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(payload), |
@@ -7,3 +7,3 @@ import { createSolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api'; | ||
import fastStableStringify from 'fast-stable-stringify'; | ||
import { SolanaError, SOLANA_ERROR__RPC_INTEGER_OVERFLOW } from '@solana/errors'; | ||
import { SolanaError, SOLANA_ERROR__RPC__INTEGER_OVERFLOW, SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING } from '@solana/errors'; | ||
import { createWebSocketTransport } from '@solana/rpc-subscriptions-transport-websocket'; | ||
@@ -32,3 +32,3 @@ | ||
const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") : void 0; | ||
const error = new SolanaError(SOLANA_ERROR__RPC_INTEGER_OVERFLOW, { | ||
const error = new SolanaError(SOLANA_ERROR__RPC__INTEGER_OVERFLOW, { | ||
argumentLabel, | ||
@@ -54,4 +54,2 @@ keyPath, | ||
}; | ||
// src/cached-abortable-iterable.ts | ||
function registerIterableCleanup(iterable, cleanupFn) { | ||
@@ -70,3 +68,2 @@ (async () => { | ||
getAbortSignalFromInputArgs, | ||
getCacheEntryMissingErrorMessage, | ||
getCacheKeyFromInputArgs, | ||
@@ -80,3 +77,5 @@ onCacheHit, | ||
if (!currentCacheEntry) { | ||
throw new Error(getCacheEntryMissingErrorMessage ? getCacheEntryMissingErrorMessage(cacheKey) : void 0); | ||
throw new SolanaError(SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING, { | ||
cacheKey: cacheKey.toString() | ||
}); | ||
} | ||
@@ -182,3 +181,2 @@ return currentCacheEntry; | ||
getAbortSignalFromInputArgs: ({ abortSignal }) => abortSignal, | ||
getCacheEntryMissingErrorMessage: __DEV__ ? (deduplicationKey2) => `Invariant: Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\`` : void 0, | ||
getCacheKeyFromInputArgs: () => deduplicationKey, | ||
@@ -307,3 +305,2 @@ async onCacheHit(_iterable, _config) { | ||
getAbortSignalFromInputArgs: ({ signal }) => signal, | ||
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, | ||
@@ -310,0 +307,0 @@ onCacheHit: (connection, { payload }) => connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(payload), |
@@ -7,3 +7,3 @@ import { createSolanaRpcSubscriptionsApi } from '@solana/rpc-subscriptions-api'; | ||
import fastStableStringify from 'fast-stable-stringify'; | ||
import { SolanaError, SOLANA_ERROR__RPC_INTEGER_OVERFLOW } from '@solana/errors'; | ||
import { SolanaError, SOLANA_ERROR__RPC__INTEGER_OVERFLOW, SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING } from '@solana/errors'; | ||
import { createWebSocketTransport } from '@solana/rpc-subscriptions-transport-websocket'; | ||
@@ -32,3 +32,3 @@ | ||
const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") : void 0; | ||
const error = new SolanaError(SOLANA_ERROR__RPC_INTEGER_OVERFLOW, { | ||
const error = new SolanaError(SOLANA_ERROR__RPC__INTEGER_OVERFLOW, { | ||
argumentLabel, | ||
@@ -54,4 +54,2 @@ keyPath, | ||
}; | ||
// src/cached-abortable-iterable.ts | ||
function registerIterableCleanup(iterable, cleanupFn) { | ||
@@ -70,3 +68,2 @@ (async () => { | ||
getAbortSignalFromInputArgs, | ||
getCacheEntryMissingErrorMessage, | ||
getCacheKeyFromInputArgs, | ||
@@ -80,3 +77,5 @@ onCacheHit, | ||
if (!currentCacheEntry) { | ||
throw new Error(getCacheEntryMissingErrorMessage ? getCacheEntryMissingErrorMessage(cacheKey) : void 0); | ||
throw new SolanaError(SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING, { | ||
cacheKey: cacheKey.toString() | ||
}); | ||
} | ||
@@ -182,3 +181,2 @@ return currentCacheEntry; | ||
getAbortSignalFromInputArgs: ({ abortSignal }) => abortSignal, | ||
getCacheEntryMissingErrorMessage: __DEV__ ? (deduplicationKey2) => `Invariant: Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\`` : void 0, | ||
getCacheKeyFromInputArgs: () => deduplicationKey, | ||
@@ -307,3 +305,2 @@ async onCacheHit(_iterable, _config) { | ||
getAbortSignalFromInputArgs: ({ signal }) => signal, | ||
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, | ||
@@ -310,0 +307,0 @@ onCacheHit: (connection, { payload }) => connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(payload), |
type CacheKey = string | symbol; | ||
type Config<TInput extends unknown[], TIterable extends AsyncIterable<unknown>> = Readonly<{ | ||
getAbortSignalFromInputArgs: (...args: TInput) => AbortSignal; | ||
getCacheEntryMissingErrorMessage?: (cacheKey: CacheKey) => string; | ||
getCacheKeyFromInputArgs: (...args: TInput) => CacheKey | undefined; | ||
@@ -9,4 +8,4 @@ onCacheHit: (iterable: TIterable, ...args: TInput) => Promise<void>; | ||
}>; | ||
export declare function getCachedAbortableIterableFactory<TInput extends unknown[], TIterable extends AsyncIterable<unknown>>({ getAbortSignalFromInputArgs, getCacheEntryMissingErrorMessage, getCacheKeyFromInputArgs, onCacheHit, onCreateIterable, }: Config<TInput, TIterable>): (...args: TInput) => Promise<TIterable>; | ||
export declare function getCachedAbortableIterableFactory<TInput extends unknown[], TIterable extends AsyncIterable<unknown>>({ getAbortSignalFromInputArgs, getCacheKeyFromInputArgs, onCacheHit, onCreateIterable, }: Config<TInput, TIterable>): (...args: TInput) => Promise<TIterable>; | ||
export {}; | ||
//# sourceMappingURL=cached-abortable-iterable.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { SOLANA_ERROR__RPC_INTEGER_OVERFLOW, SolanaError } from '@solana/errors'; | ||
import { SOLANA_ERROR__RPC__INTEGER_OVERFLOW, SolanaError } from '@solana/errors'; | ||
import type { KeyPath } from '@solana/rpc-transformers'; | ||
export declare function createSolanaJsonRpcIntegerOverflowError(methodName: string, keyPath: KeyPath, value: bigint): SolanaError<typeof SOLANA_ERROR__RPC_INTEGER_OVERFLOW>; | ||
export declare function createSolanaJsonRpcIntegerOverflowError(methodName: string, keyPath: KeyPath, value: bigint): SolanaError<typeof SOLANA_ERROR__RPC__INTEGER_OVERFLOW>; | ||
//# sourceMappingURL=rpc-integer-overflow-error.d.ts.map |
{ | ||
"name": "@solana/rpc-subscriptions", | ||
"version": "2.0.0-experimental.27479b3", | ||
"version": "2.0.0-experimental.28775df", | ||
"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.27479b3", | ||
"@solana/functional": "2.0.0-experimental.27479b3", | ||
"@solana/rpc-subscriptions-api": "2.0.0-experimental.27479b3", | ||
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.27479b3", | ||
"@solana/rpc-subscriptions-transport-websocket": "2.0.0-experimental.27479b3", | ||
"@solana/rpc-transformers": "2.0.0-experimental.27479b3", | ||
"@solana/rpc-types": "2.0.0-experimental.27479b3" | ||
"@solana/errors": "2.0.0-experimental.28775df", | ||
"@solana/rpc-subscriptions-api": "2.0.0-experimental.28775df", | ||
"@solana/rpc-subscriptions-spec": "2.0.0-experimental.28775df", | ||
"@solana/rpc-subscriptions-transport-websocket": "2.0.0-experimental.28775df", | ||
"@solana/functional": "2.0.0-experimental.28775df", | ||
"@solana/rpc-transformers": "2.0.0-experimental.28775df", | ||
"@solana/rpc-types": "2.0.0-experimental.28775df" | ||
}, | ||
@@ -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
245175
2263
+ Added@solana/addresses@2.0.0-experimental.28775df(transitive)
+ Added@solana/assertions@2.0.0-experimental.28775df(transitive)
+ Added@solana/codecs-core@2.0.0-experimental.28775df(transitive)
+ Added@solana/codecs-data-structures@2.0.0-experimental.28775df(transitive)
+ Added@solana/codecs-numbers@2.0.0-experimental.28775df(transitive)
+ Added@solana/codecs-strings@2.0.0-experimental.28775df(transitive)
+ Added@solana/errors@2.0.0-experimental.28775df(transitive)
+ Added@solana/functional@2.0.0-experimental.28775df(transitive)
+ Added@solana/keys@2.0.0-experimental.28775df(transitive)
+ Added@solana/rpc-spec@2.0.0-experimental.28775df(transitive)
+ Added@solana/rpc-spec-types@2.0.0-experimental.28775df(transitive)
+ Added@solana/rpc-subscriptions-api@2.0.0-experimental.28775df(transitive)
+ Added@solana/rpc-subscriptions-spec@2.0.0-experimental.28775df(transitive)
+ Added@solana/rpc-subscriptions-transport-websocket@2.0.0-experimental.28775df(transitive)
+ Added@solana/rpc-transformers@2.0.0-experimental.28775df(transitive)
+ Added@solana/rpc-types@2.0.0-experimental.28775df(transitive)
+ Added@solana/transactions@2.0.0-experimental.28775df(transitive)
- Removed@solana/addresses@2.0.0-experimental.27479b3(transitive)
- Removed@solana/assertions@2.0.0-experimental.27479b3(transitive)
- Removed@solana/codecs-core@2.0.0-experimental.27479b3(transitive)
- Removed@solana/codecs-data-structures@2.0.0-experimental.27479b3(transitive)
- Removed@solana/codecs-numbers@2.0.0-experimental.27479b3(transitive)
- Removed@solana/codecs-strings@2.0.0-experimental.27479b3(transitive)
- Removed@solana/errors@2.0.0-experimental.27479b3(transitive)
- Removed@solana/functional@2.0.0-experimental.27479b3(transitive)
- Removed@solana/keys@2.0.0-experimental.27479b3(transitive)
- Removed@solana/rpc-spec@2.0.0-experimental.27479b3(transitive)
- Removed@solana/rpc-spec-types@2.0.0-experimental.27479b3(transitive)
- Removed@solana/rpc-subscriptions-api@2.0.0-experimental.27479b3(transitive)
- Removed@solana/rpc-subscriptions-spec@2.0.0-experimental.27479b3(transitive)
- Removed@solana/rpc-subscriptions-transport-websocket@2.0.0-experimental.27479b3(transitive)
- Removed@solana/rpc-transformers@2.0.0-experimental.27479b3(transitive)
- Removed@solana/rpc-types@2.0.0-experimental.27479b3(transitive)
- Removed@solana/transactions@2.0.0-experimental.27479b3(transitive)
Updated@solana/rpc-subscriptions-api@2.0.0-experimental.28775df
Updated@solana/rpc-subscriptions-spec@2.0.0-experimental.28775df
Updated@solana/rpc-subscriptions-transport-websocket@2.0.0-experimental.28775df