Crates.io | spiderswap |
lib.rs | spiderswap |
version | 0.1.1 |
source | src |
created_at | 2024-11-08 14:20:39.414181 |
updated_at | 2024-11-08 20:17:08.023235 |
description | Spiderswap is a cutting-edge decentralized exchange aggregator on Solana, providing fast, efficient, and cost-effective token swaps. Our platform integrates with multiple liquidity providers to ensure users get the best rates with minimal slippage. With no monthly fees and easy API integration through our Spiderswap V1 program, Spiderswap is perfect for developers, market makers, and individual traders. |
homepage | https://www.spiderswap.io/ |
repository | https://github.com/dev-spider-web/spiderswap |
max_upload_size | |
id | 1441239 |
size | 25,625 |
This crate is organized into three main modules:
Add this crate to your Cargo.toml
dependencies:
[dependencies]
spiderswap = "x.x.x"
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.
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.
Below are some examples of how to use the main functionality of this crate.
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(())
}
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(())
}
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(())
}