Function sign_sdk_transaction

Source
pub async fn sign_sdk_transaction<T: SolanaSignTrait + ?Sized>(
    signer: &T,
    transaction: Transaction,
) -> Result<(Transaction, Signature), SignerError>
Expand description

Signs a raw Solana SDK transaction by finding the signer’s position and adding the signature

This helper function:

  1. Retrieves the signer’s public key
  2. Finds its position in the transaction’s account_keys
  3. Validates it’s marked as a required signer
  4. Signs the transaction message
  5. Inserts the signature at the correct position

§Arguments

  • signer - A type implementing SolanaSignTrait
  • transaction - The Solana SDK transaction to sign

§Returns

A Result containing either a tuple of (signed Transaction, Signature) or a SignerError

§Note

This is distinct from the Signer::sign_transaction method which operates on domain models. This function works directly with solana_sdk::transaction::Transaction.