Struct solana_sdk::transaction::Transaction [−][src]
Expand description
An atomic transaction
Fields
signatures: Vec<Signature>
A set of digital signatures of account_keys
, program_ids
, recent_blockhash
, and instructions
, signed by the first
signatures.len() keys of account_keys
NOTE: Serialization-related changes must be paired with the direct read at sigverify.
message: Message
The message to sign.
Implementations
pub fn new_signed_with_payer<T: Signers>(
instructions: &[Instruction],
payer: Option<&Pubkey>,
signing_keypairs: &T,
recent_blockhash: Hash
) -> Self
pub fn new_signed_with_payer<T: Signers>(
instructions: &[Instruction],
payer: Option<&Pubkey>,
signing_keypairs: &T,
recent_blockhash: Hash
) -> Self
Create a signed transaction
from_keypairs
- The keys used to sign the transaction.keys
- The keys for the transaction. These are the program state instances or lamport recipient keys.recent_blockhash
- The PoH hash.program_ids
- The keys that identify programs used in theinstruction
vector.instructions
- Instructions that will be executed atomically.
Panics
Panics when signing fails.
Return the serialized message data to sign.
Check keys and keypair lengths, then sign this transaction.
Panics
Panics when signing fails, use Transaction::try_sign
to handle the error.
Sign using some subset of required keys if recent_blockhash is not the same as currently in the transaction, clear any prior signatures and update recent_blockhash
Panics
Panics when signing fails, use Transaction::try_partial_sign
to handle the error.
Sign the transaction and place the signatures in their associated positions in signatures
without checking that the positions are correct.
Panics
Panics when signing fails, use Transaction::try_partial_sign_unchecked
to handle the error.
Check keys and keypair lengths, then sign this transaction, returning any signing errors encountered
pub fn try_partial_sign<T: Signers>(
&mut self,
keypairs: &T,
recent_blockhash: Hash
) -> Result<(), SignerError>
pub fn try_partial_sign<T: Signers>(
&mut self,
keypairs: &T,
recent_blockhash: Hash
) -> Result<(), SignerError>
Sign using some subset of required keys, returning any signing errors encountered. If recent_blockhash is not the same as currently in the transaction, clear any prior signatures and update recent_blockhash
pub fn try_partial_sign_unchecked<T: Signers>(
&mut self,
keypairs: &T,
positions: Vec<usize>,
recent_blockhash: Hash
) -> Result<(), SignerError>
pub fn try_partial_sign_unchecked<T: Signers>(
&mut self,
keypairs: &T,
positions: Vec<usize>,
recent_blockhash: Hash
) -> Result<(), SignerError>
Sign the transaction, returning any signing errors encountered, and place the
signatures in their associated positions in signatures
without checking that the
positions are correct.
Verify the transaction and hash its message
pub fn verify_with_results(&self) -> Vec<bool>ⓘ
Get the positions of the pubkeys in account_keys
associated with signing keypairs
Replace all the signatures and pubkeys
Trait Implementations
Returns the “default value” for a type. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self