npm package: @paxoslabs/amplify-sdk
Description: Paxos Labs Amplify SDK
Author: Paxos Labs
Latest version: 0.5.2

```
   _____                 .__  .__  _____          _________________   ____  __.
  /  _  \   _____ ______ |  | |__|/ ____\__.__.  /   _____/\______ \ |    |/ _|
 /  /_\  \ /     \\____ \|  | |  \   __<   |  |  \_____  \  |    |  \|      <
/    |    \  Y Y  \  |_> >  |_|  ||  |  \___  |  /        \ |    `   \    |  \
\____|__  /__|_|  /   __/|____/__||__|  / ____| /_______  //_______  /____|__ \
        \/      \/|__|                  \/              \/         \/        \/
```

# Paxos Labs Amplify SDK

A TypeScript SDK for interacting with Paxos Labs Amplify Vaults, providing type-safe functions for discovering vaults, depositing assets, and withdrawing across multiple blockchain networks.

[![npm version](https://img.shields.io/npm/v/@paxoslabs/amplify-sdk.svg)](https://www.npmjs.com/package/@paxoslabs/amplify-sdk)
[![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

## Features

- **Vault Discovery** - Query available vaults and supported assets via API
- **Deposits** - Deposit assets into vaults with slippage protection
- **Withdrawals** - Withdraw assets from vaults with deadline protection
- **Permit Deposits** - Gas-optimized deposits using EIP-2612 permit signatures
- **Cache Management** - Optimize API calls with built-in caching
- **Multi-Chain Support** - Seamless operations across 7+ blockchain networks
- **Full TypeScript Support** - Complete type definitions and autocomplete
- **React Ready** - Works with viem (vanilla) and wagmi (React hooks)

## Installation

```bash
# npm
npm install @paxoslabs/amplify-sdk viem

# yarn
yarn add @paxoslabs/amplify-sdk viem

# pnpm
pnpm add @paxoslabs/amplify-sdk viem

# For React apps, also install wagmi
pnpm add wagmi @tanstack/react-query
```

## Quick Start

```typescript
import {
  initAmplifySDK,
  prepareDepositAuthorization,
  prepareDeposit,
  DepositAuthMethod,
} from '@paxoslabs/amplify-sdk'

// Initialize SDK with your API key
await initAmplifySDK('pxl_your_api_key')

// Or initialize with custom RPC URLs for better reliability
await initAmplifySDK('pxl_your_api_key', {
  rpcUrls: {
    1: 'https://my-eth-rpc.com', // Ethereum
    999: 'https://my-hyperEVM-rpc.com', // HyperEVM
  },
})

// Prepare deposit authorization (auto-detects permit vs approval)
const auth = await prepareDepositAuthorization({
  yieldType: 'CORE',
  depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
  depositAmount: '1000.0',
  to: userAddress,
  chainId: 1,
})

// Shared deposit parameters
const depositParams = {
  yieldType: 'CORE',
  depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  depositAmount: '1000.0',
  to: userAddress,
  chainId: 1,
}

// Handle based on authorization method
if (auth.method === DepositAuthMethod.PERMIT) {
  // Token supports EIP-2612: sign permit and deposit in one transaction
  const signature = await signTypedData(auth.permitData)
  const tx = await prepareDeposit({
    ...depositParams,
    signature,
    deadline: auth.permitData.message.deadline,
  })
  await writeContract(tx.txData)
} else if (auth.method === DepositAuthMethod.APPROVAL) {
  // Token requires ERC20 approval: approve first, then deposit
  await writeContract(auth.txData)
  const tx = await prepareDeposit(depositParams)
  await writeContract(tx.txData)
} else if (auth.method === DepositAuthMethod.ALREADY_APPROVED) {
  // Sufficient allowance exists: proceed directly to deposit
  const tx = await prepareDeposit(depositParams)
  await writeContract(tx.txData)
}
```

## Documentation

Full documentation at https://developers.paxoslabs.com/

## License

BSD © Paxos Labs

---

**Need Help?**

- 📖 [Full Documentation](./docs/getting-started.mdx)
- 🐛 [Report Issues](https://github.com/Ion-Protocol/amplify-sdk/issues)
- 💬 [GitHub Discussions](https://github.com/Ion-Protocol/amplify-sdk/discussions)