import { bcs as suiBcs } from "../bcs/index.mjs"; import { SuiClientTypes } from "../client/types.mjs"; import { TransactionPlugin } from "./resolve.mjs"; //#region src/transactions/ObjectCache.d.ts interface ObjectCacheEntry { objectId: string; version: string; digest: string; owner: string | null; initialSharedVersion: string | null; } interface MoveFunctionCacheEntry { package: string; module: string; function: string; parameters: SuiClientTypes.OpenSignature[]; } interface CacheEntryTypes { OwnedObject: ObjectCacheEntry; SharedOrImmutableObject: ObjectCacheEntry; MoveFunction: MoveFunctionCacheEntry; Custom: unknown; } 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: SuiClientTypes.OpenSignature[]; }>; deleteMoveFunctionDefinition(ref: { package: string; module: string; function: string; }): Promise; getCustom(key: string): Promise; setCustom(key: string, value: T): Promise; deleteCustom(key: string): Promise; } interface ObjectCacheOptions { cache?: AsyncCache; onEffects?: (effects: typeof suiBcs.TransactionEffects.$inferType) => Promise; } 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 suiBcs.TransactionEffects.$inferType): Promise; } //#endregion export { AsyncCache, ObjectCache, ObjectCacheOptions }; //# sourceMappingURL=ObjectCache.d.mts.map