@ethersphere/bee-js
Version:
Javascript client for Bee
61 lines (60 loc) • 2.36 kB
TypeScript
import { BeeRequestOptions, UploadOptions } from '../types';
import { Bytes } from '../utils/bytes';
import { BatchId, EthAddress, FeedIndex, Reference, Topic } from '../utils/typed-bytes';
export interface FeedUpdateOptions {
/**
* Specifies the start date as unix time stamp
*/
at?: number;
/**
* Fetch specific previous Feed's update (default fetches latest update)
*/
index?: FeedIndex | number;
/**
* Whether the first 8 bytes of the payload are a timestamp
*/
hasTimestamp?: boolean;
}
interface FeedUpdateHeaders {
/**
* The current feed's index
*/
feedIndex: FeedIndex;
/**
* The feed's index for next update.
* Only set for the latest update. If update is fetched using previous index, then this is an empty string.
*/
feedIndexNext?: FeedIndex;
}
export interface FeedPayloadResult extends FeedUpdateHeaders {
payload: Bytes;
}
export interface FeedReferenceResult extends FeedUpdateHeaders {
reference: Reference;
}
/**
* Create an initial feed root manifest
*
* @param requestOptions Options for making requests
* @param owner Owner's ethereum address in hex
* @param topic Topic in hex
* @param postageBatchId Postage BatchId to be used to create the Feed Manifest
* @param options Additional options, like type (default: 'sequence')
*/
export declare function createFeedManifest(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic, stamp: BatchId | Uint8Array | string, options?: UploadOptions): Promise<Reference>;
/**
* Find and retrieve feed update
*
* The feed consists of updates. This endpoint looks up an
* update that matches the provided parameters and returns
* the reference it contains along with its index and the
* index of the subsequent update.
*
* @param requestOptions Options for making requests
* @param owner Owner's ethereum address
* @param topic Topic
* @param options Additional options, like index, at, type
*/
export declare function fetchLatestFeedUpdate(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<FeedPayloadResult>;
export declare function probeFeed(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic): Promise<FeedUpdateHeaders>;
export {};