> ## Documentation Index
> Fetch the complete documentation index at: https://sdk.umbraprivacy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deposit

> V18 API reference: getATAIntoETADirectDepositorFunction + 4 Stealth Pool Note creators.

All deposit-side factories live under `@umbra-privacy/sdk/deposit`.

***

## getATAIntoETADirectDepositorFunction

**Import:** `@umbra-privacy/sdk/deposit`

```typescript theme={null}
function getATAIntoETADirectDepositorFunction(
  args: { client: IUmbraClient },
  deps?: GetATAIntoETADirectDepositorFunctionDeps,
): ATAIntoETADirectDepositorFunction;
```

Transfers tokens from an ATA into a destination user's ETA. The destination must be registered on Umbra. This is the primary deposit path — no ZK proof required. Follows the [dual-instruction pattern](/concepts/how-umbra-works#the-dual-instruction-pattern).

### Deps

* `accountInfoProvider?: AccountInfoProviderFunction`.
* `getLatestBlockhash?: GetLatestBlockhash`.
* `transactionForwarder?: TransactionForwarder`.
* `getEpochInfo?: GetEpochInfo` — required for Token-2022 transfer-fee calculation.

### Returns

```typescript theme={null}
type ATAIntoETADirectDepositorFunction = (
  destinationAddress: Address,
  mint: Address,
  transferAmount: U64,
  options?: ATAIntoETADirectDepositorOptions,
) => Promise<DepositResult>;
```

### Options (`ATAIntoETADirectDepositorOptions`)

```typescript theme={null}
interface ATAIntoETADirectDepositorOptions {
  readonly optionalData?: OptionalData32;                   // 32-byte caller metadata (pre-hashed / pre-encrypted)
  readonly accountInfoCommitment?: Commitment;              // default "confirmed"
  readonly epochInfoCommitment?: Commitment;                // default "confirmed"
  readonly hooks?: ATAIntoETADirectDepositHooks;
}
```

* `optionalData` — 32 bytes of opaque caller metadata. **Must be pre-hashed or pre-encrypted.** Default 32 zero bytes.
* `accountInfoCommitment` — per-call commitment for RPC reads.
* `epochInfoCommitment` — per-call commitment for epoch-info fetches (Token-2022 transfer-fee schedule).
* `hooks` — per-phase lifecycle hooks. Keys: `onValidationStart`, `onValidationComplete`, `onMintFetchStart`, `onMintFetchComplete`, `onAccountFetchStart`, `onAccountFetchComplete`, `onArciumSetupStart`, `onArciumSetupComplete`, `onInstructionBuildStart`, `onInstructionBuildComplete`, `queueComputation` (`MpcTransactionStepHooks`), `onComplete`, `onError`.

There are no `priorityFees`, `awaitCallback`, `skipPreflight`, `maxRetries`, or `purpose` options at call time. Priority fees and retry policy are configured at factory time via `deps.microLamportsPerAcuPolicy` and `deps.transactionForwarder`.

### DepositResult

```typescript theme={null}
interface DepositResult {
  readonly signatures: readonly TransactionSignature[];
  readonly queueSignature: TransactionSignature;
  readonly callback?: CallbackOutcome;
  readonly rentClaim?: RentClaimOutcome;
}

type CallbackOutcome =
  | { readonly status: "finalized"; readonly signature?: TransactionSignature; readonly elapsedMs: number }
  | { readonly status: "pruned";    readonly elapsedMs: number }
  | { readonly status: "timed-out"; readonly elapsedMs: number };

type RentClaimOutcome =
  | { readonly claimed: true;  readonly signature: TransactionSignature }
  | { readonly claimed: false; readonly reason: string };
```

* `signatures` — every tx signature submitted, in submission order (handler, callback, rent claim).
* `queueSignature` — handler (queue computation) signature.
* `callback` — present once the callback round-trip completes (always awaited). `"finalized"` exposes the MPC callback `signature`; other statuses indicate the callback did not land.
* `rentClaim` — best-effort. `claimed: false` does not invalidate the deposit.

### Errors

Throws `EncryptedDepositError`. See [Errors](./errors#encrypteddepositerror).

### Example

```typescript theme={null}
import { getATAIntoETADirectDepositorFunction } from "@umbra-privacy/sdk/deposit";

const deposit = getATAIntoETADirectDepositorFunction({ client });
const result  = await deposit(recipientAddress, mintAddress, 1_000_000n);
console.log("Queue signature:", result.queueSignature);
if (result.callback?.status === "finalized") {
  console.log("Callback signature:", result.callback.signature);
}
```

***

## getETAIntoSelfBurnableStealthPoolNoteCreatorFunction

**Import:** `@umbra-privacy/sdk/deposit`

```typescript theme={null}
function getETAIntoSelfBurnableStealthPoolNoteCreatorFunction(
  args: { client: IUmbraClient },
  deps: { zkProver: IZkProverForETAIntoStealthPoolNote; /* … */ },
): ETAIntoSelfBurnableStealthPoolNoteCreatorFunction;
```

Writes a self-burnable Stealth Pool Note funded from the caller's ETA (ETA → pool). The note can only be burnt by the writer. Two-tx MPC pipeline. `deps.zkProver` is **required** — use `getETAIntoStealthPoolNoteCreatorProver` from `@umbra-privacy/sdk/zk-prover`.

### Returns

```typescript theme={null}
type ETAIntoSelfBurnableStealthPoolNoteCreatorFunction = (
  args: CreateStealthPoolNoteArgs,
  options?: CreateStealthPoolNoteOptions,
) => Promise<ETAIntoStealthPoolNoteCreatorResult>;
```

### CreateStealthPoolNoteArgs

* `amount: U64` — net amount locked into the note (pre-fee).
* `destinationAddress: Address` — unlocker address (must equal the caller for self-burnable).
* `mint: Address` — token mint address.

### CreateStealthPoolNoteOptions (ETA-source)

* `generationIndex?: U256` — deterministic generation index. Default: random `U256`. Pass the same value on retry to allow the pipeline's `closeProofAccount` step to reclaim a proof-account orphan from a prior failed attempt.
* `optionalData?: OptionalData32` — caller metadata. Pre-hashed only. Default 32 zero bytes.
* `accountInfoCommitment?: Commitment` — per-call RPC commitment. Default `"confirmed"`.

(Per-step hooks for the ETA-source pipeline are attached at factory time via `deps.hooks: ETAIntoStealthPoolNoteCreatorHooks`, not on the per-call options object.)

### Errors

Throws `CreateUtxoError`. See [Errors](./errors#createutxoerror).

***

## getETAIntoReceiverBurnableStealthPoolNoteCreatorFunction

**Import:** `@umbra-privacy/sdk/deposit`

Same shape as the self variant. `deps.zkProver` is `IZkProverForETAIntoStealthPoolNote` — use `getETAIntoStealthPoolNoteCreatorProver` from `@umbra-privacy/sdk/zk-prover`.

**Recipient prerequisite:** must have all three registration sub-step flags (`isInitialised`, `isUserAccountX25519KeyRegistered`, `isUserCommitmentRegistered`). Pre-check with `getUserAccountQuerierFunction` from `@umbra-privacy/sdk/query` before calling — fall back to the self-burnable creator if the recipient is not ready.

***

## getATAIntoSelfBurnableStealthPoolNoteCreatorFunction

**Import:** `@umbra-privacy/sdk/deposit`

```typescript theme={null}
function getATAIntoSelfBurnableStealthPoolNoteCreatorFunction(
  args: { client: IUmbraClient },
  deps: { zkProver: IZkProverForATAIntoStealthPoolNote; /* … */ },
): ATAIntoSelfBurnableStealthPoolNoteCreatorFunction;
```

Writes a self-burnable note funded from an ATA (ATA → pool). Single-tx, no MPC. `deps.zkProver` is **required** — use `getATAIntoStealthPoolNoteCreatorProver` from `@umbra-privacy/sdk/zk-prover`.

### Returns

```typescript theme={null}
type ATAIntoSelfBurnableStealthPoolNoteCreatorFunction = (
  args: CreateStealthPoolNoteArgs,
  options?: ATAIntoStealthPoolNoteCreatorOptions,
) => Promise<ATAIntoStealthPoolNoteCreatorResult>;
```

### ATAIntoStealthPoolNoteCreatorOptions (ATA-source)

* `generationIndex?: U256`.
* `optionalData?: OptionalData32`.
* `accountInfoCommitment?: Commitment` — default `"confirmed"`.
* `epochInfoCommitment?: Commitment` — default `"confirmed"`.
* `hooks?: ATAIntoStealthPoolNoteCreatorHooks` — per-phase + per-step lifecycle hooks. Step slot names: `closeProofAccount`, `populateProofAccount`, `createStealthPoolNote` — each `SkippableDirectTransactionStepHooks` with `{ onPreSend, onPostSend, onSkipped }`.

### Errors

Throws `CreateUtxoError`. See [Errors](./errors#createutxoerror).

***

## getATAIntoReceiverBurnableStealthPoolNoteCreatorFunction

**Import:** `@umbra-privacy/sdk/deposit`

Same shape as the self-ATA variant. `deps.zkProver` is `IZkProverForATAIntoStealthPoolNote` — use `getATAIntoStealthPoolNoteCreatorProver` from `@umbra-privacy/sdk/zk-prover`.

**Recipient prerequisite:** must have all three registration sub-step flags. Pre-check and fall back to self-burnable when needed.

***

## EncryptedDepositError

Thrown by the ATA→ETA depositor.

Stage values: `"initialization"` | `"validation"` | `"mint-fetch"` | `"fee-calculation"` | `"pda-derivation"` | `"account-fetch"` | `"instruction-build"` | `"transaction-build"` | `"transaction-compile"` | `"transaction-sign"` | `"transaction-validate"` | `"transaction-send"`.

See [Errors](./errors#encrypteddepositerror).

***

## CreateUtxoError

Thrown by all four Stealth Pool Note creators.

Stage values: `"initialization"` | `"validation"` | `"account-fetch"` | `"mint-fetch"` | `"fee-calculation"` | `"key-derivation"` | `"zk-proof-generation"` | `"pda-derivation"` | `"instruction-build"` | `"transaction-build"` | `"transaction-compile"` | `"transaction-sign"` | `"transaction-validate"` | `"transaction-send"`.

See [Errors](./errors#createutxoerror).
