Struct BundleBuilder

Source
pub struct BundleBuilder<'a, C> { /* private fields */ }
Expand description

Buidler for transaction bundle.

Implementations§

Source§

impl<C> BundleBuilder<'_, C>

Source

pub fn new(cluster: Cluster) -> BundleBuilder<'_, C>

Create a new BundleBuilder for the given cluster.

Source

pub fn new_with_options(options: CreateBundleOptions) -> BundleBuilder<'_, C>

Create a new BundleBuilder with the given options.

Source

pub fn from_rpc_client(client: RpcClient) -> BundleBuilder<'_, C>

Create a new BundleBuilder from [RpcClient].

Source

pub fn from_rpc_client_with_options( client: RpcClient, options: BundleOptions, ) -> BundleBuilder<'_, C>

Create a new BundleBuilder from [RpcClient] with the given options.

Source

pub fn packet_size(&self) -> usize

Get packet size.

Source

pub fn client(&self) -> &RpcClient

Get the client.

Source

pub fn is_empty(&self) -> bool

Is empty.

Source

pub fn try_clone_empty(&self) -> Result<BundleBuilder<'_, C>, Error>

Try clone empty.

Source

pub fn set_options( &mut self, options: BundleOptions, ) -> &mut BundleBuilder<'_, C>

Set options.

Source§

impl<'a, C> BundleBuilder<'a, C>
where C: Deref<Target = impl Signer> + Clone,

Source

pub fn try_push_with_opts( &mut self, txn: TransactionBuilder<'a, C>, new_transaction: bool, ) -> Result<&mut BundleBuilder<'a, C>, (TransactionBuilder<'a, C>, Error)>

Push a TransactionBuilder with options.

Source

pub fn try_push( &mut self, txn: TransactionBuilder<'a, C>, ) -> Result<&mut BundleBuilder<'a, C>, (TransactionBuilder<'a, C>, Error)>

Try to push a TransactionBuilder to the builder.

Source

pub fn push( &mut self, txn: TransactionBuilder<'a, C>, ) -> Result<&mut BundleBuilder<'a, C>, Error>

Source

pub fn push_many( &mut self, txns: impl IntoIterator<Item = TransactionBuilder<'a, C>>, new_transaction: bool, ) -> Result<&mut BundleBuilder<'a, C>, Error>

Source

pub fn into_builders(self) -> Vec<TransactionBuilder<'a, C>>

Get back all collected TransactionBuilders.

Source

pub async fn send_all( self, skip_preflight: bool, ) -> Result<Vec<Signature>, (Vec<Signature>, Error)>

Send all in order and returns the signatures of the success transactions.

Source

pub async fn send_all_with_opts( self, opts: SendBundleOptions, ) -> Result<Vec<WithSlot<Signature>>, (Vec<WithSlot<Signature>>, Error)>

Send all in order with the given options and returns the signatures of the success transactions.

Source

pub async fn estimate_execution_fee( &self, compute_unit_price_micro_lamports: Option<u64>, ) -> Result<u64, Error>

Estimate execution fee.

Source

pub fn append( &mut self, other: BundleBuilder<'a, C>, new_transaction: bool, ) -> Result<(), Error>

Insert all the instructions of other into self.

If new_transaction is true, then a new transaction will be created before pushing.

Trait Implementations§

Source§

impl<'a, C> From<BundleBuilder<'a, C>> for OnceMakeBundleBuilder<'a, C>

Source§

fn from(value: BundleBuilder<'a, C>) -> OnceMakeBundleBuilder<'a, C>

Converts to this type from the input type.
Source§

impl<'a, C> IntoIterator for BundleBuilder<'a, C>

Source§

type Item = TransactionBuilder<'a, C>

The type of the elements being iterated over.
Source§

type IntoIter = <Vec<TransactionBuilder<'a, C>> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <BundleBuilder<'a, C> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a, C> !Freeze for BundleBuilder<'a, C>

§

impl<'a, C> !RefUnwindSafe for BundleBuilder<'a, C>

§

impl<'a, C> !Send for BundleBuilder<'a, C>

§

impl<'a, C> !Sync for BundleBuilder<'a, C>

§

impl<'a, C> Unpin for BundleBuilder<'a, C>
where C: Unpin,

§

impl<'a, C> !UnwindSafe for BundleBuilder<'a, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T