Overview
- Access the embedded or external wallet provided by Privy.
- Prepare approval and deposit calldata with the Amplify helpers.
- Submit both transactions with
sendTransaction. - Track optimistic UI state and surface errors.
Prerequisites
- React 18+
- @privy-io/react-auth >= 3
- @paxoslabs/amplify-sdk (initialized via
initAmplifySDK) - viem >= 2.0.0 for calldata encoding and allowance checks
- Privy provider configured at the app root (
<PrivyProvider appId="...">)
Deposit Hook
Component Usage
sendTransaction resolves with the transaction hash. Add receipt polling,
analytics, and user notifications to fit your UX requirements.