pub struct IStablecoinDEXInstance<P, N = Ethereum> {
address: Address,
provider: P,
_network: PhantomData<N>,
}Expand description
A IStablecoinDEX instance.
Contains type-safe methods for interacting with an on-chain instance of the
IStablecoinDEX contract located at a given address, using a given
provider P.
If the contract bytecode is available (see the sol!
documentation on how to provide it), the deploy and deploy_builder methods can
be used to deploy a new instance of the contract.
See the module-level documentation for all the available methods.
Fields§
§address: Address§provider: P§_network: PhantomData<N>Implementations§
Source§impl<P: Provider<N>, N: Network> IStablecoinDEXInstance<P, N>
Instantiation and getters/setters.
impl<P: Provider<N>, N: Network> IStablecoinDEXInstance<P, N>
Instantiation and getters/setters.
Sourcepub const fn new(address: Address, __provider: P) -> Self
pub const fn new(address: Address, __provider: P) -> Self
Creates a new wrapper around an on-chain IStablecoinDEX contract instance.
See the wrapper’s documentation for more details.
Sourcepub fn set_address(&mut self, address: Address)
pub fn set_address(&mut self, address: Address)
Sets the address.
Source§impl<P: Clone, N> IStablecoinDEXInstance<&P, N>
impl<P: Clone, N> IStablecoinDEXInstance<&P, N>
Sourcepub fn with_cloned_provider(self) -> IStablecoinDEXInstance<P, N>
pub fn with_cloned_provider(self) -> IStablecoinDEXInstance<P, N>
Clones the provider and returns a new instance with the cloned provider.
Source§impl<P: Provider<N>, N: Network> IStablecoinDEXInstance<P, N>
Function calls.
impl<P: Provider<N>, N: Network> IStablecoinDEXInstance<P, N>
Function calls.
Sourcepub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
pub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
Creates a new call builder using this contract instance’s provider and address.
Note that the call can be any function call, not just those defined in this contract. Prefer using the other methods for building type-safe contract calls.
Sourcepub fn createPair(&self, base: Address) -> SolCallBuilder<&P, createPairCall, N>
pub fn createPair(&self, base: Address) -> SolCallBuilder<&P, createPairCall, N>
Creates a new call builder for the [createPair] function.
Sourcepub fn place(
&self,
token: Address,
amount: u128,
isBid: bool,
tick: i16,
) -> SolCallBuilder<&P, placeCall, N>
pub fn place( &self, token: Address, amount: u128, isBid: bool, tick: i16, ) -> SolCallBuilder<&P, placeCall, N>
Creates a new call builder for the [place] function.
Sourcepub fn placeFlip(
&self,
token: Address,
amount: u128,
isBid: bool,
tick: i16,
flipTick: i16,
) -> SolCallBuilder<&P, placeFlipCall, N>
pub fn placeFlip( &self, token: Address, amount: u128, isBid: bool, tick: i16, flipTick: i16, ) -> SolCallBuilder<&P, placeFlipCall, N>
Creates a new call builder for the [placeFlip] function.
Sourcepub fn cancel(&self, orderId: u128) -> SolCallBuilder<&P, cancelCall, N>
pub fn cancel(&self, orderId: u128) -> SolCallBuilder<&P, cancelCall, N>
Creates a new call builder for the [cancel] function.
Sourcepub fn cancelStaleOrder(
&self,
orderId: u128,
) -> SolCallBuilder<&P, cancelStaleOrderCall, N>
pub fn cancelStaleOrder( &self, orderId: u128, ) -> SolCallBuilder<&P, cancelStaleOrderCall, N>
Creates a new call builder for the [cancelStaleOrder] function.
Sourcepub fn swapExactAmountIn(
&self,
tokenIn: Address,
tokenOut: Address,
amountIn: u128,
minAmountOut: u128,
) -> SolCallBuilder<&P, swapExactAmountInCall, N>
pub fn swapExactAmountIn( &self, tokenIn: Address, tokenOut: Address, amountIn: u128, minAmountOut: u128, ) -> SolCallBuilder<&P, swapExactAmountInCall, N>
Creates a new call builder for the [swapExactAmountIn] function.
Sourcepub fn swapExactAmountOut(
&self,
tokenIn: Address,
tokenOut: Address,
amountOut: u128,
maxAmountIn: u128,
) -> SolCallBuilder<&P, swapExactAmountOutCall, N>
pub fn swapExactAmountOut( &self, tokenIn: Address, tokenOut: Address, amountOut: u128, maxAmountIn: u128, ) -> SolCallBuilder<&P, swapExactAmountOutCall, N>
Creates a new call builder for the [swapExactAmountOut] function.
Sourcepub fn quoteSwapExactAmountIn(
&self,
tokenIn: Address,
tokenOut: Address,
amountIn: u128,
) -> SolCallBuilder<&P, quoteSwapExactAmountInCall, N>
pub fn quoteSwapExactAmountIn( &self, tokenIn: Address, tokenOut: Address, amountIn: u128, ) -> SolCallBuilder<&P, quoteSwapExactAmountInCall, N>
Creates a new call builder for the [quoteSwapExactAmountIn] function.
Sourcepub fn quoteSwapExactAmountOut(
&self,
tokenIn: Address,
tokenOut: Address,
amountOut: u128,
) -> SolCallBuilder<&P, quoteSwapExactAmountOutCall, N>
pub fn quoteSwapExactAmountOut( &self, tokenIn: Address, tokenOut: Address, amountOut: u128, ) -> SolCallBuilder<&P, quoteSwapExactAmountOutCall, N>
Creates a new call builder for the [quoteSwapExactAmountOut] function.
Sourcepub fn balanceOf(
&self,
user: Address,
token: Address,
) -> SolCallBuilder<&P, balanceOfCall, N>
pub fn balanceOf( &self, user: Address, token: Address, ) -> SolCallBuilder<&P, balanceOfCall, N>
Creates a new call builder for the [balanceOf] function.
Sourcepub fn withdraw(
&self,
token: Address,
amount: u128,
) -> SolCallBuilder<&P, withdrawCall, N>
pub fn withdraw( &self, token: Address, amount: u128, ) -> SolCallBuilder<&P, withdrawCall, N>
Creates a new call builder for the [withdraw] function.
Sourcepub fn getOrder(&self, orderId: u128) -> SolCallBuilder<&P, getOrderCall, N>
pub fn getOrder(&self, orderId: u128) -> SolCallBuilder<&P, getOrderCall, N>
Creates a new call builder for the [getOrder] function.
Sourcepub fn getTickLevel(
&self,
base: Address,
tick: i16,
isBid: bool,
) -> SolCallBuilder<&P, getTickLevelCall, N>
pub fn getTickLevel( &self, base: Address, tick: i16, isBid: bool, ) -> SolCallBuilder<&P, getTickLevelCall, N>
Creates a new call builder for the [getTickLevel] function.
Sourcepub fn pairKey(
&self,
tokenA: Address,
tokenB: Address,
) -> SolCallBuilder<&P, pairKeyCall, N>
pub fn pairKey( &self, tokenA: Address, tokenB: Address, ) -> SolCallBuilder<&P, pairKeyCall, N>
Creates a new call builder for the [pairKey] function.
Sourcepub fn nextOrderId(&self) -> SolCallBuilder<&P, nextOrderIdCall, N>
pub fn nextOrderId(&self) -> SolCallBuilder<&P, nextOrderIdCall, N>
Creates a new call builder for the [nextOrderId] function.
Sourcepub fn books(&self, pairKey: FixedBytes<32>) -> SolCallBuilder<&P, booksCall, N>
pub fn books(&self, pairKey: FixedBytes<32>) -> SolCallBuilder<&P, booksCall, N>
Creates a new call builder for the [books] function.
Sourcepub fn MIN_TICK(&self) -> SolCallBuilder<&P, MIN_TICKCall, N>
pub fn MIN_TICK(&self) -> SolCallBuilder<&P, MIN_TICKCall, N>
Creates a new call builder for the [MIN_TICK] function.
Sourcepub fn MAX_TICK(&self) -> SolCallBuilder<&P, MAX_TICKCall, N>
pub fn MAX_TICK(&self) -> SolCallBuilder<&P, MAX_TICKCall, N>
Creates a new call builder for the [MAX_TICK] function.
Sourcepub fn TICK_SPACING(&self) -> SolCallBuilder<&P, TICK_SPACINGCall, N>
pub fn TICK_SPACING(&self) -> SolCallBuilder<&P, TICK_SPACINGCall, N>
Creates a new call builder for the [TICK_SPACING] function.
Sourcepub fn PRICE_SCALE(&self) -> SolCallBuilder<&P, PRICE_SCALECall, N>
pub fn PRICE_SCALE(&self) -> SolCallBuilder<&P, PRICE_SCALECall, N>
Creates a new call builder for the [PRICE_SCALE] function.
Sourcepub fn MIN_ORDER_AMOUNT(&self) -> SolCallBuilder<&P, MIN_ORDER_AMOUNTCall, N>
pub fn MIN_ORDER_AMOUNT(&self) -> SolCallBuilder<&P, MIN_ORDER_AMOUNTCall, N>
Creates a new call builder for the [MIN_ORDER_AMOUNT] function.
Sourcepub fn MIN_PRICE(&self) -> SolCallBuilder<&P, MIN_PRICECall, N>
pub fn MIN_PRICE(&self) -> SolCallBuilder<&P, MIN_PRICECall, N>
Creates a new call builder for the [MIN_PRICE] function.
Sourcepub fn MAX_PRICE(&self) -> SolCallBuilder<&P, MAX_PRICECall, N>
pub fn MAX_PRICE(&self) -> SolCallBuilder<&P, MAX_PRICECall, N>
Creates a new call builder for the [MAX_PRICE] function.
Sourcepub fn tickToPrice(&self, tick: i16) -> SolCallBuilder<&P, tickToPriceCall, N>
pub fn tickToPrice(&self, tick: i16) -> SolCallBuilder<&P, tickToPriceCall, N>
Creates a new call builder for the [tickToPrice] function.
Sourcepub fn priceToTick(&self, price: u32) -> SolCallBuilder<&P, priceToTickCall, N>
pub fn priceToTick(&self, price: u32) -> SolCallBuilder<&P, priceToTickCall, N>
Creates a new call builder for the [priceToTick] function.
Source§impl<P: Provider<N>, N: Network> IStablecoinDEXInstance<P, N>
Event filters.
impl<P: Provider<N>, N: Network> IStablecoinDEXInstance<P, N>
Event filters.
Sourcepub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
pub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
Creates a new event filter using this contract instance’s provider and address.
Note that the type can be any event, not just those defined in this contract. Prefer using the other methods for building type-safe event filters.
Sourcepub fn PairCreated_filter(&self) -> Event<&P, PairCreated, N>
pub fn PairCreated_filter(&self) -> Event<&P, PairCreated, N>
Creates a new event filter for the PairCreated event.
Sourcepub fn OrderPlaced_filter(&self) -> Event<&P, OrderPlaced, N>
pub fn OrderPlaced_filter(&self) -> Event<&P, OrderPlaced, N>
Creates a new event filter for the OrderPlaced event.
Sourcepub fn OrderFilled_filter(&self) -> Event<&P, OrderFilled, N>
pub fn OrderFilled_filter(&self) -> Event<&P, OrderFilled, N>
Creates a new event filter for the OrderFilled event.
Sourcepub fn OrderCancelled_filter(&self) -> Event<&P, OrderCancelled, N>
pub fn OrderCancelled_filter(&self) -> Event<&P, OrderCancelled, N>
Creates a new event filter for the OrderCancelled event.
Trait Implementations§
Source§impl<P: Clone, N: Clone> Clone for IStablecoinDEXInstance<P, N>
impl<P: Clone, N: Clone> Clone for IStablecoinDEXInstance<P, N>
Source§fn clone(&self) -> IStablecoinDEXInstance<P, N>
fn clone(&self) -> IStablecoinDEXInstance<P, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<P, N> Freeze for IStablecoinDEXInstance<P, N>where
P: Freeze,
impl<P, N> RefUnwindSafe for IStablecoinDEXInstance<P, N>where
P: RefUnwindSafe,
N: RefUnwindSafe,
impl<P, N> Send for IStablecoinDEXInstance<P, N>
impl<P, N> Sync for IStablecoinDEXInstance<P, N>
impl<P, N> Unpin for IStablecoinDEXInstance<P, N>
impl<P, N> UnsafeUnpin for IStablecoinDEXInstance<P, N>where
P: UnsafeUnpin,
impl<P, N> UnwindSafe for IStablecoinDEXInstance<P, N>where
P: UnwindSafe,
N: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
propagate-header only.§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
add-extension only.§fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
map-request-body only.§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
map-response-body only.§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
compression-br or compression-deflate or compression-gzip or compression-zstd only.§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
decompression-br or decompression-deflate or decompression-gzip or decompression-zstd only.§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
trace only.§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
trace only.§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
follow-redirect only.§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
sensitive-headers only.§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
sensitive-headers only.§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
sensitive-headers only.§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
set-header only.§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
set-header only.§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
set-header only.§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
set-header only.§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
set-header only.§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
set-header only.§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
request-id only.§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
request-id only.x-request-id as the header name. Read more§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
request-id only.§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
request-id only.x-request-id as the header name. Read more§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
catch-panic only.500 Internal Server responses. Read more§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
limit only.413 Payload Too Large responses. Read more§fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
normalize-path only.§fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
normalize-path only.§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.