Skip to content

calculateUploadFees

calculateUploadFees(params): OutputType

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

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.

Runtime batch boundaries depend on encoded message size, metadata, and upload timing, none of which can be inferred from raw sizes alone. To avoid underestimating required funding, each supplied piece is conservatively priced as its own add-pieces operation. Actual fees can be lower when pieces are submitted together in a batch.

ParameterTypeDescription
paramsParamsTypecalculateUploadFees.ParamsType

OutputType

calculateUploadFees.OutputType

ValidationError when pieceSizes is invalid