pub struct ProgrammableTransactionBuilder { /* private fields */ }
Expand description
Builder for a ProgrammableTransaction
.
Implementations§
Source§impl ProgrammableTransactionBuilder
Base API.
impl ProgrammableTransactionBuilder
Base API.
pub fn new() -> Self
pub fn finish(self) -> ProgrammableTransaction
Sourcepub fn pure<T: Serialize + ?Sized>(&mut self, value: &T) -> Result<Argument>
pub fn pure<T: Serialize + ?Sized>(&mut self, value: &T) -> Result<Argument>
Potentially adds a pure argument to the PTB.
May not create a new PTB input if a previous one already has the same contents.
Sourcepub fn force_separate_pure<T: Serialize>(
&mut self,
value: T,
) -> Result<Argument>
pub fn force_separate_pure<T: Serialize>( &mut self, value: T, ) -> Result<Argument>
Like Self::pure
but forces a separate input entry
Sourcepub fn pure_bytes(&mut self, bytes: Vec<u8>, force_separate: bool) -> Argument
pub fn pure_bytes(&mut self, bytes: Vec<u8>, force_separate: bool) -> Argument
Adds a pure argument to the PTB.
§Arguments
bytes
: the BCS-serialized contents of the argumentforce_separate
: whether to force a separate input argument to the PTB, else the builder re-uses a previously declared input argument if it has the same contents.
Source§impl ProgrammableTransactionBuilder
Extensions to the base API.
impl ProgrammableTransactionBuilder
Extensions to the base API.
Trait Implementations§
Source§impl Clone for ProgrammableTransactionBuilder
impl Clone for ProgrammableTransactionBuilder
Source§fn clone(&self) -> ProgrammableTransactionBuilder
fn clone(&self) -> ProgrammableTransactionBuilder
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 Default for ProgrammableTransactionBuilder
impl Default for ProgrammableTransactionBuilder
Source§fn default() -> ProgrammableTransactionBuilder
fn default() -> ProgrammableTransactionBuilder
Returns the “default value” for a type. Read more
Source§impl From<ProgrammableTransactionBuilder> for ProgrammableTransaction
impl From<ProgrammableTransactionBuilder> for ProgrammableTransaction
Source§fn from(value: ProgrammableTransactionBuilder) -> Self
fn from(value: ProgrammableTransactionBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProgrammableTransactionBuilder
impl RefUnwindSafe for ProgrammableTransactionBuilder
impl Send for ProgrammableTransactionBuilder
impl Sync for ProgrammableTransactionBuilder
impl Unpin for ProgrammableTransactionBuilder
impl UnwindSafe for ProgrammableTransactionBuilder
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