import type { bcs } from '../bcs/index.js'; import type { OpenMoveTypeSignature } from './data/internal.js'; import type { TransactionPlugin } from './resolve.js'; export interface ObjectCacheEntry { objectId: string; version: string; digest: string; owner: string | null; initialSharedVersion: string | null; } export interface MoveFunctionCacheEntry { package: string; module: string; function: string; parameters: OpenMoveTypeSignature[]; } export interface CacheEntryTypes { OwnedObject: ObjectCacheEntry; SharedOrImmutableObject: ObjectCacheEntry; MoveFunction: MoveFunctionCacheEntry; Custom: unknown; } export declare abstract class AsyncCache { protected abstract get(type: T, key: string): Promise; protected abstract set(type: T, key: string, value: CacheEntryTypes[T]): Promise; protected abstract delete(type: T, key: string): Promise; abstract clear(type?: T): Promise; getObject(id: string): Promise; getObjects(ids: string[]): Promise<(ObjectCacheEntry | null)[]>; addObject(object: ObjectCacheEntry): Promise; addObjects(objects: ObjectCacheEntry[]): Promise; deleteObject(id: string): Promise; deleteObjects(ids: string[]): Promise; getMoveFunctionDefinition(ref: { package: string; module: string; function: string; }): Promise; addMoveFunctionDefinition(functionEntry: MoveFunctionCacheEntry): Promise<{ package: string; module: string; function: string; parameters: OpenMoveTypeSignature[]; }>; deleteMoveFunctionDefinition(ref: { package: string; module: string; function: string; }): Promise; getCustom(key: string): Promise; setCustom(key: string, value: T): Promise; deleteCustom(key: string): Promise; } export declare class InMemoryCache extends AsyncCache { #private; protected get(type: T, key: string): Promise | null>; protected set(type: T, key: string, value: CacheEntryTypes[T]): Promise; protected delete(type: T, key: string): Promise; clear(type?: T): Promise; } export interface ObjectCacheOptions { cache?: AsyncCache; onEffects?: (effects: typeof bcs.TransactionEffects.$inferType) => Promise; } export declare class ObjectCache { #private; constructor({ cache, onEffects }: ObjectCacheOptions); asPlugin(): TransactionPlugin; clear(): Promise; getMoveFunctionDefinition(ref: { package: string; module: string; function: string; }): Promise; getObjects(ids: string[]): Promise<(ObjectCacheEntry | null)[]>; deleteObjects(ids: string[]): Promise; clearOwnedObjects(): Promise; clearCustom(): Promise; getCustom(key: string): Promise; setCustom(key: string, value: T): Promise; deleteCustom(key: string): Promise; applyEffects(effects: typeof bcs.TransactionEffects.$inferType): Promise; }