///
///
import type { DataItem, JWKInterface } from "arbundles/node";
import type { AxiosResponse } from "axios";
import type { Readable } from "stream";
import type Api from "./api";
import { ChunkingUploader } from "./chunkingUploader";
import { type Token, type Arbundles, type IrysTransactonCtor, type UploadOptions, type UploadReceipt, type UploadResponse, type CreateAndUploadOptions, type Manifest } from "./types";
import type Utils from "./utils";
export declare const sleep: (ms: number) => Promise;
export declare const CHUNKING_THRESHOLD = 50000000;
export declare class Uploader {
protected readonly api: Api;
protected token: string;
protected tokenConfig: Token;
protected utils: Utils;
protected contentTypeOverride: string | undefined;
protected forceUseChunking: boolean | undefined;
protected arbundles: Arbundles;
protected irysTransaction: IrysTransactonCtor;
constructor(api: Api, utils: Utils, token: string, tokenConfig: Token, irysTransaction: IrysTransactonCtor);
/**
* Uploads a given transaction to the bundler
* @param transaction
*/
uploadTransaction(transaction: DataItem | Readable | Buffer, opts: UploadOptions & {
getReceiptSignature: true;
}): Promise>;
uploadTransaction(transaction: DataItem | Readable | Buffer, opts?: UploadOptions): Promise>;
uploadData(data: string | Buffer | Readable, opts?: CreateAndUploadOptions): Promise;
concurrentUploader(data: (DataItem | Buffer | Readable)[], opts?: {
concurrency?: number;
resultProcessor?: (res: any) => Promise;
logFunction?: (log: string) => Promise;
itemOptions?: CreateAndUploadOptions;
}): Promise<{
errors: any[];
results: any[];
}>;
protected processItem(data: string | Buffer | Readable | DataItem, opts?: CreateAndUploadOptions): Promise;
/**
* geneates a manifest JSON object
* @param config.items mapping of logical paths to item IDs
* @param config.indexFile optional logical path of the index file for the manifest
* @returns
*/
generateManifest(config: {
items: Map;
indexFile?: string;
}): Promise;
get chunkedUploader(): ChunkingUploader;
set useChunking(state: boolean);
set contentType(type: string);
/**
* Creates & Uploads a [nested bundle](https://docs.bundlr.network/faqs/dev-faq#what-is-a-nested-bundle) from the provided list of transactions. \
* NOTE: If a provided transaction is unsigned, the transaction is signed using a temporary (throwaway) Arweave key. \
* This means transactions can be associated with a single "random" address. \
* NOTE: If a Buffer is provided, it is converted into a transaction and then signed by the throwaway key. \
* The throwaway key, address, and all bundled (provided + throwaway signed + generated) transactions are returned by this method.
*
* @param transactions List of transactions (DataItems/Raw data buffers) to bundle
* @param opts Standard upload options, plus the `throwawayKey` paramter, for passing your own throwaway JWK
* @returns Standard upload response from the bundler node, plus the throwaway key & address, and the list of bundled transactions
*/
uploadBundle(transactions: (DataItem | Buffer | string)[], opts: UploadOptions & {
getReceiptSignature: true;
throwawayKey?: JWKInterface;
}): Promise & {
throwawayKey: JWKInterface;
throwawayKeyAddress: string;
txs: DataItem[];
}>;
uploadBundle(transactions: (DataItem | Buffer)[], opts?: UploadOptions & {
throwawayKey?: JWKInterface;
}): Promise & {
throwawayKey: JWKInterface;
throwawayKeyAddress: string;
txs: DataItem[];
}>;
}
export default Uploader;