prepareWithdrawTxData with Privy’s wallet connection hooks. This pattern keeps signer UX inside Privy while letting the Amplify SDK handle calldata.
Overview
- Fetch the target vault (for example with
fetchVaultsand React Query). - Prepare withdrawal calldata with slippage protection.
- Submit the transaction via Privy’s
sendTransaction. - Track optimistic state and surface any
APIErrordetails.
Prerequisites
- React 18+
- @privy-io/react-auth >= 3
- @paxoslabs/amplify-sdk
- Vault metadata available in your component (e.g., from
fetchVaults)
Withdraw Hook
Component Usage
prepareWithdrawTxData throws APIError when the vault or asset is
unsupported. Log the endpoint and statusCode to help users fall back to
alternate flows.