pub struct PartiallySigned {
pub fee_payer_txn: FeePayerRawTransaction,
pub sender_auth: Option<AccountAuthenticator>,
pub secondary_auths: Vec<Option<AccountAuthenticator>>,
pub fee_payer_auth: Option<AccountAuthenticator>,
}Expand description
A partially signed sponsored transaction.
This represents a sponsored transaction that has been signed by some but not all required signers. It can be passed between parties for signature collection.
Fields§
§fee_payer_txn: FeePayerRawTransactionThe underlying fee payer transaction.
sender_auth: Option<AccountAuthenticator>Sender’s signature (if signed).
secondary_auths: Vec<Option<AccountAuthenticator>>Secondary signer signatures.
fee_payer_auth: Option<AccountAuthenticator>Fee payer’s signature (if signed).
Implementations§
Source§impl PartiallySigned
impl PartiallySigned
Sourcepub fn new(fee_payer_txn: FeePayerRawTransaction) -> Self
pub fn new(fee_payer_txn: FeePayerRawTransaction) -> Self
Creates a new partially signed transaction.
Sourcepub fn sign_as_sender<A: Account>(&mut self, sender: &A) -> AptosResult<()>
pub fn sign_as_sender<A: Account>(&mut self, sender: &A) -> AptosResult<()>
Signs as the sender.
§Errors
Returns an error if generating the signing message fails, if signing fails, or if the signature scheme is not recognized.
Sourcepub fn sign_as_secondary<A: Account>(
&mut self,
index: usize,
signer: &A,
) -> AptosResult<()>
pub fn sign_as_secondary<A: Account>( &mut self, index: usize, signer: &A, ) -> AptosResult<()>
Signs as a secondary signer at the given index.
§Errors
Returns an error if the index is out of bounds, if generating the signing message fails, if signing fails, or if the signature scheme is not recognized.
Sourcepub fn sign_as_fee_payer<A: Account>(
&mut self,
fee_payer: &A,
) -> AptosResult<()>
pub fn sign_as_fee_payer<A: Account>( &mut self, fee_payer: &A, ) -> AptosResult<()>
Signs as the fee payer.
§Errors
Returns an error if generating the signing message fails, if signing fails, or if the signature scheme is not recognized.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Checks if all required signatures have been collected.
Sourcepub fn finalize(self) -> AptosResult<SignedTransaction>
pub fn finalize(self) -> AptosResult<SignedTransaction>
Finalizes the transaction if all signatures are present.
Returns an error if any signatures are missing.
§Errors
Returns an error if the sender signature, fee payer signature, or any secondary signer signature is missing.
Trait Implementations§
Source§impl Clone for PartiallySigned
impl Clone for PartiallySigned
Source§fn clone(&self) -> PartiallySigned
fn clone(&self) -> PartiallySigned
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more