Execute transactions on the Solana blockchain using Para’s integrated signers. This includes signing and broadcasting transactions to the network.

Setup Solana Libraries First

import { useParaSolana } from './hooks/useParaSolana';
import { Transaction, SystemProgram, LAMPORTS_PER_SOL, PublicKey } from '@solana/web3.js';

function SendTransaction() {
  const { connection, signer } = useParaSolana();
  
  const sendSOL = async () => {
    if (!signer) {
      console.error("No signer available. Connect wallet first.");
      return;
    }
    
    const recipient = new PublicKey("RECIPIENT_ADDRESS_HERE");
    
    const transaction = new Transaction().add(
      SystemProgram.transfer({
        fromPubkey: signer.sender,
        toPubkey: recipient,
        lamports: LAMPORTS_PER_SOL * 0.1,
      })
    );
    
    try {
      const signature = await signer.sendTransaction(transaction, {
        skipPreflight: false,
        preflightCommitment: "confirmed",
      });
      
      console.log("Transaction signature:", signature);
      
      const confirmation = await connection.confirmTransaction(signature, "confirmed");
      console.log("Transaction confirmed:", confirmation);
    } catch (error) {
      console.error("Transaction failed:", error);
    }
  };
  
  return <button onClick={sendSOL}>Send 0.1 SOL</button>;
}

Next Steps