ethstorage-sdk-ts
Version:
eip-4844 blobs upload sdk from ethstorage-sdk
25 lines (24 loc) • 1.03 kB
TypeScript
/// <reference types="node" />
import { HexString } from "ethers/lib.commonjs/utils/data";
export declare class BaseEthStorage {
#private;
constructor(rpc: string, privateKey: HexString, contractAddr?: HexString | null);
address(): string;
deploy(ethStorage?: string): Promise<string | null>;
deploySepolia(): Promise<string | null>;
setDefault(filename: string): Promise<void>;
refund(): Promise<void>;
remove(fileName: string): Promise<boolean>;
download(fileName: string, ethStorageRpc?: string): Promise<Buffer | undefined>;
uploadData(fileName: string, data: any): Promise<{
fileName: string;
totalChunkCount: number;
currentSuccessIndex: number;
totalUploadCount: number;
totalUploadSize: number;
totalCost: bigint;
}>;
upload(fileOrPath: string, syncPoolSize?: number): Promise<unknown>;
getFileInfo(pathOrFile: any): void;
getFileChunk(pathOrFile: any, fileSize: number, start: number, end: number): Promise<Buffer>;
}