@ethersphere/bee-js
Version:
Javascript client for Bee
24 lines (23 loc) • 1.16 kB
TypeScript
import type { BeeRequestOptions, DownloadOptions, EnvelopeWithBatchId, UploadOptions, UploadResult } from '../types';
import { BatchId, Reference } from '../utils/typed-bytes';
/**
* Upload chunk to a Bee node
*
* The chunk data consists of 8 byte span and up to 4096 bytes of payload data.
* The span stores the length of the payload in uint64 little endian encoding.
* Upload expects the chuck data to be set accordingly.
*
* @param requestOptions Options for making requests
* @param data Chunk data to be uploaded
* @param stamp BatchId or marshaled stamp to be used for the upload
* @param options Additional options like tag, encryption, pinning
*/
export declare function upload(requestOptions: BeeRequestOptions, data: Uint8Array, stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string, options?: UploadOptions): Promise<UploadResult>;
/**
* Download chunk data as a byte array
*
* @param requestOptions Options for making requests
* @param hash Bee content reference
*
*/
export declare function download(requestOptions: BeeRequestOptions, reference: Reference | string | Uint8Array, options?: DownloadOptions): Promise<Uint8Array>;