# getUploadCosts

> **getUploadCosts**(`client`, `options`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`OutputType`](/reference/filoz/synapse-core/utils/namespaces/calculateuploadcosts/type-aliases/outputtype/)\>

Defined in: [packages/synapse-core/src/warm-storage/get-upload-costs.ts:59](https://github.com/FilOzone/synapse-sdk/blob/e66c35ddb1749f0e55bae2e4f430d1449cca89bd/packages/synapse-core/src/warm-storage/get-upload-costs.ts#L59)

Read-only function that computes upload costs, reserve-aware deposit needed,
and approval state.

Fetches account state, pricing, and approval via read-only contract calls,
then delegates all cost arithmetic to the shared pure
`calculateUploadCosts` utility. Existing-data-set calls must provide
`dataSetLeafCount`, `currentLifecycleReserveBalance`, and `pdpEndEpoch`; pass
`pendingOneTimePayments` when the data set has unflushed lifecycle fees.
Multi-piece fee and reserve estimates conservatively treat each piece as a
separate add-pieces operation because actual batching is runtime-dependent.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `client` | `Client`\<`Transport`, `Chain`\> | The client to use to compute upload costs. |
| `options` | [`OptionsType`](/reference/filoz/synapse-core/warm-storage/namespaces/getuploadcosts/type-aliases/optionstype/) | [getUploadCosts.OptionsType](/reference/filoz/synapse-core/warm-storage/namespaces/getuploadcosts/type-aliases/optionstype/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`OutputType`](/reference/filoz/synapse-core/utils/namespaces/calculateuploadcosts/type-aliases/outputtype/)\>

[getUploadCosts.OutputType](/reference/filoz/synapse-core/warm-storage/namespaces/getuploadcosts/type-aliases/outputtype/)

## Throws

When existing-data-set state or piece sizes are invalid, or the data-set service is terminated