# Spiderswap
This crate provides a comprehensive API for handling swaps, fees, and quotes. It’s structured into modules that allow users to perform operations typical in finance or trading systems.
## Overview
This crate is organized into three main modules:
- **Routes**: Manages API routes for swaps, fees, and quotes.
- **Utils**: Contains helper functions and utilities used across modules.
## Installation
Add this crate to your `Cargo.toml` dependencies:
```
[dependencies]
spiderswap = "0.1.0"
```
## Modules
### Routes Module
The `routes` module provides functionality for performing swap operations, retrieving fees, and fetching quotes. This module is suitable for use in financial applications or trading platforms where these actions are core operations.
- `swap`: Handles swaps based on given input data.
- `fee`: Retrieves or calculates fees associated with transactions.
- `quote`: Provides quote information for assets or trades.
### Utils Module
The `utils` module contains helper functions that support the main operations in `routes`. These may include string manipulations, error handling utilities, or any other common helper functions.
## Examples
Below are some examples of how to use the main functionality of this crate.
### Executing a Swap
```
async fn main() -> Result<(), Box<dyn Error>> {
let spiderswap = Spiderswap::new("your_api_key")?;
let response =spiderswap.get_swap("swap_params").await?;
println!("Swap response: {}", response);
Ok(())
}
```
### Fetching a Quote
```
async fn main() -> Result<(), Box<dyn Error>> {
let spiderswap = Spiderswap::new("your_api_key")?;
let response = spiderswap.get_quote("quote_params").await?;
println!("Quote response: {}", response);
Ok(())
}
```
### Fetching all Quotes
```
async fn main() -> Result<(), Box<dyn Error>> {
let spiderswap = Spiderswap::new("your_api_key")?;
let response = spiderswap.get_all_quotes("all_quote_params").await?;
println!("All quotes response: {}", response);
Ok(())
}
```