# depositAndApprove

```ts
function depositAndApprove(client, options): Promise<`0x${string}`>;
```

Defined in: [packages/synapse-core/src/pay/payments.ts:234](https://github.com/FilOzone/synapse-sdk/blob/ebfd64582270197fd5360682eff90a0b8d418d29/packages/synapse-core/src/pay/payments.ts#L234)

Deposit funds to the payments contract and approve an operator.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `client` | `Client`\<`Transport`, `Chain`, `Account`\> | The client to use. |
| `options` | [`DepositAndApproveOptions`](/reference/filoz/synapse-core/pay/type-aliases/depositandapproveoptions/) | The options to use. |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`` `0x${string}` ``\>

The hash of the deposit transaction.

## Throws

- SimulateContractErrorType if the simulate contract fails.

## Throws

- WriteContractErrorType if the write contract fails.

## Throws

- [InsufficientBalanceError](/reference/filoz/synapse-core/errors/classes/insufficientbalanceerror/) if the balance is insufficient.