pub struct TransactionBuilder { /* private fields */ }Implementations§
Source§impl TransactionBuilder
impl TransactionBuilder
Sourcepub fn new(
contract: Address,
max_payload_size: u32,
num_outputs: u8,
) -> Result<Self, TransactionPayloadBuilderError<'static>>
pub fn new( contract: Address, max_payload_size: u32, num_outputs: u8, ) -> Result<Self, TransactionPayloadBuilderError<'static>>
Create a transaction for contract with a payload of up to max_payload_size bytes that
declares num_outputs outputs.
See [TransactionPayloadBuilder::new()] for details of max_payload_size and
num_outputs.
Sourcepub fn with_method_call<Args>(
&mut self,
contract: &Address,
external_args: &Args,
method_context: TransactionMethodContext,
references: MethodCallReferences<'_>,
) -> Result<(), TransactionPayloadBuilderError<'static>>where
Args: ExternalArgs,
pub fn with_method_call<Args>(
&mut self,
contract: &Address,
external_args: &Args,
method_context: TransactionMethodContext,
references: MethodCallReferences<'_>,
) -> Result<(), TransactionPayloadBuilderError<'static>>where
Args: ExternalArgs,
Add method call to the transaction.
See [TransactionPayloadBuilder::with_method_call()] for details of this API.
Sourcepub fn build(
self,
read_slots: &[TransactionSlot],
write_slots: &[TransactionSlot],
) -> Result<OwnedTransaction, TransactionBuilderError>
pub fn build( self, read_slots: &[TransactionSlot], write_slots: &[TransactionSlot], ) -> Result<OwnedTransaction, TransactionBuilderError>
Build the transaction.
See [TransactionPayloadBuilder::into_aligned_bytes()] and
[OwnedTransaction::from_parts()] for errors.
Trait Implementations§
Auto Trait Implementations§
impl Forget for TransactionBuilder
impl Freeze for TransactionBuilder
impl Move for TransactionBuilder
impl RefUnwindSafe for TransactionBuilder
impl Send for TransactionBuilderwhere
InnerBuffer: Send,
impl Sync for TransactionBuilderwhere
InnerBuffer: Sync,
impl Unpin for TransactionBuilder
impl UnsafeUnpin for TransactionBuilder
impl UnwindSafe for TransactionBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more