Hierarchy

  • Storage

Constructors

Properties

userSession: UserSession

Methods

  • Deletes the specified file from the app's data store.

    Parameters

    • path: string

      The path to the file to delete.

    • Optional options: {
          wasSigned?: boolean;
      }

      Optional options object.

      • Optional wasSigned?: boolean

        Set to true if the file was originally signed in order for the corresponding signature file to also be deleted.

    Returns Promise<void>

    Resolves when the file has been removed or rejects with an error.

  • Get the app storage bucket URL

    Parameters

    • gaiaHubUrl: string

      the gaia hub URL

    • appPrivateKey: string

      the app private key used to generate the app address

    Returns Promise<string>

    That resolves to the URL of the app index file or rejects if it fails

  • Retrieves the specified file from the app's data store.

    Parameters

    • path: string

      the path to the file to read

    • Optional options: GetFileOptions

      a [[GetFileOptions]] object

    Returns Promise<null | string | ArrayBuffer>

    that resolves to the raw data in the file or rejects with an error

  • Parameters

    • path: string
    • app: string
    • username: undefined | string
    • zoneFileLookupURL: undefined | string
    • forceText: boolean
    • fetchFn: FetchFn = ...

    Returns Promise<null | string | ArrayBuffer>

  • Parameters

    Returns Promise<null | string | ArrayBuffer>

  • Get the URL for reading a file from an app's data store.

    Parameters

    Returns Promise<string>

    that resolves to the URL or rejects with an error

  • Parameters

    • app: string
    • Optional username: string
    • Optional zoneFileLookupURL: string

    Returns Promise<string>

  • Fetch the public read URL of a user file for the specified app.

    Parameters

    • path: string

      the path to the file to read

    • username: string

      The Blockstack ID of the user to look up

    • appOrigin: string

      The app origin

    • Optional zoneFileLookupURL: string

      The URL to use for zonefile lookup. If falsey, this will use the blockstack.js's [[getNameInfo]] function instead.

    Returns Promise<undefined | string>

    that resolves to the public read URL of the file or rejects with an error

  • Parameters

    • path: string
    • storedContents: string
    • app: string
    • Optional privateKey: string
    • Optional username: string
    • Optional zoneFileLookupURL: string

    Returns Promise<string | Uint8Array>

  • List the set of files in this application's Gaia storage bucket.

    Parameters

    • callback: ((name) => boolean)

      a callback to invoke on each named file that returns true to continue the listing operation or false to end it. If the call is ended early by the callback, the last file is excluded. If an error occurs the entire call is rejected.

        • (name): boolean
        • Parameters

          • name: string

          Returns boolean

    Returns Promise<number>

    that resolves to the number of files listed

  • Stores the data provided in the app's data store to to the file specified.

    Parameters

    • path: string

      the path to store the data in

    • content: string | Uint8Array | Blob | ArrayBufferView

      the data to store in the file

    • Optional options: PutFileOptions

      a [[PutFileOptions]] object

    Returns Promise<string>

    that resolves if the operation succeed and rejects if it failed

  • Private

    These two functions are app-specific connections to gaia hub, they read the user data object for information on setting up a hub connection, and store the hub config to localstorage

    Returns Promise<GaiaHubConfig>

    that resolves to the new gaia hub connection

Generated using TypeDoc