Represents the BundlrClient for handling file uploads and downloads using the Bundlr network.

Hierarchy

Constructors

  • Constructs a new BundlrClient instance with the specified options.

    Parameters

    • Optional options: BundlrOptions

      The options to configure the BundlrClient.

    Returns BundlrClient

Properties

_honeycomb: Honeycomb

Methods

  • Retrieves the Bundlr instance used for file uploads and downloads.

    Returns Promise<default | default>

    A Promise resolving to the Bundlr instance.

  • Downloads a HoneycombFile from the provided URI.

    Parameters

    • uri: string

      The URI of the file to download.

    Returns Promise<HoneycombFile>

    The downloaded HoneycombFile.

  • Downloads a JSON object from the provided URI.

    Type Parameters

    • T extends object = object

    Parameters

    • uri: string

      The URI of the JSON object to download.

    Returns Promise<T>

    The downloaded JSON object.

  • Funds the Bundlr account with the specified amount of tokens.

    Parameters

    • amount: Amount

      The amount to fund the Bundlr account with.

    • Optional skipBalanceCheck: boolean

      Whether to skip the balance check and always fund the account.

    Returns Promise<any>

    A Promise resolving to void.

  • Retrieves the upload price for a specified number of bytes.

    Parameters

    • bytes: number

      The number of bytes to calculate the upload price for.

    Returns Promise<Amount>

    A Promise resolving to the upload price in the form of an Amount.

  • Retrieves the upload price for a HoneycombFile.

    Parameters

    • file: HoneycombFile

      The HoneycombFile for which to calculate the upload price.

    Returns Promise<Amount>

    A Promise resolving to the upload price in the form of an Amount.

  • Retrieves the upload price for an array of HoneycombFiles.

    Parameters

    • files: HoneycombFile[]

      An array of HoneycombFiles to calculate the upload price for.

    Returns Promise<Amount>

    A Promise resolving to the upload price in the form of an Amount.

  • Get the Honeycomb client instance associated with the module.

    Returns Honeycomb

    The Honeycomb client instance.

  • Installs the BundlrClient into the Honeycomb instance.

    Parameters

    • honeycomb: Honeycomb

      The Honeycomb instance to install the BundlrClient into.

    Returns Honeycomb

    The Honeycomb instance with the BundlrClient installed.

  • Uploads a HoneycombFile to the Bundlr storage.

    Parameters

    Returns Promise<string>

    A Promise resolving to the URI of the uploaded file.

  • Uploads an array of HoneycombFiles to the Bundlr storage.

    Parameters

    Returns Promise<string[]>

    A Promise resolving to an array of URIs for the uploaded files.

  • Uploads a JSON object to the Honeycomb storage.

    Type Parameters

    • T extends object = object

    Parameters

    • json: T

      The JSON object to upload.

    Returns Promise<string>

    The URI of the uploaded file.

Generated using TypeDoc