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

# sendDeposit

Start a deposit from the connected EOA to its Zyfai Smart Wallet. This is the
recommended deposit API.

`sendDeposit` confirms the ERC-20 transfer and registers its custody-credit
lifecycle. It does **not** wait for the backend handover to finish. That split
matches the familiar `sendTransaction` → `waitForTransactionReceipt` model:

1. Call `sendDeposit` to send, confirm, and register the deposit.
2. Read `result.registration.id`.
3. Call [`waitForDepositCredit`](/docs/sdk/api/wait-for-deposit-credit) when
   your UI needs to wait until the funds are investable.

On the first deposit, Zyfai assigns the user's EOA a pre-deployed Safe with a
signed session key. No separate deploy or session-key API is needed.

## Signature

```typescript theme={null}
sendDeposit(
  userAddress: string,
  chainId: SupportedChainId,
  amount: string,
  asset: string,
  strategy?: Strategy,
): Promise<DepositResponse>
```

## Example

```typescript theme={null}
await sdk.connectAccount(walletProvider, 8453);

const sent = await sdk.sendDeposit(
  userAddress,
  8453,
  "100000000", // 100 USDC
  "USDC",
  "conservative", // first deposit only
);

console.log("Transfer confirmed:", sent.txHash);
console.log("Credit lifecycle:", sent.registration.status);

const credited = await sdk.waitForDepositCredit(
  sent.registration.id,
  8453,
);
console.log("Funds are investable:", credited.id);
```

`sendDeposit` may already return `credited`. Passing that lifecycle ID to
`waitForDepositCredit` is safe; the helper returns immediately when credit is
complete.

## Lifecycle states

| State              | Meaning                                                                                    |
| ------------------ | ------------------------------------------------------------------------------------------ |
| `handover_pending` | Transfer is confirmed and registered; custody handover or balance credit is still running. |
| `credited`         | Funds are credited and investable.                                                         |
| `recovered_to_eoa` | Terminal recovery: funds were returned to the EOA and were not credited.                   |

Use [`getDepositStatus`](/docs/sdk/api/get-deposit-status) for a one-off UI
refresh. Do not show a pending deposit as yield-bearing until it is `credited`
and `balanceCredited` is `true`.

## Custom and sponsored wallets

For Privy, Biconomy, mobile, or other app-managed wallets, use the
[external deposit building blocks](/docs/sdk/api/external-deposit-building-blocks):
prepare the first deposit, build and submit the transfer, confirm it, then
register it with `logDeposit` and await credit.

## Compatibility

[`depositFunds`](/docs/sdk/api/deposit-funds) remains available for existing
integrations. It is a convenience wrapper around `sendDeposit` plus a short
normal credit wait. New integrations should own the completion UX explicitly
with `sendDeposit` and `waitForDepositCredit`.
