Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Data

Hierarchy

  • Data

Index

Properties

cidInfo

cidInfo: (cid: string) => Promise<AsObject>

Get detailed information about the current state of a cid in Powergate.

param

The cid to get information for.

returns

An object with detailed information about the cid.

Type declaration

    • Parameters

      • cid: string

      Returns Promise<AsObject>

cidSummary

cidSummary: (...cids: string[]) => Promise<AsObject>

Get high level information about the current state of cids in Powergate.

param

A list of cids to filter the results by.

returns

An object containing a list of cid summary info.

Type declaration

    • (...cids: string[]): Promise<AsObject>
    • Parameters

      • Rest ...cids: string[]

      Returns Promise<AsObject>

get

get: (cid: string) => Promise<Uint8Array>

Retrieve data stored by the current user.

param

The cid of the data to retrieve.

returns

The raw data.

Type declaration

    • (cid: string): Promise<Uint8Array>
    • Parameters

      • cid: string

      Returns Promise<Uint8Array>

getFolder

getFolder: (cid: string, output: string, opts?: GetFolderOptions) => Promise<void>

Retrieve a folder stored stored by the current user.

param

The root cid of the folder to retrieve.

param

The location to write the folder to

param

Options controlling the behavior of retrieving the folder

Type declaration

    • Parameters

      Returns Promise<void>

replaceData

replaceData: (cid1: string, cid2: string) => Promise<AsObject>

Applies a StorageConfig for cid2 equal to that of cid1, and removes cid1. This operation is more efficient than manually removing and adding in two separate operations.

param

The cid to replace.

param

The new cid.

returns

The job id of the job executing the storage configuration.

Type declaration

    • (cid1: string, cid2: string): Promise<AsObject>
    • Parameters

      • cid1: string
      • cid2: string

      Returns Promise<AsObject>

stage

stage: (input: Uint8Array) => Promise<AsObject>

A helper method to stage data in IPFS in preparation for storing using storageConfig.apply. This doesn't actually store data in Powergate, you'll want to call storageConfig.apply for that.

param

The raw data to add.

returns

The cid of the added data.

Type declaration

    • (input: Uint8Array): Promise<AsObject>
    • Parameters

      • input: Uint8Array

      Returns Promise<AsObject>

stageFolder

stageFolder: (path: string) => Promise<string>

A helper method to stage a folder recursively in IPFS in preparation for storing using storageConfig.apply. This doesn't actually store data in Powergate, you'll want to call storageConfig.apply for that.

param

The path to the folder to add.

returns

The cid of the added folder.

Type declaration

    • (path: string): Promise<string>
    • Parameters

      • path: string

      Returns Promise<string>

watchLogs

watchLogs: (handler: (event: AsObject) => void, cid: string, opts?: WatchLogsOptions) => () => void

Listen for any updates for a stored cid.

param

The callback to receive log updates.

param

The cid to watch.

param

Options that control the behavior of watching logs.

returns

A function that can be used to cancel watching.

Type declaration

Generated using TypeDoc