pub struct SwapsClient { /* private fields */ }Expand description
Client for swaps operations.
Implementations§
Source§impl SwapsClient
impl SwapsClient
pub fn new(client: Client) -> Self
Sourcepub async fn list_swaps(
&self,
query: Option<ListSwapsQuery>,
) -> Result<ListSwapsResponse, Error>
pub async fn list_swaps( &self, query: Option<ListSwapsQuery>, ) -> Result<ListSwapsResponse, Error>
List all swaps with pagination
Sourcepub async fn create_swap(
&self,
body: CreateSwapRequest,
) -> Result<CreateSwapResponse, Error>
pub async fn create_swap( &self, body: CreateSwapRequest, ) -> Result<CreateSwapResponse, Error>
Create a new swap based on an existing quote. This is the second step of the Swap flow.
Sourcepub async fn request_swap_quote(
&self,
body: RequestSwapQuoteRequest,
) -> Result<RequestSwapQuoteResponse, Error>
pub async fn request_swap_quote( &self, body: RequestSwapQuoteRequest, ) -> Result<RequestSwapQuoteResponse, Error>
Request a quote from a given provider for swapping assets. This is the first step of the Swap flow.
Sourcepub async fn get_swap(&self, swap_id: String) -> Result<GetSwapResponse, Error>
pub async fn get_swap(&self, swap_id: String) -> Result<GetSwapResponse, Error>
Get details of a specific swap by its ID
Sourcepub async fn get_swap_quote(
&self,
quote_id: String,
) -> Result<GetSwapQuoteResponse, Error>
pub async fn get_swap_quote( &self, quote_id: String, ) -> Result<GetSwapQuoteResponse, Error>
Get details of a specific swap quote by its ID
Trait Implementations§
Source§impl Clone for SwapsClient
impl Clone for SwapsClient
Source§fn clone(&self) -> SwapsClient
fn clone(&self) -> SwapsClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SwapsClient
impl !UnwindSafe for SwapsClient
impl Freeze for SwapsClient
impl Send for SwapsClient
impl Sync for SwapsClient
impl Unpin for SwapsClient
impl UnsafeUnpin for SwapsClient
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