UNPKG

@saberhq/sail

Version:

Account caching and batched loading for React-based Solana applications.

31 lines 905 B
import type { PublicKey } from "@solana/web3.js"; /** * Emitted when the cache is updated. */ export declare class CacheBatchUpdateEvent { readonly ids: ReadonlySet<string>; static type: string; constructor(ids: ReadonlySet<string>); /** * Construct an event from keys. * @param keys * @returns */ static fromKeys(keys: readonly PublicKey[]): CacheBatchUpdateEvent; /** * Returns true if the key was present in the batch. * @param key * @returns */ hasKey(key: PublicKey): boolean; } export declare class CacheClearEvent { static type: string; } export declare class AccountsEmitter { private readonly _emitter; onBatchCache: (callback: (args: CacheBatchUpdateEvent) => void) => (() => void); raiseBatchCacheUpdated(ids: ReadonlySet<string>): void; raiseCacheCleared(): void; } //# sourceMappingURL=emitter.d.ts.map