useUploadPieces
useUploadPieces(
props?):UseMutationResult<{confirmations:object[];failed:object[];pieces:object[]; },Error,UseUploadPiecesVariables,unknown>
Defined in: synapse-react/src/warm-storage/use-upload-pieces.ts:106
Upload files to an existing data set with synapse-core only (SP.uploadPieces).
Each file is streamed to the data set’s provider, which computes its PieceCID. All parked pieces are added to the
data set in one signed add-pieces request, and the hook waits for the transaction to be confirmed. Files that fail
are returned in failed; the others are still added.
Signs with sessionKey when given, otherwise with the connected wallet.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props? | UseUploadPiecesProps | The props to use. UseUploadPiecesProps |
Returns
Section titled “Returns”UseMutationResult<{ confirmations: object[]; failed: object[]; pieces: object[]; }, Error, UseUploadPiecesVariables, unknown>
The upload mutation. UseUploadPiecesResult