Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Storage

Index

Constructors

constructor

  • new Storage(storageConfig?: StorageConfigProps): Storage

Properties

apiKey

apiKey: string

constants

constants: Constants

firebase

firebase: undefined | App

storage

storage: undefined | Storage

Methods

Private uploadCloud

  • uploadCloud(buffer: Buffer | ArrayBuffer, contentType: string): Promise<ResponseData<string>>
  • Uploads raw binary data to the cloud. This method is useful because we can trigger an arweave upload via an http request with the returned file name.

    Parameters

    • buffer: Buffer | ArrayBuffer

      the raw binary data of the file to upload

    • contentType: string

      the content type

    Returns Promise<ResponseData<string>>

    the filename

uploadMetadata

  • uploadMetadata(metadata: unknown): Promise<ResponseData<{ id: string }>>
  • Uploads metadata to Arweave via a cloud function

    Parameters

    • metadata: unknown

      metadata object

    Returns Promise<ResponseData<{ id: string }>>

    arweave content identifier

uploadToArweave

  • uploadToArweave(file: File): Promise<ResponseData<{ contentType: string; id: string }>>
  • Upload file to Arweave via a cloud function

    Parameters

    • file: File

      the file to upload

    Returns Promise<ResponseData<{ contentType: string; id: string }>>

    retunrns an object containing the arweave content identifier and the content type.

Generated using TypeDoc