[][src]Struct solana_sdk::transaction::Transaction

pub struct Transaction {
    pub signatures: Vec<Signature>,
    pub account_keys: Vec<Pubkey>,
    pub recent_blockhash: Hash,
    pub fee: u64,
    pub program_ids: Vec<Pubkey>,
    pub instructions: Vec<Instruction<u8, u8>>,
}

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]

pub fn new_unsigned<T: Serialize>(
    from_pubkey: &Pubkey,
    transaction_keys: &[Pubkey],
    program_id: &Pubkey,
    userdata: &T,
    recent_blockhash: Hash,
    fee: u64
) -> Self
[src]

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]

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 the instruction 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]

pub fn signer_key(
    &self,
    instruction_index: usize,
    accounts_index: usize
) -> Option<&Pubkey>
[src]

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]

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]

impl Clone for 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]

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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]