Skip to content

calculateUploadFees

calculateUploadFees(params): OutputType

Defined in: packages/synapse-core/src/warm-storage/calculate-upload-fees.ts:37

Compute the one-time fees an upload incurs.

Scope is intentionally limited to upload-time fees: create-data-set (new datasets only) and add-pieces. Schedule-removals, terminate, and delete are post-upload lifecycle operations and are not part of an upload cost preview.

The number of addPieces operations is derived from pieceCount and a pieces-per-call heuristic (MAX_ADD_PIECES_BATCH_SIZE): each call is charged the base fee. Actual batches are limited by message size via addPiecesFits, so this is a fee preview, not an action cap.

TODO: Review in a follow-up and update fee/pricing calculations to match message-size batching instead of this count heuristic.

ParameterTypeDescription
paramsParamsTypecalculateUploadFees.ParamsType

OutputType

calculateUploadFees.OutputType