import { JWKInterface } from "arweave/node/lib/wallet";
import { Struct } from "superstruct";
import winston from "winston";
import { BigNumber } from "../../utils/BigNumberUtils";
export interface ArweaveGatewayConfig {
    host: string;
    protocol?: string;
    port?: number;
}
export declare const DEFAULT_ARWEAVE_GATEWAYS: ArweaveGatewayConfig[];
export declare class ArweaveClient {
    private arweaveJWT;
    private logger;
    private readonly retries;
    private readonly retryDelaySeconds;
    private gateways;
    constructor(arweaveJWT: JWKInterface, logger: winston.Logger, gateways?: ArweaveGatewayConfig[], retries?: number, retryDelaySeconds?: number);
    /**
     * Races a request across all gateways, returning the first successful response.
     * If all gateways fail, throws an error with details from each gateway.
     */
    private _raceGateways;
    /**
     * Tries gateways sequentially, returning the first successful response.
     * Used for write operations where we want exactly one successful submission.
     */
    private _failoverGateways;
    private _retryRequest;
    private _isNotFoundError;
    private _wrapWriteError;
    /**
     * Stores an arbitrary record in the Arweave network. The record is stored as a JSON string and uses
     * JSON.stringify to convert the record to a string. The record has all of its big numbers converted
     * to strings for convenience.
     * @param value The value to store
     * @param topicTag An optional topic tag to add to the transaction
     * @returns The transaction ID of the stored value
     */
    set(value: Record<string, unknown>, topicTag?: string | undefined): Promise<string | undefined>;
    /**
     * Retrieves a record from the Arweave network. The record is expected to be a JSON string and is
     * parsed using JSON.parse. All numeric strings are converted to big numbers for convenience.
     * @param transactionID The transaction ID of the record to retrieve
     * @param structValidator An optional struct validator to validate the retrieved value. If the value does not match the struct, null is returned.
     * @returns The record if it exists, otherwise null
     */
    get<T>(transactionID: string, validator: Struct<T>): Promise<T | null>;
    /**
     * Retrieves a list of records from the Arweave network that have a specific tag.
     * The records are expected to be a JSON string and are pre-filtered by the Across
     * protocol tag, the content-type tag, and this client's address. Furthermore, the
     * records are expected to be an array of the given type and will be discarded if
     * they do not match the given validator.
     * @param tag The tag to filter all the transactions by
     * @param validator The validator to validate the retrieved values
     * @param originQueryAddress An optional flag to override the originating address for the query. By default,
     *                           the address of the RL Arweave storage wallet is used.
     * @returns The records if they exist, otherwise an empty array
     */
    getByTopic<T>(tag: string, validator: Struct<T>, originQueryAddress?: string): Promise<{
        data: T;
        hash: string;
    }[]>;
    /**
     * Retrieves the metadata of a transaction
     * @param transactionID The transaction ID of the record to retrieve
     * @returns The metadata of the transaction if it exists, otherwise null
     */
    getMetadata(transactionID: string): Promise<Record<string, string> | null>;
    /**
     * Returns the address of the signer of the JWT. This is a local crypto
     * operation and does not require a network call.
     * @returns The address of the signer in this client
     */
    getAddress(): Promise<string>;
    /**
     * The balance of the signer
     * @returns The balance of the signer in winston units
     */
    getBalance(): Promise<BigNumber>;
}
//# sourceMappingURL=ArweaveClient.d.ts.map