pub fn sign_sponsored_transaction<S, F>(
fee_payer_txn: &FeePayerRawTransaction,
sender: &S,
secondary_signers: &[&dyn Account],
fee_payer: &F,
) -> AptosResult<SignedTransaction>Expand description
Signs a sponsored (fee payer) transaction with all required signatures.
§Arguments
fee_payer_txn- The unsigned fee payer transactionsender- The sender accountsecondary_signers- Additional signers (if any)fee_payer- The account paying gas fees
§Example
ⓘ
use aptos_sdk::transaction::sign_sponsored_transaction;
let signed_txn = sign_sponsored_transaction(
&fee_payer_txn,
&sender_account,
&[], // No secondary signers
&fee_payer_account,
)?;§Errors
Returns an error if generating the signing message fails or if any signer fails to sign.