> ## 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.

# API Reference

> Complete function reference for the Amplify SDK

The Amplify SDK provides functions for initializing the SDK, fetching data, and preparing transactions for deposits and withdrawals.

## Initialization

<CardGroup cols={2}>
  <Card title="initAmplifySDK" icon="play" href="/v0.3.0/intro/products/earn/developers/api/initAmplifySDK">
    Initialize the SDK with your API key before using any other functions.
  </Card>

  <Card title="fetchSupportedAssets" icon="database" href="/v0.3.0/intro/products/earn/developers/api/fetchSupportedAssets">
    Fetch supported tokens and vault configurations for a yield type.
  </Card>
</CardGroup>

## Deposits

<CardGroup cols={2}>
  <Card title="Deposit Workflow" icon="route" href="/v0.3.0/intro/products/earn/developers/api/deposit-workflow">
    The unified deposit API with `prepareDepositAuthorization` and `prepareDeposit`.
  </Card>

  <Card title="prepareDepositTxData" icon="code" href="/v0.3.0/intro/products/earn/developers/api/prepareDepositTxData">
    Prepare transaction data for a standard deposit after approval.
  </Card>

  <Card title="prepareDepositWithPermitTxData" icon="signature" href="/v0.3.0/intro/products/earn/developers/api/prepareDepositWithPermitTxData">
    Prepare transaction data for a permit-based deposit (single transaction).
  </Card>
</CardGroup>

## Withdrawals

<CardGroup cols={2}>
  <Card title="prepareApproveWithdrawTxData" icon="check" href="/v0.3.0/intro/products/earn/developers/api/prepareApproveWithdrawTxData">
    Prepare the approval transaction required before withdrawing.
  </Card>

  <Card title="prepareWithdrawTxData" icon="arrow-up-from-bracket" href="/v0.3.0/intro/products/earn/developers/api/prepareWithdrawTxData">
    Prepare transaction data to redeem vault shares for tokens.
  </Card>
</CardGroup>

## Function Quick Reference

| Function                         | Description                               |
| -------------------------------- | ----------------------------------------- |
| `initAmplifySDK`                 | Initialize SDK with API key and options   |
| `fetchSupportedAssets`           | Get supported tokens for a yield type     |
| `prepareDepositAuthorization`    | Determine optimal authorization method    |
| `prepareDeposit`                 | Prepare deposit with auto-detected method |
| `prepareDepositTxData`           | Prepare standard deposit transaction      |
| `prepareDepositWithPermitTxData` | Prepare permit-based deposit transaction  |
| `prepareApproveWithdrawTxData`   | Prepare withdrawal approval transaction   |
| `prepareWithdrawTxData`          | Prepare withdrawal execution transaction  |

## Type Guards

The SDK exports type guards for handling discriminated union results:

```ts theme={null}
import {
  isPermitAuth,
  isApprovalAuth,
  isAlreadyApprovedAuth,
} from "@paxoslabs/amplify-sdk";

const auth = await prepareDepositAuthorization(params);

if (isPermitAuth(auth)) {
  // auth.permitData is available
} else if (isApprovalAuth(auth)) {
  // auth.txData is available
} else if (isAlreadyApprovedAuth(auth)) {
  // auth.allowance is available
}
```

See [DepositAuthMethod](/v0.3.0/intro/products/earn/developers/types/DepositAuthMethod) for full type documentation.
