pub struct Transaction {Show 16 fields
pub fee_payer: TnPubkey,
pub program: TnPubkey,
pub rw_accs: Option<Vec<TnPubkey>>,
pub r_accs: Option<Vec<TnPubkey>>,
pub instructions: Option<Vec<u8>>,
pub fee: u64,
pub req_compute_units: u32,
pub req_state_units: u16,
pub req_memory_units: u16,
pub expiry_after: u32,
pub start_slot: u64,
pub nonce: u64,
pub flags: u8,
pub signature: Option<TnSignature>,
pub fee_payer_state_proof: Option<StateProof>,
pub fee_payer_account_meta_raw: Option<Vec<u8>>,
}Expand description
Normal Rust struct for transaction construction
Fields§
§fee_payer: TnPubkey§program: TnPubkey§rw_accs: Option<Vec<TnPubkey>>§r_accs: Option<Vec<TnPubkey>>§instructions: Option<Vec<u8>>§fee: u64§req_compute_units: u32§req_state_units: u16§req_memory_units: u16§expiry_after: u32§start_slot: u64§nonce: u64§flags: u8§signature: Option<TnSignature>§fee_payer_state_proof: Option<StateProof>§fee_payer_account_meta_raw: Option<Vec<u8>>Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn new(fee_payer: TnPubkey, program: TnPubkey, fee: u64, nonce: u64) -> Self
pub fn new(fee_payer: TnPubkey, program: TnPubkey, fee: u64, nonce: u64) -> Self
Create a new unsigned transaction
pub fn has_fee_payer_state_proof(&self) -> bool
pub fn may_compress_account(&self) -> bool
pub fn get_signature(&self) -> Option<Signature>
pub fn with_may_compress_account(self) -> Self
Sourcepub fn with_fee_payer_state_proof(self, state_proof: &StateProof) -> Self
pub fn with_fee_payer_state_proof(self, state_proof: &StateProof) -> Self
Builder method: set fee payer state proof
Sourcepub fn with_fee_payer_account_meta_raw(self, account_meta_raw: Vec<u8>) -> Self
pub fn with_fee_payer_account_meta_raw(self, account_meta_raw: Vec<u8>) -> Self
Builder method: set fee payer account meta as raw bytes
Sourcepub fn without_fee_payer_state_proof(self) -> Self
pub fn without_fee_payer_state_proof(self) -> Self
Builder method: remove fee payer state proof
Sourcepub fn with_rw_accounts(self, accounts: Vec<TnPubkey>) -> Self
pub fn with_rw_accounts(self, accounts: Vec<TnPubkey>) -> Self
Builder method: add read-write accounts
Sourcepub fn with_r_accounts(self, accounts: Vec<TnPubkey>) -> Self
pub fn with_r_accounts(self, accounts: Vec<TnPubkey>) -> Self
Builder method: add read-only accounts
Sourcepub fn add_rw_account(self, account: TnPubkey) -> Self
pub fn add_rw_account(self, account: TnPubkey) -> Self
Builder method: add a single read-write account
Sourcepub fn add_r_account(self, account: TnPubkey) -> Self
pub fn add_r_account(self, account: TnPubkey) -> Self
Builder method: add a single read-only account
Sourcepub fn with_instructions(self, instructions: Vec<u8>) -> Self
pub fn with_instructions(self, instructions: Vec<u8>) -> Self
Builder method: add instruction data
Sourcepub fn with_compute_units(self, units: u32) -> Self
pub fn with_compute_units(self, units: u32) -> Self
Builder method: set compute units
Sourcepub fn with_state_units(self, units: u16) -> Self
pub fn with_state_units(self, units: u16) -> Self
Builder method: set state units
Sourcepub fn with_memory_units(self, units: u16) -> Self
pub fn with_memory_units(self, units: u16) -> Self
Builder method: set memory units
Sourcepub fn with_expiry_after(self, expiry: u32) -> Self
pub fn with_expiry_after(self, expiry: u32) -> Self
Builder method: set expiry
Sourcepub fn with_nonce(self, nonce: u64) -> Self
pub fn with_nonce(self, nonce: u64) -> Self
Builder method: set nonce
Sourcepub fn with_start_slot(self, slot: u64) -> Self
pub fn with_start_slot(self, slot: u64) -> Self
Builder method: set start slot
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl Default for Transaction
impl Default for Transaction
Source§fn default() -> Transaction
fn default() -> Transaction
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more