Skip to content

assertAddPiecesFit

assertAddPiecesFit(options): void

Defined in: packages/synapse-core/src/sp/add-pieces-fits.ts:92

Throw if pieces is empty, a PieceCID is outside Curio’s size bounds, or the list does not fit in one addPieces / createAndAdd message.

ParameterTypeDescription
optionsLimiterOptionsLimiterOptions

void

AtLeastOnePieceRequiredError when pieces is empty

InvalidUploadSizeError when a PieceCID size is below SIZE_CONSTANTS.MIN_UPLOAD_SIZE or above SIZE_CONSTANTS.MAX_UPLOAD_SIZE

AddPiecesBatchTooLargeError when the estimated message exceeds SIZE_CONSTANTS.MAX_ADD_PIECES_MESSAGE_SIZE