@orca-so/tx-sender
    Preparing search index...

    Function sendTransaction

    • Sends a signed transaction message to the Solana network with a specified commitment level. Asserts that the transaction is fully signed before sending.

      Parameters

      • transaction: Readonly<Transaction & TransactionWithLifetime>

        The transaction to send (will be asserted as fully signed).

      • Optionalcommitment: Commitment = "confirmed"

        The commitment level for transaction confirmation.

      Returns Promise<Signature>

      A promise that resolves to the transaction signature.

      If transaction is missing signatures, sending fails, the RPC connection fails, or the transaction expires.

      // With KeyPairSigner (Node.js) - already fully signed
      const tx = await buildTransaction(instructions, keypairSigner);
      const signature = await sendTransaction(tx, "confirmed");

      // With wallet signature (browser)
      const partialTx = await buildTransaction(instructions, noopSigner);
      const [signedTx] = await wallet.modifyAndSignTransactions([partialTx]);
      const signature = await sendTransaction(signedTx, "confirmed");