pub struct Client { /* private fields */ }Expand description
Client for interacting with Rango APIs
Implementations§
Source§impl Client
impl Client
Sourcepub async fn is_approved(
&self,
request: IsApprovedRequest,
) -> Result<CheckApprovalResponse, SdkErr>
pub async fn is_approved( &self, request: IsApprovedRequest, ) -> Result<CheckApprovalResponse, SdkErr>
In some blockchains (like evm), before sending the swap transaction, user is needing to give a approval to the conttact. This method will track and check the approval transcation.
Sourcepub async fn status(
&self,
request: StatusRequest,
) -> Result<StatusResponse, SdkErr>
pub async fn status( &self, request: StatusRequest, ) -> Result<StatusResponse, SdkErr>
After signing the transaction by the user and receiving transaction hash, you could periodically call Rango check-status API to track the transaction status.
Sourcepub async fn balance(
&self,
request: BalanceRequest,
) -> Result<BalanceResponse, SdkErr>
pub async fn balance( &self, request: BalanceRequest, ) -> Result<BalanceResponse, SdkErr>
Getting wallet’s balance by giving blockchain and address.
Source§impl Client
impl Client
Sourcepub async fn meta(&self) -> Result<Meta, SdkErr>
pub async fn meta(&self) -> Result<Meta, SdkErr>
All the essential data needed for a client, including list of support blockchains, tokens and protocols (DEXs & Bridges).
Sourcepub async fn chains(&self) -> Result<Vec<BlockchainMeta>, SdkErr>
pub async fn chains(&self) -> Result<Vec<BlockchainMeta>, SdkErr>
List of supported chains by Rango
Sourcepub async fn swappers(&self) -> Result<Vec<SwapperMeta>, SdkErr>
pub async fn swappers(&self) -> Result<Vec<SwapperMeta>, SdkErr>
List of supported swappers by Rango
Sourcepub async fn messaging_protocols(&self) -> Result<MessagingProtocols, SdkErr>
pub async fn messaging_protocols(&self) -> Result<MessagingProtocols, SdkErr>
List of supported messaging protocols by Rango
Source§impl Client
impl Client
Sourcepub async fn quote(
&self,
request: QuoteRequest,
) -> Result<QuoteResponse, SdkErr>
pub async fn quote( &self, request: QuoteRequest, ) -> Result<QuoteResponse, SdkErr>
Getting a quote for requested swap
Rango will find the best route from available DEX or bridges for doing the swap. Quote is a preview of route, if the quote confirmed by the user, you will need to use swap for getting the actual swap and complete the swap.