@ethersphere/bee-js
Version:
Javascript client for Bee
25 lines (24 loc) • 1.89 kB
TypeScript
import { Optional } from 'cafe-utility';
import { Chunk } from '../chunk/cac';
import { FeedUpdateOptions } from '../modules/feed';
import { BeeRequestOptions, FeedReader, FeedWriter, UploadOptions, UploadResult } from '../types';
import { Bytes } from '../utils/bytes';
import { BatchId, EthAddress, FeedIndex, PrivateKey, Reference, Topic } from '../utils/typed-bytes';
export interface Epoch {
time: number;
level: number;
}
export interface FeedUploadOptions extends UploadOptions, FeedUpdateOptions {
}
export interface FeedUpdate {
timestamp: Optional<number>;
payload: Bytes;
}
export declare function findNextIndex(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic): Promise<FeedIndex>;
export declare function updateFeedWithReference(requestOptions: BeeRequestOptions, signer: PrivateKey, topic: Topic, reference: Reference | string | Uint8Array, postageBatchId: BatchId, options?: FeedUploadOptions): Promise<UploadResult>;
export declare function updateFeedWithPayload(requestOptions: BeeRequestOptions, signer: PrivateKey, topic: Topic, data: Uint8Array | string, postageBatchId: BatchId, options?: FeedUploadOptions): Promise<UploadResult>;
export declare function getFeedUpdateChunkReference(owner: EthAddress, topic: Topic, index: FeedIndex): Reference;
export declare function downloadFeedUpdate(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic, index: FeedIndex | number, hasTimestamp?: boolean): Promise<FeedUpdate>;
export declare function downloadFeedUpdateAsCAC(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic, index: FeedIndex | number): Promise<Chunk>;
export declare function makeFeedReader(requestOptions: BeeRequestOptions, topic: Topic, owner: EthAddress): FeedReader;
export declare function makeFeedWriter(requestOptions: BeeRequestOptions, topic: Topic, signer: PrivateKey): FeedWriter;