tovarish-relayer/lib/services/data.d.ts

34 lines
1.3 KiB
TypeScript
Raw Permalink Normal View History

2024-11-13 04:42:13 +03:00
import { AsyncZippable, Unzipped } from 'fflate';
import { BaseEvents, CachedEvents, MinimalEvents } from '@tornado/core';
export declare function existsAsync(fileOrDir: string): Promise<boolean>;
export declare function zipAsync(file: AsyncZippable): Promise<Uint8Array>;
export declare function unzipAsync(data: Uint8Array): Promise<Unzipped>;
export declare function saveUserFile({ fileName, userDirectory, dataString, lastBlock, }: {
fileName: string;
userDirectory: string;
dataString: string;
lastBlock?: number;
}): Promise<void>;
export declare function saveLastBlock({ fileName, userDirectory, lastBlock, }: {
fileName: string;
userDirectory: string;
lastBlock: number;
}): Promise<void>;
export declare function loadLastBlock({ name, directory }: {
name: string;
directory: string;
}): Promise<number | undefined>;
export declare function loadSavedEvents<T extends MinimalEvents>({ name, userDirectory, }: {
name: string;
userDirectory: string;
}): Promise<BaseEvents<T>>;
export declare function download({ name, cacheDirectory }: {
name: string;
cacheDirectory: string;
}): Promise<string>;
export declare function loadCachedEvents<T extends MinimalEvents>({ name, cacheDirectory, deployedBlock, }: {
name: string;
cacheDirectory: string;
deployedBlock: number;
}): Promise<CachedEvents<T>>;