[−][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
, fee
and instructions
, signed by the first
signatures.len() keys of account_keys
account_keys: Vec<Pubkey>
All the account keys used by this transaction
recent_blockhash: Hash
The id of a recent ledger entry.
fee: u64
The number of lamports paid for processing and storing of this transaction.
program_ids: Vec<Pubkey>
All the program id keys used to execute this transaction's instructions
instructions: Vec<Instruction<u8, u8>>
Programs that will be executed in sequence and committed in one atomic transaction if all succeed.
Methods
impl Transaction
[src]
pub fn new<S: Serialize, T: KeypairUtil>(
from_keypair: &T,
transaction_keys: &[Pubkey],
program_id: &Pubkey,
userdata: &S,
recent_blockhash: Hash,
fee: u64
) -> Self
[src]
from_keypair: &T,
transaction_keys: &[Pubkey],
program_id: &Pubkey,
userdata: &S,
recent_blockhash: Hash,
fee: u64
) -> Self
pub fn new_unsigned<T: Serialize>(
from_pubkey: &Pubkey,
transaction_keys: &[Pubkey],
program_id: &Pubkey,
userdata: &T,
recent_blockhash: Hash,
fee: u64
) -> Self
[src]
from_pubkey: &Pubkey,
transaction_keys: &[Pubkey],
program_id: &Pubkey,
userdata: &T,
recent_blockhash: Hash,
fee: u64
) -> Self
pub fn new_with_instructions<T: KeypairUtil>(
from_keypairs: &[&T],
keys: &[Pubkey],
recent_blockhash: Hash,
fee: u64,
program_ids: Vec<Pubkey>,
instructions: Vec<Instruction<u8, u8>>
) -> Self
[src]
from_keypairs: &[&T],
keys: &[Pubkey],
recent_blockhash: Hash,
fee: u64,
program_ids: Vec<Pubkey>,
instructions: Vec<Instruction<u8, u8>>
) -> Self
Create a signed transaction
from_keypair
- The key used to sign the transaction. This key is stored as keys[0]account_keys
- The keys for the transaction. These are the program state instances or lamport recipient keys.recent_blockhash
- The PoH hash.fee
- The transaction fee.program_ids
- The keys that identify programs used in theinstruction
vector.instructions
- The programs and their arguments that the transaction will execute atomically
pub fn userdata(&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 program_id(&self, instruction_index: usize) -> &Pubkey
[src]
pub fn message(&self) -> Vec<u8>
[src]
Get the transaction data to sign.
pub fn sign<T: KeypairUtil>(&mut self, keypairs: &[&T], recent_blockhash: Hash)
[src]
Sign this transaction.
pub fn sign_checked<T: KeypairUtil>(
&mut self,
keypairs: &[&T],
recent_blockhash: Hash
)
[src]
&mut self,
keypairs: &[&T],
recent_blockhash: Hash
)
Check keys and keypair lengths, then sign this transaction. Note: this presumes signatures.capacity() was set to the number of required signatures.
pub fn verify_signature(&self) -> bool
[src]
Verify only the transaction signature.
pub fn verify_refs(&self) -> bool
[src]
Verify that references in the instructions are valid
pub fn from(&self) -> &Pubkey
[src]
pub fn hash(transactions: &[Transaction]) -> Hash
[src]
pub fn serialized_size(&self) -> Result<u64, Error>
[src]
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<'de> Deserialize<'de> for Transaction
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Serialize for Transaction
[src]
Auto Trait Implementations
impl Send for Transaction
impl Sync for Transaction
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,