pub struct TxBuilder { /* private fields */ }Expand description
High-level builder for legacy-versioned transaction messages.
Implementations§
Source§impl TxBuilder
impl TxBuilder
Sourcepub fn add_instruction(self, instruction: Instruction) -> Self
pub fn add_instruction(self, instruction: Instruction) -> Self
Appends one instruction.
Sourcepub fn add_instructions<I>(self, instructions: I) -> Selfwhere
I: IntoIterator<Item = Instruction>,
pub fn add_instructions<I>(self, instructions: I) -> Selfwhere
I: IntoIterator<Item = Instruction>,
Appends many instructions.
Sourcepub const fn with_compute_unit_limit(self, units: u32) -> Self
pub const fn with_compute_unit_limit(self, units: u32) -> Self
Sets compute unit limit.
Sourcepub const fn with_priority_fee_micro_lamports(self, micro_lamports: u64) -> Self
pub const fn with_priority_fee_micro_lamports(self, micro_lamports: u64) -> Self
Sets priority fee in micro-lamports.
Sourcepub const fn tip_developer(self) -> Self
pub const fn tip_developer(self) -> Self
Enables default developer tip.
Sourcepub const fn tip_developer_lamports(self, lamports: u64) -> Self
pub const fn tip_developer_lamports(self, lamports: u64) -> Self
Enables developer tip with explicit lamports.
Sourcepub const fn tip_to(self, recipient: Pubkey, lamports: u64) -> Self
pub const fn tip_to(self, recipient: Pubkey, lamports: u64) -> Self
Sets a custom tip recipient and lamports.
Sourcepub fn build_unsigned(self, recent_blockhash: [u8; 32]) -> UnsignedTx
pub fn build_unsigned(self, recent_blockhash: [u8; 32]) -> UnsignedTx
Builds an unsigned transaction wrapper.
Sourcepub fn build_and_sign<T>(
self,
recent_blockhash: [u8; 32],
signers: &T,
) -> Result<VersionedTransaction, BuilderError>
pub fn build_and_sign<T>( self, recent_blockhash: [u8; 32], signers: &T, ) -> Result<VersionedTransaction, BuilderError>
Builds and signs a transaction in one step.
§Errors
Returns BuilderError::SignTransaction when signer validation or signing fails.
Sourcepub fn build_message(self, recent_blockhash: [u8; 32]) -> VersionedMessage
pub fn build_message(self, recent_blockhash: [u8; 32]) -> VersionedMessage
Builds a legacy message wrapped as a versioned message.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TxBuilder
impl RefUnwindSafe for TxBuilder
impl Send for TxBuilder
impl Sync for TxBuilder
impl Unpin for TxBuilder
impl UnsafeUnpin for TxBuilder
impl UnwindSafe for TxBuilder
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