Hierarchy

  • Storage

Constructors

Properties

userSession: UserSession

Methods

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

    Returns

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

    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>

  • Get the app storage bucket URL

    Returns

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

    Parameters

    • gaiaHubUrl: string

      the gaia hub URL

    • appPrivateKey: string

      the app private key used to generate the app address

    Returns Promise<string>

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

    Returns

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

    Parameters

    Returns Promise<null | string | ArrayBuffer>

  • 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.

    Returns

    that resolves to the URL or rejects with an error

    Parameters

    Returns Promise<string>

  • 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.

    Returns

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

    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>

  • 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.

    Returns

    that resolves to the number of files listed

    Parameters

    • callback: ((name: string) => 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: string): boolean
        • Parameters

          • name: string

          Returns boolean

    Returns Promise<number>

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

    Returns

    that resolves if the operation succeed and rejects if it failed

    Parameters

    • path: string

      the path to store the data in

    • content: string | Uint8Array | ArrayBufferView | Blob

      the data to store in the file

    • Optional options: PutFileOptions

      a PutFileOptions object

    Returns Promise<string>

Generated using TypeDoc