# waitForAddPieces

> **waitForAddPieces**(`options`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\{ `addMessageOk`: `true`; `confirmedPieceIds`: `bigint`[]; `dataSetId`: `bigint`; `pieceCount`: `number`; `piecesAdded`: `true`; `txHash`: `` `0x${string}` ``; `txStatus`: `"confirmed"`; \}\>

Defined in: [packages/synapse-core/src/sp/wait-for-add-pieces.ts:70](https://github.com/FilOzone/synapse-sdk/blob/7fdc04df4e3c52366a9f0cd55da4c05e20b2ed82/packages/synapse-core/src/sp/wait-for-add-pieces.ts#L70)

Wait for the add pieces status.

GET /pdp/data-sets/{dataSetId}/pieces/added/{txHash}

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `options` | [`OptionsType`](/reference/filoz/synapse-core/sp/namespaces/waitforaddpieces/type-aliases/optionstype/) | [waitForAddPieces.OptionsType](/reference/filoz/synapse-core/sp/namespaces/waitforaddpieces/type-aliases/optionstype/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\{ `addMessageOk`: `true`; `confirmedPieceIds`: `bigint`[]; `dataSetId`: `bigint`; `pieceCount`: `number`; `piecesAdded`: `true`; `txHash`: `` `0x${string}` ``; `txStatus`: `"confirmed"`; \}\>

Status [waitForAddPieces.OutputType](/reference/filoz/synapse-core/sp/namespaces/waitforaddpieces/type-aliases/outputtype/)

## Throws

Errors [waitForAddPieces.ErrorType](/reference/filoz/synapse-core/sp/namespaces/waitforaddpieces/type-aliases/errortype/)