Solana Integration
Integrate Para with Solana in your Flutter applications
Introduction
This guide demonstrates how to integrate Para with Solana in your Flutter applications. Para acts as a secure signer for your Solana transactions, while the Solana Dart package handles the blockchain interactions.
Para’s approach to Solana transaction signing is designed for flexibility and security:
- Para signs the raw transaction bytes without modifying the transaction data
- Your application maintains full control over transaction construction
- Your private keys remain secure in Para’s wallet infrastructure
Prerequisites
Before you begin, ensure you have:
- Para SDK set up in your Flutter project (see the Setup Guide)
- A user authenticated with Para
- Solana Dart package installed in your project
Setting Up the Para Solana Signer
The Para SDK provides a Solana signer that works with the Solana Dart package. First, let’s create the necessary components:
Sending Transactions
After signing a transaction, you can send it to the Solana network:
Checking Transaction Status
After sending a transaction, you may want to check its status:
Working with SPL Tokens
Para can also sign transactions involving SPL tokens (Solana’s token standard). Here’s an example of transferring an SPL token:
Best Practices
When using Para with Solana:
- Always verify transaction data before signing: Para signs whatever you provide, so ensure transaction data is correct
- Use appropriate commitment levels: For important transactions, wait for “confirmed” or “finalized” commitment
- Handle network congestion: Solana transactions can fail during network congestion, implement appropriate retry mechanisms
- Check token accounts: Always verify token accounts exist before sending SPL tokens
- Test on devnet first: Always test your integration on Solana devnet before moving to mainnet
Example
For an example of signing with Solana transactions using para and the Solana Dart package, check out the following code example:
Resources
For more information about using the Solana Dart package, refer to the official documentation: