[−][src]Struct solana_sdk::transaction::Transaction
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
message: Message
The message to sign.
Methods
impl Transaction
[src]
pub fn new_unsigned(message: Message) -> Self
[src]
pub fn new_with_payer(
instructions: Vec<Instruction>,
payer: Option<&Pubkey>
) -> Self
[src]
instructions: Vec<Instruction>,
payer: Option<&Pubkey>
) -> Self
pub fn new_signed_with_payer<T: KeypairUtil>(
instructions: Vec<Instruction>,
payer: Option<&Pubkey>,
signing_keypairs: &[&T],
recent_blockhash: Hash
) -> Self
[src]
instructions: Vec<Instruction>,
payer: Option<&Pubkey>,
signing_keypairs: &[&T],
recent_blockhash: Hash
) -> Self
pub fn new_unsigned_instructions(instructions: Vec<Instruction>) -> Self
[src]
pub fn new<T: KeypairUtil>(
from_keypairs: &[&T],
message: Message,
recent_blockhash: Hash
) -> Transaction
[src]
from_keypairs: &[&T],
message: Message,
recent_blockhash: Hash
) -> Transaction
pub fn new_signed_instructions<T: KeypairUtil>(
from_keypairs: &[&T],
instructions: Vec<Instruction>,
recent_blockhash: Hash
) -> Transaction
[src]
from_keypairs: &[&T],
instructions: Vec<Instruction>,
recent_blockhash: Hash
) -> Transaction
pub fn new_with_compiled_instructions<T: KeypairUtil>(
from_keypairs: &[&T],
keys: &[Pubkey],
recent_blockhash: Hash,
program_ids: Vec<Pubkey>,
instructions: Vec<CompiledInstruction>
) -> Self
[src]
from_keypairs: &[&T],
keys: &[Pubkey],
recent_blockhash: Hash,
program_ids: Vec<Pubkey>,
instructions: Vec<CompiledInstruction>
) -> 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.
pub fn data(&self, instruction_index: usize) -> &[u8]
[src]
pub fn key(
&self,
instruction_index: usize,
accounts_index: usize
) -> Option<&Pubkey>
[src]
&self,
instruction_index: usize,
accounts_index: usize
) -> Option<&Pubkey>
pub fn signer_key(
&self,
instruction_index: usize,
accounts_index: usize
) -> Option<&Pubkey>
[src]
&self,
instruction_index: usize,
accounts_index: usize
) -> Option<&Pubkey>
pub fn message(&self) -> &Message
[src]
Return a message containing all data that should be signed.
pub fn message_data(&self) -> Vec<u8>
[src]
Return the serialized message data to sign.
pub fn sign<T: KeypairUtil>(&mut self, keypairs: &[&T], recent_blockhash: Hash)
[src]
Check keys and keypair lengths, then sign this transaction.
pub fn partial_sign<T: KeypairUtil>(
&mut self,
keypairs: &[&T],
recent_blockhash: Hash
)
[src]
&mut self,
keypairs: &[&T],
recent_blockhash: Hash
)
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
pub fn partial_sign_unchecked<T: KeypairUtil>(
&mut self,
keypairs: &[&T],
positions: Vec<usize>,
recent_blockhash: Hash
)
[src]
&mut self,
keypairs: &[&T],
positions: Vec<usize>,
recent_blockhash: Hash
)
Sign the transaction and place the signatures in their associated positions in signatures
without checking that the positions are correct.
pub fn get_signing_keypair_positions<T: KeypairUtil>(
&self,
keypairs: &[&T]
) -> Result<Vec<Option<usize>>>
[src]
&self,
keypairs: &[&T]
) -> Result<Vec<Option<usize>>>
Get the positions of the pubkeys in account_keys
associated with signing keypairs
pub fn is_signed(&self) -> bool
[src]
pub fn verify_refs(&self) -> bool
[src]
Verify that references in the instructions are valid
Trait Implementations
impl PartialEq<Transaction> for Transaction
[src]
fn eq(&self, other: &Transaction) -> bool
[src]
fn ne(&self, other: &Transaction) -> bool
[src]
impl Clone for Transaction
[src]
fn clone(&self) -> Transaction
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Transaction
[src]
impl Debug for Transaction
[src]
impl Serialize for Transaction
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Transaction
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for Transaction
impl Unpin for Transaction
impl Sync for Transaction
impl RefUnwindSafe for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same<T> for T
type Output = T
Should always be Self