pub struct ValiantClient {
pub client: Client,
pub base_url: Url,
}Fields§
§client: Client§base_url: UrlImplementations§
Source§impl ValiantClient
impl ValiantClient
Sourcepub fn from_params(
api_key: &str,
network_environment: NetworkEnvironment,
valiant_url_override: Option<String>,
) -> Result<Self>
pub fn from_params( api_key: &str, network_environment: NetworkEnvironment, valiant_url_override: Option<String>, ) -> Result<Self>
Creates a new ValiantClient from the given parameters.
Sourcepub async fn swap_tokens_probabilistic(
&self,
mint_swap_rates: &[MintSwapRate],
transaction_sponsor: &Keypair,
rpc: &RpcClient,
pubsub: &PubsubClientWithReconnect,
) -> Vec<Result<SwapConfirmationResult>> ⓘ
pub async fn swap_tokens_probabilistic( &self, mint_swap_rates: &[MintSwapRate], transaction_sponsor: &Keypair, rpc: &RpcClient, pubsub: &PubsubClientWithReconnect, ) -> Vec<Result<SwapConfirmationResult>> ⓘ
Swaps tokens into FOGO based on sampling using the provided mint swap rates. If the sample is successful, constructs and submits a swap transaction. Returns a vector of confirmation results, one per attempted swap. Note this could return a smaller vector than the number of input mint swap rates.
Auto Trait Implementations§
impl !RefUnwindSafe for ValiantClient
impl !UnwindSafe for ValiantClient
impl Forget for ValiantClient
impl Freeze for ValiantClient
impl Send for ValiantClient
impl Sync for ValiantClient
impl Unpin for ValiantClient
impl UnsafeUnpin for ValiantClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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