> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Solana Interactions

For interacting the SVM blockchain, you must have our `dynamic_sdk_solana` package installed. Add the package to your `pubspec.yaml`:

```yaml theme={"system"}
dependencies:
  dynamic_sdk_solana: ^1.2.4
```

Here is an example on how you can interact with the SVM by signing the message or sending the transaction:

````dart theme={"system"}
Future<void> _signSolanaMessage(String message) async {
    if (_wallet == null) {
      print('Please connect a wallet first.');
      return;
    }
    
    try {
      final signer = _sdk.solana.createSigner(wallet: _wallet!);
      final signature = await signer.signMessage(message: message);
      print('Message signed with signature: $signature');
    } catch (e) {
      print('An error occurred while signing the message: $e');
    }
  }

  Future<void> _sendSolanaTransaction(String recipientAddress, double amount) async {
    if (_wallet == null) {
      print('Please connect a wallet first.');
      return;
    }

    try {
      final signer = _sdk.solana.createSigner(wallet: _wallet!);
      final connection = _sdk.solana.createConnection();

      final fromPubKey = Pubkey.fromString(_wallet!.address);
      final toPubKey = Pubkey.fromString(recipientAddress);

      final BlockhashWithExpiryBlockHeight recentBlockhash =
          await connection.getLatestBlockhash();

      final transaction = Transaction.v0(
        payer: fromPubKey,
        recentBlockhash: recentBlockhash.blockhash,
        instructions: [
          SystemProgram.transfer(
            fromPubkey: fromPubKey,
            toPubkey: toPubKey,
            lamports: solToLamports(amount),
          ),
        ],
      );

      final signature = await signer.signAndSendTransaction(transaction: transaction);
      print('Transaction sent with signature: $signature');
    } catch (e) {
      print('An error occurred while sending the transaction: $e');
    }
  }```
````
