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

# Functions

> SDK function reference for deposits, withdrawals, and vault operations

The Amplify SDK provides helper functions that prepare transaction data for vault operations. All functions require [SDK initialization](../sdk-initialization) before use.

<CardGroup cols={2}>
  <Card title="Deposits" icon="arrow-down-to-bracket" href="/v0.2.4/intro/products/earn/developers/functions/deposits">
    Unified deposit API with automatic permit/approval detection. Handles all deposit scenarios with a single entry point.
  </Card>

  <Card title="Withdraw" icon="arrow-up-from-bracket" href="/v0.2.4/intro/products/earn/developers/functions/withdraw">
    Prepare withdrawal transactions to redeem vault shares for underlying assets.
  </Card>
</CardGroup>

## Function Naming Convention

All transaction preparation functions use the `*TxData` suffix:

| Function                             | Purpose                                |
| ------------------------------------ | -------------------------------------- |
| `prepareDepositAuthorization()`      | Determine optimal authorization method |
| `prepareDeposit()`                   | Unified deposit preparation            |
| `prepareDepositTxData()`             | Low-level deposit transaction data     |
| `prepareApproveDepositTokenTxData()` | ERC20 approval for deposits            |
| `prepareDepositWithPermitTxData()`   | Deposit with permit signature          |
| `prepareWithdrawTxData()`            | Withdrawal transaction data            |
| `prepareApproveWithdrawTxData()`     | ERC20 approval for withdrawals         |

## Recommended Approach

Use the **Unified Deposit API** (`prepareDepositAuthorization` + `prepareDeposit`) for the best developer experience. It automatically:

* Detects if the token supports EIP-2612 permits
* Checks existing allowances
* Routes to the optimal authorization flow
* Provides type-safe discriminated unions for handling each case

See [Deposits](/v0.2.4/intro/products/earn/developers/functions/deposits) for complete documentation and examples.
