# addPiecesFits

> **addPiecesFits**(`options`): `boolean`

Defined in: [packages/synapse-core/src/sp/add-pieces-fits.ts:65](https://github.com/FilOzone/synapse-sdk/blob/be109459b3ce23e76e3fc606d809ae47209fe3d3/packages/synapse-core/src/sp/add-pieces-fits.ts#L65)

Whether a candidate piece list fits in one addPieces / createAndAdd message.

Uses estimated encoded-params size (PieceCID bytes + dummy extraData) against
[SIZE\_CONSTANTS.MAX\_ADD\_PIECES\_MESSAGE\_SIZE](/reference/filoz/synapse-core/utils/variables/size_constants/#max_add_pieces_message_size) (64 KiB message cap minus
overhead), with a temporary cap of [SIZE\_CONSTANTS.MAX\_ADD\_PIECES\_BATCH\_SIZE](/reference/filoz/synapse-core/utils/variables/size_constants/#max_add_pieces_batch_size)
pieces per operation. Empty `pieces` does not fit.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `options` | [`LimiterOptions`](/reference/filoz/synapse-core/sp/type-aliases/limiteroptions/) | [addPiecesFits.OptionsType](/reference/filoz/synapse-core/sp/namespaces/addpiecesfits/type-aliases/optionstype/) |

## Returns

`boolean`

Whether the pieces fit [addPiecesFits.OutputType](/reference/filoz/synapse-core/sp/namespaces/addpiecesfits/type-aliases/outputtype/)

## Example

```ts
import { addPiecesFits } from '@filoz/synapse-core/sp'

const fits = addPiecesFits({
  kind: 'addPieces',
  dataSet,
  pieces: [{ pieceCid }],
})
```