pub struct Svm { /* private fields */ }Implementations§
Source§impl Svm
impl Svm
pub fn new(rpc_url: String) -> Self
pub async fn get_express_relay_metadata( &self, chain_id: String, ) -> Result<ExpressRelayMetadata, ClientError>
pub fn get_express_relay_pid(chain_id: String) -> Pubkey
pub fn get_submit_bid_instruction( params: GetSubmitBidInstructionParams, ) -> Result<Instruction, ClientError>
pub fn get_memo_instruction(memo: String) -> Instruction
pub fn get_swap_create_accounts_idempotent_instructions( params: GetSwapCreateAccountsIdempotentInstructionsParams, ) -> Vec<Instruction>
pub fn get_swap_instruction( params: GetSwapInstructionParams, ) -> Result<Instruction, ClientError>
pub fn get_wrap_sol_instructions( params: GetWrapSolInstructionsParams, ) -> Result<Vec<Instruction>, ClientError>
pub fn get_unwrap_sol_instruction( params: GetUnwrapSolInstructionParams, ) -> Result<Instruction, ClientError>
pub fn get_user_amount_to_wrap( amount_user: u64, user_mint_user_balance: u64, token_account_initialization_configs: &TokenAccountInitializationConfigs, ) -> u64
Sourcepub fn get_bid_amount_including_fees(
opportunity: &OpportunityParamsSvm,
bid_amount: u64,
) -> Result<u64, ClientError>
pub fn get_bid_amount_including_fees( opportunity: &OpportunityParamsSvm, bid_amount: u64, ) -> Result<u64, ClientError>
Adjusts the bid amount in the case where the amount that needs to be provided by the searcher is specified and the fees are in the user token.
In this case, searchers’ bids represent how many tokens they would like to receive.
However, for the searcher to receive bidAmount, the user needs to provide bidAmount * (FEE_SPLIT_PRECISION / (FEE_SPLIT_PRECISION - fees))
This function handles this adjustment.
Auto Trait Implementations§
impl Freeze for Svm
impl !RefUnwindSafe for Svm
impl Send for Svm
impl Sync for Svm
impl Unpin for Svm
impl !UnwindSafe for Svm
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> 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