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:
- Retrieves the signer’s public key
- Finds its position in the transaction’s account_keys
- Validates it’s marked as a required signer
- Signs the transaction message
- Inserts the signature at the correct position
§Arguments
signer- A type implementing SolanaSignTraittransaction- 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.