JitoClient

Struct JitoClient 

Source
pub struct JitoClient { /* private fields */ }
Expand description

Jito client for sending transactions and bundles.

Implementations§

Source§

impl JitoClient

Source

pub fn new() -> Self

Creates a new client with default settings.

Source

pub async fn raw_send(&self, body: &Value) -> Result<Response>

Sends a raw request.

Source

pub async fn raw_send_api( &self, api_url: impl AsRef<str>, body: &Value, ) -> Result<Response>

Sends a raw request, use base_url + api_url.

Source

pub async fn raw_send_lazy( &self, body: impl Future<Output = Result<Value>>, ) -> Result<Response>

Sends a raw request, with lazy body construction.

Source

pub async fn raw_send_api_lazy( &self, api_url: impl AsRef<str>, body: impl Future<Output = Result<Value>>, ) -> Result<Response>

Sends a raw request, use base_url + api_url, with lazy body construction.

Source

pub async fn raw_send_lazy_fn<F>(&self, callback: F) -> Result<Response>

Sends a raw request, with lazy function to build the body.

Source

pub async fn raw_send_api_lazy_fn<F>( &self, api_url: impl AsRef<str>, callback: F, ) -> Result<Response>

Sends a raw request, use base_url + api_url, with lazy function to build the body.

Source

pub async fn send_transaction(&self, tx: impl Serialize) -> Result<Response>

Sends a single transaction and returns the HTTP response.

Source

pub async fn send_transaction_bid(&self, tx: impl Serialize) -> Result<String>

Sends a transaction and returns the bundle ID from the response headers.

Source

pub async fn send_transaction_no_bundle_only( &self, tx: impl Serialize, ) -> Result<Response>

Sends a transaction without bundleOnly flag.

Source

pub async fn send_bundle<T: IntoIterator<Item = impl Serialize>>( &self, tx: T, ) -> Result<Response>

Sends multiple transactions as a bundle.

Source

pub async fn send_bundle_bid<T: IntoIterator<Item = impl Serialize>>( &self, tx: T, ) -> Result<String>

Sends a bundle and returns its bundle ID from the JSON response.

Source

pub async fn send_transaction_lazy<T>( &self, tx: impl Future<Output = Result<T>>, ) -> Result<Response>
where T: Serialize,

Sends a single transaction and returns the HTTP response, with lazy serialization.

Source

pub async fn send_transaction_bid_lazy<T>( &self, tx: impl Future<Output = Result<T>>, ) -> Result<String>
where T: Serialize,

Sends a transaction and returns the bundle ID from the response headers, with lazy serialization.

Source

pub async fn send_transaction_no_bundle_only_lazy<T>( &self, tx: impl Future<Output = Result<T>>, ) -> Result<Response>
where T: Serialize,

Sends a transaction without bundleOnly flag, with lazy serialization.

Source

pub async fn send_bundle_lazy<T, S>( &self, tx: impl Future<Output = Result<T>>, ) -> Result<Response>
where T: IntoIterator<Item = S>, S: Serialize,

Sends multiple transactions as a bundle, with lazy serialization.

Source

pub async fn send_bundle_bid_lazy<T, S>( &self, tx: impl Future<Output = Result<T>>, ) -> Result<String>
where T: IntoIterator<Item = S>, S: Serialize,

Sends a bundle and returns its bundle ID from the JSON response, with lazy serialization.

Source

pub async fn send_transaction_lazy_fn<F, T>( &self, callback: F, ) -> Result<Response>
where F: AsyncFnOnce(&Vec<String>, &Client) -> Result<T>, T: Serialize,

Sends a single transaction and returns the HTTP response, with lazy serialization.

Source

pub async fn send_transaction_bid_lazy_fn<F, T>( &self, callback: F, ) -> Result<String>
where F: AsyncFnOnce(&Vec<String>, &Client) -> Result<T>, T: Serialize,

Sends a transaction and returns the bundle ID from the response headers, with lazy serialization.

Source

pub async fn send_transaction_no_bundle_only_lazy_fn<F, T>( &self, callback: F, ) -> Result<Response>
where F: AsyncFnOnce(&Vec<String>, &Client) -> Result<T>, T: Serialize,

Sends a transaction without bundleOnly flag, with lazy serialization.

Source

pub async fn send_bundle_lazy_fn<F, T, S>( &self, callback: F, ) -> Result<Response>
where F: AsyncFnOnce(&Vec<String>, &Client) -> Result<T>, T: IntoIterator<Item = S>, S: Serialize,

Sends multiple transactions as a bundle, with lazy serialization.

Source

pub async fn send_bundle_bid_lazy_fn<F, T, S>( &self, callback: F, ) -> Result<String>
where F: AsyncFnOnce(&Vec<String>, &Client) -> Result<T>, T: IntoIterator<Item = S>, S: Serialize,

Sends a bundle and returns its bundle ID from the JSON response, with lazy serialization.

Trait Implementations§

Source§

impl Clone for JitoClient

Source§

fn clone(&self) -> JitoClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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