Client

The Client methods all have to do with interacting with the storage and retrieval markets as a client.

clientCalcCommP

clientCalcCommP (str: string): Promise<CommPRet>

Calculates the CommP for a specified file

Parameters:

  • str: string

Returns:

Promise<CommPRet>

Source: index.d.ts, line 266, character 17

clientDataTransferUpdates

clientDataTransferUpdates (handler: (data: DataTransferChannel) => void): [() => void, Promise<void>]

Parameters:

Returns:

[() => void, Promise<void>]

Source: index.d.ts, line 267, character 27

clientDealSize

clientDealSize (cid: Cid): Promise<DataSize>

Calculates real deal data size

Parameters:

Returns:

Promise<DataSize>

Source: index.d.ts, line 271, character 16

clientFindData

clientFindData (cid: Cid, cid1: Cid): Promise<Array<QueryOffer>>

Identifies peers that have a certain file, and returns QueryOffers (one per peer).

Parameters:

Returns:

Promise<Array<QueryOffer>>

Source: index.d.ts, line 275, character 16

clientGenCar

clientGenCar (fileRef: FileRef, str: string): Promise<void>

Generates a CAR file for the specified file.

Parameters:

Returns:

Promise<void>

Source: index.d.ts, line 279, character 14

clientGetDealInfo

clientGetDealInfo (cid: Cid): Promise<DealInfo>

Returns the latest information about a given deal.

Parameters:

Returns:

Promise<DealInfo>

Source: index.d.ts, line 283, character 19

clientGetDealStatus

clientGetDealStatus (uint: number): Promise<string>

Returns status given a code

Parameters:

  • uint: number

Returns:

Promise<string>

Source: index.d.ts, line 287, character 21

clientGetDealUpdates

clientGetDealUpdates (handler: (data: DealInfo) => void): [() => void, Promise<void>]

Returns the status of updated deals

Parameters:

Returns:

[() => void, Promise<void>]

Source: index.d.ts, line 291, character 22

clientHasLocal

clientHasLocal (cid: Cid): Promise<boolean>

Indicates whether a certain CID is locally stored.

Parameters:

Returns:

Promise<boolean>

Source: index.d.ts, line 295, character 16

clientImport

clientImport (fileRef: FileRef): Promise<ImportRes>

Imports file under the specified path into filestore.

Parameters:

Returns:

Promise<ImportRes>

Source: index.d.ts, line 299, character 14

clientListDataTransfers

clientListDataTransfers (): Promise<Array<DataTransferChannel>>

clientListTransfers returns the status of all ongoing transfers of data

Returns:

Promise<Array<DataTransferChannel>>

Source: index.d.ts, line 303, character 25

clientListDeals

clientListDeals (): Promise<Array<DealInfo>>

Returns information about the deals made by the local client.

Returns:

Promise<Array<DealInfo>>

Source: index.d.ts, line 307, character 17

clientListImports

clientListImports (): Promise<Array<Import>>

Lists imported files and their root CIDs

Returns:

Promise<Array<Import>>

Source: index.d.ts, line 311, character 19

clientMinerQueryOffer

clientMinerQueryOffer (address: string, cid: Cid, cid1: Cid): Promise<QueryOffer>

Returns a QueryOffer for the specific miner and file.

Parameters:

  • address: string
  • cid: Cid
  • cid1: Cid

Returns:

Promise<QueryOffer>

Source: index.d.ts, line 315, character 23

clientQueryAsk

clientQueryAsk (id: string, address: string): Promise<StorageAsk>

Returns a signed StorageAsk from the specified miner.

Parameters:

  • id: string
  • address: string

Returns:

Promise<StorageAsk>

Source: index.d.ts, line 319, character 16

clientRemoveImport

clientRemoveImport (storeID: number): Promise<void>

Removes file import

Parameters:

  • storeID: number

Returns:

Promise<void>

Source: index.d.ts, line 323, character 20

clientRestartDataTransfer

clientRestartDataTransfer (transferID: number, id: string, bool: boolean): Promise<void>

Attempts to restart a data transfer with the given transfer ID and other peer

Parameters:

  • transferID: number
  • id: string
  • bool: boolean

Returns:

Promise<void>

Source: index.d.ts, line 327, character 27

clientRetrieve

clientRetrieve (retrievalOrder: RetrievalOrder, fileRef: FileRef): Promise<void>

Initiates the retrieval of a file, as specified in the order.

Parameters:

Returns:

Promise<void>

Source: index.d.ts, line 331, character 16

clientRetrieveTryRestartInsufficientFunds

clientRetrieveTryRestartInsufficientFunds (address: string): Promise<void>

Attempts to restart stalled retrievals on a given payment channel which are stuck due to insufficient funds

Parameters:

  • address: string

Returns:

Promise<void>

Source: index.d.ts, line 336, character 43

clientRetrieveWithEvents

clientRetrieveWithEvents (handler: (data: RetrievalEvent) => void, retrievalOrder: RetrievalOrder, fileRef: FileRef): [() => void, Promise<void>]

Initiates the retrieval of a file, as specified in the order, and provides a channel of status updates.

Parameters:

Returns:

[() => void, Promise<void>]

Source: index.d.ts, line 341, character 26

clientStartDeal

clientStartDeal (startDealParams: StartDealParams): Promise<Cid>

Proposes a deal with a miner.

Parameters:

Returns:

Promise<Cid>

Source: index.d.ts, line 345, character 17