| Crates.io | splitnow |
| lib.rs | splitnow |
| version | 1.0.0 |
| created_at | 2026-01-25 05:05:12.651916+00 |
| updated_at | 2026-01-25 05:05:12.651916+00 |
| description | Rust SDK for SplitNOW, the multi-wallet instant crypto exchange |
| homepage | |
| repository | https://github.com/splitnow/rust-sdk |
| max_upload_size | |
| id | 2068164 |
| size | 95,037 |
Rust SDK (API wrapper) for SplitNOW, the multi-wallet instant crypto exchange. 🪼
4 Dependencies :
reqwestserdetokiothiserrorAdd splitnow as a dependency to your Cargo.toml file:
[dependencies]
splitnow = "1.0"
You'll need to create a SplitNOW API key if you don't have one already:
This example demonstrates splitting 10 SOL evenly across 2 wallets through Binance & Bybit:
use splitnow::{AssetId, ExchangerId, NetworkId, SplitNow, WalletDistribution};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Get a free API key at: https://splitnow.io/auth/register
const API_KEY: &str = "replace_me";
let splitnow = SplitNow::new(API_KEY.to_string())?;
// Step 1: Create and fetch a quote
let quote = splitnow
.create_and_fetch_quote(
10.0,
AssetId::Sol,
NetworkId::Solana,
AssetId::Sol,
NetworkId::Solana,
)
.await?;
println!("Quote ID: {}", quote.quote_id);
println!("Available rates:");
for rate in "e.rates {
println!(" {}: {}", rate.exchange_id, rate.exchange_rate);
}
// Step 2: Create and fetch an order
let wallet_distributions = vec![
WalletDistribution {
to_address: "7ingPqZUYmuso5HakTLgoXjMpETpbZYzxeQBJChGrQn5".to_string(),
to_pct_bips: 5000,
to_asset_id: AssetId::Sol,
to_network_id: NetworkId::Solana,
to_exchanger_id: ExchangerId::Binance,
},
WalletDistribution {
to_address: "92CzWZt7fD5ffhwkRNBKHxqHahVTPeWedd5UYmdmHjMw".to_string(),
to_pct_bips: 5000,
to_asset_id: AssetId::Sol,
to_network_id: NetworkId::Solana,
to_exchanger_id: ExchangerId::Bybit,
},
];
let order = splitnow
.create_and_fetch_order(
quote.quote_id,
10.0,
AssetId::Sol,
NetworkId::Solana,
wallet_distributions,
)
.await?;
println!("\nOrder ID: {}", order.order_id);
println!("Deposit Address: {}", order.deposit_address);
println!("Deposit Amount: {}", order.deposit_amount);
// Step 3: Get order status
let order_status = splitnow.get_order_status(&order.order_id).await?;
println!("\nOrder Status: {:?}", order_status.order_status);
println!("Status Short: {:?}", order_status.order_status_short);
println!("Status Text: {}", order_status.order_status_text);
Ok(())
}
To ensure a seamless SplitNOW API integration for your use case, you must first understand the 3-step flow when using the SplitNOW API.
Below is a short explainer of each step so that you can best fit each step into your own software & workflows.
splitnow.create_and_fetch_quote() - Creating and fetching a quotelet quote = splitnow
.create_and_fetch_quote(
10.0,
AssetId::Sol,
NetworkId::Solana,
AssetId::Sol,
NetworkId::Solana,
)
.await?;
quote.quote_id because you need this value to create your order in the next step.quote.rates to see which exchanges are available and at what rate.exchange_rate field of a rate object in the quote.rates vector is 0, the pair might not be supported on that exchange.splitnow.create_and_fetch_order() - Creating and fetching an orderlet order = splitnow
.create_and_fetch_order(
quote.quote_id,
10.0,
AssetId::Sol,
NetworkId::Solana,
wallet_distributions,
)
.await?;
quote_id from the previous step!order struct contains important information you'll need for initiating the order: order.deposit_address & order.deposit_amount.order.order_id so you can check the status of your order anytime.splitnow.get_order_status() - Fetching an order statuslet order_status = splitnow.get_order_status(&order.order_id).await?;
order_id from the previous step!order_status.order_id.order_status.order_status such as update your app's client or trigger a notification once the order status changes.order_status.order_status_text.order_status.order_status is OrderStatus::Completed, it's all done and the wallets are funded as requested! Enjoy!This Rust SDK includes 10 functions that wrap around the SplitNOW API to help you get up and running with creating quotes & orders quickly, no matter your use case:
pub async fn get_health(&self) -> Result<bool, SplitNowError>
Result<bool, SplitNowError> indicating API health status.API Reference: GET /health/
pub async fn get_assets(&self) -> Result<Vec<Asset>, SplitNowError>
Result<Vec<Asset>, SplitNowError>.💡 Pro Tip: When creating quotes & orders, the asset_id field of each Asset can be used for from_asset_id & to_asset_id.
💡 Pro Tip: When creating quotes & orders, the network_id field of a corresponding Asset can be used for from_network_id & to_network_id.
API Reference: GET /assets/
pub async fn get_asset_prices(&self) -> Result<HashMap<String, Option<f64>>, SplitNowError>
Result<HashMap<String, Option<f64>>, SplitNowError> where each key is an asset ID and each value is its price.API Reference: GET /assets/prices/
pub async fn get_asset_deposit_limits(&self) -> Result<Vec<AssetLimit>, SplitNowError>
Result<Vec<AssetLimit>, SplitNowError>.API Reference: GET /assets/limits/
pub async fn get_exchangers(&self) -> Result<Vec<Exchanger>, SplitNowError>
Result<Vec<Exchanger>, SplitNowError>.💡 Pro Tip: When creating quotes & orders, the id field of each Exchanger can be used for to_exchanger_id.
API Reference: GET /exchangers/
pub async fn create_and_fetch_quote(
&self,
from_amount: f64,
from_asset_id: impl Into<String>,
from_network_id: impl Into<String>,
to_asset_id: impl Into<String>,
to_network_id: impl Into<String>,
) -> Result<QuoteData, SplitNowError>
from_amount: A numerical amount of tokens to split.from_asset_id: The input asset ID returned from get_assets. Accepts AssetId enum or String.from_network_id: A corresponding input network ID returned from get_assets. Accepts NetworkId enum or String.to_asset_id: The output asset ID returned from get_assets. Accepts AssetId enum or String.to_network_id: A corresponding output network ID returned from get_assets. Accepts NetworkId enum or String.Result<QuoteData, SplitNowError>.API Reference: POST /quotes/, GET /quotes/{id}
pub async fn create_and_fetch_order(
&self,
quote_id: impl Into<String>,
from_amount: f64,
from_asset_id: impl Into<String>,
from_network_id: impl Into<String>,
wallet_distributions: Vec<WalletDistribution>,
) -> Result<OrderData, SplitNowError>
quote_id: A quote ID returned from create_and_fetch_quote.from_amount: A numerical amount of tokens to split.from_asset_id: The input asset ID returned from get_assets. Accepts AssetId enum or String.from_network_id: A corresponding input network ID returned from get_assets. Accepts NetworkId enum or String.wallet_distributions: A Vec<WalletDistribution> containing recipient wallets and distribution preferences.Result<OrderData, SplitNowError>.API Reference: POST /orders/, GET /orders/{id}
pub async fn get_quote(&self, quote_id: &str) -> Result<Quote, SplitNowError>
quote_id: The quote ID to fetch.Result<Quote, SplitNowError>.API Reference: GET /quotes/{id}
pub async fn get_order(&self, order_id: &str) -> Result<Order, SplitNowError>
order_id: The order ID to fetch.Result<Order, SplitNowError>.API Reference: GET /orders/{id}
pub async fn get_order_status(&self, order_id: &str) -> Result<OrderStatusData, SplitNowError>
order_id: The order ID to fetch.Result<OrderStatusData, SplitNowError>.API Reference: GET /orders/{id}
The default rate-limit of each API key is 60 requests per minute.
Don't hesitate to contact SplitNOW if you need more. We scale to meet any demand instantly!
Never expose your SplitNOW API key to clients! If you think your API key may have been accidentally leaked, please contact support right away so that we can get you set up with a fresh one.
Our API services are not available to users in the Restricted Regions, directly or indirectly, in accordance with our Terms of Service.
Unlicensed (Whitelabelled)
More information: https://unlicense.org
© 2025 SplitOTC, Ltd.