@solana/spl-token and @solana/web3.js with Privy wallets. In this example, we’ll use USDC as the SPL token, but you can adapt it for any SPL token by changing the mint address and decimals.
Before following this recipe, make sure you have configured Privy for
Solana in your app.
Overview
This recipe demonstrates how to:- Create an SPL token transfer transaction using
@solana/spl-token - Handle token accounts and decimals properly
- Sign and send the transaction using Privy wallets
Prerequisites
Install the required dependencies:- TypeScript
- Python
bash npm install @solana/web3.js @solana/spl-token 1. Create the SPL token transfer transaction
Create an SPL token transfer transaction using your preferred language:2. Send the transaction
You can send the transaction using Privy’s different SDKs. Below are examples for React, React Native, NodeJS, and Python: You’ve successfully sent SPL tokens!Token account considerations
Getting token account information
You can check if token accounts exist and get their addresses:Next steps
Now that you can send SPL tokens, you might want to explore:- Sending SOL - Learn how to send native SOL tokens
- Web3 integrations - Advanced integration patterns with Solana libraries

