> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://ensforge.com/api/mcp` to find what you need.

# useWithdrawHcaDeposit

Use the validated owner self-call withdrawal route. Uses the SDK from `EnsforgeProvider`.

## Import

```tsx
import { useWithdrawHcaDeposit } from "@ensforge/react";
```

## Usage

:::code-group
```tsx [component.tsx]
import { useWithdrawHcaDeposit } from "@ensforge/react";

function Component() {
  const mutation = useWithdrawHcaDeposit();

  return (
    <button
      disabled={mutation.isWaiting}
      onClick={() =>
        mutation.mutate({
          hca: "0x1234567890123456789012345678901234567890",
          amount: 1_000_000_000_000_000n,
          to: "0x2345678901234567890123456789012345678901",
        })
      }
    >
      Submit
    </button>
  );
}
```

```tsx [provider.tsx]
// [!include ~/snippets/hca/provider.tsx]
```
:::

## Parameters

```ts
import type { EnsMutationOptions } from "@ensforge/react";
```

The hook accepts an optional `EnsMutationOptions` object.

### retry

`false | Schedule<unknown, Failure> | undefined`

An Effect schedule used to retry typed failures. It defaults to `false`. Only retry writes that are
known to be safe and idempotent.

### onExit

`(exit: Exit<Success, Failure>, parameters: Parameters) => void`

Receives the complete Effect `Exit` and the exact mutation parameters after execution. Use
`Exit.match` or `Exit.isSuccess` to handle both outcomes without losing typed failures.

See [Mutation Options](/react/api/mutation-options) for schedules, provider defaults, and per-call
`onExit` handlers.

## Mutation Parameters

```ts
import type { HcaManagementParameters } from "@ensforge/sdk/hca";
```

### hca

`` `0x${string}` ``

HCA address to inspect or operate on.

### amount

`bigint`

Native token amount in wei.

### to

`` `0x${string}` ``

Destination address.

### salt

`bigint | undefined`

Account derivation salt. Defaults to the deployment profile canonical salt.

### confirmation

`ConfirmationPolicy | undefined`

Receipt confirmation policy.

### walletClient

`WalletClient | undefined`

Viem wallet override. Defaults to the configured wallet resolver.

### account

`` `0x${string}` | Account | undefined ``

Wallet account override for the operation.

## Return Type

```ts
type Result = ReturnType<typeof useWithdrawHcaDeposit>;
```

Returns an [`EnsMutationResult`](/react/api/mutation-result).

| Property       | Description                                                    |
| -------------- | -------------------------------------------------------------- |
| `mutate`       | Starts the mutation and optionally reports its `Exit`.         |
| `mutateAsync`  | Starts the mutation and returns a Promise.                     |
| `mutateEffect` | Starts the mutation and returns an Effect with typed failures. |
| `data`         | Latest successful value, or `undefined`.                       |
| `error`        | Latest typed failure, an unexpected `Error`, or `null`.        |
| `cause`        | Complete Effect cause for the latest failure.                  |
| `isInitial`    | The mutation has not executed since creation or reset.         |
| `isWaiting`    | The mutation Effect is currently running.                      |
| `isSuccess`    | The latest execution succeeded.                                |
| `isFailure`    | The latest execution failed.                                   |
| `parameters`   | Parameters used by the latest execution.                       |
| `interrupt`    | Interrupts the active Effect.                                  |
| `reset`        | Restores the mutation to its initial state.                    |
| `result`       | Underlying Effect `AsyncResult`.                               |

## Effect Atom

```ts
import { createWithdrawHcaDepositMutationAtom } from "@ensforge/react/atoms";
import { sdk } from "./client";

const atom = createWithdrawHcaDepositMutationAtom(sdk);
```

## Action

* [`withdrawHcaDeposit`](/core/api/actions/hca/withdraw-hca-deposit)
* [`sdk.hca.withdrawHcaDeposit`](/sdk/api/hca/withdraw-hca-deposit)
