pub struct TransactionSimulator { /* private fields */ }Expand description
Transaction simulator.
Implementations§
Source§impl TransactionSimulator
impl TransactionSimulator
Sourcepub fn from_client(client: RpcClient) -> Self
pub fn from_client(client: RpcClient) -> Self
Create from existing RpcClient.
Sourcepub fn simulate(&self, transaction: &Transaction) -> Result<SimulationResult>
pub fn simulate(&self, transaction: &Transaction) -> Result<SimulationResult>
Simulate a transaction and return detailed results.
Sourcepub fn simulate_and_validate(
&self,
transaction: &Transaction,
config: &SimulationConfig,
) -> Result<SimulationSafetyReport>
pub fn simulate_and_validate( &self, transaction: &Transaction, config: &SimulationConfig, ) -> Result<SimulationSafetyReport>
Simulate and validate against safety config.
Sourcepub fn preview_swap(&self, transaction: &Transaction) -> Result<SwapPreview>
pub fn preview_swap(&self, transaction: &Transaction) -> Result<SwapPreview>
Preview a swap outcome.
Auto Trait Implementations§
impl !Freeze for TransactionSimulator
impl !RefUnwindSafe for TransactionSimulator
impl !UnwindSafe for TransactionSimulator
impl Send for TransactionSimulator
impl Sync for TransactionSimulator
impl Unpin for TransactionSimulator
impl UnsafeUnpin for TransactionSimulator
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
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